Browse Source

科德系统财务、营销管理员更换审核人员处理
科德系统修改审核逻辑去掉董事长与总裁角色人员查询

anderx 3 years ago
parent
commit
43b26219a1

+ 9 - 0
src/main/java/com/goafanti/common/dao/NewOrderChangeMapper.java

@@ -40,4 +40,13 @@ public interface NewOrderChangeMapper {
     NewOrderChangeBo selectByChangeId(String changeId);
 
     NewOrderChangeBo selectByorderNoAndStatus(String orderNo);
+
+    /**
+     * 切换审核人员
+     * @param type 3财务
+     * @param depId 部门编号
+     * @param aid 切换后审核人
+     * @return
+     */
+    int updateexamineName(@Param("type")Integer type, @Param("depId")String depId, @Param("aid")String aid);
 }

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

@@ -57,4 +57,13 @@ public interface TOrderNewMapper {
     List<OutOrderSalesSource> orderSalesSource(InputOrderSalesSource in);
 
     TOrderNew  checkOrderProcessStatus(Integer tid);
+
+    /**
+     * 切换审核人员
+     * @param type 3财务
+     * @param depId 部门编号
+     * @param aid 切换后审核人
+     * @return
+     */
+    int updateexamineName(@Param("type")Integer type, @Param("depId")String depId, @Param("aid")String aid);
 }

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

@@ -722,7 +722,16 @@ select
 	set `refund_Invoice`=ifnull(`refund_Invoice`,0)- #{amount}
 	where order_no= #{orderNo}
 	</update>
-	<select id="getOrderChange" resultType="java.util.Map">
+
+    <select id="getOrderChange" resultType="java.util.Map">
 	select id,used_order usedOrder from new_order_change where  order_no= #{orderNo} order by id
 	</select>
+
+  <update id="updateexamineName">
+    update  new_order_change a,t_order_new b,admin c
+    set a.examine_name=c.name
+    where a.process_state = #{type} and a.order_no =b.order_no
+      and b.order_dep = #{depId}
+      and c.id= #{aid}
+  </update>
 </mapper>

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

@@ -1615,6 +1615,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
                            refund_amount=#{refundAmount,jdbcType=DECIMAL}	where order_no=#{orderNo}
   </update>
 
+
   <select id="selectArrearsDunListByPage" resultType="com.goafanti.order.bo.OutArrearsDunListBo">
     select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,
     b.project_status projectStatus, b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,a.`type`,
@@ -1940,4 +1941,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     where order_no = (select t_order_task.order_no from t_order_task where id=#{tid})
   </select>
 
+  <update id="updateexamineName">
+    update  t_order_new a,admin b
+    set a.examine_name=b.name
+    where a.process_status = #{type} and a.order_dep = #{depId}
+    and b.id= #{aid}
+  </update>
+
 </mapper>

+ 1 - 26
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -648,32 +648,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			}
 			if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
 
-		}else if (noc.getProcessState()== OrderChangeProcess.ZC.getCode()){
-			if (noc.getStatus()==2){
-				TOrderNewBo ton = tOrderNewMapper.getSaleIdByOno(noc.getOrderNo());
-				OrganizationListOut dep = departmentMapper.selectAllById(ton.getOrderDep());
-				noc.setExamineName(dep.getFinanceName());
-			}else {
-				StringBuffer str=new StringBuffer();
-				List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.CED);
-				for (Admin a : admins) {
-					str=str.append(a.getName()).append(",");
-				}
-				if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
-			}
-		}else if (noc.getProcessState()== OrderChangeProcess.DSZ.getCode()){
-			if (noc.getStatus()==2){
-				TOrderNewBo ton = tOrderNewMapper.getSaleIdByOno(noc.getOrderNo());
-				OrganizationListOut dep = departmentMapper.selectAllById(ton.getOrderDep());
-				noc.setExamineName(dep.getFinanceName());
-			}else {
-				StringBuffer str=new StringBuffer();
-				List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.APPROVAL_DECISION);
-				for (Admin a : admins) {
-					str=str.append(a.getName()).append(",");
-				}
-				if (str.length()>0)noc.setExamineName(str.substring(0,str.length()-1));
-			}
+		}else {
 
 		}
 	}

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

@@ -975,26 +975,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				OrganizationListOut dep = departmentMapper.selectAllById(t.getOrderDep());
 				t.setExamineName(dep.getManagerName());
 			}
-		}else if (t.getProcessStatus()==ProcessStatus.YPTPSH.getCode()){
-			if(t.getApproval()==ApprovalNewState.ZCDSH.getCode()){
-				List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.CED);
-				for (Admin e : admins) {
-					str=str.append(e.getName()).append(",");
-				}
-
-
-			}else if(t.getApproval()==ApprovalNewState.DSZDSH.getCode()) {
-				List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.APPROVAL_DECISION);
-				for (Admin e : admins) {
-					str=str.append(e.getName()).append(",");
-				}
-			}
-
-		}else if (t.getProcessStatus()==ProcessStatus.YPZXSGLY.getCode()){
-			List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN);
-			for (Admin e : admins) {
-				str=str.append(e.getName()).append(",");
-			}
 		}else if (t.getProcessStatus()==ProcessStatus.YPZXSGLY.getCode()){
 			List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN);
 			for (Admin e : admins) {

+ 16 - 0
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -3,6 +3,8 @@ package com.goafanti.organization.service.impl;
 import java.util.*;
 
 import com.goafanti.common.dao.DepartmentMapper;
+import com.goafanti.common.dao.NewOrderChangeMapper;
+import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.model.Department;
 import com.goafanti.organization.bo.DepOut;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +24,10 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 	private DepartmentMapper departmentMapper;
 	@Autowired
 	private TOrderMidMapper	tOrderMidMapper;
+	@Autowired
+	private TOrderNewMapper	tOrderNewMapper;
+	@Autowired
+	private NewOrderChangeMapper newOrderChangeMapper;
 
 	@Override
 	public Pagination<OrganizationListOut> listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
@@ -187,6 +193,16 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		dep.setProvince(province);
 		dep.setHideSign(hideSign);
 		dep.setWorkingHoursType(workingHoursType);
+		Department use = departmentMapper.selectByPrimaryKey(id);
+		if (!use.getFinanceId().equals(financeId)){
+			//切换后更换审核人
+			tOrderNewMapper.updateexamineName(3,id,financeId);
+			newOrderChangeMapper.updateexamineName(5,id,financeId);
+		}
+		if (!use.getManagerId().equals(managerId)){
+			tOrderNewMapper.updateexamineName(1,id,managerId);
+			newOrderChangeMapper.updateexamineName(1,id,managerId);
+		}
 		tOrderMidMapper.updateFinanceId(id,financeId);
 		int x=departmentMapper.updateByPrimaryKeySelective(dep);
 		return x;