|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import com.ruoyi.common.exception.BusinessException; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
@ -136,7 +137,7 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void deptReview(SysMakeorderDeptDto makeorderDeptDto) { |
|
|
|
public int deptReview(SysMakeorderDeptDto makeorderDeptDto) { |
|
|
|
String makeNo = makeorderDeptDto.getMakeNo(); |
|
|
|
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts(); |
|
|
|
// 部门预审数据是一起录入
|
|
|
@ -158,7 +159,8 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService |
|
|
|
makeOrder.setMakeNo(makeNo); |
|
|
|
// 待部门主管确认
|
|
|
|
makeOrder.setMakeStatus("1"); |
|
|
|
makeOrderService.updateByMakeNo(makeOrder); |
|
|
|
|
|
|
|
|
|
|
|
makeorderDeptList.forEach(dept->{ |
|
|
|
// 业务部门 无需部门领导确认
|
|
|
|
if("GMD".equals(dept.getDeptNumber())){ |
|
|
@ -170,28 +172,45 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService |
|
|
|
} |
|
|
|
sysMakeorderDeptMapper.updateSysMakeorderDept(dept); |
|
|
|
}); |
|
|
|
return makeOrderService.updateByMakeNo(makeOrder); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto) { |
|
|
|
public void deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto){ |
|
|
|
String makeNo = makeorderDeptDto.getMakeNo(); |
|
|
|
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts(); |
|
|
|
String deptNumber = ShiroUtils.getSysUser().getDept().getDeptNumber(); |
|
|
|
|
|
|
|
boolean hasUnconfirmedData = false; // 标记是否有未确认的数据
|
|
|
|
|
|
|
|
// 遍历所有部门数据
|
|
|
|
for (SysMakeorderDept dept : makeorderDeptList) { |
|
|
|
// 检查当前部门数据的deptNumber是否与给定的deptNumber匹配
|
|
|
|
if (deptNumber.equals(dept.getDeptNumber())) { |
|
|
|
// 检查deptLeaderConfirmStatus是否为空
|
|
|
|
if (dept.getDeptLeaderConfirmStatus().equals("0")) { |
|
|
|
hasUnconfirmedData = true; |
|
|
|
break; // 如果发现未确认的数据,可以直接退出循环
|
|
|
|
} else { |
|
|
|
sysMakeorderDeptMapper.updateSysMakeorderDept(dept); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 如果有未确认的数据,抛出异常或给出提示
|
|
|
|
if (hasUnconfirmedData) { |
|
|
|
throw new BusinessException("有数据未被确认,请进行部门主管确认!"); |
|
|
|
} |
|
|
|
|
|
|
|
// 工程部门领导确认完,生产状态更新为待工程审核
|
|
|
|
if("END".equals(deptNumber)){ |
|
|
|
if ("END".equals(deptNumber)) { |
|
|
|
SysMakeOrder makeOrder = new SysMakeOrder(); |
|
|
|
makeOrder.setMakeNo(makeNo); |
|
|
|
// 待工程审核
|
|
|
|
makeOrder.setMakeStatus("2"); |
|
|
|
makeOrderService.updateByMakeNo(makeOrder); |
|
|
|
} |
|
|
|
makeorderDeptList.forEach(dept->{ |
|
|
|
String deptLeaderConfirmStatus = dept.getDeptLeaderConfirmStatus(); |
|
|
|
if(StringUtils.isNotBlank(deptLeaderConfirmStatus)){ |
|
|
|
sysMakeorderDeptMapper.updateSysMakeorderDept(dept); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|