班组退料

This commit is contained in:
mashuai 2025-08-18 16:09:02 +08:00
parent e586306296
commit aba67051f6
2 changed files with 14 additions and 16 deletions

View File

@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.archives.service.ArchivesService;
@ -371,6 +372,9 @@ public class BackApplyInfoController extends BaseController {
public AjaxResult submitBackApply(@RequestBody BackApplyInfo backApplyInfo) {
try {
BmUnit unit = taskMapper.selectBmUnitInfo(backApplyInfo);
if (unit != null && unit.getTypeId() == null) {
throw new ServiceException("单位类型为空");
}
if (unit != null && unit.getTypeId() == 1731L) {
// 班组退料提交
return backApplyInfoService.submitBzBackApply(backApplyInfo);

View File

@ -2041,25 +2041,19 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
if (backApplyInfo.getUnitId() == null || backApplyInfo.getProId() == null) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "参数不能为空");
}
BmUnit queryUnitInfo = bmUnitMapper.selectBmUnitByUnitId(backApplyInfo.getUnitId());
if (queryUnitInfo.getTypeId() == null) {
throw new ServiceException("单位类型为空");
}
// 如果单位类型为班组则查询该班在机具签署的协议ID
LeaseOutDetails leaseOutDetail = new LeaseOutDetails();
if (queryUnitInfo.getTypeId() == 1731L) {
// 查询班组挂靠的项目部协议信息
leaseOutDetail = leaseApplyInfoMapper.selectProjectUnitAgreementIdByTeamAndProject(
Math.toIntExact(backApplyInfo.getUnitId()),
Math.toIntExact(backApplyInfo.getProId())
);
if (leaseOutDetail == null) {
throw new ServiceException("项目部协议信息查询为空");
}
// 把后续流程设置为项目部的协议进行处理
backApplyInfo.setAgreementId(leaseOutDetail.getProjectUnitAgreementId());
backApplyInfo.setUnitId(leaseOutDetail.getProjectUnitAgreementId());
// 查询班组挂靠的项目部协议信息
leaseOutDetail = leaseApplyInfoMapper.selectProjectUnitAgreementIdByTeamAndProject(
Math.toIntExact(backApplyInfo.getUnitId()),
Math.toIntExact(backApplyInfo.getProId())
);
if (leaseOutDetail == null) {
throw new ServiceException("项目部协议信息查询为空");
}
// 把后续流程设置为项目部的协议进行处理
backApplyInfo.setAgreementId(leaseOutDetail.getProjectUnitAgreementId());
backApplyInfo.setUnitId(leaseOutDetail.getProjectUnitAgreementId());
SelectDto dto = new SelectDto();
dto.setProId(backApplyInfo.getProId()).setUnitId(Math.toIntExact(backApplyInfo.getUnitId()));
List<AgreementVo> list = mapper.getAgreementInfoByIdBack(dto);