Explorar o código

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

anderx hai 1 ano
pai
achega
54ce8e07fc

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

@@ -105,7 +105,7 @@ public interface TOrderNewMapper {
 
     Department selectDepByOrderNo(String orderNo);
 
-    List<String> selectByFinanceNotExamine(String financeId);
+    List<String> selectByFinanceNotExamine(@Param("financeId") String financeId, @Param("depId") String depId);
 
     void updateOrderDepFinanceExamineName(@Param("list") List<String> list, @Param("processStatus") Integer processStatus);
 

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

@@ -2136,7 +2136,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   <select id="selectByFinanceNotExamine" resultType="string">
     select a.order_no orderNo
     from t_order_new a left join t_order_examine b on a.order_no=b.order_no
-    where  b.aid = #{financeId} and a.process_status = 3
+    where  b.aid = #{financeId} and a.process_status = 3 and a.order_dep= #{depId}
   </select>
     <select id="selectExpenseCount" parameterType="com.goafanti.expenseAccount.bo.ExpenseCountsInput" resultType="com.goafanti.expenseAccount.bo.ExpenseCountsBo">
       select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,toc.max_duration maxDuration ,toc.actual_duration actualDuration ,

+ 19 - 5
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -280,7 +280,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 				//审核人切换
 				departmentMapper.updateOrderDepFinanceNotExamine(in.getFinanceId(), useDep.getFinanceId(), useDep.getId());
 				//查询切换后的订单刷新审核人
-				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getFinanceId());
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getFinanceId(), useDep.getId());
 				if (!list.isEmpty()){
 					torderNewMapper.updateOrderDepFinanceExamineName(list,ProcessStatus.YPCW_JSZJ.getCode());
 				}
@@ -298,7 +298,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		if (in.getTechAdminId()==null||!in.getTechAdminId().equals(useDep.getTechAdminId())){
 			if(StringUtils.isBlank(in.getTechAdminId())){
 				//先将旧的查出来
-				List<String> list = torderNewMapper.selectByFinanceNotExamine(useDep.getTechAdminId());
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(useDep.getTechAdminId(),useDep.getId());
 				//再删除旧单需要审核的
 				torderExamineMapper.deleteExamineFinance(useDep.getId(), useDep.getTechAdminId());
 				if (!list.isEmpty()){
@@ -312,7 +312,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 				//审核人切换
 				departmentMapper.updateOrderDepFinanceNotExamine(in.getTechAdminId(), useDep.getTechAdminId(), useDep.getId());
 				//查询切换后的订单刷新审核人
-				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getTechAdminId());
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getTechAdminId(), useDep.getId());
 				if (!list.isEmpty()){
 					torderNewMapper.updateOrderDepFinanceExamineName(list,ProcessStatus.YPCW_JSZJ.getCode());
 				}
@@ -321,7 +321,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		if (!in.getRetrialFinanceId().equals(useDep.getRetrialFinanceId())){
 			if(StringUtils.isBlank(in.getRetrialFinanceId())) {
 				//先将旧的查出来
-				List<String> list = torderNewMapper.selectByFinanceNotExamine(useDep.getRetrialFinanceId());
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(useDep.getRetrialFinanceId(), useDep.getId());
 				//再删除旧单需要审核的
 				torderExamineMapper.deleteExamineFinance(useDep.getId(), useDep.getRetrialFinanceId());
 				if (!list.isEmpty()) {
@@ -334,7 +334,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 			}else {
 				dep.setRetrialFinanceId(in.getRetrialFinanceId());
 				departmentMapper.updateOrderDepFinanceNotExamine(in.getRetrialFinanceId(), useDep.getRetrialFinanceId(), useDep.getId());
-				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getRetrialFinanceId());
+				List<String> list = torderNewMapper.selectByFinanceNotExamine(in.getRetrialFinanceId(), useDep.getId());
 				if (!list.isEmpty()){
 					torderNewMapper.updateOrderDepFinanceExamineName(list,ProcessStatus.YPCW_JSZJ.getCode());
 				}
@@ -401,6 +401,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 			TOrderNewBo order = torderNewMapper.getSaleIdByOno(s);
 			TOrderNew newOrder = new TOrderNew();
 			newOrder.setOrderNo(s);
+
 			//如果订单是特批
 			if (tOrderNew.getApproval() == ApprovalNewState.TPDSH.getCode() || tOrderNew.getApproval() == ApprovalNewState.TPBH.getCode()) {
 				if (StringUtils.isNotEmpty(in.getOperationGuaranteeId())) {
@@ -412,12 +413,17 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 					addOrderLog(s,OrderLogProcess.TP.getCode(),"部门特批审核未设置,系统自动通过");
 					newOrder.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 					newOrder.setApproval(ApprovalNewState.TPTG.getCode());
+					pushJSZJidAndName(aids, str);
 				} else {
 					addOrderLog(s,OrderLogProcess.YYBZSHTG.getCode(),"运营保障审核人未设置,系统自动通过");
 					newOrder.setProcessStatus(ProcessStatus.YPTPSH.getCode());
 					aids.add(order.getApprovalAid());
 					str.append(order.getApprovalName()).append(",");
 				}
+			}else {
+				newOrder.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
+				newOrder.setApproval(ApprovalNewState.TPTG.getCode());
+				pushJSZJidAndName(aids, str);
 			}
 			newOrder.setExamineName(str.substring(0,str.length()-1));
 			torderNewMapper.updateByPrimaryKeySelective(newOrder);
@@ -425,6 +431,14 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 
 	}
 
+	private void pushJSZJidAndName(List<String> aids, StringBuilder str) {
+		List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.TECH_ADMIN);
+		for (Admin admin : admins) {
+			aids.add(admin.getId());
+			str.append(admin.getName()).append(",");
+		}
+	}
+
 	/**
 	 * 添加审核人 财务专员,财务复审,技术总监审核
 	 * @param useDep 部门