Browse Source

Merge remote-tracking branch 'origin/test2' into prod

anderx 1 year ago
parent
commit
c17df7a680
57 changed files with 2285 additions and 114 deletions
  1. 19 0
      src/main/java/com/goafanti/admin/bo/AdminListBo.java
  2. 63 0
      src/main/java/com/goafanti/admin/bo/AdminStatisticsBo.java
  3. 105 0
      src/main/java/com/goafanti/admin/bo/SalesTeamBo.java
  4. 125 0
      src/main/java/com/goafanti/admin/controller/AdminSalesTeamController.java
  5. 25 0
      src/main/java/com/goafanti/admin/controller/AdminStatisticsController.java
  6. 4 0
      src/main/java/com/goafanti/admin/service/AdminStatisticsService.java
  7. 59 0
      src/main/java/com/goafanti/admin/service/SalesTeamService.java
  8. 186 13
      src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java
  9. 2 0
      src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java
  10. 138 0
      src/main/java/com/goafanti/admin/service/impl/SalesTeamServiceImpl.java
  11. 6 1
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  12. 0 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  13. 95 0
      src/main/java/com/goafanti/common/dao/AdminCallDayMapper.java
  14. 2 0
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  15. 95 0
      src/main/java/com/goafanti/common/dao/SalesTeamMapper.java
  16. 2 0
      src/main/java/com/goafanti/common/dao/TaskScoreMapper.java
  17. 4 0
      src/main/java/com/goafanti/common/dao/UserMapper.java
  18. 2 0
      src/main/java/com/goafanti/common/dao/UserMidMapper.java
  19. 1 0
      src/main/java/com/goafanti/common/enums/NoticeStatus.java
  20. 1 0
      src/main/java/com/goafanti/common/enums/NoticeTypes.java
  21. 225 0
      src/main/java/com/goafanti/common/mapper/AdminCallDayMapper.xml
  22. 22 9
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  23. 9 9
      src/main/java/com/goafanti/common/mapper/CallLogMapper.xml
  24. 220 0
      src/main/java/com/goafanti/common/mapper/SalesTeamMapper.xml
  25. 3 3
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  26. 5 0
      src/main/java/com/goafanti/common/mapper/TaskScoreMapper.xml
  27. 1 0
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  28. 16 1
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  29. 14 2
      src/main/java/com/goafanti/common/mapper/UserMidMapper.xml
  30. 22 4
      src/main/java/com/goafanti/common/model/Admin.java
  31. 153 0
      src/main/java/com/goafanti/common/model/AdminCallDay.java
  32. 135 0
      src/main/java/com/goafanti/common/model/SalesTeam.java
  33. 72 20
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  34. 1 0
      src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java
  35. 77 0
      src/main/java/com/goafanti/customer/bo/InputListCallDayBo.java
  36. 10 0
      src/main/java/com/goafanti/customer/bo/InputUserClueBo.java
  37. 12 2
      src/main/java/com/goafanti/customer/bo/OutUserClueExcel.java
  38. 9 0
      src/main/java/com/goafanti/customer/bo/OutUserClueList.java
  39. 16 2
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  40. 2 3
      src/main/java/com/goafanti/customer/controller/UserClueApiController.java
  41. 15 9
      src/main/java/com/goafanti/customer/controller/UserOutboundApiController.java
  42. 4 5
      src/main/java/com/goafanti/customer/service/CustomerService.java
  43. 1 0
      src/main/java/com/goafanti/customer/service/UserOutboundService.java
  44. 7 0
      src/main/java/com/goafanti/customer/service/impl/AdminCallDayService.java
  45. 69 0
      src/main/java/com/goafanti/customer/service/impl/AdminCallDayServiceImpl.java
  46. 19 8
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  47. 49 6
      src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java
  48. 24 4
      src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java
  49. 17 5
      src/main/java/com/goafanti/order/bo/TaskScore/OutAdminTaskScore.java
  50. 17 0
      src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java
  51. 4 0
      src/main/java/com/goafanti/order/service/OrderInvoiceService.java
  52. 16 2
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  53. 1 0
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  54. 16 1
      src/main/java/com/goafanti/order/service/impl/TaskScoreServiceImpl.java
  55. 61 1
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  56. 4 2
      src/main/resources/props/config_local.properties
  57. 3 1
      src/main/resources/props/config_test.properties

+ 19 - 0
src/main/java/com/goafanti/admin/bo/AdminListBo.java

@@ -132,6 +132,25 @@ public class AdminListBo {
 	private String ambRole;
 	private String publicCarbonCopy;
 
+	private Integer teamId;
+	private String teamName;
+
+	public Integer getTeamId() {
+		return teamId;
+	}
+
+	public void setTeamId(Integer teamId) {
+		this.teamId = teamId;
+	}
+
+	public String getTeamName() {
+		return teamName;
+	}
+
+	public void setTeamName(String teamName) {
+		this.teamName = teamName;
+	}
+
 	public String getPublicCarbonCopy() {
 		return publicCarbonCopy;
 	}

+ 63 - 0
src/main/java/com/goafanti/admin/bo/AdminStatisticsBo.java

@@ -22,7 +22,70 @@ public class AdminStatisticsBo {
     private Integer projectStopSum;
     private Integer projectCheckSum;
     private Integer callSum;
+    private Integer connectSum;
+    private Integer validSum;
     private BigDecimal callDurationSum;
+    private Integer teamPeopleSum;
+    private Integer teamCallSum;
+    private Integer teamConnectSum;
+    private Integer teamValidSum;
+    private BigDecimal teamCallDurationSum;
+
+    public Integer getTeamValidSum() {
+        return teamValidSum;
+    }
+
+    public void setTeamValidSum(Integer teamValidSum) {
+        this.teamValidSum = teamValidSum;
+    }
+
+    public Integer getTeamConnectSum() {
+        return teamConnectSum;
+    }
+
+    public void setTeamConnectSum(Integer teamConnectSum) {
+        this.teamConnectSum = teamConnectSum;
+    }
+
+    public Integer getConnectSum() {
+        return connectSum;
+    }
+
+    public void setConnectSum(Integer connectSum) {
+        this.connectSum = connectSum;
+    }
+
+    public Integer getValidSum() {
+        return validSum;
+    }
+
+    public void setValidSum(Integer validSum) {
+        this.validSum = validSum;
+    }
+
+    public Integer getTeamPeopleSum() {
+        return teamPeopleSum;
+    }
+
+    public void setTeamPeopleSum(Integer teamPeopleSum) {
+        this.teamPeopleSum = teamPeopleSum;
+    }
+
+    public Integer getTeamCallSum() {
+        return teamCallSum;
+    }
+
+    public void setTeamCallSum(Integer teamCallSum) {
+        this.teamCallSum = teamCallSum;
+    }
+
+    public BigDecimal getTeamCallDurationSum() {
+        return teamCallDurationSum;
+    }
+
+    public void setTeamCallDurationSum(BigDecimal teamCallDurationSum) {
+        this.teamCallDurationSum = teamCallDurationSum;
+    }
 
     public Integer getCallSum() {
         return callSum;

+ 105 - 0
src/main/java/com/goafanti/admin/bo/SalesTeamBo.java

@@ -0,0 +1,105 @@
+package com.goafanti.admin.bo;
+
+import com.goafanti.common.model.SalesTeam;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public class SalesTeamBo extends SalesTeam {
+
+    private String depName;
+    private String adminName;
+    private String superName;
+    private Integer teamPeopleSum;
+    private Integer teamCallSum;
+    private Integer teamConnectSum;
+    private Integer teamValidSum;
+    private BigDecimal teamCallDurationSum;
+    private List<SalesTeamBo> list;
+
+    public List<SalesTeamBo> getList() {
+        return list;
+    }
+
+    public void setList(List<SalesTeamBo> list) {
+        this.list = list;
+    }
+
+    public SalesTeamBo() {
+    }
+    public SalesTeamBo(SalesTeam salesTeam) {
+        this.setId(salesTeam.getId());
+        this.setDepId(salesTeam.getDepId());
+        this.setAid(salesTeam.getAid());
+        this.setSuperId(salesTeam.getSuperId());
+        this.setName(salesTeam.getName());
+        this.setLvl(salesTeam.getLvl());
+        this.setStatus(salesTeam.getStatus());
+        this.setCreateTime(salesTeam.getCreateTime());
+    }
+
+
+    public Integer getTeamConnectSum() {
+        return teamConnectSum;
+    }
+
+    public void setTeamConnectSum(Integer teamConnectSum) {
+        this.teamConnectSum = teamConnectSum;
+    }
+
+    public Integer getTeamValidSum() {
+        return teamValidSum;
+    }
+
+    public void setTeamValidSum(Integer teamValidSum) {
+        this.teamValidSum = teamValidSum;
+    }
+
+    public Integer getTeamPeopleSum() {
+        return teamPeopleSum;
+    }
+
+    public void setTeamPeopleSum(Integer teamPeopleSum) {
+        this.teamPeopleSum = teamPeopleSum;
+    }
+
+    public Integer getTeamCallSum() {
+        return teamCallSum;
+    }
+
+    public void setTeamCallSum(Integer teamCallSum) {
+        this.teamCallSum = teamCallSum;
+    }
+
+    public BigDecimal getTeamCallDurationSum() {
+        return teamCallDurationSum;
+    }
+
+    public void setTeamCallDurationSum(BigDecimal teamCallDurationSum) {
+        this.teamCallDurationSum = teamCallDurationSum;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getSuperName() {
+        return superName;
+    }
+
+    public void setSuperName(String superName) {
+        this.superName = superName;
+    }
+}

+ 125 - 0
src/main/java/com/goafanti/admin/controller/AdminSalesTeamController.java

@@ -0,0 +1,125 @@
+package com.goafanti.admin.controller;
+
+import com.goafanti.admin.bo.SalesTeamBo;
+import com.goafanti.admin.service.SalesTeamService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.SalesTeam;
+import com.goafanti.common.utils.ParamUtils;
+import com.goafanti.core.mybatis.page.Pagination;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 营销团队(SalesTeam)表控制层
+ *
+ * @author makejava
+ * @since 2024-12-09 11:18:43
+ */
+@Controller
+@RequestMapping(value = "/api/admin/salesTeam")
+public class AdminSalesTeamController extends CertifyApiController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private SalesTeamService salesTeamService;
+
+
+    /**
+     * 新增数据
+     *
+     * @param in 实体
+     * @return 新增结果
+     */
+    @PostMapping(value = "/add")
+    public Result add(@Validated SalesTeam in, BindingResult bindingResult) {
+        Result res = new Result();
+        if (bindingResult.hasErrors()) {
+            String param=bindingResult.getFieldError().getField();
+            res.getError().add(buildError(ParamUtils.getParamMsg(in,param),ParamUtils.getParamName(in,param)));
+            return res;
+        }
+        if (salesTeamService.checkName(in)){
+            res.getError().add(buildError("团队名称已经存在。"));
+            return res;
+        }
+        return res.data(this.salesTeamService.insert(in));
+    }
+
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/get")
+    public Result<SalesTeam> queryById(Integer id) {
+        return new Result<>().data(this.salesTeamService.queryById(id));
+    }
+
+
+    /**
+     * 编辑数据
+     *
+     * @param salesTeam 实体
+     * @return 编辑结果
+     */
+    @PostMapping("/update")
+    public Result edit(SalesTeam salesTeam) {
+        return new Result<>().data(this.salesTeamService.update(salesTeam));
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除是否成功
+     */
+    @GetMapping("/delete")
+    public Result deleteById(Integer id) {
+        return new Result<>().data(this.salesTeamService.deleteById(id));
+    }
+
+    /**
+     * 分页列表查询
+     *
+     * @param in 参数
+     * @return
+     */
+    @GetMapping("/pageList")
+    public Result<Pagination<SalesTeamBo>> pageList(SalesTeam in, Integer pageNo, Integer pageSize) {
+        return new Result<>().data(this.salesTeamService.pageList(in, pageNo, pageSize));
+    }
+
+    /**
+     * 列表查询
+     *
+     * @param lvl 层级
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<Pagination<SalesTeamBo>> list(Integer lvl) {
+        return new Result<>().data(this.salesTeamService.list(lvl));
+    }
+
+    /**
+     * 团队层级列表查询
+     *
+     * @return
+     */
+    @GetMapping("/lvlList")
+    public Result<List<SalesTeamBo>> lvlList() {
+        return new Result<>().data(this.salesTeamService.lvlList());
+    }
+
+}
+

+ 25 - 0
src/main/java/com/goafanti/admin/controller/AdminStatisticsController.java

@@ -94,4 +94,29 @@ public class AdminStatisticsController extends CertifyApiController {
         return res;
     }
 
+
+    /**
+     * 营销团队外呼统计
+     * @return
+     */
+    @RequestMapping(value = "/salesTeam", method = RequestMethod.GET)
+    public Result salesTeam(String startTime,String endTime) {
+        Result res =new Result();
+        String aid = TokenManager.getAdminId();
+        res.data(adminStatisticsService.salesTeam(aid,startTime, endTime));
+        return res;
+    }
+
+    /**
+     * 营销团队外呼统计缓存清理
+     * @return
+     */
+    @RequestMapping(value = "/salesTeam/clean", method = RequestMethod.GET)
+    public Result salesTeamClean() {
+        Result res =new Result();
+        String aid = TokenManager.getAdminId();
+        res.data(adminStatisticsService.salesTeamClean());
+        return res;
+    }
+
 }

+ 4 - 0
src/main/java/com/goafanti/admin/service/AdminStatisticsService.java

@@ -12,4 +12,8 @@ public interface AdminStatisticsService {
     Object financeInfo(String startTime, String endTime);
 
     Object financeLists(String adminId);
+
+    Object salesTeam(String aid,String startTime,String endTime);
+
+    Object salesTeamClean();
 }

+ 59 - 0
src/main/java/com/goafanti/admin/service/SalesTeamService.java

@@ -0,0 +1,59 @@
+package com.goafanti.admin.service;
+
+import com.goafanti.admin.bo.SalesTeamBo;
+import com.goafanti.common.model.SalesTeam;
+
+/**
+ * 营销团队(SalesTeam)表服务接口
+ *
+ * @author makejava
+ * @since 2024-12-09 11:18:44
+ */
+public interface SalesTeamService {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    SalesTeamBo queryById(Integer id);
+
+
+    /**
+     * 新增数据
+     *
+     * @param salesTeam 实例对象
+     * @return 实例对象
+     */
+    SalesTeam insert(SalesTeam salesTeam);
+
+    /**
+     * 修改数据
+     *
+     * @param salesTeam 实例对象
+     * @return 实例对象
+     */
+    SalesTeam update(SalesTeam salesTeam);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    boolean deleteById(Integer id);
+
+    /**
+     * 列表数据
+     *
+     * @return 是否成功
+     */
+    Object list(Integer lvl);
+
+    boolean checkName(SalesTeam name);
+
+    Object pageList(SalesTeam in, Integer pageNo, Integer pageSize);
+
+    Object lvlList();
+}

+ 186 - 13
src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java

@@ -1,19 +1,17 @@
 package com.goafanti.admin.service.impl;
 
-import com.goafanti.admin.bo.AdminStatisticsBo;
-import com.goafanti.admin.bo.ConsultantStatisticsBo;
-import com.goafanti.admin.bo.ConsultantUserCount;
-import com.goafanti.admin.bo.OutFinanceCount;
+import com.goafanti.admin.bo.*;
 import com.goafanti.admin.service.AdminStatisticsService;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.CallLogMapper;
-import com.goafanti.common.dao.FinanceCountMapper;
-import com.goafanti.common.dao.PublicReleaseMapper;
+import com.goafanti.common.dao.*;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AdminUserCount;
+import com.goafanti.common.model.SalesTeam;
 import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.core.shiro.token.TokenManager;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -25,14 +23,18 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
 
 
 
-    @Autowired
+    @Resource
     private AdminMapper adminMapper;
-    @Autowired
+    @Resource
     private PublicReleaseMapper publicReleaseMapper;
-    @Autowired
+    @Resource
     private FinanceCountMapper financeCountMapper;
     @Resource
     private CallLogMapper callLogMapper;
+    @Resource
+    private SalesTeamMapper salesTeamMapper;
+    @Resource
+    private AdminCallDayMapper adminCallDayMapper;
 
 
     @Override
@@ -62,17 +64,83 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
         BigDecimal rangeReceivables=adminMapper.addAdminContactsRangeReceivables(aid,startTime,endTime);
         adminStatisticsBo.setRangeReceivables(rangeReceivables);
         //添加外呼数据
-        AdminStatisticsBo as=callLogMapper.selectAdminCallSum(aid,startTime,endTime);
+        AdminStatisticsBo as = adminCallDayMapper.selectByAidCount(aid, startTime, endTime);
         if (as !=null){
             if (as.getCallSum()!=null)adminStatisticsBo.setCallSum(as.getCallSum());
             if (as.getCallDurationSum()!=null)adminStatisticsBo.setCallDurationSum(as.getCallDurationSum());
+            if (as.getConnectSum()!=null)adminStatisticsBo.setConnectSum(as.getConnectSum());
+            if (as.getValidSum()!=null)adminStatisticsBo.setValidSum(as.getValidSum());
         }else {
             adminStatisticsBo.setCallSum(0);
             adminStatisticsBo.setCallDurationSum(BigDecimal.ZERO);
+            adminStatisticsBo.setConnectSum(0);
+            adminStatisticsBo.setValidSum(0);
         }
+        //添加销售团队数据
+        statisticsSalesTeam(adminStatisticsBo,aid,startTime,endTime);
+
         return adminStatisticsBo;
     }
 
+    private void statisticsSalesTeam(AdminStatisticsBo res,String aid ,String startTime,String endTime) {
+        List<String> list =new ArrayList<>();
+        List<SalesTeam> salesTeams = salesTeamMapper.queryByAid(aid);
+        //如果不是团队负责人,所有数据都为null
+        if (salesTeams.isEmpty()){
+            res.setTeamPeopleSum(null);
+            res.setTeamCallSum(null);
+            res.setTeamCallDurationSum(null);
+            return;
+        }
+        //先获取顶层再迭代获取每一层
+        for (SalesTeam e : salesTeams) {
+            List<Admin> admins = adminMapper.queryByTeamId(e.getId());
+            admins.stream().forEach(e1 -> {
+                list.add(e1.getId());
+            });
+            addSonSalesTeam(list,e);
+        }
+        Set<String> set = new HashSet<>(list);
+        int teamCallSum=0;
+        int teamConnectSum=0;
+        int teamValidSum=0;
+        BigDecimal teamCallDurationSum=BigDecimal.ZERO;
+        for (String s : set) {
+            AdminStatisticsBo as = adminCallDayMapper.selectByAidCount(s, startTime, endTime);
+            if (as != null) {
+                if (as.getCallSum()!= null) teamCallSum = teamCallSum + as.getCallSum();
+                if (as.getCallDurationSum()!= null) teamCallDurationSum = teamCallDurationSum.add(as.getCallDurationSum());
+                if (as.getConnectSum() !=null) teamConnectSum = teamConnectSum + as.getConnectSum();
+                if (as.getValidSum()!=null) teamValidSum = teamValidSum + as.getValidSum();
+
+            }
+        }
+        res.setTeamPeopleSum(set.size());
+        res.setTeamCallSum(teamCallSum);
+        res.setTeamConnectSum(teamConnectSum);
+        res.setTeamValidSum(teamValidSum);
+        res.setTeamCallDurationSum(teamCallDurationSum);
+
+    }
+
+    /**
+     *
+     * @param list
+     * @param res
+     */
+    private void addSonSalesTeam(List<String> list, SalesTeam res) {
+        List<SalesTeam> salesTeams = salesTeamMapper.queryBySuperId(res.getId());
+        if (!salesTeams.isEmpty()){
+            for (SalesTeam e : salesTeams) {
+                List<Admin> admins = adminMapper.queryByTeamId(e.getId());
+                admins.stream().forEach(e1 -> {
+                    list.add(e1.getId());
+                });
+                addSonSalesTeam(list,e);
+            }
+        }
+    }
+
     @Override
 //    @Cacheable(value = "adminStatisticeLists#300", key = "'key:'+#aid")
     public Object lists(String aid) {
@@ -278,6 +346,111 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
         return map;
     }
 
+    @Override
+    @Cacheable(value = "salesTeam#600", key = "'key:'+#aid+'_'+#startTime+'_'+#endTime")
+    public Object salesTeam(String aid,String startTime, String endTime) {
+        endTime=endTime+" 23:59:59";
+        List<SalesTeamBo> resList=new ArrayList<>();
+        List<SalesTeam> salesTeams=new ArrayList<>();
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+            List<SalesTeamBo> salesTeamLvlList = salesTeamMapper.findSalesTeamLvlList(1);
+            salesTeams.addAll(salesTeamLvlList);
+        }else {
+            salesTeams= salesTeamMapper.queryByAid(aid);
+        }
+        //如果不是团队负责人,所有数据都为null
+        int teamCallSum=0;
+        int teamConnectSum=0;
+        int teamValidSum=0;
+        BigDecimal teamCallDurationSum=BigDecimal.ZERO;
+        //先计算负责人
+//        AdminStatisticsBo ab=adminCallDayMapper.selectByAidCount(aid,startTime,endTime);
+//        if (ab!= null) {
+//            if (ab.getCallSum()!= null) teamCallSum = teamCallSum + ab.getCallSum();
+//            if (ab.getCallDurationSum()!= null) teamCallDurationSum = teamCallDurationSum.add(ab.getCallDurationSum());
+//            if (ab.getConnectSum()!= null) teamConnectSum = teamConnectSum + ab.getConnectSum();
+//            if (ab.getValidSum()!= null) teamValidSum = teamValidSum + ab.getValidSum();
+//        }
+        if (!salesTeams.isEmpty()){
+            //先获取顶层再迭代获取每一层
+            for (SalesTeam e : salesTeams) {
+                SalesTeamBo salesTeamBo = new SalesTeamBo(e);
+                //再计算所有成员
+                List<Admin> admins = adminMapper.queryByTeamId(e.getId());
+                for (Admin e2 : admins) {
+                    AdminStatisticsBo as=adminCallDayMapper.selectByAidCount(e2.getId(), startTime,endTime);
+                    if (as != null) {
+                        if (as.getCallSum()!= null) teamCallSum = teamCallSum + as.getCallSum();
+                        if (as.getCallDurationSum()!= null) teamCallDurationSum = teamCallDurationSum.add(as.getCallDurationSum());
+                        if (as.getConnectSum()!= null) teamConnectSum = teamConnectSum + as.getConnectSum();
+                        if (as.getValidSum()!= null) teamValidSum = teamValidSum + as.getValidSum();
+                    }
+                }
+                salesTeamBo.setTeamCallSum(teamCallSum);
+                salesTeamBo.setTeamCallDurationSum(teamCallDurationSum);
+                salesTeamBo.setTeamPeopleSum(admins.size());
+                salesTeamBo.setTeamConnectSum(teamConnectSum);
+                salesTeamBo.setTeamValidSum(teamValidSum);
+                resList.add(salesTeamBo);
+                addSonTeam(resList,salesTeamBo,startTime,endTime);
+            }
+        }
+        return resList;
+    }
+
+    @Override
+    @CacheEvict(value = "salesTeam#600", allEntries = true)
+    public Object salesTeamClean() {
+        LoggerUtils.debug(getClass(),"营销团队缓存清理");
+        return 1;
+    }
+
+    private void addSonTeam(List<SalesTeamBo>list, SalesTeamBo salesTeamBo, String startTime, String endTime) {
+        List<SalesTeam> salesTeams = salesTeamMapper.queryBySuperId(salesTeamBo.getId());
+
+        if (!salesTeams.isEmpty()){
+            //计算所有子项数据
+            for (SalesTeam e : salesTeams) {
+                SalesTeamBo salesTeamBo2 = new SalesTeamBo(e);
+                int teamCallSum=0;
+                int teamConnectSum=0;
+                int teamValidSum=0;
+                BigDecimal teamCallDurationSum=BigDecimal.ZERO;
+                //先计算负责人
+//                AdminStatisticsBo ab=callLogMapper.selectAdminCallSum(e.getAid(),startTime,endTime);
+//                if (ab!= null) {
+//                    if (ab.getCallSum()!= null) teamCallSum = teamCallSum + ab.getCallSum();
+//                    if (ab.getCallDurationSum()!= null) teamCallDurationSum = teamCallDurationSum.add(ab.getCallDurationSum());
+//                    if (ab.getConnectSum()!= null) teamConnectSum = teamConnectSum + ab.getConnectSum();
+//                    if (ab.getValidSum()!= null) teamValidSum = teamValidSum + ab.getValidSum();
+//                }
+                List<Admin> admins = adminMapper.queryByTeamId(e.getId());
+                for (Admin admin : admins) {
+                    AdminStatisticsBo as=callLogMapper.selectAdminCallSum(admin.getId(),startTime,endTime);
+                    if (as!= null) {
+                        if (as.getCallSum()!= null) teamCallSum = teamCallSum + as.getCallSum();
+                        if (as.getCallDurationSum()!= null) teamCallDurationSum = teamCallDurationSum.add(as.getCallDurationSum());
+                        if (as.getConnectSum()!= null) teamConnectSum = teamConnectSum + as.getConnectSum();
+                        if (as.getValidSum()!= null) teamValidSum = teamValidSum + as.getValidSum();
+                    }
+                }
+                salesTeamBo2.setTeamCallSum(teamCallSum);
+                salesTeamBo2.setTeamCallDurationSum(teamCallDurationSum);
+                salesTeamBo2.setTeamConnectSum(teamConnectSum);
+                salesTeamBo2.setTeamValidSum(teamValidSum);
+                salesTeamBo2.setTeamPeopleSum(admins.size());
+                //迭代计算并赋值给上一层
+                addSonTeam(list,salesTeamBo2,startTime,endTime);
+                if (salesTeamBo2.getTeamPeopleSum()!=null)salesTeamBo.setTeamPeopleSum(salesTeamBo.getTeamPeopleSum() + salesTeamBo2.getTeamPeopleSum());
+                if (salesTeamBo2.getTeamCallSum()!=null)salesTeamBo.setTeamCallSum(salesTeamBo.getTeamCallSum()+salesTeamBo2.getTeamCallSum());
+                if (salesTeamBo2.getTeamCallDurationSum()!=null)salesTeamBo.setTeamCallDurationSum(salesTeamBo.getTeamCallDurationSum().add(salesTeamBo2.getTeamCallDurationSum()));
+                if (salesTeamBo2.getTeamConnectSum()!=null)salesTeamBo.setTeamConnectSum(salesTeamBo.getTeamConnectSum()+salesTeamBo2.getTeamConnectSum());
+                if (salesTeamBo2.getTeamValidSum()!=null)salesTeamBo.setTeamValidSum(salesTeamBo.getTeamValidSum()+salesTeamBo2.getTeamValidSum());
+                list.add(salesTeamBo2);
+            }
+        }
+    }
+
 
     public  List<String> getThisMonth(Days days) {
         //获取三十天前的日期

+ 2 - 0
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -49,6 +49,8 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		if(StringUtils.isNotBlank(alb.getMobile())) params.put("mobile", alb.getMobile());
 		if(StringUtils.isNotBlank(alb.getSuperiorId())) params.put("superiorId", alb.getSuperiorId());
 		if(StringUtils.isNotBlank(alb.getAmbId())) params.put("ambId", alb.getAmbId());
+		//新增团队查询
+		if(alb.getTeamId()!=null) params.put("teamId", alb.getTeamId());
 		if(StringUtils.isNotBlank(alb.getAncestors())) params.put("ancestors", alb.getAncestors());
 		if(alb.getAmbManage()!=null) params.put("ambManage", alb.getAmbManage());
 		if(alb.getSeniorStaff()!=null) params.put("seniorStaff", alb.getSeniorStaff());

+ 138 - 0
src/main/java/com/goafanti/admin/service/impl/SalesTeamServiceImpl.java

@@ -0,0 +1,138 @@
+package com.goafanti.admin.service.impl;
+
+import com.goafanti.admin.bo.SalesTeamBo;
+import com.goafanti.admin.service.SalesTeamService;
+import com.goafanti.common.dao.SalesTeamMapper;
+import com.goafanti.common.model.SalesTeam;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 营销团队(SalesTeam)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-12-09 11:18:44
+ */
+@Service("salesTeamService")
+public class SalesTeamServiceImpl extends BaseMybatisDao<SalesTeamMapper> implements SalesTeamService {
+    @Resource
+    private SalesTeamMapper salesTeamMapper;
+
+
+    @Override
+    public Pagination<SalesTeamBo> pageList(SalesTeam salesTeam, Integer pageNo, Integer pageSize) {
+        return (Pagination<SalesTeamBo>) findPage("findSalesTeamList",
+                "findSalesTeamCount", salesTeam, pageNo, pageSize);
+    }
+
+
+
+    @Override
+    public boolean checkName(SalesTeam in) {
+        SalesTeam salesTeam = salesTeamMapper.queryByName(in.getName());
+        if (salesTeam != null){
+            return !salesTeam.getId().equals(in.getId());
+        }
+        return false;
+    }
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public SalesTeamBo queryById(Integer id) {
+        return this.salesTeamMapper.queryDetailsById(id);
+    }
+
+
+    /**
+     * 新增数据
+     *
+     * @param salesTeam 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public SalesTeam insert(SalesTeam salesTeam) {
+        salesTeam.setCreateTime(new Date());
+        if (salesTeam.getSuperId() == null) {
+            salesTeam.setAncestors("0");
+        }else {
+            SalesTeam superSt = salesTeamMapper.queryById(salesTeam.getSuperId());
+            if (superSt != null) {
+                salesTeam.setAncestors(superSt.getAncestors() + "," + superSt.getId());
+            }
+        }
+        this.salesTeamMapper.insert(salesTeam);
+        return salesTeam;
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param salesTeam 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public SalesTeam update(SalesTeam salesTeam) {
+        if (salesTeam.getSuperId() == null) {
+            salesTeam.setAncestors("0");
+        }else {
+            SalesTeam superSt = salesTeamMapper.queryById(salesTeam.getSuperId());
+            if (superSt != null) {
+                salesTeam.setAncestors(superSt.getAncestors() + "," + superSt.getId());
+            }
+        }
+        this.salesTeamMapper.update(salesTeam);
+        return this.queryById(salesTeam.getId());
+    }
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    @Override
+    public boolean deleteById(Integer id) {
+        return this.salesTeamMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    public Object list(Integer lvl) {
+        return salesTeamMapper.findSalesTeamLvlList(lvl);
+    }
+
+    @Override
+    public Object lvlList() {
+        List<SalesTeamBo> list = salesTeamMapper.findSalesTeamLvlList(null);
+        List<SalesTeamBo> lvl1List = list.stream()
+                .filter(e -> e.getLvl() == 1)
+                .collect(Collectors.toList());
+        List<SalesTeamBo> lvl2List = list.stream()
+                .filter(e -> e.getLvl() == 2)
+                .collect(Collectors.toList());
+        List<SalesTeamBo> lvl3List = list.stream()
+                .filter(e -> e.getLvl() == 3)
+                .collect(Collectors.toList());
+        lvl2List.forEach(e -> {
+            e.setList(lvl3List.stream()
+                    .filter(e1 -> e1.getSuperId().equals(e.getId()))
+                    .collect(Collectors.toList()));
+        });
+        lvl1List.forEach(e -> {
+            e.setList(lvl2List.stream()
+                   .filter(e1 -> e1.getSuperId().equals(e.getId()))
+                   .collect(Collectors.toList()));
+        });
+        return lvl1List;
+    }
+}

+ 6 - 1
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -14,6 +14,9 @@ public class AFTConstants {
 	public static final String	MMDDYYYY							= "MM/dd/yyyy";
 
 	public static final String	MMDD								= "MM-dd";
+
+	/**线索客户释放时间*/
+	public static final long CLUE_USER_MAX							= 30L;
 	/** 初始密码*/
 	public static final String	INITIALPASSWORD						= "123456";
 
@@ -55,6 +58,8 @@ public class AFTConstants {
 	public static final String  PERSONNEL_AUDITOR              	  	= "9990";
 	/** 运营管理 */
 	public static final String  OPERATION_MANAGER		            = "9989";
+	/** 运营管理 */
+	public static final String  CALL_MANAGER		            = "9979";
 
 	/** 运营管理 */
 	public static final String  OPERATION_GUARANTEE		            = "9988";
@@ -69,7 +74,7 @@ public class AFTConstants {
 	public static final String  FINANCE_MANAGER						= "997";
 	/** 营销经理 */
 	public static final String  SALESMAN_MANAGER                    = "996";
-	/** 营销经理 */
+	/** 心锁经理 */
 	public static final String  CLUE_MANAGER                    = "986";
 	/** 客服营销员 */
 	public static final String  CUSTOMER_SERVICE_SALESMAN     		= "960";

+ 0 - 1
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -988,7 +988,6 @@ public class PublicController extends CertifyApiController {
 	@PostMapping("/callCompleted")
 	@ResponseBody
 	public Result callCompleted(@RequestBody InputCallCompleter in) {
-		System.out.println(in);
 		return new Result<>().data(userOutboundService.pushCallCompleted(in));
 	}
 

+ 95 - 0
src/main/java/com/goafanti/common/dao/AdminCallDayMapper.java

@@ -0,0 +1,95 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.admin.bo.AdminStatisticsBo;
+import com.goafanti.common.model.AdminCallDay;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ * 外呼每天统计表(AdminCallDay)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-12-11 09:21:49
+ */
+public interface AdminCallDayMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    AdminCallDay queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param adminCallDay 查询条件
+     * @param pageable     分页对象
+     * @return 对象列表
+     */
+    List<AdminCallDay> findAdminCallDayList(AdminCallDay adminCallDay, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param adminCallDay 查询条件
+     * @return 总行数
+     */
+    int findAdminCallDayCount(AdminCallDay adminCallDay);
+
+    /**
+     * 新增数据
+     *
+     * @param adminCallDay 实例对象
+     * @return 影响行数
+     */
+    int insert(AdminCallDay adminCallDay);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<AdminCallDay> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<AdminCallDay> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<AdminCallDay> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<AdminCallDay> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param adminCallDay 实例对象
+     * @return 影响行数
+     */
+    int update(AdminCallDay adminCallDay);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    AdminCallDay selectByAidAndDay(@Param("aid") String aid, @Param("now") LocalDate now);
+
+    void insertDay(@Param("id") String id, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endTime);
+
+    void updateDay(@Param("id") String id, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endTime);
+
+
+    AdminStatisticsBo selectByAidCount(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
+}
+

+ 2 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -278,6 +278,8 @@ public interface AdminMapper {
     List<Admin> agentList();
 
     Admin selectByCallStaffNo(String staffNo);
+
+    List<Admin> queryByTeamId(Integer id);
 }
 
 

+ 95 - 0
src/main/java/com/goafanti/common/dao/SalesTeamMapper.java

@@ -0,0 +1,95 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.admin.bo.SalesTeamBo;
+import com.goafanti.common.model.SalesTeam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 营销团队(SalesTeam)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-12-09 10:59:45
+ */
+public interface SalesTeamMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    SalesTeam queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param salesTeam 查询条件
+     * @return 对象列表
+     */
+    List<SalesTeam> findSalesTeamList(SalesTeam salesTeam);
+
+    /**
+     * 统计总行数
+     *
+     * @param salesTeam 查询条件
+     * @return 总行数
+     */
+    int findSalesTeamCount(SalesTeam salesTeam);
+
+    /**
+     * 新增数据
+     *
+     * @param salesTeam 实例对象
+     * @return 影响行数
+     */
+    int insert(SalesTeam salesTeam);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<SalesTeam> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<SalesTeam> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<SalesTeam> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<SalesTeam> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param salesTeam 实例对象
+     * @return 影响行数
+     */
+    int update(SalesTeam salesTeam);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    SalesTeam queryByName(String name);
+
+    SalesTeamBo queryDetailsById(Integer id);
+
+    List<SalesTeamBo> findSalesTeamLvlList(@Param("lvl") Integer lvl);
+
+    List<SalesTeam> queryByAid(String aid);
+
+    List<SalesTeam> queryBySuperId(Integer id);
+
+    List<Integer> queryByAncestors(Integer id);
+}
+

+ 2 - 0
src/main/java/com/goafanti/common/dao/TaskScoreMapper.java

@@ -86,5 +86,7 @@ public interface TaskScoreMapper {
     TaskScore queryByTid(Integer tid);
 
     List<OutAdminTaskScore> findAdminTaskScoreList(InputTaskScore in);
+
+    List<TaskScore> selectRemarkByAid(String id);
 }
 

+ 4 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -300,5 +300,9 @@ public interface UserMapper {
     List<LockingReleaseBo > selectSignReleaseUser(String id);
 
     int selectUserLevel(String aid);
+
+    List<User> selectClueUserByClueType(String aid);
+
+    void updateClueUserRelease(List<User> updateList);
 }
 

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMidMapper.java

@@ -91,5 +91,7 @@ public interface UserMidMapper {
     UserMid getUserDtails(String buyerId);
 
     UserMid selectByUid(String uid);
+
+    void updateCallByUid(@Param("uid") String uid, @Param("count") int count, @Param("duration") int duration);
 }
 

+ 1 - 0
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -92,6 +92,7 @@ public enum NoticeStatus {
 	PUBLIC_MAX_DURATION(82,"公出时长审核发起"),
 	PUBLIC_MAX_DURATION_YES(83,"公出时长审核通过"),
 	PUBLIC_MAX_DURATION_NO(84,"公出时长审核驳回"),
+	CLUE_USER_RELEASE(85,"线索客户丢失"),
 	OTHER(0, "其他");
 
 	private NoticeStatus(Integer code, String desc) {

+ 1 - 0
src/main/java/com/goafanti/common/enums/NoticeTypes.java

@@ -53,6 +53,7 @@ public enum NoticeTypes {
 		} else if (i == NoticeStatus.CUSTOMER_LOSE30.getCode() || i == NoticeStatus.CUSTOMER_LOSE270.getCode()
 				|| i == NoticeStatus.CUSTOMER_CHENNEL_LOSE.getCode() || i == NoticeStatus.CUSTOMER_CHENNEL_RECOVERY.getCode()
 				|| i == NoticeStatus.RESTRICT_PROJECT_LOSE30.getCode() || i == NoticeStatus.RESTRICT_PROJECT_LOSE270.getCode()
+				||i == NoticeStatus.CLUE_USER_RELEASE.getCode()
 		) {
 			return KHSF.code;
 		} else if (i == NoticeStatus.CUSTOMER_PRIVATE_REMINDER.getCode()|| i == NoticeStatus.CUSTOMER_LOSE_REMINDER.getCode()

+ 225 - 0
src/main/java/com/goafanti/common/mapper/AdminCallDayMapper.xml

@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.AdminCallDayMapper">
+
+    <resultMap type="com.goafanti.common.model.AdminCallDay" id="AdminCallDayMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="teamId" column="team_id" jdbcType="INTEGER"/>
+        <result property="teamName" column="team_name" jdbcType="VARCHAR"/>
+        <result property="callSum" column="call_sum" jdbcType="INTEGER"/>
+        <result property="connectSum" column="connect_sum" jdbcType="INTEGER"/>
+        <result property="validSum" column="valid_sum" jdbcType="INTEGER"/>
+        <result property="callDurationSum" column="call_duration_sum" jdbcType="INTEGER"/>
+        <result property="dayDate" column="day_date" jdbcType="TIMESTAMP"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="AdminCallDayAllSql">
+        id, name, aid, team_id, team_name, call_sum, connect_sum, valid_sum, call_duration_sum, day_date, create_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="AdminCallDayMap">
+        select
+        <include refid="AdminCallDayAllSql"/>
+        from admin_call_day
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findAdminCallDayList" resultMap="AdminCallDayMap">
+        select
+        <include refid="AdminCallDayAllSql"/>
+        from admin_call_day
+        <include refid="AdminCallDayListSql"/>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+    <sql id="AdminCallDayListSql">
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="name != null and name != ''">
+                and name  like concat('%',#{name},'%')
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="teamIdList != null">
+                and team_id in
+                <foreach collection="teamIdList" item="teamId" open="(" close=")" separator=",">
+                    #{teamId}
+                </foreach>
+            </if>
+            <if test="teamIds != null">
+            and team_id in
+            <foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
+                #{teamId}
+            </foreach>
+        </if>
+            <if test="quantityType !=null">
+                <if test="quantityType==1">
+                    and valid_sum &lt; 10
+                </if>
+                <if test="quantityType==2">
+                    and valid_sum &gt;= 10 and valid_sum &lt; 20
+                </if>
+                <if test="quantityType==3">
+                    and valid_sum &gt;= 20 and valid_sum &lt; 50
+                </if>
+                <if test="quantityType==4">
+                    and valid_sum &gt;= 50
+                </if>
+            </if>
+            <if test="startTime != null and endTime != null">
+                and day_date BETWEEN #{startTime} and  #{endTime}
+            </if>
+        </where>
+    </sql>
+
+
+    <!--统计总行数-->
+    <select id="findAdminCallDayCount" resultType="java.lang.Integer">
+        select count(1)
+        from admin_call_day
+        <include refid="AdminCallDayListSql"/>
+    </select>
+
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into admin_call_day(name, aid, team_id, team_name, call_sum, connect_sum, valid_sum, call_duration_sum,
+                                   day_date, create_time)
+        values (#{name}, #{aid}, #{teamId}, #{teamName}, #{callSum}, #{connectSum}, #{validSum}, #{callDurationSum},
+                #{dayDate}, #{createTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into admin_call_day(name, aid, team_id, team_name, call_sum, connect_sum, valid_sum, call_duration_sum,
+        day_date, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.aid}, #{entity.teamId}, #{entity.teamName}, #{entity.callSum},
+            #{entity.connectSum}, #{entity.validSum}, #{entity.callDurationSum}, #{entity.dayDate},
+            #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into admin_call_day(name, aid, team_id, team_name, call_sum, connect_sum, valid_sum, call_duration_sum,
+        day_date, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.aid}, #{entity.teamId}, #{entity.teamName}, #{entity.callSum},
+            #{entity.connectSum}, #{entity.validSum}, #{entity.callDurationSum}, #{entity.dayDate},
+            #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        name = values(name),
+        aid = values(aid),
+        team_id = values(team_id),
+        team_name = values(team_name),
+        call_sum = values(call_sum),
+        connect_sum = values(connect_sum),
+        valid_sum = values(valid_sum),
+        call_duration_sum = values(call_duration_sum),
+        day_date = values(day_date),
+        create_time = values(create_time)
+    </insert>
+
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update admin_call_day
+        <set>
+            <if test="name != null and name != ''">
+                name = #{name},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="teamId != null">
+                team_id = #{teamId},
+            </if>
+            <if test="teamName != null and teamName != ''">
+                team_name = #{teamName},
+            </if>
+            <if test="callSum != null">
+                call_sum = #{callSum},
+            </if>
+            <if test="connectSum != null">
+                connect_sum = #{connectSum},
+            </if>
+            <if test="validSum != null">
+                valid_sum = #{validSum},
+            </if>
+            <if test="callDurationSum != null">
+                call_duration_sum = #{callDurationSum},
+            </if>
+            <if test="dayDate != null">
+                day_date = #{dayDate},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from admin_call_day
+        where id = #{id}
+    </delete>
+
+
+    <select id="selectByAidAndDay" resultMap="AdminCallDayMap">
+        select
+        <include refid="AdminCallDayAllSql"/>
+        from admin_call_day
+        where aid = #{aid} and day_date = #{now}
+    </select>
+
+    <insert id="insertDay">
+        insert into admin_call_day(aid,name,team_id,team_name,call_sum,connect_sum,valid_sum,call_duration_sum,day_date)
+        select b.id,b.name,c.id,c.name ,a.callSum,a.connectSum,a.validSum,a.callDurationSum,a.dates
+        from (SELECT x.aid,sum(x.duration) callDurationSum,sum(x.counts) callSum,
+        sum(x.connectSum)connectSum,sum(x.validSum)validSum,x.dates
+        from(SELECT b.aid ,b.duration ,1 counts,if(b.duration>0 and b.duration &lt; 5,1,0)connectSum,
+        if(b.duration>=5,1,0)validSum ,DATE_FORMAT(b.create_time,'%Y-%m-%d') dates
+        from  call_log b
+        where b.aid= #{id}
+        and b.create_time between #{startDate} and #{endDate}
+        )x group by x.aid,x.dates)a
+        left join admin b on a.aid=b.id
+        left join sales_team c on b.team_id=c.id
+    </insert>
+    <update id="updateDay">
+        update admin_call_day a ,(SELECT x.aid,sum(x.duration) callDurationSum,sum(x.counts) callSum,
+                 sum(x.connectSum)connectSum,sum(x.validSum)validSum,x.dates
+                from(SELECT b.aid ,b.duration ,1 counts,if(b.duration>0 and b.duration &lt; 5,1,0)connectSum,
+                      if(b.duration>=5,1,0)validSum ,DATE_FORMAT(b.create_time,'%Y-%m-%d') dates
+               from  call_log b
+               where b.aid= #{id}
+                 and b.create_time between #{startDate} and #{endDate}
+              )x group by x.aid,x.dates)b
+        set a.call_sum=b.callSum,a.connect_sum=b.connectSum,a.valid_sum=b.validSum,a.call_duration_sum=b.callDurationSum
+        where a.aid=b.aid and a.day_date=b.dates
+    </update>
+    <select id="selectByAidCount" resultType="com.goafanti.admin.bo.AdminStatisticsBo">
+        select  aid,sum(call_sum) callSum,
+                sum(connect_sum)connectSum,sum(valid_sum)validSum,sum(call_duration_sum) callDurationSum
+        from admin_call_day
+        where aid= #{aid}
+          and day_date BETWEEN #{startTime} and  #{endTime}
+        group by aid
+    </select>
+
+</mapper>
+

+ 22 - 9
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -38,7 +38,7 @@
     </resultMap>
 
     <sql id="AdminAllSql">
-        id, mobile, name, password, email, create_time, number, province, position, superior_id, city, department_id, status, user_no, duty, district, head_portrait_url, contact_mobile, last_login_time, open_id, type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id, expense_super_examine, public_carbon_copy, call_no
+        id, mobile, name, password, email, create_time, number, province, position, superior_id, city, department_id, status, user_no, duty, district, head_portrait_url, contact_mobile, last_login_time, open_id, type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id, expense_super_examine, public_carbon_copy, call_no, team_id
     </sql>
 
     <!--查询单个-->
@@ -55,19 +55,19 @@
                           department_id, status, user_no, duty, district, head_portrait_url, contact_mobile,
                           last_login_time, open_id, type, reviewer, amb_id, amb_role, amb_manage, manager_id,
                           senior_staff, public_purview, expense_open_id, expense_super_examine, public_carbon_copy,
-                          call_no)
+                          call_no, team_id)
         values (#{id},#{mobile}, #{name}, #{password}, #{email}, #{createTime}, #{number}, #{province}, #{position},
                 #{superiorId}, #{city}, #{departmentId}, #{status}, #{userNo}, #{duty}, #{district}, #{headPortraitUrl},
                 #{contactMobile}, #{lastLoginTime}, #{openId}, #{type}, #{reviewer}, #{ambId}, #{ambRole}, #{ambManage},
                 #{managerId}, #{seniorStaff}, #{publicPurview}, #{expenseOpenId}, #{expenseSuperExamine},
-                #{publicCarbonCopy}, #{callNo})
+                #{publicCarbonCopy}, #{callNo}, #{teamId})
     </insert>
 
     <insert id="insertBatch">
         insert into admin(mobile, name, password, email, create_time, number, province, position, superior_id, city,
         department_id, status, user_no, duty, district, head_portrait_url, contact_mobile, last_login_time, open_id,
         type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id,
-        expense_super_examine, public_carbon_copy, call_no)
+        expense_super_examine, public_carbon_copy, call_no, team_id)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
@@ -76,7 +76,7 @@
             #{entity.headPortraitUrl}, #{entity.contactMobile}, #{entity.lastLoginTime}, #{entity.openId},
             #{entity.type}, #{entity.reviewer}, #{entity.ambId}, #{entity.ambRole}, #{entity.ambManage},
             #{entity.managerId}, #{entity.seniorStaff}, #{entity.publicPurview}, #{entity.expenseOpenId},
-            #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo})
+            #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo}, #{entity.teamId})
         </foreach>
     </insert>
 
@@ -84,7 +84,7 @@
         insert into admin(mobile, name, password, email, create_time, number, province, position, superior_id, city,
         department_id, status, user_no, duty, district, head_portrait_url, contact_mobile, last_login_time, open_id,
         type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id,
-        expense_super_examine, public_carbon_copy, call_no)
+        expense_super_examine, public_carbon_copy, call_no, team_id)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
@@ -126,7 +126,8 @@
         expense_open_id = values(expense_open_id),
         expense_super_examine = values(expense_super_examine),
         public_carbon_copy = values(public_carbon_copy),
-        call_no = values(call_no)
+        call_no = values(call_no),
+        team_id = values(team_id)
     </insert>
 
     <!--通过主键修改数据-->
@@ -226,6 +227,9 @@
             <if test="callNo != null and callNo != ''">
                 call_no = #{callNo},
             </if>
+            <if test="teamId != null">
+                team_id = #{teamId},
+            </if>
         </set>
         where id = #{id}
     </update>
@@ -482,13 +486,14 @@
     <!--*************************************************************************-->
     <select id="selectAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
         select a.id, a.mobile, a.name, a.position, a.email, a.province, a.city, a.create_time as createTime, aa.name as superior,dep.name departmentName,
-        a.superior_id as superiorId, a.department_id as departmentId, a.last_login_time as lastLoginTime, a.contact_mobile as contactMobile,
+        a.superior_id as superiorId, a.department_id as departmentId, a.last_login_time as lastLoginTime, a.contact_mobile as contactMobile,st.name teamName,a.team_id teamId,
         a.duty,a.status, a.type, ambs.id ambId,ambs.name ambName,ambs.ancestors_names ancestorsNames ,a.amb_role ambRole,a.senior_staff seniorStaff,a.public_purview publicPurview
         from admin a
         left join admin_location al on a.id = al.admin_id
         left join admin aa on aa.id = a.superior_id
         left join amb_system ambs on a.amb_id=ambs.id
         left join department dep on a.department_id = dep.id
+        left join sales_team st on a.team_id=st.id
         <if test="rid != null">
             RIGHT join (select uid from user_role where rid=#{rid,jdbcType=VARCHAR}) ur on a.id=ur.uid
         </if>
@@ -630,9 +635,10 @@
                a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,a.expense_super_examine expenseSuperExamine,
                a.head_portrait_url as headPortraitUrl, a.contact_mobile as contactMobile,a.senior_staff seniorStaff,
                b.name superior,c.name reviewerName,a.type,a.amb_id ambId,a.manager_id managerId ,d.name managerName,
-               a.public_carbon_copy publicCarbonCopy,e.name publicCarbonCopyName
+               a.public_carbon_copy publicCarbonCopy,e.name publicCarbonCopyName,a.team_id teamId,st.name teamName
         from admin a left join admin b on a.superior_id =b.id left join admin c on a.reviewer =c.id
                      left join admin d on a.manager_id=d.id left join admin e on a.public_carbon_copy=e.id
+                     left join  sales_team st on a.team_id=st.id
         where a.id= #{id,jdbcType=VARCHAR}
     </select>
     <select id="selectNameByid" parameterType="java.lang.String" resultType="java.lang.String">
@@ -1307,5 +1313,12 @@
         from admin
         where  call_no = #{callStaffNo}
     </select>
+
+    <select id="queryByTeamId" resultMap="AdminMap">
+        select
+        <include refid="AdminAllSql"/>
+        from admin
+        where team_id = #{teamId}
+    </select>
 </mapper>
 

+ 9 - 9
src/main/java/com/goafanti/common/mapper/CallLogMapper.xml

@@ -194,20 +194,20 @@
         where uid = #{uid}
     </select>
     <select id="selectAdminCallSum" resultType="com.goafanti.admin.bo.AdminStatisticsBo">
-        SELECT x.id,sum(x.duration) callDurationSum,count(*) callSum
-        from (SELECT a.id,b.duration ,b.create_time
-              from admin a  left join call_log b on a.id =b.aid
-              where  b.duration >0
-        <if test="aid ==null">
-            and   a.call_no >0
-        </if>
+        SELECT x.aid id,sum(x.duration) callDurationSum,sum(x.counts) callSum,
+        sum(x.connectSum)connectSum,sum(x.validSum)validSum
+        from (SELECT b.aid,b.duration ,1 counts,if(b.duration>0 and b.duration &lt;5,1,0)connectSum,
+        if(b.duration>=5,1,0)validSum
+        from  call_log b
+        <where>
         <if test="aid !=null">
-            and a.id= #{aid}
+            and b.aid = #{aid}
         </if>
         <if test="startTime !=null and endTime !=null">
             and   b.create_time BETWEEN #{startTime} and #{endTime}
         </if>
-                )x group by x.id
+        </where>
+        )x group by x.aid
     </select>
 
 

+ 220 - 0
src/main/java/com/goafanti/common/mapper/SalesTeamMapper.xml

@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.SalesTeamMapper">
+
+    <resultMap type="com.goafanti.common.model.SalesTeam" id="SalesTeamMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="lvl" column="lvl" jdbcType="INTEGER"/>
+        <result property="depId" column="dep_id" jdbcType="VARCHAR"/>
+        <result property="superId" column="super_id" jdbcType="INTEGER"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="ancestors" column="ancestors" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="SalesTeamAllSql">
+        id, name, aid, lvl, dep_id, super_id, status, create_time, ancestors
+    </sql>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="SalesTeamMap">
+        select
+        <include refid="SalesTeamAllSql"/>
+        from sales_team
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findSalesTeamList" resultType="com.goafanti.admin.bo.SalesTeamBo">
+        select a.id, a.name, a.aid, a.lvl, a.dep_id depId, a.super_id superId, a.status, a.create_time createTime,
+        b.name adminName,c.name depName,d.name superName
+        from sales_team a left join admin b on a.aid=b.id left join department c on a.dep_id=c.id
+        left join sales_team d on a.super_id=d.id
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="name != null and name != ''">
+                and name = #{name}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="lvl != null">
+                and lvl = #{lvl}
+            </if>
+            <if test="depId != null and depId != ''">
+                and dep_id = #{depId}
+            </if>
+            <if test="superId != null">
+                and super_id = #{superId}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="ancestors != null and ancestors != ''">
+                and ancestors = #{ancestors}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findSalesTeamCount" resultType="java.lang.Integer">
+        select count(1)
+        from sales_team
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="name != null and name != ''">
+                and name = #{name}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="lvl != null">
+                and lvl = #{lvl}
+            </if>
+            <if test="depId != null and depId != ''">
+                and dep_id = #{depId}
+            </if>
+            <if test="superId != null">
+                and super_id = #{superId}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="ancestors != null and ancestors != ''">
+                and ancestors = #{ancestors}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into sales_team(name, aid, lvl, dep_id, super_id, status, create_time, ancestors)
+        values (#{name}, #{aid}, #{lvl}, #{depId}, #{superId}, #{status}, #{createTime}, #{ancestors})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into sales_team(name, aid, lvl, dep_id, super_id, status, create_time, ancestors)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.aid}, #{entity.lvl}, #{entity.depId}, #{entity.superId}, #{entity.status},
+            #{entity.createTime}, #{entity.ancestors})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into sales_team(name, aid, lvl, dep_id, super_id, status, create_time, ancestors)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.aid}, #{entity.lvl}, #{entity.depId}, #{entity.superId}, #{entity.status},
+            #{entity.createTime}, #{entity.ancestors})
+        </foreach>
+        on duplicate key update
+        name = values(name),
+        aid = values(aid),
+        lvl = values(lvl),
+        dep_id = values(dep_id),
+        super_id = values(super_id),
+        status = values(status),
+        create_time = values(create_time),
+        ancestors = values(ancestors)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update sales_team
+        <set>
+            <if test="name != null and name != ''">
+                name = #{name},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="lvl != null">
+                lvl = #{lvl},
+            </if>
+            <if test="depId != null and depId != ''">
+                dep_id = #{depId},
+            </if>
+            <if test="superId != null">
+                super_id = #{superId},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="ancestors != null and ancestors != ''">
+                ancestors = #{ancestors},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from sales_team
+        where id = #{id}
+    </delete>
+
+    <select id="queryByName" resultMap="SalesTeamMap">
+        select
+        <include refid="SalesTeamAllSql"/>
+        from sales_team
+        where name = #{name}
+    </select>
+    <select id="queryDetailsById" resultType="com.goafanti.admin.bo.SalesTeamBo">
+        select a.id, a.name, a.aid, a.lvl, a.dep_id depId, a.super_id superId, a.status, a.create_time createTime,
+               b.name adminName,c.name depName,d.name superName
+        from sales_team a left join admin b on a.aid=b.id left join department c on a.dep_id=c.id
+        left join sales_team d on a.super_id=d.id
+    where a.id = #{id}
+    </select>
+
+    <select id="findSalesTeamLvlList" resultType="com.goafanti.admin.bo.SalesTeamBo" parameterType="java.lang.Integer">
+        select a.id, a.name, a.aid, a.lvl, a.dep_id depId, a.super_id superId, a.status, a.create_time createTime,
+        b.name adminName,c.name depName,d.name superName
+        from sales_team a left join admin b on a.aid=b.id left join department c on a.dep_id=c.id
+        left join sales_team d on a.super_id=d.id
+        where a.status=0
+            <if test="lvl != null">
+                and a.lvl = #{lvl}
+            </if>
+
+
+    </select>
+    <select id="queryByAid" resultMap="SalesTeamMap">
+        select
+            <include refid="SalesTeamAllSql"/>
+        from sales_team
+        where aid = #{aid}
+    </select>
+    <select id="queryBySuperId"  resultMap="SalesTeamMap">
+        select
+        <include refid="SalesTeamAllSql"/>
+        from sales_team
+        where super_id = #{superId}
+    </select>
+    <select id="queryByAncestors" resultType="java.lang.Integer">
+        select id
+        from sales_team
+        where find_in_set(#{id},ancestors)
+    </select>
+</mapper>
+

+ 3 - 3
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -578,7 +578,7 @@
             <if test="settlementTime != null">
                 settlement_time = #{settlementTime},
             </if>
-            <if test="contractPictureUrl != null and contractPictureUrl != ''">
+            <if test="contractPictureUrl != null ">
                 contract_picture_url = #{contractPictureUrl},
             </if>
             <if test="contractNo != null and contractNo != ''">
@@ -629,13 +629,13 @@
             <if test="backStatus != null">
                 back_status = #{backStatus},
             </if>
-            <if test="agreementUrl != null and agreementUrl != ''">
+            <if test="agreementUrl != null">
                 agreement_url = #{agreementUrl},
             </if>
             <if test="newUser != null">
                 new_user = #{newUser},
             </if>
-            <if test="serviceContent != null and serviceContent != ''">
+            <if test="serviceContent != null ">
                 service_content = #{serviceContent},
             </if>
             <if test="salesType != null">

+ 5 - 0
src/main/java/com/goafanti/common/mapper/TaskScoreMapper.xml

@@ -253,6 +253,11 @@
         from task_score
         where tid = #{tid}
     </select>
+    <select id="selectRemarkByAid" resultMap="TaskScoreMap">
+        select b.*
+        from t_order_task a right join task_score b on a.id =b.tid
+        where a.task_receiver= #{aid}
+    </select>
 
 </mapper>
 

+ 1 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1540,6 +1540,7 @@
         left join admin d on a.clue_aid=d.id
         where a.clue_status =1
         <include refid="selectUserClueListSql"/>
+        order by a.clue_transfer_time
         <if test="page_sql !=null">
             ${page_sql}
         </if>

+ 16 - 1
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2180,7 +2180,8 @@ inner join(
      </foreach>
      )
   </update>
-  <select id="checkBeforeChannel" resultType="java.lang.String">
+
+	<select id="checkBeforeChannel" resultType="java.lang.String">
 	 select b.aid from user_channel a
 	left join user b on a.uid =b.id
 	where a.status=8 and a.uid = #{uid}
@@ -2525,4 +2526,18 @@ inner join(
 		where a.type= 1 and a.source in(1,2,3) and a.share_type = 0 and a.new_channel=0
 		and aid = #{aid}
 	</select>
+    <select id="selectClueUserByClueType" resultMap="UserMap">
+		select
+		    <include refid="UserAllSql"/>
+		from user
+		where clue_status =1 and clue_process in (0,1,2) and clue_aid = #{aid}
+	</select>
+	<update id="updateClueUserRelease">
+		update user
+		set clue_process =3,clue_transfer_time=now()
+		where id in
+		<foreach item="item" collection="list" separator=","  open="(" close=")">
+			#{item.id}
+		</foreach>
+	</update>
 </mapper>

+ 14 - 2
src/main/java/com/goafanti/common/mapper/UserMidMapper.xml

@@ -399,10 +399,10 @@
 
 
 
-    <update id="updateByUid" parameterType="com.goafanti.common.model.UserMid">
+    <update id="updateByUid">
         update user_mid
         <set>
-            <if test="aid != null">
+            <if test="aid != null and aid != ''">
                 aid = #{aid,jdbcType=VARCHAR},
             </if>
             <if test="lastFollowTime != null">
@@ -680,6 +680,18 @@
             #{item}
         </foreach>
     </update>
+    <update id="updateCallByUid">
+        update user_mid
+        <set>
+            <if test="count!= null">
+                call_count = #{count},
+            </if>
+            <if test="duration!= null">
+                call_duration = #{duration},
+            </if>
+        </set>
+        where `uid` = #{uid}
+    </update>
 
     <select id="getUserTaskNames" resultType="java.lang.String">
         select group_concat(distinct b.commodity_name)task_names from t_order_new a

+ 22 - 4
src/main/java/com/goafanti/common/model/Admin.java

@@ -10,7 +10,7 @@ import java.util.Date;
  * (Admin)实体类
  *
  * @author makejava
- * @since 2024-11-19 11:09:35
+ * @since 2024-12-09 15:16:51
  */
 public class Admin extends BaseModel implements AftUser{
 
@@ -133,14 +133,16 @@ public class Admin extends BaseModel implements AftUser{
      * 公出抄送人
      */
     private String publicCarbonCopy;
-
-
-
     /**
      * 外呼号码
      */
     private String callNo;
+    /**
+     * 团队编号
+     */
+    private Integer teamId;
 
+    private String	teamName;
     private String	superior;
     private String reviewerName;
 
@@ -149,6 +151,14 @@ public class Admin extends BaseModel implements AftUser{
 
     private static final long serialVersionUID = 1L;
 
+    public String getTeamName() {
+        return teamName;
+    }
+
+    public void setTeamName(String teamName) {
+        this.teamName = teamName;
+    }
+
     public String getPublicCarbonCopyName() {
         return publicCarbonCopyName;
     }
@@ -451,5 +461,13 @@ public class Admin extends BaseModel implements AftUser{
         this.callNo = callNo;
     }
 
+    public Integer getTeamId() {
+        return teamId;
+    }
+
+    public void setTeamId(Integer teamId) {
+        this.teamId = teamId;
+    }
+
 }
 

+ 153 - 0
src/main/java/com/goafanti/common/model/AdminCallDay.java

@@ -0,0 +1,153 @@
+package com.goafanti.common.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 外呼每天统计表(AdminCallDay)实体类
+ *
+ * @author makejava
+ * @since 2024-12-11 09:21:49
+ */
+public class AdminCallDay implements Serializable {
+    private static final long serialVersionUID = -20468848993770714L;
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 外呼人名称
+     */
+    private String name;
+    /**
+     * 外呼人编号
+     */
+    private String aid;
+    /**
+     * 团队编号
+     */
+    private Integer teamId;
+    /**
+     * 团队名称
+     */
+    private String teamName;
+    /**
+     * 外呼次数
+     */
+    private Integer callSum;
+    /**
+     * 接通次数
+     */
+    private Integer connectSum;
+    /**
+     * 有效次数
+     */
+    private Integer validSum;
+    /**
+     * 时长
+     */
+    private Integer callDurationSum;
+    /**
+     * 记录时间
+     */
+    private Date dayDate;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getTeamId() {
+        return teamId;
+    }
+
+    public void setTeamId(Integer teamId) {
+        this.teamId = teamId;
+    }
+
+    public String getTeamName() {
+        return teamName;
+    }
+
+    public void setTeamName(String teamName) {
+        this.teamName = teamName;
+    }
+
+    public Integer getCallSum() {
+        return callSum;
+    }
+
+    public void setCallSum(Integer callSum) {
+        this.callSum = callSum;
+    }
+
+    public Integer getConnectSum() {
+        return connectSum;
+    }
+
+    public void setConnectSum(Integer connectSum) {
+        this.connectSum = connectSum;
+    }
+
+    public Integer getValidSum() {
+        return validSum;
+    }
+
+    public void setValidSum(Integer validSum) {
+        this.validSum = validSum;
+    }
+
+    public Integer getCallDurationSum() {
+        return callDurationSum;
+    }
+
+    public void setCallDurationSum(Integer callDurationSum) {
+        this.callDurationSum = callDurationSum;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    public Date getDayDate() {
+        return dayDate;
+    }
+
+    public void setDayDate(Date dayDate) {
+        this.dayDate = dayDate;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+

+ 135 - 0
src/main/java/com/goafanti/common/model/SalesTeam.java

@@ -0,0 +1,135 @@
+package com.goafanti.common.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.goafanti.common.utils.Param;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 营销团队(SalesTeam)实体类
+ *
+ * @author makejava
+ * @since 2024-12-17 10:35:48
+ */
+public class SalesTeam implements Serializable {
+    private static final long serialVersionUID = -29387315654659431L;
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 团队名称
+     */
+    @NotNull
+    @Param(name = "团队名称")
+    private String name;
+    /**
+     * 团队队长编号
+     */
+    private String aid;
+    /**
+     * 等级 0=无,1=一级,2=二级,3=三级
+     */
+    private Integer lvl;
+    /**
+     * 部门编号
+     */
+    @NotNull
+    @Param(name = "部门编号")
+    private String depId;
+    /**
+     * 上级团队
+     */
+    private Integer superId;
+    /**
+     * 状态 0=正常,1=解散
+     */
+    private Integer status;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 祖级列表
+     */
+    private String ancestors;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getLvl() {
+        return lvl;
+    }
+
+    public void setLvl(Integer lvl) {
+        this.lvl = lvl;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public Integer getSuperId() {
+        return superId;
+    }
+
+    public void setSuperId(Integer superId) {
+        this.superId = superId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getAncestors() {
+        return ancestors;
+    }
+
+    public void setAncestors(String ancestors) {
+        this.ancestors = ancestors;
+    }
+
+}
+

+ 72 - 20
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -4,10 +4,7 @@ import com.goafanti.business.bo.OutRestrictProject;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminUserCountMapper;
-import com.goafanti.common.dao.NoticeMapper;
-import com.goafanti.common.dao.RestrictProjectMapper;
-import com.goafanti.common.dao.UserTransferLogMapper;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.model.AdminUserCount;
@@ -20,14 +17,12 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.Date;
@@ -42,9 +37,9 @@ public class ReleaseUserTask {
 	private CustomerService customerService;
 	@Resource
 	private UserService userService;
-	@Autowired
+	@Resource
 	private NoticeMapper	noticeMapper;
-	@Autowired
+	@Resource
 	private AsyncUtils	asyncUtils;
 	@Value(value = "${dev.name}")
 	private String devName=null;
@@ -52,20 +47,23 @@ public class ReleaseUserTask {
 
 	int pointsDataLimit = 50;
 
-	@Autowired
+
+	@Resource
 	private AdminUserCountMapper adminUserCountMapper;
 
-	@Autowired
+	@Resource
 	private RestrictProjectMapper restProjectMapper;
 
-	@Autowired
+	@Resource
 	private UserTransferLogMapper userTransferLogMapper;
+	@Resource
+	private UserMapper userMapper;
 
 	/**
 	 * 客户释放
 	 *
 	 */
-//	@Scheduled(cron = "0 10 17  * * ?")
+//	@Scheduled(cron = "0 22 16  * * ?")
 //	@RequestMapping("/open/test")
 	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
@@ -76,12 +74,73 @@ public class ReleaseUserTask {
 			updateUser(userList);
 			Thread.sleep(2000);
 			pushRestrictProject(userList);
+			Thread.sleep(2000);
+			pushReleaseClueUser(userList);
 		} catch (InterruptedException e) {
 			e.printStackTrace();
 		}
 
 	}
 
+	private void pushReleaseClueUser(List<User> userList) {
+		LoggerUtils.debug(getClass(), "==============线索客户丢失开始============");
+		LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
+		Date date = new Date();
+		List<Notice> ln = new ArrayList<>();
+		List<User> releaseUserList = new ArrayList<>();
+		List<UserTransferLog> logList=new ArrayList<>();
+		for (User admin : userList) {
+			List<User> users = userMapper.selectClueUserByClueType(admin.getId());
+			for (User u : users) {
+				String aid=null;
+				LocalDateTime clueTime=u.getClueTransferTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
+				clueTime = clueTime.withHour(0).withMinute(0).withSecond(0);
+				//已分配的通知人与时间不同,
+				if (u.getClueProcess()==1){
+					aid=u.getAid();
+				}else{
+					aid=admin.getId();
+				}
+				LocalDateTime endTime = clueTime.plusDays(AFTConstants.CLUE_USER_MAX);
+				long between= ChronoUnit.DAYS.between(now, endTime);
+				System.out.println("====="+u.getNickname()+"===="+between);
+				if (between<1){
+					releaseUserList.add(u);
+					logList.add(new UserTransferLog(u.getId(), "1",null, 27, "",date));
+					ln.add(new Notice(UUID.randomUUID().toString(),date, 0, aid,
+							NoticeStatus.CLUE_USER_RELEASE.getCode(),
+							String.format("您的线索客户[%s]已丢失!",u.getNickname())
+							,u.getId()));
+				}
+			}
+
+		}
+		addNoticeBatch(ln);
+		addUserTransferLogBatch(logList);
+		pushClueUserRelease(releaseUserList);
+		LoggerUtils.debug(getClass(), "==============线索客户丢失结束============");
+	}
+
+	private void pushClueUserRelease(List<User> lu) {
+		List<User> updateList=new ArrayList<>();
+		if (lu != null && !lu.isEmpty()) {
+			for (int i = 0; i < lu.size(); i++) {
+				updateList.add(lu.get(i));
+				if (50 == updateList.size() || i == lu.size() - 1) {
+                    userMapper.updateClueUserRelease(updateList);
+                    updateList.clear();
+					try {
+						Thread.sleep(1000);
+					} catch (InterruptedException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+		}
+
+	}
+
+
 	/**
 	 * 限时项目定时任务
 	 */
@@ -163,14 +222,7 @@ public class ReleaseUserTask {
 		}
 	}
 
-	public static void main(String[] args) {
-		LocalDateTime now = LocalDateTime.now();
-		LocalDateTime endTime = LocalDateTime.of(2024,5,14,0,0);
-		endTime= endTime.minusDays(270);
-		long between = ChronoUnit.DAYS.between(now, endTime);
-		System.out.println(between);
-		System.out.println(endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-	}
+
 
 	private void pushReleaseRestrictProject(List<Integer> list) {
 		List<Integer> list2 = new ArrayList<>();

+ 1 - 0
src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java

@@ -33,6 +33,7 @@ public class FastJsonRedisSerializer implements RedisSerializer<Object> {
 		pc.addAccept("com.goafanti.common.bo.OutPovertyFlag");
 		pc.addAccept("com.goafanti.expenseAccount.bo.ExpenseCountsBo");
 		pc.addAccept("com.goafanti.weChat.bo.releaseAndExpenseCountOut");
+		pc.addAccept("com.goafanti.admin.bo.SalesTeamBo");
 
 	}
 

+ 77 - 0
src/main/java/com/goafanti/customer/bo/InputListCallDayBo.java

@@ -0,0 +1,77 @@
+package com.goafanti.customer.bo;
+
+public class InputListCallDayBo {
+
+    private Integer pageSize;
+    private Integer pageNo;
+    /**
+     * 姓名
+     */
+    private String name;
+    /**
+     * 团队编号
+     */
+    private String teamId;
+    /**
+     * 有效次数 0=10次以下;1=10-20;2=20-50;3=50以上
+     */
+    private String  quantityType;
+    private String startTime;
+    private String endTime;
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getTeamId() {
+        return teamId;
+    }
+
+    public void setTeamId(String teamId) {
+        this.teamId = teamId;
+    }
+
+    public String getQuantityType() {
+        return quantityType;
+    }
+
+    public void setQuantityType(String quantityType) {
+        this.quantityType = quantityType;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+}

+ 10 - 0
src/main/java/com/goafanti/customer/bo/InputUserClueBo.java

@@ -7,6 +7,15 @@ public class InputUserClueBo {
     private String contacts;
 
     private String contactMobile;
+    private String contactMobileMore;
+
+    public String getContactMobileMore() {
+        return contactMobileMore;
+    }
+
+    public void setContactMobileMore(String contactMobileMore) {
+        this.contactMobileMore = contactMobileMore;
+    }
 
     public String getUserName() {
         return userName;
@@ -31,4 +40,5 @@ public class InputUserClueBo {
     public void setContactMobile(String contactMobile) {
         this.contactMobile = contactMobile;
     }
+
 }

+ 12 - 2
src/main/java/com/goafanti/customer/bo/OutUserClueExcel.java

@@ -6,14 +6,24 @@ public class OutUserClueExcel {
     private String id;
     @Excel(name = "客户名称")
     private String nickname;
-    @Excel(name = "联系人")
+    @Excel(name = "联系人(无联系人,填未知)")
     private String contacts;
-    @Excel(name = "联系人手机号")
+    @Excel(name = "电话")
     private String contactMobile;
+    @Excel(name = "更多电话(电话之间用;号隔开)")
+    private String contactMobileMore;
     private String adminName;
     private String clueProcess;
     private String clueTime;
 
+    public String getContactMobileMore() {
+        return contactMobileMore;
+    }
+
+    public void setContactMobileMore(String contactMobileMore) {
+        this.contactMobileMore = contactMobileMore;
+    }
+
     public String getId() {
         return id;
     }

+ 9 - 0
src/main/java/com/goafanti/customer/bo/OutUserClueList.java

@@ -19,6 +19,15 @@ public class OutUserClueList {
     private String clueProcess;
     private Date clueTime;
     private Date clueTransferTime;
+    private Integer days;
+
+    public Integer getDays() {
+        return days;
+    }
+
+    public void setDays(Integer days) {
+        this.days = days;
+    }
 
     public String getClueAname() {
         return clueAname;

+ 16 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -14,6 +14,7 @@ import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Attachment;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserMid;
 import com.goafanti.common.utils.*;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -464,9 +465,10 @@ public class AdminCustomerApiController extends BaseApiController{
 
 	/** 查看客户联系人列表 **/
 	@RequestMapping(value = "/findCustomerContacts", method = RequestMethod.GET)
-	public Result findCustomerContacts(String uid){
+	public Result findCustomerContacts(String uid,Integer type){
 		Result res = new Result();
-		res.setData(customerService.findCustomerContacts(uid));
+		if (type==null)type=0;
+		res.setData(customerService.findCustomerContacts(uid,type));
 		return res;
 	}
 
@@ -1671,4 +1673,16 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.selectUserLevel());
 		return res;
 	}
+
+	/**
+	 * 修改用户标签
+	 * @param in
+	 * @return
+	 */
+	@PostMapping("/updateMid")
+	public Result updateMid(UserMid in) {
+		Result res = new Result();
+		res.data(customerService.updateMid(in));
+		return res;
+	}
 }

+ 2 - 3
src/main/java/com/goafanti/customer/controller/UserClueApiController.java

@@ -55,9 +55,8 @@ public class UserClueApiController extends BaseApiController{
 	 * @return
 	 */
 	@GetMapping("/exportTemplate")
-	public Result exportList( ) {
-		NewExcelUtil<OutUserClueExcel> excelUtil=new NewExcelUtil<>(OutUserClueExcel.class);
-		return excelUtil.exportExcel(null,"客户线索模版",uploadPath);
+	public Result exportList() {
+		return new Result("/tmp/userClue_template.xlsx");
 	}
 
 	/**

+ 15 - 9
src/main/java/com/goafanti/customer/controller/UserOutboundApiController.java

@@ -4,14 +4,18 @@ import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.AdminCallDay;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.customer.bo.*;
+import com.goafanti.customer.bo.InputCallNumber;
+import com.goafanti.customer.bo.InputListCallDayBo;
+import com.goafanti.customer.bo.InputUserCallList;
 import com.goafanti.customer.service.UserOutboundService;
+import com.goafanti.customer.service.impl.AdminCallDayService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
 
 import javax.annotation.Resource;
 
@@ -22,6 +26,9 @@ public class UserOutboundApiController  extends BaseApiController {
 
     @Resource
     private UserOutboundService userOutboundService;
+    @Resource
+    private AdminCallDayService adminCallDayService;
+
     /**
      * 客户外呼查询
      *
@@ -109,14 +116,13 @@ public class UserOutboundApiController  extends BaseApiController {
         return new Result<>().data(this.userOutboundService.userCallList(in));
     }
 
+
     /**
-     * 开启长连接
+     * 外呼明细
+     *
      */
-    @RequestMapping("/SSeStart")
-    public SseEmitter testSseEmitter() {
-        // 默认30秒超时,设置为0L则永不超时
-        SseEmitterUTF8 sseEmitter = new SseEmitterUTF8(3600_000L);
-        SseMap.sseEmitterMap.put(TokenManager.getAdminId(), new SseResult(TokenManager.getAdminId(), System.currentTimeMillis(), sseEmitter));
-        return sseEmitter;
+    @GetMapping("/listCallDay")
+    public Result<Pagination<AdminCallDay>> listCallDay(InputListCallDayBo in) {
+        return new Result<>().data(this.adminCallDayService.listCallDay(in));
     }
 }

+ 4 - 5
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -3,10 +3,7 @@ package com.goafanti.customer.service;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.AdminUserCount;
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.model.User;
+import com.goafanti.common.model.*;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -169,7 +166,7 @@ public interface CustomerService {
 	 * @param uid
 	 * @return
 	 */
-	List<OrganizationContactBook> findCustomerContacts(String uid);
+	List<OrganizationContactBook> findCustomerContacts(String uid,Integer type);
 
 	/**
 	 * 添加拜访记录
@@ -601,4 +598,6 @@ public interface CustomerService {
 	void updateUserShareType(List<LockingReleaseBo> newList);
 
 	Object selectUserLevel();
+
+    Object updateMid(UserMid in);
 }

+ 1 - 0
src/main/java/com/goafanti/customer/service/UserOutboundService.java

@@ -19,4 +19,5 @@ public interface UserOutboundService {
     Object getDefaultMobile(String uid);
 
     Object userCallList(InputUserCallList in);
+
 }

+ 7 - 0
src/main/java/com/goafanti/customer/service/impl/AdminCallDayService.java

@@ -0,0 +1,7 @@
+package com.goafanti.customer.service.impl;
+
+import com.goafanti.customer.bo.InputListCallDayBo;
+
+public interface AdminCallDayService {
+    Object listCallDay(InputListCallDayBo in);
+}

+ 69 - 0
src/main/java/com/goafanti/customer/service/impl/AdminCallDayServiceImpl.java

@@ -0,0 +1,69 @@
+package com.goafanti.customer.service.impl;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminCallDayMapper;
+import com.goafanti.common.dao.SalesTeamMapper;
+import com.goafanti.common.model.SalesTeam;
+import com.goafanti.common.utils.BeanUtilsExt;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.InputListCallDayBo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Service
+public class AdminCallDayServiceImpl extends BaseMybatisDao<AdminCallDayMapper> implements AdminCallDayService{
+
+    @Resource
+    private SalesTeamMapper salesTeamMapper;
+
+    @Override
+    public Object listCallDay(InputListCallDayBo in) {
+//        if (in.getEndTime()!=null)in.setEndTime(in.getEndTime()+" 23:59:59");
+        Map<String, Object> map = BeanUtilsExt.pushMap(in);
+        Set<Integer> set = new HashSet<>();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)&& !TokenManager.hasRole(AFTConstants.CALL_MANAGER)){
+            String adminId = TokenManager.getAdminId();
+            List<SalesTeam> salesTeams = salesTeamMapper.queryByAid(adminId);
+            if (!salesTeams.isEmpty()){
+                List<Integer> collect = salesTeams.stream().map(SalesTeam::getId).collect(Collectors.toList());
+                set.addAll(collect);
+                for (Integer i : collect) {
+                    List<Integer> integers = salesTeamMapper.queryByAncestors(i);
+                    set.addAll(integers);
+                }
+                //查看的权限
+                map.put("teamIds",set);
+            }
+        }
+        if (in.getTeamId()!=null){
+            List<Integer> integers = salesTeamMapper.queryByAncestors(Integer.valueOf(in.getTeamId()));
+            integers.add(Integer.valueOf(in.getTeamId()));
+            map.put("teamIdList",integers);
+        }
+        return findPage("findAdminCallDayList", "findAdminCallDayCount", map, in.getPageNo(), in.getPageSize());
+    }
+
+    /**
+     *
+     * @param map
+     * @param set
+     * @param integers
+     */
+    private void pushTeams(Map<String, Object> map, Set<Integer> set, List<Integer> integers) {
+        if (integers.isEmpty()){
+            map.put("teamIds",set);
+        }else {
+            List<Integer> newList = integers.stream()
+                    .filter(set::contains)
+                    .collect(Collectors.toList());
+            map.put("teamIds",newList);
+        }
+    }
+}

+ 19 - 8
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -749,14 +749,20 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 
-	public List<OrganizationContactBook> findCustomerContacts(String uid) {
-		List<OrganizationContactBook> list = userMapper.findCustomerContacts(uid, TokenManager.getAdminId());
-		for (OrganizationContactBook ob : list) {
-			if (!ob.getAid().equals(TokenManager.getAdminId())){
-				ob.setName("***");
-				ob.setMobile("***");
-			}
+	public List<OrganizationContactBook> findCustomerContacts(String uid,Integer type) {
+		List<OrganizationContactBook> list=null;
+		if(type==0){
+			list = userMapper.findCustomerContacts(uid, TokenManager.getAdminId());
+//			for (OrganizationContactBook ob : list) {
+//				if (!ob.getAid().equals(TokenManager.getAdminId())){
+//					ob.setName("***");
+//					ob.setMobile("***");
+//				}
+//			}
+		}else {
+			list = userMapper.findCustomerContacts(uid, null);
 		}
+
 		return list;
 	}
 
@@ -3145,8 +3151,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.selectUserLevel(TokenManager.getAdminId());
     }
 
+	@Override
+	public Object updateMid(UserMid in) {
+		return userMidMapper.updateByUid(in);
+	}
+
 
-    private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
+	private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();
 		int i = 0;

+ 49 - 6
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -7,6 +7,7 @@ import com.goafanti.common.enums.UserLevel;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
 import com.goafanti.common.utils.PasswordUtil;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -15,6 +16,9 @@ import com.goafanti.customer.service.UserClueService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -55,7 +59,20 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         }
         in.setAid(TokenManager.getAdminId());
         if(in.getEndTime()!=null)in.setEndTime(in.getEndTime()+ " 23:59:59");
-        return (Pagination<OutUserClueList>)findPage("selectUserClueList", "selectUserClueCount", in);
+        return pushReleaseUser((Pagination<OutUserClueList>) findPage("selectUserClueList", "selectUserClueCount", in));
+    }
+
+    private Pagination<OutUserClueList> pushReleaseUser(Pagination<OutUserClueList> page) {
+        List<OutUserClueList> list = (List<OutUserClueList>) page.getList();
+        LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime clueTime = null;
+        for (OutUserClueList e : list) {
+             clueTime=e.getClueTransferTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+            clueTime = clueTime.withHour(0).withMinute(0).withSecond(0).plusDays(AFTConstants.CLUE_USER_MAX);
+            long between = ChronoUnit.DAYS.between(now,clueTime);
+            e.setDays((int) between);
+        }
+        return page;
     }
 
     @Override
@@ -92,6 +109,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         user.setClueProcess(0);
         user.setClueStatus(1);
         user.setClueTime(now);
+        user.setClueTransferTime(now);
         passwordUtil.encryptPassword(user);
         String aname = adminMapper.queryById(TokenManager.getAdminId()).getName();
         UserMid um=new UserMid();
@@ -117,6 +135,12 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         un.setName(user.getNickname());
         userNamesMapper.insertSelective(un);
         // 新增企业联系人
+        iterContactBook(in,aname,uid);
+        addUserTransferLog(user,22,null);
+        return 1;
+    }
+
+    private void iterContactBook(InputUserClueBo in, String aname, String uid) {
         OrganizationContactBook cob = new OrganizationContactBook();
         cob.setAid(TokenManager.getAdminId());
         cob.setAname(aname);
@@ -126,8 +150,27 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         cob.setMobile(in.getContactMobile());
         cob.setMajor(AFTConstants.YES);
         organizationContactBookMapper.insert(cob);
-        addUserTransferLog(user,22,null);
-        return 1;
+        if (StringUtils.isNotBlank(in.getContactMobileMore())){
+            String[] split = null;
+            if (in.getContactMobileMore().contains(";")){
+                split = in.getContactMobileMore().split(";");
+            } else if (in.getContactMobileMore().contains(";")) {
+                split = in.getContactMobileMore().split(";");
+            }
+            for (String s : split) {
+                if (StringUtils.isNotBlank(s)) {
+                    OrganizationContactBook cob2 = new OrganizationContactBook();
+                    cob2.setAid(TokenManager.getAdminId());
+                    cob2.setAname(aname);
+                    cob2.setId(UUID.randomUUID().toString());
+                    cob2.setUid(uid);
+                    cob2.setName(in.getContacts());
+                    cob2.setMobile(s);
+                    cob2.setMajor(AFTConstants.NO);
+                    organizationContactBookMapper.insert(cob2);
+                }
+            }
+        }
     }
 
     @Override
@@ -149,6 +192,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
             inUserClueBo.setUserName(e.getNickname());
             inUserClueBo.setContactMobile(e.getContactMobile());
             inUserClueBo.setContacts(e.getContacts());
+            inUserClueBo.setContactMobileMore(e.getContactMobileMore());
             try {
                 add(inUserClueBo);
             }catch (Exception ex){
@@ -212,7 +256,6 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         if (in.getType()==0){
             user.setAid(in.getTransferId());
             user.setClueProcess(1);
-            user.setClueTransferTime(date);
             type=23;
         }else if (in.getType()==1){
             user.setClueProcess(2);
@@ -221,13 +264,12 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
             aid=user.getClueAid();
         }else if (in.getType()==2){
             user.setClueProcess(3);
-            user.setTransferTime(date);
             userMapper.update(user);
             type=25;
         }else if (in.getType()==3){
             user.setClueProcess(4);
             user.setShareType(0);
-            user.setTransferTime(date);
+
             type=26;
             if (userLockReleaseMapper.selectByUidGetCount(aid,user.getId())==0){
                 UserLockRelease ulr=new UserLockRelease();
@@ -241,6 +283,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
             }
             organizationContactBookMapper.updateAdmin(user.getId(),TokenManager.getAdminId());
         }
+        user.setTransferTime(date);
         userMapper.update(user);
         addUserTransferLog(user,type,aid);
     }

+ 24 - 4
src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java

@@ -20,9 +20,11 @@ import com.goafanti.customer.service.UserOutboundService;
 import org.apache.shiro.crypto.hash.SimpleHash;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.socket.TextMessage;
 
 import javax.annotation.Resource;
+import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -53,6 +55,8 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
     private OrganizationContactBookMapper organizationContactBookMapper;
     @Resource
     private CallLogMapper callLogMapper;
+    @Resource
+    private AdminCallDayMapper adminCallDayMapper;
 
     @Override
     public Object checkUser(Integer type) {
@@ -150,6 +154,7 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
     }
 
     @Override
+    @Transactional
     public Object pushCallCompleted(InputCallCompleter in) {
         Map<String, Object> notify = in.getNotify();
         String staffNo=String.valueOf(notify.get("staffNo"));
@@ -198,7 +203,7 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
         callLog.setStatus(0);
         callLog.setRemarks(callResultMsg);
         callLogMapper.insert(callLog);
-        pushCountUser(uid);
+        pushCountUser(uid,id);
         //需要关闭客户呼叫中
 //        SseResult res =  SseMap.sseEmitterMap.get(TokenManager.getAdminId());
 
@@ -218,9 +223,12 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
 
     /**
      * 客户通话时长统计
-     * @param uid
+     *
+     * @param uid 客户编号
+     * @param id 呼叫人编号
      */
-    private void pushCountUser(String uid) {
+    private void pushCountUser(String uid, String id) {
+        LocalDate now = LocalDate.now();
         List<CallLog> callLogList = callLogMapper.selectByUid(uid);
         int count=0;
         int duration=0;
@@ -228,11 +236,21 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
             count++;
             duration+=log.getDuration();
         }
+        //统计客户呼叫时长
         UserMid mid=new UserMid();
         mid.setUid(uid);
         mid.setCallCount(count);
         mid.setCallDuration(duration);
-        userMidMapper.updateByUid(mid);
+        userMidMapper.updateCallByUid(uid,count,duration);
+        //统计呼叫人每天的通话时长
+        AdminCallDay adminCallDay = adminCallDayMapper.selectByAidAndDay(id, now);
+        LocalDate endTime = now.plusDays(1);
+        if (adminCallDay==null){
+            adminCallDayMapper.insertDay(id,now,endTime);
+        }else {
+            adminCallDayMapper.updateDay(id,now,endTime);
+        }
+
         User u =new User();
         u.setId(uid);
         u.setCallStatus(0);
@@ -271,4 +289,6 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
         res.put("sum",sumMap);
         return res;
     }
+
+
 }

+ 17 - 5
src/main/java/com/goafanti/order/bo/TaskScore/OutAdminTaskScore.java

@@ -6,6 +6,12 @@ import com.goafanti.common.utils.excel.Excel;
 import java.util.Date;
 
 public class OutAdminTaskScore {
+
+    /**
+     * 用户姓名
+     */
+    @Excel(name = "用户姓名")
+    private String name;
     /**
      * 高新&科技总数
      */
@@ -49,11 +55,7 @@ public class OutAdminTaskScore {
     @Excel(name = "会员平均分")
     private double memberScoreAverage;
     private String id;
-    /**
-     * 用户姓名
-     */
-    @Excel(name = "用户姓名")
-    private String name;
+
     private String depId;
     /**
      * 部门名称
@@ -77,6 +79,16 @@ public class OutAdminTaskScore {
     @Excel(name = "最后登录时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date lastLoginTime;
 
+    @Excel(name = "备注")
+    private String remarks;
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
 
     public int getHtSatCount() {
         return htSatCount;

+ 17 - 0
src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java

@@ -12,6 +12,7 @@ import com.goafanti.order.bo.TOrderInvoiceBo;
 import com.goafanti.order.service.OrderInvoiceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -216,4 +217,20 @@ public class OrderInvoiceApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 删除开票申请
+	 * @param id
+	 * @return
+	 */
+	@PostMapping("/delete")
+	public Result delete(Integer id) {
+		Result res = new Result();
+		if (orderInvoiceService.checkDelete(id)){
+			res.getError().add(buildError("该申请状态,无法删除。"));
+			return res;
+		}
+		res.data(orderInvoiceService.delete(id));
+		return res;
+	}
+
 }

+ 4 - 0
src/main/java/com/goafanti/order/service/OrderInvoiceService.java

@@ -45,4 +45,8 @@ public interface OrderInvoiceService {
 
 
     List<OutInvoiceLog> InvoiceLog(Integer id);
+
+    boolean checkDelete(Integer id);
+
+	Object delete(Integer id);
 }

+ 16 - 2
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -164,8 +164,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 	@Override
 	public boolean checkAmount(TOrderInvoice t) {
 		TOrderNew tn=tOrderNewMapper.queryById(t.getOrderNo());
-
-			String i=tOrderInvoiceMapper.checkApplyAmount(t.getOrderNo(),t.getId());//新建时直接查所有数据,修改时除掉修改订单
+		String i=tOrderInvoiceMapper.checkApplyAmount(t.getOrderNo(),t.getId());//新建时直接查所有数据,修改时除掉修改订单
 			//处理精度问题
 		BigDecimal q=t.getAmount().add(new BigDecimal(i)).setScale(4, BigDecimal.ROUND_DOWN);;
 		BigDecimal w=tn.getTotalAmount();
@@ -409,4 +408,19 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		List<OutInvoiceLog>  list=tOrderInvoiceMapper.selectInvoiceLog(id);
 		return list;
 	}
+
+	@Override
+	public boolean checkDelete(Integer id) {
+		TOrderInvoice t=tOrderInvoiceMapper.selectByPrimaryKey(id);
+        return t.getStatus() == 1 || t.getStatus() == 2;
+    }
+
+	@Override
+	public Object delete(Integer id) {
+		TOrderInvoice t=new TOrderInvoice();
+		t.setId(id);
+		t.setStatus(4);
+
+		return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -799,6 +799,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				boolean flag=false;
                 for (Integer year : collect) {
 					OrderYearMaxDuration orderYearMaxDuration = new OrderYearMaxDuration();
+					orderYearMaxDuration.setYear(year);
 					//需修改成判定
 					if (maxDuration.compareTo(new BigDecimal(-1))==0){
 						orderYearMaxDuration.setMaxDuration(BigDecimal.ZERO);

+ 16 - 1
src/main/java/com/goafanti/order/service/impl/TaskScoreServiceImpl.java

@@ -247,9 +247,24 @@ public class TaskScoreServiceImpl extends BaseMybatisDao<TaskScoreMapper> implem
     @Override
     public Result listExport(InputTaskScore params) {
         List<OutAdminTaskScore> list = (List<OutAdminTaskScore>) findList("findAdminTaskScoreList",params, 1, 99999);
-
+        pushRemarks(list);
         NewExcelUtil excel = new NewExcelUtil(OutAdminTaskScore.class);
         return excel.exportExcel(list, "人员评分列表", uploadPath);
     }
 
+    private void pushRemarks(List<OutAdminTaskScore> list) {
+        for (OutAdminTaskScore e : list) {
+            List<TaskScore> taskScores = taskScoreMapper.selectRemarkByAid(e.getId());
+            StringBuilder remark=new StringBuilder();
+            if (!taskScores.isEmpty()){
+                for (TaskScore e2 : taskScores) {
+                    if (e2.getRemarks()!=null){
+                        remark.append(e2.getRemarks()).append("\r\n");
+                    }
+                }
+            }
+            e.setRemarks(remark.toString());
+        }
+    }
+
 }

+ 61 - 1
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -1779,7 +1779,64 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	@Override
 	public List<outPublicReleaseLog> listPublicReleaseLog(Integer id,String ufid) {
-		List<outPublicReleaseLog> list=publicReleaseLogMapper.listPublicReleaseLog(id,ufid);
+		List<outPublicReleaseLog> list=new ArrayList<>();
+		List<outPublicReleaseLog> log=publicReleaseLogMapper.listPublicReleaseLog(id,ufid);
+		PublicRelease e = publicReleaseMapper.queryById(id);
+		List<PublicExamine> publicExamines = publicExamineMapper.selectByPrid(id);
+		if (e.getStatus()==1){
+			outPublicReleaseLog outPublicReleaseLog = new outPublicReleaseLog();
+			outPublicReleaseLog.setStatus(6);
+				List<AdminPublicReviewerBo> adminPublicReviewerBos=null;
+				if (e.getType()==3){
+					adminPublicReviewerBos= adminPublicReviewerMapper.selectByAid(e.getAid());
+					StringBuffer str =new StringBuffer();
+					for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
+						if(ap.getType()==1)str=str.append(ap.getReviewerName()+",");
+					}
+					if(str.length()>1){
+
+						outPublicReleaseLog.setAname(str.substring(0,str.length()-1));
+						list.add(outPublicReleaseLog);
+					}
+				}else {
+					if (((e.getPublicType()==0||e.getPublicType()==2)
+							&&(e.getTechStartProcess()==0||e.getTechStartProcess()==2))
+							&&(e.getAssistProcess()==0||e.getAssistProcess()==1)
+					){
+						StringBuffer str =new StringBuffer();
+						adminPublicReviewerBos= adminPublicReviewerMapper.selectByAid(e.getAid());
+						for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
+							if(ap.getType()==0)str=str.append(ap.getReviewerName()+",");
+						}
+						if(str.length()>1){
+							outPublicReleaseLog.setAname(str.substring(0,str.length()-1));
+							list.add(outPublicReleaseLog);
+						}
+					}else if (e.getType()==0&&e.getAssistProcess()==2){
+						//获取技术协单
+						List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(e.getId(), null, null);
+						StringBuffer str =new StringBuffer();
+						for (PublicRelease e2 : publicReleases) {
+							if (e2.getStatus()==1){
+								adminPublicReviewerBos= adminPublicReviewerMapper.selectByAid(e2.getAid());
+								List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e1 -> e1.getType() == 1).collect(Collectors.toList());
+								for (AdminPublicReviewerBo e1 : collect) {
+									str.append(e1.getReviewerName()+",");
+								}
+							}
+						}
+						if(str.length()>1){
+							outPublicReleaseLog.setAname(str.substring(0,str.length()-1));
+							list.add(outPublicReleaseLog);
+						}
+					} else {
+						String s = publicReleaseDetailsMapper.selectUserAdminByPrid(e.getId());
+						outPublicReleaseLog.setAname(s);
+						list.add(outPublicReleaseLog);
+					}
+				}
+		}
+		list.addAll(log);
 		return list;
 	}
 
@@ -2084,11 +2141,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 			if (adminPublicReviewerBos ==null) adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(out.getAid());
 			StringBuffer str =new StringBuffer();
+			//技术协单,获取协单审核人
 			if(out.getType()==3){
 				List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 1).collect(Collectors.toList());
 				for (AdminPublicReviewerBo e : collect) {
 					str.append(e.getReviewerName()+",");
 				}
+				//业务公出且协单部分审核(看着流程有点问题)
 			}else if (out.getType()==0&& out.getAssistProcess()==2){
 				//获取技术协单
 				List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(out.getId(), null, null);
@@ -2116,6 +2175,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 //					}
 //				}
 			} else {
+				//业务公出,且协单审核完成?
 				List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
 				for (AdminPublicReviewerBo e : collect) {
 					str.append(e.getReviewerName()+",");

+ 4 - 2
src/main/resources/props/config_local.properties

@@ -1,8 +1,8 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
-static.host=//static.jishutao.com/1.3.31
-#static.host=//172.16.1.187/1.3.31
+static.host=//static.jishutao.com/1.3.32
+#static.host=//172.16.1.187/1.3.32
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20241122?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
@@ -52,6 +52,8 @@ user_channel_days=90
 yxzj_max=800
 yxy_max=100
 yxjl_max=100
+#\u7EBF\u7D22\u5BA2\u6237\u91CA\u653E\u65F6\u95F4
+clue_release_day=15
 
 amb.maxLvl=6
 

+ 3 - 1
src/main/resources/props/config_test.properties

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.31
+static.host=//static.jishutao.com/1.3.32
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.url=jdbc:mysql://127.0.0.1:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
@@ -47,6 +47,8 @@ user_channel_days=90
 yxzj_max=800
 yxy_max=100
 yxjl_max=100
+#\u7EBF\u7D22\u5BA2\u6237\u91CA\u653E\u65F6\u95F4
+clue_release_day=15
 
 amb.maxLvl=6