Prechádzať zdrojové kódy

1.任务导出添加数据权限

wuhp 1 rok pred
rodič
commit
c6e74334bf

+ 7 - 5
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -630,11 +630,13 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
         TaskStatisticsDto result = this.insAreaCompanyMapper.getCountBusinessData(taskStatisticsVo);
         TaskStatisticsDto userNumberdto = this.insAreaCompanyMapper.getUserNumber(taskStatisticsVo);
         if (ObjectUtils.isNotEmpty(userNumberdto)) {
-            BigDecimal userNumber = userNumberdto.getUserNumber();
-            BigDecimal totalPremium = new BigDecimal(result.getTotalPremium());
-            BigDecimal resultDivided = totalPremium.divide(userNumber, 2, RoundingMode.HALF_UP); //人均产能
-            result.setPerCapitaAmount(resultDivided);
-            result.setUserNumber(userNumberdto.getUserNumber());
+            if(result.getTotalPremium()!=null  &&  userNumberdto.getUserNumber() !=null){
+                BigDecimal userNumber = userNumberdto.getUserNumber();
+                BigDecimal totalPremium = new BigDecimal(result.getTotalPremium());
+                BigDecimal resultDivided = totalPremium.divide(userNumber, 2, RoundingMode.HALF_UP); //人均产能
+                result.setPerCapitaAmount(resultDivided);
+                result.setUserNumber(userNumberdto.getUserNumber());
+            }
         }
         return result;
     }

+ 13 - 0
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -53,6 +53,10 @@
         <if test="vo.enterTimeStart != null and vo.enterTimeStart!='' and vo.enterTimeEnd != null and vo.enterTimeEnd != ''">
             AND iac.createtime BETWEEN #{vo.enterTimeStart} AND #{vo.enterTimeEnd}
         </if>
+
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
         <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
             AND su.leader_id IN
             <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
@@ -120,6 +124,9 @@
         <if test="vo.signingTimeStart != null and vo.signingTimeStart!='' and vo.signingTimeEnd != null and vo.signingTimeEnd != ''">
             AND iac.signing_time BETWEEN #{vo.signingTimeStart} AND #{vo.signingTimeEnd}
         </if>
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
         <if test="vo.enterTimeStart != null and vo.enterTimeStart!='' and vo.enterTimeEnd != null and vo.enterTimeEnd != ''">
             AND iac.createtime BETWEEN #{vo.enterTimeStart} AND #{vo.enterTimeEnd}
         </if>
@@ -197,6 +204,9 @@
             <if test="vo.days !=null  and vo.days !=''  and vo.days != 0 ">
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
             </if>
+            <if test="vo.leaderName != null and vo.leaderName!='' ">
+                AND iac.leader_name = #{vo.leaderName}
+            </if>
 
             <if test="vo.userName !=null  and vo.userName!=''">
                 and io.userName=#{vo.userName}
@@ -259,6 +269,9 @@
             <if test="vo.userId !=null  and vo.userId!=''">
                 and su.id=#{vo.userId}
             </if>
+            <if test="vo.leaderName != null and vo.leaderName!='' ">
+                AND iac.leader_name = #{vo.leaderName}
+            </if>
             <if test="vo.proportionUserIds  !=null  and vo.proportionUserIds!=''  and vo.proportionUserIds.size()>0">
                 and su.id in
                 <foreach collection="vo.proportionUserIds" item="item" open="(" separator="," close=")">

+ 10 - 0
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -2467,6 +2467,9 @@
         <if test="vo.enterTimeStart != null and vo.enterTimeStart!='' and vo.enterTimeEnd != null and vo.enterTimeEnd != ''">
             AND iac.createtime BETWEEN #{vo.enterTimeStart} AND #{vo.enterTimeEnd}
         </if>
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
         <if test="vo.provinceId != null and vo.provinceId != '' and  vo.cityId == null and vo.countyId == null  and vo.houseId == null ">
             and io.deptid like concat('%',#{vo.provinceId},'%')
         </if>
@@ -2573,6 +2576,10 @@
             AND iac.createtime BETWEEN #{vo.enterTimeStart} AND #{vo.enterTimeEnd}
         </if>
 
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
+
         <if test="vo.provinceId != null and vo.provinceId != '' and  vo.cityId == null and vo.countyId == null  and vo.houseId == null ">
             and io.deptid like concat('%',#{vo.provinceId},'%')
         </if>
@@ -2650,6 +2657,9 @@
         <if test="vo.cityId != null and vo.cityId != '' and vo.countyId ==null and  vo.houseId ==null">
             and io.deptid like concat('%',#{vo.cityId},'%')
         </if>
+        <if test="vo.leaderName != null and vo.leaderName!='' ">
+            AND iac.leader_name = #{vo.leaderName}
+        </if>
         <if test="vo.countyId != null and vo.countyId != '' and  vo.houseId  ==null">
             and io.deptid like concat('%',#{vo.countyId},'%')
         </if>