Explorar el Código

轮单积压增加时间判断超过七天的才会积压&其他修改

wucl hace 1 mes
padre
commit
c3ba7a146e

+ 4 - 1
dao/src/main/resources/mapper/CommissionDeclareMapper.xml

@@ -431,7 +431,9 @@
             cd.defined_low_limit_amount,
             cd.business_type AS declareBusinessType,
             cc1.name as clientName,
-            cc2.name as clientSubName
+            cc2.name as clientSubName,
+            m.bailor,
+            u1.name as clientManager
         FROM
             commission_declare cd
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
@@ -440,6 +442,7 @@
                 left join major m on m.id = cd.business_id
                 left join customer_company cc1 on cc1.id = m.clientele_id
                 left join customer_company cc2 on cc2.id = m.clientele_sub_id
+                left join user u1 on u1.id = m.client_manager_id
             where cd.deleted = 0 and bcr.deleted = 0 and cd.id =#{id}
     </select>
 

+ 1 - 0
dao/src/main/resources/mapper/DepartmentMapper.xml

@@ -132,6 +132,7 @@
                           AND node_id IN ( 55, 56, 57, 58, 59 ))
                   AND deleted = 0
                   AND allot_type = '轮单'
+                and created &lt; DATE_SUB(NOW(), INTERVAL 7 DAY)
                 GROUP BY
                     department_id
             ) o ON d.id = o.department_id

+ 1 - 0
dao/src/main/resources/mapper/MajorMapper.xml

@@ -782,6 +782,7 @@
                   AND node_id IN ( 55, 56, 57, 58, 59 ))
           AND deleted = 0
           AND allot_type = '轮单'
+            and created &lt;=DATE_SUB(NOW(), INTERVAL 7 DAY)
           AND department_id = #{departmentId}
     </select>
 </mapper>

+ 5 - 0
domain/src/main/java/com/dayou/vo/CommissionDeclareDetailVO.java

@@ -54,4 +54,9 @@ public class CommissionDeclareDetailVO {
     private String clientName;
 
     private String clientSubName;
+
+    private String clientManager;
+
+    private String bailor;
+
 }

+ 13 - 0
service/src/main/java/com/dayou/service/impl/MajorProductionAllotServiceImpl.java

@@ -3,6 +3,7 @@ package com.dayou.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.dayou.common.BaseEntity;
 import com.dayou.dto.UserShareRate;
 import com.dayou.entity.Major;
 import com.dayou.entity.MajorProductionAllot;
@@ -10,6 +11,7 @@ import com.dayou.exception.ErrorCode;
 import com.dayou.mapper.MajorProductionAllotMapper;
 import com.dayou.service.IMajorProductionAllotService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayou.service.IMajorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -30,6 +32,8 @@ import org.springframework.web.multipart.MultipartFile;
 import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.stream.Collectors;
+
 import org.springframework.transaction.annotation.Transactional;
 import com.dayou.enums.BatchTaskTypeEnum;
 
@@ -48,6 +52,9 @@ public class MajorProductionAllotServiceImpl extends ServiceImpl<MajorProduction
     @Autowired
     private MajorProductionAllotMapper majorProductionAllotMapper;
 
+    @Autowired
+    private IMajorService majorService;
+
     @Override
     @SuppressWarnings("unchecked")
     public List<MajorProductionAllot> getList(Long productionId){
@@ -75,7 +82,13 @@ public class MajorProductionAllotServiceImpl extends ServiceImpl<MajorProduction
     public Boolean saveAllot(List<MajorProductionAllot> list) {
         if (CollectionUtils.isNotEmpty(list)){
             Long majorProductionId = list.get(0).getMajorProductionId();
+            Long majorId = list.get(0).getMajorId();
             majorProductionAllotMapper.deleteByMajorProductionId(majorProductionId);
+            //更新项目成员
+            Major major = majorService.getOne(new LambdaQueryWrapper<Major>().eq(Major::getId, majorId).select(Major::getPrincipalId, Major::getMembers));
+            List<Long> members = list.stream().map(MajorProductionAllot::getUserId).filter(x -> !x.equals(major.getPrincipalId())).collect(Collectors.toList());
+            majorService.update(new LambdaUpdateWrapper<Major>().set(Major::getMembers,JSON.toJSONString(members)).eq(BaseEntity::getId,majorId));
+            //分配绩效
             return this.saveBatch(list);
         }
         return Boolean.FALSE;