|
|
@@ -16,6 +16,8 @@ import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.TChangeTask;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.order.bo.NewOrderChangeBo;
|
|
|
+import com.goafanti.order.enums.OrderChangeProcess;
|
|
|
+import com.goafanti.order.enums.ProcessStatus;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -113,21 +115,14 @@ public class AsyncUtils {
|
|
|
|
|
|
/**
|
|
|
* 切换审核人员
|
|
|
- * @param type 1营销管理 3财务
|
|
|
* @param depId 部门编号
|
|
|
* @param aid 切换后审核人
|
|
|
* @return
|
|
|
*/
|
|
|
- public void updateExamineName(Integer type, String depId, String aid) {
|
|
|
- if (type==1){
|
|
|
- tOrderNewMapper.updateExamineName(1,depId,aid);
|
|
|
- newOrderChangeMapper.updateExamineName(1,depId,aid);
|
|
|
- tOrderInvoiceMapper.updateExamineName(1,depId,aid);
|
|
|
- }else if (type==3){
|
|
|
- tOrderNewMapper.updateExamineName(3,depId,aid);
|
|
|
- newOrderChangeMapper.updateExamineName(5,depId,aid);
|
|
|
- tOrderInvoiceMapper.updateExamineName(0,depId,aid);
|
|
|
- }
|
|
|
+ public void updateExamineName( String depId, String aid) {
|
|
|
+ tOrderNewMapper.updateExamineName(3,depId,aid,null);
|
|
|
+ newOrderChangeMapper.updateExamineName(5,depId,aid,null);
|
|
|
+ tOrderInvoiceMapper.updateExamineName(0,depId,aid,null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -137,17 +132,33 @@ public class AsyncUtils {
|
|
|
* @param roleType
|
|
|
*/
|
|
|
public void updateListExamineName(Integer type, String depId, String roleType) {
|
|
|
- StringBuffer names=new StringBuffer();
|
|
|
+ StringBuffer str=new StringBuffer();
|
|
|
+ String names="";
|
|
|
+
|
|
|
+ if (str.length()>1)names=str.substring(0,str.length()-1);
|
|
|
if (type==1){
|
|
|
- List<Admin> admins = adminMapper.selectAdminByRoleType(roleType);
|
|
|
- for (Admin admin : admins) {
|
|
|
- if (admin.getDepartmentId().equals(depId)){
|
|
|
- names=names.append(admin.getName()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- tOrderInvoiceMapper.updateListExamineName(type,depId,roleType);
|
|
|
+ getNames(depId, roleType, str);
|
|
|
+ tOrderNewMapper.updateExamineName(ProcessStatus.YPYXGLY.getCode(),depId,null,names);
|
|
|
+ newOrderChangeMapper.updateExamineName(OrderChangeProcess.YXGLY.getCode(),depId,null,names);
|
|
|
+ tOrderInvoiceMapper.updateExamineName(1,depId,null,names);
|
|
|
}else if (type==2){
|
|
|
tOrderInvoiceMapper.updateListExamineName(type,depId,roleType);
|
|
|
+ }else if (type==3){
|
|
|
+ getNames(depId, roleType, str);
|
|
|
+ newOrderChangeMapper.updateExamineName(OrderChangeProcess.CWZJ.getCode(),depId,null,names);
|
|
|
+ }else if (type==4){
|
|
|
+ getNames(depId, roleType, str);
|
|
|
+ tOrderNewMapper.updateExamineName(ProcessStatus.YPZXSGLY.getCode(),depId,null,names);
|
|
|
+ newOrderChangeMapper.updateExamineName(OrderChangeProcess.JSZJ.getCode(),depId,null,names);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getNames(String depId, String roleType, StringBuffer str) {
|
|
|
+ List<Admin> admins = adminMapper.selectAdminByRoleType(roleType);
|
|
|
+ for (Admin admin : admins) {
|
|
|
+ if (admin.getDepartmentId().equals(depId)) {
|
|
|
+ str = str.append(admin.getName()).append(",");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|