Parcourir la source

Merge branch 'prod' into test2

anderx il y a 6 mois
Parent
commit
266aa9f391
44 fichiers modifiés avec 473 ajouts et 172 suppressions
  1. 1 0
      .gitignore
  2. 6 7
      pom.xml
  3. 1 0
      src/main/java/com/goafanti/Interview/service/impl/UserArchivesInterviewServiceImpl.java
  4. 106 0
      src/main/java/com/goafanti/admin/bo/selectAllUserDataBo.java
  5. 1 1
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  6. 20 9
      src/main/java/com/goafanti/admin/controller/AdminStatisticsController.java
  7. 5 0
      src/main/java/com/goafanti/admin/service/AdminStatisticsService.java
  8. 46 0
      src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java
  9. 10 0
      src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java
  10. 2 0
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  11. 1 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  12. 44 0
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  13. 2 1
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  14. 2 1
      src/main/java/com/goafanti/common/mapper/RoleResourcesMapper.xml
  15. 1 1
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  16. 1 1
      src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml
  17. 1 0
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  18. 2 1
      src/main/java/com/goafanti/common/mapper/UserTransferLogMapper.xml
  19. 16 0
      src/main/java/com/goafanti/common/task/AutoBackUpAuditTask.java
  20. 54 80
      src/main/java/com/goafanti/common/task/OrderDunTask.java
  21. 1 0
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  22. 1 0
      src/main/java/com/goafanti/common/utils/DateUtils.java
  23. 4 3
      src/main/java/com/goafanti/common/utils/WeChatUtils.java
  24. 8 11
      src/main/java/com/goafanti/core/shiro/filter/AdminFilter.java
  25. 8 8
      src/main/java/com/goafanti/core/shiro/filter/LoginFilter.java
  26. 6 11
      src/main/java/com/goafanti/core/shiro/filter/ShiroFilterUtils.java
  27. 29 0
      src/main/java/com/goafanti/customer/bo/transferListBo.java
  28. 45 13
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  29. 2 8
      src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java
  30. 5 1
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
  31. 1 2
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseCountsServiceImpl.java
  32. 2 0
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  33. 2 1
      src/main/java/com/goafanti/order/controller/OrderChangeApiController.java
  34. 8 2
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  35. 2 1
      src/main/java/com/goafanti/order/service/impl/PushOrderService.java
  36. 3 1
      src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java
  37. 9 0
      src/main/java/com/goafanti/weChat/bo/OutPublicReleaseList.java
  38. 1 1
      src/main/java/com/goafanti/weChat/controller/PublicAssistAdviceController.java
  39. 1 1
      src/main/java/com/goafanti/weChat/controller/service/PublicAssistAdviceService.java
  40. 2 2
      src/main/java/com/goafanti/weChat/controller/service/impl/PublicAssistAdviceServiceImpl.java
  41. 3 1
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  42. 4 1
      src/main/resources/props/config_local.properties
  43. 3 1
      src/main/resources/props/config_test.properties
  44. 1 0
      src/main/resources/spring/spring-mvc.xml

+ 1 - 0
.gitignore

@@ -16,3 +16,4 @@
 
 /qodana.yaml
 
+/src/main/resources/lib/

+ 6 - 7
pom.xml

@@ -461,13 +461,12 @@
 			<version>0.2.15</version>
 			<scope>compile</scope>
 		</dependency>
-		<!--        orc智能识别-->
-		<!-- https://mvnrepository.com/artifact/net.sourceforge.tess4j/tess4j -->
-<!--		<dependency>-->
-<!--			<groupId>net.sourceforge.tess4j</groupId>-->
-<!--			<artifactId>tess4j</artifactId>-->
-<!--			<version>5.8.0</version>-->
-<!--		</dependency>-->
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>2.11.0</version>
+		</dependency>
+
 
 
 	</dependencies>

+ 1 - 0
src/main/java/com/goafanti/Interview/service/impl/UserArchivesInterviewServiceImpl.java

@@ -191,6 +191,7 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
             userArchivesInterviewMapper.update(userArchivesInterview);
         }else {
             userArchivesInterview.setCreateTime(new Date());
+            userArchivesInterview.setPrdid(null);
             userArchivesInterviewMapper.insert(userArchivesInterview);
             in.setUaiId(userArchivesInterview.getId());
         }

+ 106 - 0
src/main/java/com/goafanti/admin/bo/selectAllUserDataBo.java

@@ -0,0 +1,106 @@
+package com.goafanti.admin.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+public class selectAllUserDataBo {
+    @Excel(name = "部门名称")
+    private String depName;
+    @Excel(name = "管理员名称")
+    private String name;
+    @Excel(name = "日客户")
+    private Integer dayCustomer;
+    @Excel(name = "日面谈")
+    private Integer dayMeet;
+    @Excel(name = "周客户")
+    private Integer weekCustomer;
+    @Excel(name = "周面谈")
+    private Integer weekMeet;
+    @Excel(name = "月客户")
+    private Integer monthCustomer;
+    @Excel(name = "月面谈")
+    private Integer monthMeet;
+    @Excel(name = "年客户")
+    private Integer yearCustomer;
+    @Excel(name = "年面谈")
+    private Integer yearMeet;
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getDayCustomer() {
+        return dayCustomer;
+    }
+
+    public void setDayCustomer(Integer dayCustomer) {
+        this.dayCustomer = dayCustomer;
+    }
+
+    public Integer getDayMeet() {
+        return dayMeet;
+    }
+
+    public void setDayMeet(Integer dayMeet) {
+        this.dayMeet = dayMeet;
+    }
+
+    public Integer getWeekCustomer() {
+        return weekCustomer;
+    }
+
+    public void setWeekCustomer(Integer weekCustomer) {
+        this.weekCustomer = weekCustomer;
+    }
+
+    public Integer getWeekMeet() {
+        return weekMeet;
+    }
+
+    public void setWeekMeet(Integer weekMeet) {
+        this.weekMeet = weekMeet;
+    }
+
+    public Integer getMonthCustomer() {
+        return monthCustomer;
+    }
+
+    public void setMonthCustomer(Integer monthCustomer) {
+        this.monthCustomer = monthCustomer;
+    }
+
+    public Integer getMonthMeet() {
+        return monthMeet;
+    }
+
+    public void setMonthMeet(Integer monthMeet) {
+        this.monthMeet = monthMeet;
+    }
+
+    public Integer getYearCustomer() {
+        return yearCustomer;
+    }
+
+    public void setYearCustomer(Integer yearCustomer) {
+        this.yearCustomer = yearCustomer;
+    }
+
+    public Integer getYearMeet() {
+        return yearMeet;
+    }
+
+    public void setYearMeet(Integer yearMeet) {
+        this.yearMeet = yearMeet;
+    }
+}

+ 1 - 1
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -13,7 +13,7 @@ import com.goafanti.common.model.*;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.StringUtils;
-import com.goafanti.common.utils.WeChatUtils;
+import com.goafanti.common.utils.weChat.WeChatUtils;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.core.shiro.token.TokenManager;

+ 20 - 9
src/main/java/com/goafanti/admin/controller/AdminStatisticsController.java

@@ -2,8 +2,10 @@ package com.goafanti.admin.controller;
 
 import com.goafanti.admin.bo.AdminPublicDuration;
 import com.goafanti.admin.bo.AdminPublicDurationCount;
+import com.goafanti.admin.bo.selectAllUserDataBo;
 import com.goafanti.admin.service.AdminStatisticsService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -13,9 +15,11 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 @Controller
 @RequestMapping(value = "/api/admin/statistics")
@@ -31,7 +35,6 @@ public class AdminStatisticsController extends CertifyApiController {
      * 营销首页信息
      * @param startTime  开始时间
      * @param endTime  结束时间
-     * @return
      */
     @RequestMapping(value = "/info", method = RequestMethod.GET)
     public Result info(String startTime,String endTime) {
@@ -44,7 +47,6 @@ public class AdminStatisticsController extends CertifyApiController {
 
     /**
      * 营销首页折线图
-     * @return
      */
     @RequestMapping(value = "/lists", method = RequestMethod.GET)
     public Result lists() {
@@ -58,7 +60,6 @@ public class AdminStatisticsController extends CertifyApiController {
      * 咨询师首页信息
      * @param startTime  开始时间
      * @param endTime  结束时间
-     * @return
      */
     @RequestMapping(value = "/consultant/info", method = RequestMethod.GET)
     public Result consultantInfo(String startTime,String endTime) {
@@ -70,7 +71,6 @@ public class AdminStatisticsController extends CertifyApiController {
 
     /**
      * 咨询首页折线图
-     * @return
      */
     @RequestMapping(value = "/consultant/lists", method = RequestMethod.GET)
     public Result consultantLists() {
@@ -84,7 +84,6 @@ public class AdminStatisticsController extends CertifyApiController {
      * 财务首页信息
      * @param startTime  开始时间
      * @param endTime  结束时间
-     * @return
      */
     @RequestMapping(value = "/finance/info", method = RequestMethod.GET)
     public Result financeInfo(String startTime,String endTime) {
@@ -96,7 +95,6 @@ public class AdminStatisticsController extends CertifyApiController {
 
     /**
      * 咨询首页折线图
-     * @return
      */
     @RequestMapping(value = "/finance/lists", method = RequestMethod.GET)
     public Result financeLists() {
@@ -108,7 +106,6 @@ public class AdminStatisticsController extends CertifyApiController {
 
     /**
      * 营销团队外呼统计
-     * @return
      */
     @RequestMapping(value = "/salesTeam", method = RequestMethod.GET)
     public Result salesTeam(String startTime,String endTime) {
@@ -120,12 +117,10 @@ public class AdminStatisticsController extends CertifyApiController {
 
     /**
      * 营销团队外呼统计缓存清理
-     * @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;
     }
@@ -174,4 +169,20 @@ public class AdminStatisticsController extends CertifyApiController {
         }
     }
 
+
+    /**
+     * 统计日周月年客户与面谈
+     */
+    @RequestMapping(value = "/AllDataExport", method = RequestMethod.GET)
+    public Result AllDataExport( HttpServletResponse response) {
+        //管理员与曾妹涵账号有权限导出
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN)|| Objects.equals(TokenManager.getAdminId(), "a7661bcf-bdca-484e-baef-6f52b305aeae")){
+            List<selectAllUserDataBo> list = adminStatisticsService.AllDataExport();
+            NewExcelUtil<selectAllUserDataBo> newExcelUtil=new NewExcelUtil<>(selectAllUserDataBo.class);
+            return newExcelUtil.exportExcel(list,"统计所有用户数据",response);
+        }
+        return new Result<>("账号权限不足");
+
+    }
+
 }

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

@@ -1,5 +1,8 @@
 package com.goafanti.admin.service;
 
+import com.goafanti.admin.bo.selectAllUserDataBo;
+
+import java.util.List;
 import java.util.Map;
 
 public interface AdminStatisticsService {
@@ -20,4 +23,6 @@ public interface AdminStatisticsService {
     Object salesTeamClean();
 
     Map<String,Object> monthData(String month);
+
+    List<selectAllUserDataBo> AllDataExport();
 }

+ 46 - 0
src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java

@@ -610,6 +610,52 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
         return map;
     }
 
+    @Override
+    public List<selectAllUserDataBo> AllDataExport() {
+        // 获取今天,明天,本周第一天,下周第一天,本月第一天,下月第一天,本年第一天,下年第一天
+        Date today = new Date();
+        //获取明天
+        Calendar md = Calendar.getInstance();
+        md.setTime(today);
+        md.add(Calendar.DATE, 1);
+        Date tomorrow = md.getTime();
+        //获取本周的第一天
+        Date firstDayOfWeek = DateUtils.getFirstDayOfWeek(today);
+        //获取下周的第一天
+        Calendar c = Calendar.getInstance();
+        c.setTime(firstDayOfWeek);
+        c.add(Calendar.DATE, 7);
+        Date firstDayOfNextWeek = c.getTime();
+        //获取本月的第一天
+        Date firstDayOfMonth = DateUtils.getFirstDayOfMonth(today);
+        //获取下月的第一天
+        Calendar c2 = Calendar.getInstance();
+        c2.setTime(firstDayOfMonth);
+        c2.add(Calendar.MONTH, 1);
+        Date firstDayOfNextMonth = c2.getTime();
+        //获取本年的第一天
+        Calendar c3 = Calendar.getInstance();
+        c3.setTime(today);
+        c3.set(Calendar.DAY_OF_YEAR, 1);
+        c3.set(Calendar.HOUR_OF_DAY, 0);
+        Date firstDayOfYear = c3.getTime();
+        //获取下年的第一天
+        Calendar c4 = Calendar.getInstance();
+        c4.setTime(firstDayOfYear);
+        c4.add(Calendar.YEAR, 1);
+        Date firstDayOfNextYear = c4.getTime();
+        // 将日期转换为字符串
+        String d1 = DateUtils.formatDate(today, AFTConstants.YYYYMMDD);
+        String d2 = DateUtils.formatDate(tomorrow, AFTConstants.YYYYMMDD);
+        String w1 = DateUtils.formatDate(firstDayOfWeek, AFTConstants.YYYYMMDD);
+        String w2 = DateUtils.formatDate(firstDayOfNextWeek, AFTConstants.YYYYMMDD);
+        String m1 = DateUtils.formatDate(firstDayOfMonth, AFTConstants.YYYYMMDD);
+        String m2 = DateUtils.formatDate(firstDayOfNextMonth, AFTConstants.YYYYMMDD);
+        String y1 = DateUtils.formatDate(firstDayOfYear, AFTConstants.YYYYMMDD);
+        String y2 = DateUtils.formatDate(firstDayOfNextYear, AFTConstants.YYYYMMDD);
+        List<selectAllUserDataBo> list = adminMapper.selectAllUserData(d1, d2, w1, w2, m1, m2, y1, y2);
+        return list;
+    }
 
 
     private void pushAdminNameAndProvince(String aid, AdminPublicDuration a) {

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

@@ -75,6 +75,16 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 			ls.add(role.getRoleName());
 		}
 		i.setRolesName(ls);
+		List<AdminPublicReviewerBo> list = adminPublicReviewerMapper.selectByAid(i.getId());
+		List<AdminPublicReviewerBo> collect = list.stream().filter(e -> e.getType() == 2).collect(Collectors.toList());
+		StringJoiner sb = new StringJoiner(",");
+		for (AdminPublicReviewerBo e : collect) {
+			sb.add(e.getReviewerName());
+		}
+		if  (sb.length() > 0) {
+			i.setSuperior(sb.toString());
+		}
+
 	}
 
 	@Override

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

@@ -284,6 +284,8 @@ public interface AdminMapper {
     AdminStatisticsBo selectUserCount(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     void updateManagerId(Admin ad);
+
+    List<selectAllUserDataBo> selectAllUserData(@Param("d1") String d1, @Param("d2") String d2, @Param("w1") String w1, @Param("w2") String w2, @Param("m1") String m1, @Param("m2") String m2, @Param("y1") String y1, @Param("y2") String y2);
 }
 
 

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

@@ -221,7 +221,7 @@ public interface UserMapper {
 
     int checkCustomerInformation(String uid);
 
-    void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
+    void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId, @Param("date") Date date);
 
     List<userDataListBo> userDataStatistics(@Param("deps")List<String> deps);
 

+ 44 - 0
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1332,5 +1332,49 @@
         AND aid = #{aid}
         group by aid
     </select>
+    <select id="selectAllUserData" resultType="com.goafanti.admin.bo.selectAllUserDataBo">
+        select dep.name depName,a.name ,ifnull(b.counts,0) dayCustomer,ifnull(c.counts,0) dayMeet,ifnull(b1.counts,0) weekCustomer,ifnull(c1.counts,0) weekMeet,
+               ifnull(b2.counts,0) monthCustomer,ifnull(c2.counts,0) monthMeet,ifnull(b3.counts,0) yearCustomer,ifnull(c3.counts,0) yearMeet
+        from admin a
+                 left join (select aid ,count(*)counts  from user
+                            where share_type in (0,2)and source in (1,2)
+                              and transfer_time BETWEEN #{d1} and #{d2}
+                            group by aid) b on a.id =b.aid
+                 left join (SELECT a.aid,count(*) counts
+                            from public_release a left join public_release_details b on a.id =b.prid
+                            where a.status =2 and b.clock_in =1
+                              and  a.release_start BETWEEN #{d1} and #{d2}
+                            group by a.aid)c on a.id=c.aid
+                 left join (select aid ,count(*)counts  from user
+                            where share_type in (0,2)and source in (1,2)
+                              and transfer_time BETWEEN #{w1} and #{w2}
+                            group by aid) b1 on a.id =b1.aid
+                 left join (SELECT a.aid,count(*) counts
+                            from public_release a left join public_release_details b on a.id =b.prid
+                            where a.status =2 and b.clock_in =1
+                              and  a.release_start BETWEEN #{w1} and #{w2}
+                            group by a.aid)c1 on a.id=c1.aid
+                 left join (select aid ,count(*)counts  from user
+                            where share_type in (0,2)and source in (1,2)
+                              and transfer_time BETWEEN #{m1} and #{m2}
+                            group by aid) b2 on a.id =b2.aid
+                 left join (SELECT a.aid,count(*) counts
+                            from public_release a left join public_release_details b on a.id =b.prid
+                            where a.status =2 and b.clock_in =1
+                              and  a.release_start BETWEEN #{m1} and #{m2}
+                            group by a.aid)c2 on a.id=c2.aid
+                 left join (select aid ,count(*)counts  from user
+                            where share_type in (0,2)and source in (1,2)
+                              and transfer_time BETWEEN #{y1} and #{y2}
+                            group by aid) b3 on a.id =b3.aid
+                 left join (SELECT a.aid,count(*) counts
+                            from public_release a left join public_release_details b on a.id =b.prid
+                            where a.status =2 and b.clock_in =1
+                              and  a.release_start BETWEEN  #{y1} and #{y2}
+                            group by a.aid)c3 on a.id=c3.aid
+                 left join user_role d on a.id =d.uid left join `role` e on d.rid =e.id
+                 left join department dep on a.department_id =dep.id
+        where a.status ='0' and e.role_type in ('96','996')
+    </select>
 </mapper>
 

+ 2 - 1
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -664,6 +664,7 @@
 
     <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
         select a.id ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,a.public_type publicType,a.order_no orderNo,
+        ton.contract_no contractNo,
         date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
         date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
         a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
@@ -681,8 +682,8 @@
             left join public_release_details b on a.id=b.prid
             left join user e on b.uid=e.id  left join admin ad on e.aid=ad.id
         </if>
-        <if test="type==5">
             left join t_order_new ton on a.order_no =ton.order_no
+        <if test="type==5">
             left join t_order_mid tom on a.order_no=tom.order_no
         </if>
         <if test="type==1">

+ 2 - 1
src/main/java/com/goafanti/common/mapper/RoleResourcesMapper.xml

@@ -326,7 +326,8 @@ where a.id= #{aid,jdbcType=VARCHAR}
   <update id="updateLockRelease" parameterType="java.lang.String">
      update  user_lock_release 
 	 set aid=#{transferId,jdbcType=VARCHAR}
-	 where aid = #{aid,jdbcType=VARCHAR}
+     ,lock_time= now()
+     where aid = #{aid,jdbcType=VARCHAR}
 	 and type=#{type,jdbcType=VARCHAR}
 	 and status=0
 </update>

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

@@ -950,7 +950,7 @@
     </select>
     <!-- 通过订单编号获得订单的负责人(营销员) -->
     <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
-        select o.order_no orderNo ,o.salesman_id as salesmanId, a.name as salesmanName,e.name managerName,
+        select o.order_no orderNo ,o.salesman_id as salesmanId, a.name as salesmanName,e.name managerName,o.delete_sign deleteSign,
                o.contract_no contractNo,a.email ,u.nickname as userName,o.order_dep orderDep,d.name departmentName,
                d.finance_id  financeId,d.approval approvalStatus,d.approval_aid approvalAid,ad.name approvalName,
                d.operation_guarantee_id operationGuaranteeId,ad2.name operationGuaranteeName

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

@@ -370,7 +370,7 @@
 
   <update id="updateUserTypeLockList">
   	update user_lock_release set status = #{newStatus} , release_time= #{date}
-  	where aid = #{aid} and type = 0 and type = #{type} and uid in
+  	where aid = #{aid}  and type = #{type} and uid in
 	<foreach item="item" collection="list" separator="," open="(" close=")" index="">
        #{item}
     </foreach>

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

@@ -1256,6 +1256,7 @@
         update user
         set aid=#{transferId,jdbcType=VARCHAR},
             information_maintainer=#{transferId,jdbcType=VARCHAR},
+            transfer_time=now(),
             source=3
         where aid=#{aid,jdbcType=VARCHAR}
     </update>

+ 2 - 1
src/main/java/com/goafanti/common/mapper/UserTransferLogMapper.xml

@@ -166,7 +166,8 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByUidGetList" resultType="com.goafanti.customer.bo.transferListBo">
-	select a.id,a.type,b.nickname userName,c.name usedAName,d.name newAName,e.bname Pname, 
+	select a.id,a.type,b.nickname userName,c.name usedAName,d.name newAName,e.bname Pname,
+	       a.aid,a.uid,a.take_aid takeAid,
   	date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createDate,remarks
   	from user_transfer_log a left join user b on a.uid=b.id
 	left join admin c on a.aid=c.id left join admin d on a.take_aid=d.id

+ 16 - 0
src/main/java/com/goafanti/common/task/AutoBackUpAuditTask.java

@@ -0,0 +1,16 @@
+package com.goafanti.common.task;
+
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AutoBackUpAuditTask {
+
+    /**
+     * 自动备份消息存档
+     * */
+    @Scheduled(cron = "0 0 0/2 * * ?")
+    public void backupWeChat() {
+
+    }
+}

+ 54 - 80
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.task;
 
 
-import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.ErrorDunListBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -13,7 +12,6 @@ import com.goafanti.common.model.TOrderMid;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.OrderDunProjectType;
 import com.goafanti.order.service.LegalAffairsService;
@@ -242,87 +240,63 @@ public class OrderDunTask {
 	*
 	*/
 	@Scheduled(cron = "0 0 4 1 * ?")
+//	@Scheduled(cron = "0 33 9 * * ?")
 //	@RequestMapping(value = "/open/pushOrderArrearsDun", method = RequestMethod.GET)
-	public void pushOrderArrearsDun(){
-		try {
-			LoggerUtils.debug(logger, "======================欠款催款启动===================");
-			Date date=new Date();
-			//运算 list(未启动) list2(催款中) list3(已完成)订单的欠款催款
-			List<TArrearsDun> list=tArrearsDunMapper.selectStatusAll(0);
-			List<TArrearsDun> list2=tArrearsDunMapper.selectStatusAll(1);
-			List<TArrearsDun> list3=tArrearsDunMapper.selectStatusAndAmount(2);
-			for (TArrearsDun td : list) {
-				TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(td.getOrderNo());
-
-
-				TOrderMid tm=tOrderMidMapper.selectByOrderNo(td.getOrderNo());
-				//如果欠款大于0则需要触发邮件
-				if (tm.getOrderArrears().compareTo(new BigDecimal(0))>0) {
-					td.setDunStatus(1);
-					td.setStartTime(date);
-					td.setOrderArrears(tm.getOrderArrears());
-					td.setOrderReceivables(tm.getOrderReceivables());
-					orderNewService.addNotic(NoticeStatus.ORDER_ARREARS_DUN.getCode(),b,null);
-					tArrearsDunMapper.updateByPrimaryKeySelective(td);
-				}else if(tm.getOrderArrears().compareTo(new BigDecimal(0))<1) {
-					td.setDunStatus(2);
-					td.setEndTime(date);
-					td.setOrderArrears(tm.getOrderArrears());
-					tArrearsDunMapper.updateByPrimaryKeySelective(td);
-				}
-				Thread.sleep(2000);
-			}
-			for (TArrearsDun ta : list2) {
-				TOrderMid tm=tOrderMidMapper.selectByOrderNo(ta.getOrderNo());
-				TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(ta.getOrderNo());
-				//如果欠款大于0则需要触发邮件
-				if (tm.getOrderArrears().compareTo(new BigDecimal(0))>0) {
-					ta.setDunStatus(3);
-					tArrearsDunMapper.updateByPrimaryKeySelective(ta);
-					ta.setId(null);
-					ta.setDunStatus(1);
-					ta.setStartTime(date);
-					ta.setOrderArrears(tm.getOrderArrears());
-					ta.setOrderReceivables(tm.getOrderReceivables());
-					tArrearsDunMapper.insertSelective(ta);
-					orderNewService.addNotic(NoticeStatus.ORDER_ARREARS_DUN.getCode(),b,null);
-				}else if(tm.getOrderArrears().compareTo(new BigDecimal(0))<1) {
-					ta.setDunStatus(2);
-					ta.setOrderArrears(tm.getOrderArrears());
-					tArrearsDunMapper.updateByPrimaryKeySelective(ta);
-				}
-				Thread.sleep(2000);
+	public void pushOrderArrearsDun() {
+    try {
+        LoggerUtils.debug(logger, "======================欠款催款启动===================");
+        Date date = new Date();
+
+        List<TArrearsDun> list = tArrearsDunMapper.selectStatusAll(0);
+        List<TArrearsDun> list2 = tArrearsDunMapper.selectStatusAll(1);
+        List<TArrearsDun> list3 = tArrearsDunMapper.selectStatusAndAmount(2);
+
+        processList(list, date);
+        processList(list2, date);
+        processList(list3, date);
+
+        LoggerUtils.debug(getClass(), "===========================欠款催款完成==========================");
+    } catch (Exception e) {
+        LoggerUtils.error(getClass(), "===========================欠款催款失败==========================", e);
+    }
+}
 
-			}
-			for (TArrearsDun ta : list3) {
-				TOrderMid tm=tOrderMidMapper.selectByOrderNo(ta.getOrderNo());
-				TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(ta.getOrderNo());
-				AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
-
-				//如果欠款大于0则需要触发邮件
-				if (tm.getOrderArrears().compareTo(new BigDecimal(0))>0) {
-					ta.setDunStatus(3);
-					tArrearsDunMapper.updateByPrimaryKeySelective(ta);
-					ta.setId(null);
-					ta.setDunStatus(1);
-					ta.setStartTime(date);
-					ta.setOrderArrears(tm.getOrderArrears());
-					ta.setOrderReceivables(tm.getOrderReceivables());
-					tArrearsDunMapper.insertSelective(ta);
-					orderNewService.addNotic(NoticeStatus.ORDER_ARREARS_DUN.getCode(),b,null);
-				}else if(tm.getOrderArrears().compareTo(new BigDecimal(0))<1) {
-					ta.setDunStatus(2);
-					ta.setOrderReceivables(tm.getOrderReceivables());
-					ta.setOrderArrears(tm.getOrderArrears());
-					tArrearsDunMapper.updateByPrimaryKeySelective(ta);
-				}
-				Thread.sleep(2000);
+private void processList(List<TArrearsDun> tarrearsList, Date date) {
+    for (TArrearsDun ta : tarrearsList) {
+        TOrderMid tm = tOrderMidMapper.selectByOrderNo(ta.getOrderNo());
+        TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(ta.getOrderNo());
+
+        if (b == null || b.getDeleteSign() == null || b.getDeleteSign() == 1) {
+            ta.setDunStatus(3);
+            ta.setEndTime(date);
+            ta.setOrderArrears(tm.getOrderArrears());
+            tArrearsDunMapper.updateByPrimaryKeySelective(ta);
+        } else {
+            BigDecimal arrears = tm.getOrderArrears();
+            if (arrears.compareTo(BigDecimal.ZERO) > 0) {
+                // 欠款大于0则触发邮件并新建记录
+                ta.setDunStatus(3);
+                tArrearsDunMapper.updateByPrimaryKeySelective(ta);
+                ta.setId(null);
+                ta.setDunStatus(1);
+                ta.setStartTime(date);
+                ta.setOrderArrears(arrears);
+                ta.setOrderReceivables(tm.getOrderReceivables());
+                tArrearsDunMapper.insertSelective(ta);
+                orderNewService.addNotic(NoticeStatus.ORDER_ARREARS_DUN.getCode(), b, null);
+            } else if (arrears.compareTo(BigDecimal.ZERO) <= 0) {
+                ta.setDunStatus(2);
+                ta.setOrderArrears(arrears);
+                ta.setOrderReceivables(tm.getOrderReceivables());
+                tArrearsDunMapper.updateByPrimaryKeySelective(ta);
+            }
+        }
+
+        // 若确实需要限流,请使用异步方式替代 Thread.sleep()
+        // Thread.sleep(200); // 建议删除或改为异步处理
+    }
+}
 
-			}
-		} catch (Exception e) {
-			LoggerUtils.error(getClass(), "===========================欠款催款失败==========================", e);
-		}
-	}
 
 //	/**
 //	*	旧催款处理

+ 1 - 0
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -10,6 +10,7 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
+import com.goafanti.common.utils.weChat.WeChatUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.NewOrderChangeBo;
 import com.goafanti.order.bo.TOrderNewBo;

+ 1 - 0
src/main/java/com/goafanti/common/utils/DateUtils.java

@@ -144,6 +144,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 		calendar.setFirstDayOfWeek(Calendar.SUNDAY);
 		calendar.setTime(date);
 		calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek()); // Sunday
+		calendar.add(Calendar.DATE, 1);
 		setMidnight(calendar);
 		return calendar.getTime();
 	}

+ 4 - 3
src/main/java/com/goafanti/common/utils/WeChatUtils.java

@@ -1,10 +1,11 @@
-package com.goafanti.common.utils;
+package com.goafanti.common.utils.weChat;
 
 import com.alibaba.fastjson.JSONObject;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.utils.*;
 import com.goafanti.core.shiro.token.TokenManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -136,7 +137,7 @@ public class WeChatUtils {
 	}
 
 	private Integer SendHttpPost(Map<String, Object> map, String url) {
-		JSONObject res=HttpUtils.httpPost(url, map);
+		JSONObject res= HttpUtils.httpPost(url, map);
 		if (res.get("errcode")!=null) {
 			LoggerUtils.error(this.getClass(),String.format("================errcode={%s}",res));
 			LoggerUtils.error(this.getClass(),String.format("================data={%s}",map.get("data")));
@@ -185,7 +186,7 @@ public class WeChatUtils {
 	 */
 	private Map<String, Object> getPublicData(Integer type,Date date, String aname, String remarks) {
 		Map<String, Object> we=new HashMap<String, Object>();
-		String strDate=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
+		String strDate= DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
 		if (remarks.length()>20)remarks=remarks.substring(0,17)+"...";
 		if (type==1) {
 			Map<String, Object> v1=new HashMap<String, Object>();

+ 8 - 11
src/main/java/com/goafanti/core/shiro/filter/AdminFilter.java

@@ -1,31 +1,28 @@
 package com.goafanti.core.shiro.filter;
 
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.web.filter.AccessControlFilter;
-import org.springframework.beans.factory.annotation.Autowired;
-
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
-import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftUser;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import org.apache.shiro.web.filter.AccessControlFilter;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 public class AdminFilter extends AccessControlFilter {
-	final static Class<AdminFilter>	CLASS	= AdminFilter.class;
 
 	@Autowired
 	private ShiroFilterUtils		shiroFilterUtils;
 
+
 	@Override
 	protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
 			throws Exception {
-
 		AftUser token = TokenManager.getToken();
 		if (token instanceof Admin) {
 			return Boolean.TRUE;

+ 8 - 8
src/main/java/com/goafanti/core/shiro/filter/LoginFilter.java

@@ -1,17 +1,16 @@
 package com.goafanti.core.shiro.filter;
 
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.web.filter.AccessControlFilter;
-import org.springframework.beans.factory.annotation.Autowired;
-
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import org.apache.shiro.web.filter.AccessControlFilter;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 public class LoginFilter extends AccessControlFilter {
 	final static Class<LoginFilter>	CLASS	= LoginFilter.class;
@@ -19,6 +18,7 @@ public class LoginFilter extends AccessControlFilter {
 	@Autowired
 	private ShiroFilterUtils		shiroFilterUtils;
 
+
 	@Override
 	protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
 			throws Exception {

+ 6 - 11
src/main/java/com/goafanti/core/shiro/filter/ShiroFilterUtils.java

@@ -1,17 +1,14 @@
 package com.goafanti.core.shiro.filter;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.beans.factory.annotation.Value;
-
 import com.alibaba.fastjson.JSON;
-
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.utils.LoggerUtils;
+import org.springframework.beans.factory.annotation.Value;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
 
 public class ShiroFilterUtils {
 	final static Class<? extends ShiroFilterUtils> CLAZZ = ShiroFilterUtils.class;
@@ -44,8 +41,6 @@ public class ShiroFilterUtils {
 	/**
 	 * response 输出JSON
 	 * 
-	 * @param hresponse
-	 * @param resultMap
 	 * @throws IOException
 	 */
 	public void out(HttpServletResponse response, Result res) {

+ 29 - 0
src/main/java/com/goafanti/customer/bo/transferListBo.java

@@ -9,6 +9,35 @@ public class transferListBo {
 	private String pName;
 	private String createDate;
 	private String remarks;
+
+	private String aid;
+	private String uid;
+	private String takeAid;
+
+	public String getAid() {
+		return aid;
+	}
+
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public String getTakeAid() {
+		return takeAid;
+	}
+
+	public void setTakeAid(String takeAid) {
+		this.takeAid = takeAid;
+	}
+
 	public Integer getId() {
 		return id;
 	}

+ 45 - 13
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.customer.service.impl;
 
 import com.goafanti.admin.bo.AdminListBo;
+import com.goafanti.admin.bo.AdminPublicReviewerBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.userDaysBo;
@@ -38,6 +39,7 @@ import java.time.LocalDate;
 import java.time.ZoneId;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 @Service
@@ -114,9 +116,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	private RestrictProjectMapper restrictProjectMapper;
 	@Resource
 	private	AsyncUtils asyncUtils;
-
 	@Resource
 	private UserReceiveLogMapper userReceiveLogMapper;
+	@Resource
+	private AdminPublicReviewerMapper adminPublicReviewerMapper;
 
 
 
@@ -216,7 +219,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				"selectPublicOrganizationCustomerCount", params, pageNo, pageSize);
 		List<CustomerListOut> list = (List<CustomerListOut>) page.getList();
 		list.forEach(e -> {
-			if (e.getAid().equals(TokenManager.getAdminId())){
+			List<transferListBo> transferListBos = userTransferLogMapper.selectByUidGetList(e.getUid());
+			//去重获取aid的List
+			List<String> alist = transferListBos.stream().map(e2 -> e2.getAid()).distinct().collect(Collectors.toList());
+			//判定alist里面是否含有当前用户
+			boolean flag = alist.contains(TokenManager.getAdminId());
+			if (flag){
 				e.setMyUser(1);
 			}
 		});
@@ -260,9 +268,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		for (CustomerListOut c : l) {
 			if (null != c) {
 				if (null != c.getAid()) c.setAdminName(adminMapper.selectNameByid(c.getAid()));
-				if (c.getAid().equals(TokenManager.getAdminId())) c.setMyUser(1);
 				if (null != c.getShareType() && c.getShareType().equals("1")) c.setAdminName("暂无");
 				if (null != c.getMid()) c.setInformationMaintainer(adminMapper.selectNameByid(c.getMid()));
+				List<transferListBo> transferListBos = userTransferLogMapper.selectByUidGetList(c.getUid());
+				//去重获取aid的List
+				List<String> alist = transferListBos.stream().map(e2 -> e2.getAid()).distinct().collect(Collectors.toList());
+				//判定alist里面是否含有当前用户
+				boolean flag = alist.contains(TokenManager.getAdminId());
+				if (flag){
+					c.setMyUser(1);
+				}
 			}
 		}
 		return p;
@@ -1419,8 +1434,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		StringBuffer content=null;
 		String noticeAid=null;
 		for (PublicReleaseTransferUserBo e : list) {
-			PublicExamine pe=new PublicExamine();
-			pe.setPrid(e.getId());
+			List<PublicExamine> pes=new ArrayList<>();
 			if (e.getAid().equals(aid)){
 				content=new StringBuffer().append("[").append(e.getUserNames()).append("]公司的外出申请已发起,请尽快审核。");
 				//再查比对和发起者一致的全部走入下一个审核流程
@@ -1428,15 +1442,28 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				pr.setId(e.getId());
 				pr.setPublicType(0);
 				publicReleaseMapper.update(pr);
-				Admin sendAdmin=adminMapper.selectById(admin.getReviewer());
-				noticeAid=sendAdmin.getId();
-				logStatus=2;
-				logMsg="转交客户到发起公出审核人,自动审核通过。";
-				pe.setAid(sendAdmin.getId());
-				pe.setAname(sendAdmin.getName());
-				pe.setCreateTime(new Date());
+				List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(admin.getId());
+				//提取type=0的数据
+					Admin sendAdmin=adminMapper.selectById(admin.getReviewer());
+//				noticeAid=sendAdmin.getId();
+				List<AdminPublicReviewerBo> adminPublicReviewerBos0 = adminPublicReviewerBos.stream().filter(e1 -> e1.getType().equals(0)).collect(Collectors.toList());
+				//又
+				if (adminPublicReviewerBos0.size()>0){
+					for (AdminPublicReviewerBo e2 : adminPublicReviewerBos0) {
+						logStatus=2;
+						logMsg="转交客户到发起公出审核人,自动审核通过。";
+						PublicExamine pe=new PublicExamine();
+						pe.setPrid(e.getId());
+						pe.setAid(e2.getReviewerId());
+						pe.setAname(e2.getReviewerName());
+						pe.setCreateTime(new Date());
+						pes.add(pe);
+					}
+				}
 			}else {
 				//与发起者不一致的就需要修改审核人员
+				PublicExamine pe=new PublicExamine();
+				pe.setPrid(e.getId());
 				pe.setAid(aid);
 				pe.setAname(admin.getName());
 				//给新的审核人发送消息
@@ -1444,6 +1471,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				logMsg="转交客户归属人到["+admin.getName()+"]。";
 				content=new StringBuffer().append("[").append(e.getUserNames()).append("]公司已转交给您,相关公出请尽快审核。");
 				noticeAid=aid;
+				pes.add(pe);
 			}
 			PublicReleaseLog log = new PublicReleaseLog(e.getId(), TokenManager.getAdminId(), logStatus, logMsg, new Date());
 			publicReleaseLogMapper.insertSelective(log);
@@ -1455,7 +1483,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			n.setContent(content.toString());
 			n.setReaded(0);//未读
 			asyncUtils.addNotice(n);
-			publicExamineMapper.updateByPridSelective(pe);
+			if (pes.size()>0){
+				for (PublicExamine pe : pes) {
+					publicExamineMapper.updateByPridSelective(pe);
+				}
+			}
 		}
 	}
 

+ 2 - 8
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -112,14 +112,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         }
         BeanUtils.copyProperties(userArchives, user);
         user.setUid(id);
-        List<selectByUidAidBo> userArchivesInterviews;
-        if (type==0){
-            userArchivesInterviews = userArchivesInterviewMapper.selectByUidAid(id, TokenManager.getAdminId());
-            user.setInterviewList(userArchivesInterviews);
-        }else {
-            userArchivesInterviews = userArchivesInterviewMapper.selectByUidAid(id, TokenManager.getAdminId());
-        }
-        user.setInterviewList(userArchivesInterviews);
+        //设置面谈列表
+        user.setInterviewList(userArchivesInterviewMapper.selectByUidAid(id, TokenManager.getAdminId()));
         //获取首次面谈时间
         List<UserFirstInterview> firstList;
         if (type == 0){

+ 5 - 1
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -12,10 +12,14 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
-import com.goafanti.common.utils.*;
+import com.goafanti.common.utils.AsyncUtils;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.FileUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.common.utils.pdf.PDFUtils;
+import com.goafanti.common.utils.weChat.WeChatUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;

+ 1 - 2
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseCountsServiceImpl.java

@@ -53,7 +53,7 @@ public class ExpenseCountsServiceImpl implements ExpenseCountsService {
                         }
 
                     }
-                    if(useOyd.getStatus()==1){
+                    if(useOyd !=null&&useOyd.getStatus()==1){
                         e.setMaxDuration("不限制");
                         e.setExceedDuration("0");
                     }else {
@@ -65,7 +65,6 @@ public class ExpenseCountsServiceImpl implements ExpenseCountsService {
                         }
                     }
                 }
-
             });
             return expenseCountsBos;
         }else {

+ 2 - 0
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -251,6 +251,8 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		res.setData(orderNewService.getOrderNewDetail(orderNo));
 		return res;
 	}
+
+
 	/**
 	 * 订单审核列表
 	 */

+ 2 - 1
src/main/java/com/goafanti/order/controller/OrderChangeApiController.java

@@ -538,7 +538,8 @@ public class OrderChangeApiController extends CertifyApiController {
 	 * 变更-新增会员子项目
 	 *
 	 */
-	@RequestMapping(value = "/addMemberSonProject" ,method = RequestMethod.POST)
+	@RequestMapping(value = "" +
+			"/addMemberSonProject" ,method = RequestMethod.POST)
 	public Result addMemberSonProject(InputAddSonProject in ){
 		Result res = new Result();
 		if(in.getId()==null||StringUtils.isBlank(in.getServiceYear())){

+ 8 - 2
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -1425,8 +1425,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 								addSonProject(t2);
 							}
 						}
+				}else if(bp.getProjectType().equals(NewProjectTypeEnum.SIMPLE.getCode())||bp.getProjectType().equals(NewProjectTypeEnum.UNILATERAL.getCode())){
+					addSonProject(t);
 				}
-
 				return t;
 			}
 
@@ -1451,7 +1452,12 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	}
 
 	private void pushSuerProject( InputTChangeTaskBo tChangeTask) {
-		List<TChangeTask> tChangeTasks = tChangeTaskMapper.selectBySuper(null, tChangeTask.getId(), tChangeTask.getCid());
+		List<TChangeTask> tChangeTasks;
+		if (tChangeTask.getTid()==null){
+			 tChangeTasks = tChangeTaskMapper.selectBySuper(null, tChangeTask.getId(), tChangeTask.getCid());
+		}else{
+			tChangeTasks = tChangeTaskMapper.selectBySuper(tChangeTask.getTid(), null, tChangeTask.getCid());
+		}
 		if (!tChangeTasks.isEmpty()){
 			int a=0,b=0,c=0;
 			StringBuilder str= new StringBuilder();

+ 2 - 1
src/main/java/com/goafanti/order/service/impl/PushOrderService.java

@@ -34,7 +34,8 @@ public class PushOrderService {
     public String processStatusConstant(TOrderNewBo t){
         //tOrder.getContractPictureUrl(),tOrder.getSalesmanId(),tOrder.getProcessStatus(),tOrder.getApproval()
         //流程状态 0-已派营销员,1-已派营销员管理员,2-已派财务管理员,3-已派财务专员,4-已派咨询师管理员,5-已部分派咨询师经理,6-已部全部派咨询师经理
-        if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ){
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
+        ||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT) ){
             return t.getContractPictureUrl();
         }else if ((TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN)
                 ||TokenManager.hasRole(AFTConstants.SALESMAN_ASSISTANT))&&

+ 3 - 1
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -55,6 +55,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 	private AsyncUtils asyncUtils;
 	@Autowired
 	private DepartmentMapper departmentMapper;
+	@Autowired
+	private UserLockReleaseMapper userLockReleaseMapper;
 
 
 	@Override
@@ -176,7 +178,7 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 				organizationContactBookMapper.updateDimissionTransfer(aid,transferId);
 				//所有客户转交给接受者
 				transferUserUpdateExamine(aid,transferId);
-				userMapper.updateDimissionTransfer(aid,transferId);
+				userMapper.updateDimissionTransfer(aid,transferId,date);
 			}else if (s==roleResources.QDYW.getCode()) {
 				userTransferLogMapper.insertUserLockLog(aid,transferId,date);
 				patentNewMapper.updateAdmin(aid,transferId);

+ 9 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicReleaseList.java

@@ -8,6 +8,7 @@ public class OutPublicReleaseList {
 	private Integer id;
 	private String nickname;
 	private String orderNo;
+	private String contractNo;
 	private String districtName;
 	private String aid;
 	private String aname;
@@ -43,6 +44,14 @@ public class OutPublicReleaseList {
 	private Integer assistProcess;
 	private Integer alone;
 
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
 	public Integer getMaxProcess() {
 		return maxProcess;
 	}

+ 1 - 1
src/main/java/com/goafanti/weChat/controller/PublicAssistAdviceController.java

@@ -2,7 +2,7 @@ package com.goafanti.weChat.controller;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.PublicAssistAdvice;
-import com.goafanti.weChat.controller.service.PublicAssistAdviceService;
+import com.goafanti.weChat.service.PublicAssistAdviceService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;

+ 1 - 1
src/main/java/com/goafanti/weChat/controller/service/PublicAssistAdviceService.java

@@ -1,4 +1,4 @@
-package com.goafanti.weChat.controller.service;
+package com.goafanti.weChat.service;
 
 import com.goafanti.common.model.PublicAssistAdvice;
 

+ 2 - 2
src/main/java/com/goafanti/weChat/controller/service/impl/PublicAssistAdviceServiceImpl.java

@@ -1,11 +1,11 @@
-package com.goafanti.weChat.controller.service.impl;
+package com.goafanti.weChat.service.impl;
 
 import com.goafanti.common.dao.PublicAssistAdviceMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.PublicAssistAdvice;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.weChat.controller.service.PublicAssistAdviceService;
+import com.goafanti.weChat.service.PublicAssistAdviceService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;

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

@@ -12,6 +12,7 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
 import com.goafanti.common.utils.*;
+import com.goafanti.common.utils.weChat.WeChatUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -1700,7 +1701,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		List<PublicRelease> newList = publicReleaseMapper.selectByMainId(use.getId(),3,null);
 		int count = 0;
 		for (PublicRelease e : newList) {
-			if (e.getStatus()==2){
+			//如果是完成或者拒绝则标记,全中断则修改状态
+			if (e.getStatus()==2||e.getStatus()==3){
 				count++;
 			}
 		}

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

@@ -1,6 +1,7 @@
 dev.name=local
+spring.main.lazy-initialization=true
 jdbc.driverClassName=com.mysql.jdbc.Driver
-kede.version=1.3.43
+kede.version=1.3.44
 static.host=//static.jishutao.com/${kede.version}
 #static.host=//172.16.1.199:3000/${kede.version}
 #static.host=//172.16.1.187/${kede.version}
@@ -29,6 +30,8 @@ jdbc.removeAbandonedTimeout=300
 jdbc.logAbandoned=true
 jdbc.filters=stat
 logging.level.com.goafanti=DEBUG
+conversationContent.corpid=wwd1f2fb82952be74c
+conversationContent.secret=0k4XYuHUl4QB8QTB6cAOSaRIX00ur1Vyjjz4p_REP_k
 
 jedis.host=localhost
 jedis.port=6379

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

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.43
+static.host=//static.jishutao.com/1.3.44
 #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
@@ -20,6 +20,8 @@ jdbc.removeAbandoned=true
 jdbc.removeAbandonedTimeout=300
 jdbc.logAbandoned=true
 jdbc.filters=stat
+conversationContent.corpid=wwd1f2fb82952be74c
+conversationContent.secret=0k4XYuHUl4QB8QTB6cAOSaRIX00ur1Vyjjz4p_REP_k
 
 logging.level.com.goafanti=DEBUG
 

+ 1 - 0
src/main/resources/spring/spring-mvc.xml

@@ -16,6 +16,7 @@
 
 	<context:component-scan
 		base-package="com.goafanti.*.controller;com.goafanti.common.task;com.goafanti.common.utils;
+		com.tencent.wework;
 		com.goafanti.core.websocket" />