소스 검색

Merge branch 'CH-1101-GS' of sckj/mz-cloud into master

953954216 5 달 전
부모
커밋
bbd07300db

+ 17 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/DateUtils.java

@@ -7,6 +7,8 @@ import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.*;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -157,6 +159,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return day + "天" + hour + "小时" + min + "分钟";
     }
 
+    public static long getDaysDiff(String start, String end)
+    {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
+
+        // 解析字符串为LocalDate对象
+        LocalDate startDate = LocalDate.parse(start, formatter);
+        LocalDate endDate = LocalDate.parse(end, formatter);
+
+        // 计算两个日期之间的天数差
+        return ChronoUnit.DAYS.between(startDate, endDate);
+    }
+
+
+
+
     /** 计算两个时间差,返回是否大于一个月 */
     public static boolean isMoreThanOneMonth(String startDateStr, String endDateStr) throws ParseException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");

+ 1 - 0
ruoyi-modules/mz-organization-jg/src/main/resources/mapper/organization/YljgFwcdCwMapper.xml

@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectYljgFwcdCwList" parameterType="YljgFwcdCw" resultMap="YljgFwcdCwResult">
         <include refid="selectYljgFwcdCwVo"/>
         <where>
+            a.cwzt='1'
             <if test="id != null  and id != ''"> and a.id = #{id}</if>
             <if test="jgId != null  and jgId != ''"> and a.jg_id = #{jgId}</if>
             <if test="lyId != null  and lyId != ''"> and d.id = #{lyId}</if>

+ 1 - 0
ruoyi-modules/mz-organization-jg/src/main/resources/mapper/organization/YljgFwcdFjMapper.xml

@@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectYljgFwcdFjList" parameterType="YljgFwcdFj" resultMap="YljgFwcdFjResult">
         <include refid="selectYljgFwcdFjVo"/>
         <where>
+            a.fjzt='1'
             <if test="id != null  and id != ''"> and a.id = #{id}</if>
             <if test="lyName != null  and lyName != ''"> and c.lymc like concat('%', #{lyName}, '%')</if>
             <if test="lcName != null  and lcName != ''"> and b.lcmc like concat('%', #{lcName}, '%')</if>

+ 2 - 1
ruoyi-modules/mz-organization-yggl/src/main/java/com/ruoyi/organization/service/impl/YljgYgHtxxServiceImpl.java

@@ -96,7 +96,8 @@ public class YljgYgHtxxServiceImpl implements IYljgYgHtxxService
                 yg.setBtjssj(yljgYgHtxx.getHtjssj());
                 yljgYgJbxxMapper.updateYljgYgJbxx(yg);
             }else{ // 有历史合同,且合同连续,只更新结束日期.
-                if(Integer.parseInt(htxxResult.getHtjssj()) == Integer.parseInt(yljgYgHtxx.getHtkssj())){
+                long dayDiff = DateUtils.getDaysDiff(htxxResult.getHtjssj(),yljgYgHtxx.getHtkssj());
+                if((Integer.parseInt(htxxResult.getHtjssj()) == Integer.parseInt(yljgYgHtxx.getHtkssj())) || (dayDiff == 1 )){
                     yg.setBtjssj(yljgYgHtxx.getHtjssj());
                     yljgYgJbxxMapper.updateYljgYgJbxx(yg);
                 }