ysh 2 سال پیش
والد
کامیت
eacceb760b

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/mapper/bdClockinMonthMapper.java

@@ -112,7 +112,7 @@ public interface bdClockinMonthMapper extends BaseMapper<bdClockinMonth> {
      * @return
      */
     @DS("multi-datasource1")
-    int updateU8WaGZData(@Param("list") List<bdClockinMonth> list);
+    int updateU8WaGZData(bdClockinMonth list);
 
     int updateSy(@Param("list") List<bdClockinMonth> list);
 

+ 64 - 61
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/mapper/xml/bdClockinMonthMapper.xml

@@ -236,74 +236,75 @@
 
     <update id="updateU8WaGZData" parameterType="java.util.List">
 
-     <!--   <foreach collection="list" item="item" index="index" separator=",">
-            update WA_GZData
-                <set>
-            <if test="item.basePay != null and item.basePay != ''">
-                 F_8 = #{item.basePay},
+<!--        <foreach collection="list" item="item" index="index" separator=";">-->
+<!--            update WA_GZData set cPsn_Num = #{item.personCode}-->
+<!--                <if test="item.basePay != null and item.basePay != ''">-->
+<!--                    ,F_8 = #{item.basePay} &lt;!&ndash; 基本工资1&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.basePay_2 != null and item.basePay_2 != ''">-->
+<!--                    ,F_52 = #{item.basePay_2} &lt;!&ndash; 基本工资2&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.workDay != null and item.workDay != ''">-->
+<!--                    , F_10 = #{item.workDay} &lt;!&ndash; 考勤天数1 &ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.workDay_2 != null and item.workDay_2 != ''">-->
+<!--                    , F_10 = #{item.workDay_2} &lt;!&ndash; 考勤天数2 &ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.workDayReal != null and item.workDayReal != ''">-->
+<!--                    , F_53 = #{item.workDayReal} &lt;!&ndash; 实际考勤天数1&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.workDayReal_2 != null and item.workDayReal_2 != ''">-->
+<!--                    ,F_54 = #{item.workDayReal_2} &lt;!&ndash; 实际考勤天数2&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.wagesBase != null and item.wagesBase != ''">-->
+<!--                    , F_51 = #{item.wagesBase} &lt;!&ndash; 缴交基数1&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.duration != null and item.duration != ''">-->
+<!--                    ,F_55 = #{item.duration} &lt;!&ndash; 本月加班时长&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.holidayTimeSj != null and item.holidayTimeSj != ''">-->
+<!--                    , F_56 = #{item.holidayTimeSj} &lt;!&ndash; 本月请假时长&ndash;&gt;-->
+<!--                </if>-->
+<!--                <if test="item.syFund != null and item.syFund != ''">-->
+<!--                    ,F_58 = #{item.syFund} &lt;!&ndash; 公积金账号&ndash;&gt;-->
+<!--                </if>-->
+<!--            where cPsn_Num = #{item.personCode} and iYear = #{item.years} and iMonth = #{item.months}-->
+<!--        </foreach>-->
+
+
+            update WA_GZData set cPsn_Num = #{personCode}
+            <if test="basePay != null and basePay != ''">
+                ,F_8 = #{basePay} <!-- 基本工资1-->
             </if>
-            <if test="item.basePay_2 != null and item.basePay_2 != ''">
-                F_52 = #{item.basePay_2},
-             </if>
-            <if test="item.workDay != null and item.workDay != ''">
-                F_10 = #{item.workDay},
+            <if test="basePay_2 != null and basePay_2 != ''">
+                ,F_52 = #{basePay_2} <!-- 基本工资2-->
             </if>
-            <if test="item.wagesBase != null and item.wagesBase != ''">
-                F_51 = #{item.wagesBase},
+            <if test="workDay != null and workDay != ''">
+                , F_10 = #{workDay} <!-- 考勤天数1 -->
             </if>
-            <if test="item.workDayReal != null and item.workDayReal != ''">
-                F_53 = #{item.workDayReal},
+            <if test="workDay_2 != null and workDay_2 != ''">
+                , F_10 = #{workDay_2} <!-- 考勤天数2 -->
             </if>
-            <if test="item.workDayReal1 != null and item.workDayReal1 != ''">
-                F_54 = #{item.workDayReal1},
+            <if test="workDayReal != null and workDayReal != ''">
+                , F_53 = #{workDayReal} <!-- 实际考勤天数1-->
             </if>
-            <if test="item.duration != null and item.duration != ''">
-                F_55 = #{item.duration},
+            <if test="workDayReal_2 != null and workDayReal_2 != ''">
+                ,F_54 = #{workDayReal_2} <!-- 实际考勤天数2-->
             </if>
-            <if test="item.holidayTimeSj != null and item.holidayTimeSj != ''">
-                F_56 = #{item.holidayTimeSj},
+            <if test="wagesBase != null and wagesBase != ''">
+                , F_51 = #{wagesBase} <!-- 缴交基数1-->
             </if>
-            <if test="item.syFund != null and item.syFund != ''">
-                F_58 = #{item.syFund}
+            <if test="duration != null and duration != ''">
+                ,F_55 = #{duration} <!-- 本月加班时长-->
             </if>
-                </set>
-        where cPsn_Num = #{item.personCode} and iYear = #{item.years} and iMonth = #{item.months}
-        </foreach>
--->
-        <foreach collection="list" item="item" index="index" separator=";">
-            update WA_GZData set cPsn_Num = #{item.personCode}
-                <if test="item.basePay != null and item.basePay != ''">
-                    ,F_8 = #{item.basePay} <!-- 基本工资1-->
-                </if>
-                <if test="item.basePay_2 != null and item.basePay_2 != ''">
-                    ,F_52 = #{item.basePay_2} <!-- 基本工资2-->
-                </if>
-                <if test="item.workDay != null and item.workDay != ''">
-                    , F_10 = #{item.workDay} <!-- 考勤天数1 -->
-                </if>
-                <if test="item.workDay_2 != null and item.workDay_2 != ''">
-                    , F_10 = #{item.workDay_2} <!-- 考勤天数2 -->
-                </if>
-                <if test="item.workDayReal != null and item.workDayReal != ''">
-                    , F_53 = #{item.workDayReal} <!-- 实际考勤天数1-->
-                </if>
-                <if test="item.workDayReal_2 != null and item.workDayReal_2 != ''">
-                    ,F_54 = #{item.workDayReal_2} <!-- 实际考勤天数2-->
-                </if>
-                <if test="item.wagesBase != null and item.wagesBase != ''">
-                    , F_51 = #{item.wagesBase} <!-- 缴交基数1-->
-                </if>
-                <if test="item.duration != null and item.duration != ''">
-                    ,F_55 = #{item.duration} <!-- 本月加班时长-->
-                </if>
-                <if test="item.holidayTimeSj != null and item.holidayTimeSj != ''">
-                    , F_56 = #{item.holidayTimeSj} <!-- 本月请假时长-->
-                </if>
-                <if test="item.syFund != null and item.syFund != ''">
-                    ,F_58 = #{item.syFund} <!-- 公积金账号-->
-                </if>
-            where cPsn_Num = #{item.personCode} and iYear = #{item.years} and iMonth = #{item.months}
-        </foreach>
+            <if test="holidayTimeSj != null and holidayTimeSj != ''">
+                , F_56 = #{holidayTimeSj} <!-- 本月请假时长-->
+            </if>
+            <if test="syFund != null and syFund != ''">
+                ,F_58 = #{syFund} <!-- 公积金账号-->
+            </if>
+            where cPsn_Num = #{personCode} and iYear = #{years} and iMonth = #{months}
+
     </update>
     
     <insert id="insertU8WaGZData" parameterType="java.util.List" useGeneratedKeys="false">
@@ -355,10 +356,12 @@
     </insert>
 
     <update id="updateSy" parameterType="java.util.List">
+
+        update bd_clockin_month set sy_u8 = '1',sy_time = NOW() where id in(
         <foreach collection="list" item="item" index="index" separator=",">
-            update bd_clockin_month set sy_u8 = '1',sy_time = NOW() where id =
             #{item.id}
         </foreach>
+        )
     </update>
 
     <insert id="insertClose">

+ 1 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/mapper/xml/viewClockInMapper.xml

@@ -285,13 +285,11 @@
                 and b.set_info > 0 ) and b.error_state is null
                 and b.holiday_type is null -- 请假信息(有值时表示当天有请假记录)
 
-                and (date_format(b.entry_date,'%Y-%m') &lt;= #{viewDate} or b.entry_date is null ) -- 离职人员和没入职人员过滤掉
-
                 group by b.username
             ) B on a.id = b.user_id
 
             where (a.employment_status = 10 or date_format(a.term_date,'%Y-%m') >= #{viewDate} or a.term_date is null )
-
+            and (date_format(a.entry_date,'%Y-%m') &lt;= #{viewDate} or a.entry_date is null ) -- 离职人员和没入职人员过滤掉
         <if test="deptCode != null and deptCode != '' and deptCode.size >0">
             and a.depart_ids in(
             <foreach collection="deptCode" item="item" index="index" separator=",">

+ 4 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/service/impl/bdClockinMonthServiceImpl.java

@@ -317,10 +317,11 @@ public class bdClockinMonthServiceImpl extends ServiceImpl<bdClockinMonthMapper,
                 }
             }
 
-            int st = clockinMonthMapper.updateU8WaGZData(list);//更新u8数据库表WA_GZData
-            if(st != 0){
-                clockinMonthMapper.updateSy(list);//更新月报同步状态
+            for(bdClockinMonth o:list){
+                clockinMonthMapper.updateU8WaGZData(o);//更新u8数据库表WA_GZData
             }
+            clockinMonthMapper.updateSy(list);//更新月报同步状态
+
         }else{
             return "无效数据";
         }