Browse Source

修改订单跳过审核修改开发

anderx 1 year ago
parent
commit
43d00a3560

+ 2 - 2
src/main/java/com/goafanti/common/enums/OrderLogProcess.java

@@ -38,8 +38,8 @@ public enum OrderLogProcess {
 	HYXMWC(23,"会员项目完成"),
 	DDZJ(24,"订单转交"),
 
-	YYBZSHTG(25,"运营保障审核通过"),
-	YYBZSHBH(25,"运营保障审核驳回"),
+	YYBZSHTG(26,"运营保障审核通过"),
+	YYBZSHBH(27,"运营保障审核驳回"),
 	NOT(99,"未知"),
 	;
 

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

@@ -621,11 +621,11 @@
         where a.process_status =3 and a.status =0 and a.auditor = #{useFinanceId}
           and b.id= #{newFinanceId}
     </update>
-    <update id="updateNull">
+    <update id="updateNull" parameterType="com.goafanti.organization.bo.InputDep">
         update department
         <set>
-            <if test="thAdminId ==null">
-                th_admin_id=null,
+            <if test="techAdminId ==null">
+                tech_admin_id=null,
             </if>
             <if test="operationGuaranteeId ==null">
                 operation_guarantee_id=null,

+ 52 - 2
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -269,6 +269,56 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 			if(StringUtils.isBlank(in.getRetrialFinanceId()))in.setRetrialFinanceId(null);
 			departmentMapper.updateNull(in);
 		}
+		//处理去掉咨询师管理员
+		if (in.getTechAdminId()==null||!in.getTechAdminId().equals(useDep.getTechAdminId())){
+			if(StringUtils.isBlank(in.getTechAdminId())){
+				//先将旧的查出来
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(useDep.getTechAdminId());
+				//再删除旧单需要审核的
+				torderExamineMapper.deleteExamineFinance(useDep.getTechAdminId());
+				if (!list.isEmpty()){
+					//先把药推送到下个流程的查出来
+					for (String s : list) {
+						List<TOrderExamine> tOrderExamines = torderExamineMapper.selectByOrderNo(s, 0);
+						int i = 0;
+						for (TOrderExamine e : tOrderExamines) {
+							if (e.getStatus() == 1) i++;
+						}
+						if (i == tOrderExamines.size()) {
+							//推送订单流程
+							addOrderLog(s,OrderLogProcess.XMZJSH.getCode(),"订单修改技术总监,判定审核通过");
+							StringBuilder str = new StringBuilder();
+							TOrderNew tOrderNew = torderNewMapper.selectByPrimaryKey(s);
+							TOrderNewBo order = torderNewMapper.getSaleIdByOno(s);
+							TOrderNew newOrder = new TOrderNew();
+							//如果订单是特批
+							if (tOrderNew.getApproval() == ApprovalNewState.TPDSH.getCode() || tOrderNew.getApproval() == ApprovalNewState.TPBH.getCode()) {
+								if (StringUtils.isNotEmpty(in.getOperationGuaranteeId())) {
+									newOrder.setProcessStatus(ProcessStatus.YYBZSH.getCode());
+									str.append(order.getOperationGuaranteeName()).append(",");
+									aids.add(order.getOperationGuaranteeId());
+								} else if (order.getApprovalStatus() == 0) {
+									newOrder.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
+									newOrder.setApproval(ApprovalNewState.TPTG.getCode());
+									addOrderLog(s,OrderLogProcess.TP.getCode(),"部门特批审核人未设置,系统自动通过");
+								} else {
+									newOrder.setProcessStatus(ProcessStatus.YPTPSH.getCode());
+									aids.add(order.getApprovalAid());
+									str.append(order.getApprovalName()).append(",");
+									addOrderLog(s,OrderLogProcess.YYBZSHTG.getCode(),"运营保障审核人未设置,系统自动通过");
+								}
+							}
+							newOrder.setExamineName(str.substring(0,str.length()-1));
+							torderNewMapper.updateByPrimaryKeySelective(newOrder);
+						}
+						torderNewMapper.updateOrderDepFinanceExamineName(list);
+					}
+				}
+			}else{
+			}
+
+		}
+
 		if (!in.getRetrialFinanceId().equals(useDep.getRetrialFinanceId())){
 			if(StringUtils.isBlank(in.getRetrialFinanceId())) {
 				//先将旧的查出来
@@ -285,7 +335,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 						}
 						if (i == tOrderExamines.size()) {
 							//推送订单流程
-							addOrderLog(s,OrderLogProcess.TP.getCode(),"订单修改财务复审,判定审核通过");
+							addOrderLog(s,OrderLogProcess.CWFS.getCode(),"订单修改财务复审,判定审核通过");
 							StringBuilder str = new StringBuilder();
 							TOrderNew tOrderNew = torderNewMapper.selectByPrimaryKey(s);
 							TOrderNewBo order = torderNewMapper.getSaleIdByOno(s);
@@ -304,7 +354,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 									newOrder.setProcessStatus(ProcessStatus.YPTPSH.getCode());
 									aids.add(order.getApprovalAid());
 									str.append(order.getApprovalName()).append(",");
-									addOrderLog(s,OrderLogProcess.TP.getCode(),"运营保障审核人未设置,系统自动通过");
+									addOrderLog(s,OrderLogProcess.YYBZSHTG.getCode(),"运营保障审核人未设置,系统自动通过");
 								}
 							}
 							newOrder.setExamineName(str.substring(0,str.length()-1));