Browse Source

修改列表参数

anderx 3 years ago
parent
commit
1ae725522e

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

@@ -798,7 +798,7 @@
     left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
     left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id
     left join admin d on a.task_receiver=d.id left join t_task_member j on a.id =j.tid
-    left join t_task_mid ttm on a.id=ttm.tid left join task_sopt ts on a.id = ts.tid
+    left join t_task_mid ttm on a.id=ttm.tid left join task_stop ts on a.id = ts.tid
     where a.super_id is null and a.split_status in(0,1)
       <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}

+ 5 - 5
src/main/java/com/goafanti/common/model/TaskLog.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * task_log
- * @author 
+ * @author
  */
 public class TaskLog implements Serializable {
     private Integer id;
@@ -33,7 +33,7 @@ public class TaskLog implements Serializable {
     /**
      * 发起暂停编号
      */
-    private Integer stopId;
+    private Long stopId;
 
     private static final long serialVersionUID = 1L;
 
@@ -77,11 +77,11 @@ public class TaskLog implements Serializable {
         this.aid = aid;
     }
 
-    public Integer getStopId() {
+    public Long getStopId() {
         return stopId;
     }
 
-    public void setStopId(Integer stopId) {
+    public void setStopId(Long stopId) {
         this.stopId = stopId;
     }
-}
+}

+ 38 - 19
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -175,7 +175,7 @@ public class AsyncUtils {
 
 	/**
 	 *
-	 * @param type  发送对象 0营销管理员 1 通知所有人
+	 * @param type  发送对象 0发起营销管理员 1 完成通知所有人 2拒绝发送给营销员
 	 *  @param sotpType  发送对象 类型 0=项目暂停,1=项目重启
 	 *
 	 */
@@ -183,9 +183,11 @@ public class AsyncUtils {
 		Integer noticeType=0;
 		if (task==null)task = tOrderTaskMapper.selectByPrimaryKey(Integer.valueOf(ids.split(",")[0]));
 		TOrderNewBo tOrderNew = tOrderNewMapper.getOrderNewDetail(task.getOrderNo());
+		List<Notice> notes=new ArrayList<>();
+		StringBuffer emails=new StringBuffer();
 		if (type==0){
 			noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_START.getCode() :NoticeStatus.PROJECT_RENEW_START.getCode();
-			String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],请及时审核",tOrderNew.getUserName(),task.getOrderNo(),ids);
+			String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],请及时审核",tOrderNew.getUserName(),task.getOrderNo(),ids);
 			List<Admin> admins = adminMapper.listAdminBydepIdAndRoleType(tOrderNew.getOrderDep(),AFTConstants.SALESMAN_ADMIN);
 			for (Admin admin : admins) {
 				addNotic( noticeType,admin.getId(), str);
@@ -194,43 +196,60 @@ public class AsyncUtils {
 		}else if(type==1){
 			String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],已%s请悉知。",tOrderNew.getUserName(),task.getOrderNo(),task.getId(),sotpType==1?"恢复":"暂停");
 			noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_YES.getCode() :NoticeStatus.PROJECT_RENEW_YES.getCode();
-			List<String> list = new ArrayList<>();
-			List<Notice> notes=new ArrayList<>();
 			OrderOperator orderOperator = tOrderTaskMapper.selectAidByParam(task.getId());
-			StringBuffer emails=new StringBuffer();
-			if (task.getConsultantId()!=null){
-				 pushParam(task.getConsultantId(), noticeType, str, notes, emails);
+			List<String >aids=new ArrayList<>();
+			if (orderOperator.getSalesmanId()!=null&&!aids.contains(orderOperator.getFinanceId())){
+				aids.add(orderOperator.getSalesmanId());
 			}
-			if (task.getManagerId()!=null){
-				pushParam(task.getManagerId(), noticeType, str, notes, emails);
+			if (task.getConsultantId()!=null&&!aids.contains(task.getConsultantId())){
+				 aids.add(task.getConsultantId());
 			}
-
-			if (orderOperator.getFinanceId()!=null){
-				pushParam(orderOperator.getFinanceId(), noticeType, str, notes, emails);
-
+			if (task.getManagerId()!=null&&!aids.contains(task.getManagerId())){
+				aids.add(task.getManagerId());
 			}
-			if (orderOperator.getSalesmanId()!=null){
-				pushParam(orderOperator.getSalesmanId(), noticeType, str, notes, emails);
+			if (orderOperator.getFinanceId()!=null&&!aids.contains(orderOperator.getFinanceId())){
+				aids.add(orderOperator.getFinanceId());
 			}
 			List<Admin> cwgly = adminMapper.selectAdminByRoleType(AFTConstants.FINANCE_ADMIN);
 			for (Admin admin : cwgly) {
-				pushParam(orderOperator.getSalesmanId(), noticeType, str, notes, emails);
+				if (!aids.contains(admin.getId())){
+					aids.add(admin.getId());
+				}
 			}
 			List<Admin> zxsgly = adminMapper.selectAdminByRoleType(AFTConstants.TECH_ADMIN);
 			for (Admin admin : zxsgly) {
-				pushParam(admin, noticeType, str, notes, emails);
+				if (!aids.contains(admin.getId())){
+					aids.add(admin.getId());
+				}
 			}
 			List<Admin> zc = adminMapper.selectAdminByRoleType(AFTConstants.CED);
 			for (Admin admin : zc) {
-				pushParam(admin, noticeType, str, notes, emails);
+				if (!aids.contains(admin.getId())){
+					aids.add(admin.getId());
+				}
 			}
 			List<Admin> dsz = adminMapper.selectAdminByRoleType(AFTConstants.APPROVAL_DECISION);
 			for (Admin admin : dsz) {
-				pushParam(admin, noticeType, str, notes, emails);
+				if (!aids.contains(admin.getId())){
+					aids.add(admin.getId());
+				}
+			}
+			if (!aids.isEmpty()){
+				for (String aid : aids) {
+					pushParam( aid,  noticeType, str,  notes,  emails);
+				}
 			}
 			System.out.println("========================"+emails.substring(0,emails.length()-1));
 			noticeMapper.insertBatch(notes);
 			send(new EmailBo(NoticeStatus.getValueByCode(noticeType),emails.substring(0,emails.length()-1),str));
+			}else if (type==2){
+				noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_NO.getCode() :NoticeStatus.PROJECT_RENEW_NO.getCode();
+				String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],已经被驳回。",tOrderNew.getUserName(),task.getOrderNo(),task.getId());
+				if (tOrderNew.getSalesmanId()!=null){
+					Admin admin = adminMapper.selectByPrimaryKey(tOrderNew.getSalesmanId());
+					addNotic( noticeType,admin.getId(), str);
+					send(new EmailBo(NoticeStatus.getValueByCode(noticeType),admin.getEmail(),str));
+				}
 			}
 		}
 

+ 3 - 2
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1552,9 +1552,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		TaskStop use = taskStopMapper.selectByPrimaryKey(in.getTaskStopId());
 		TaskStop t=new TaskStop();
 		t.setId(use.getId());
+		TOrderTask task = tOrderTaskMapper.selectByPrimaryKey(use.getTid());
 		if (in.getStatus()==1){
 			t.setStatus(1);
-			TOrderTask task = tOrderTaskMapper.selectByPrimaryKey(use.getTid());
 			StringBuffer str =new StringBuffer();
 			str.append("项目状态修改为:");
 			if (use.getType()==0){
@@ -1567,7 +1567,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				examineProjectSotpAddNotice(task,1,use.getType());
 			}
 			TaskLog taskLog = new TaskLog();
-			taskLog.setSotpId(in.getTaskStopId());
+			taskLog.setStopId(in.getTaskStopId());
 			taskLog.setTaskId(use.getTid());
 			taskLog.setContent(str.toString());
 			taskLog.setAid(use.getCreateBy());
@@ -1582,6 +1582,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			tTaskMidMapper.updateByTid(tt);
 		}else if(in.getStatus()==2) {
 			t.setStatus(2);
+			examineProjectSotpAddNotice(task,2,use.getType());
 		}
 		TaskStopLog tsl=new TaskStopLog();
 		tsl.setTaskStopId(in.getTaskStopId());