新购验收会签、维修人员
This commit is contained in:
parent
4c96c5ab9d
commit
758cd9f47d
|
|
@ -458,7 +458,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
return AjaxResult.error("会签失败!,请检查用户部门信息");
|
return AjaxResult.error("会签失败!,请检查用户部门信息");
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty(purchaseSignRecordList)) {
|
if (CollectionUtils.isEmpty(purchaseSignRecordList)) {
|
||||||
// 如果没有进行过会签,则进行会签流程
|
// 如果该任务没有进行过会签,则无需校验 直接进行会签流程
|
||||||
int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(new PurchaseSignRecord(details.getTaskId(), SecurityUtils.getUserId(), loginUserDeptId));
|
int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(new PurchaseSignRecord(details.getTaskId(), SecurityUtils.getUserId(), loginUserDeptId));
|
||||||
if (0 < addPurchaseSignResult) {
|
if (0 < addPurchaseSignResult) {
|
||||||
return AjaxResult.success("会签成功");
|
return AjaxResult.success("会签成功");
|
||||||
|
|
@ -466,7 +466,13 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
return AjaxResult.error("会签失败!,插入0条数据");
|
return AjaxResult.error("会签失败!,插入0条数据");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 进行过会签,进行下一步校验
|
// 该任务进行过会签,进行下一步校验
|
||||||
|
|
||||||
|
// 首先判断本账户是否进行过会签,如果进行过 则禁止重复操作 -- 2025.1.23日经需求讨论关闭 by 阮世耀
|
||||||
|
//List<Long> thisIsSignRecord = purchaseSignRecordList.stream().map(PurchaseSignRecord::getUserId).filter(o -> o.equals(SecurityUtils.getUserId())).collect(Collectors.toList());
|
||||||
|
//if (!CollectionUtils.isEmpty(thisIsSignRecord)) {
|
||||||
|
// return AjaxResult.error("操作失败!您已进行过会签 无法重复操作!");
|
||||||
|
//}
|
||||||
|
|
||||||
// 查询需要进行会签的org_id集合
|
// 查询需要进行会签的org_id集合
|
||||||
List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo());
|
List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo());
|
||||||
|
|
|
||||||
|
|
@ -426,17 +426,17 @@ public class RepairServiceImpl implements RepairService {
|
||||||
// 准备业务逻辑数据
|
// 准备业务逻辑数据
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
// 配件集合
|
// 配件集合
|
||||||
List<RepairPartDetails> partList = new ArrayList<>();
|
List<RepairPartDetails> partList;
|
||||||
|
|
||||||
// 校验参数,过滤空数据
|
// 校验参数,过滤空数据
|
||||||
repairDeviceVOList.removeIf(Objects::isNull);
|
repairDeviceVOList.removeIf(Objects::isNull);
|
||||||
|
|
||||||
for (RepairDeviceVO bean : repairDeviceVOList) {
|
for (RepairDeviceVO bean : repairDeviceVOList) {
|
||||||
if (bean.getManageType() == null) {throw new ServiceException("请选择物资管理方式");}
|
if (null == bean.getManageType()) {throw new ServiceException("请选择物资管理方式");}
|
||||||
if (Objects.equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId(), bean.getManageType())) {
|
if (Objects.equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId(), bean.getManageType())) {
|
||||||
partList = bean.getNumberInRepairPartList();
|
partList = bean.getNumberInRepairPartList();
|
||||||
// 物资管理方式--编码管理
|
// 物资管理方式--编码管理
|
||||||
if (bean.getRepairType() == null) {continue;}
|
if (null == bean.getRepairType()) {continue;}
|
||||||
// 根据维修方式,更新维修数量、报废数量
|
// 根据维修方式,更新维修数量、报废数量
|
||||||
switch (bean.getRepairType()) {
|
switch (bean.getRepairType()) {
|
||||||
case INNER_REPAIR: {
|
case INNER_REPAIR: {
|
||||||
|
|
@ -462,6 +462,15 @@ public class RepairServiceImpl implements RepairService {
|
||||||
System.err.println("请输入正确的维修类型:" + bean.getRepairType());
|
System.err.println("请输入正确的维修类型:" + bean.getRepairType());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新维修人员信息
|
||||||
|
if (!CollectionUtils.isEmpty(bean.getRepairList())) {
|
||||||
|
RepairPartDetails repairPartDetails = bean.getRepairList().get(0);
|
||||||
|
bean.setRepairer(repairPartDetails.getRepairer());
|
||||||
|
bean.setRemark(repairPartDetails.getRemark());
|
||||||
|
repairMapper.updateRepairer(bean);
|
||||||
|
}
|
||||||
|
|
||||||
// 统一处理配件集合数据
|
// 统一处理配件集合数据
|
||||||
copeNumberManageInList(bean, partList, loginUser, bean.getManageType());
|
copeNumberManageInList(bean, partList, loginUser, bean.getManageType());
|
||||||
|
|
||||||
|
|
@ -577,7 +586,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
RepairApplyRecord repairApplyRecord = new RepairApplyRecord();
|
RepairApplyRecord repairApplyRecord = new RepairApplyRecord();
|
||||||
repairApplyRecord.setTaskId(bean.getTaskId()).setMaId(bean.getMaId()).setTypeId(bean.getTypeId())
|
repairApplyRecord.setTaskId(bean.getTaskId()).setMaId(bean.getMaId()).setTypeId(bean.getTypeId())
|
||||||
.setRepairType(RepairTypeEnum.TO_SCRAP.getTypeId()).setStatus(0L).setIsSlt(0L).setPartNum(0)
|
.setRepairType(RepairTypeEnum.TO_SCRAP.getTypeId()).setStatus(0L).setIsSlt(0L).setPartNum(0)
|
||||||
.setFileIds(fileInfo.getId() == null ? "" : String.valueOf(fileInfo.getId()))
|
.setFileIds(null == fileInfo.getId() ? "" : String.valueOf(fileInfo.getId()))
|
||||||
.setRepairNum(BigDecimal.valueOf(0)).setScrapNum(bean.getNumberScrapRepairPartList().get(0).getScrapNum())
|
.setRepairNum(BigDecimal.valueOf(0)).setScrapNum(bean.getNumberScrapRepairPartList().get(0).getScrapNum())
|
||||||
.setScrapReason(bean.getNumberScrapRepairPartList().get(0).getScrapReason())
|
.setScrapReason(bean.getNumberScrapRepairPartList().get(0).getScrapReason())
|
||||||
.setScrapType(bean.getNumberScrapRepairPartList().get(0).getScrapType())
|
.setScrapType(bean.getNumberScrapRepairPartList().get(0).getScrapType())
|
||||||
|
|
@ -703,8 +712,8 @@ public class RepairServiceImpl implements RepairService {
|
||||||
repairApplyRecord.setCreateBy(loginUser.getUsername());
|
repairApplyRecord.setCreateBy(loginUser.getUsername());
|
||||||
repairApplyRecord.setStatus(0L);
|
repairApplyRecord.setStatus(0L);
|
||||||
|
|
||||||
if ((partDetails.getId() != null || partDetails.getPartId() != null) && null != partDetails.getPartNum()) {
|
if ((null != partDetails.getId() || null != partDetails.getPartId()) && null != partDetails.getPartNum()) {
|
||||||
partDetails.setPartId(partDetails.getPartId() != null ? partDetails.getPartId() : partDetails.getId());
|
partDetails.setPartId(null != partDetails.getPartId() ? partDetails.getPartId() : partDetails.getId());
|
||||||
// 有维修配件时,如果价格为空,设置为0
|
// 有维修配件时,如果价格为空,设置为0
|
||||||
if (null == partDetails.getPartCost()) {partDetails.setPartCost(BigDecimal.ZERO);}
|
if (null == partDetails.getPartCost()) {partDetails.setPartCost(BigDecimal.ZERO);}
|
||||||
|
|
||||||
|
|
@ -729,7 +738,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
repairMapper.addRecord(repairApplyRecord);
|
repairMapper.addRecord(repairApplyRecord);
|
||||||
// 扣减个人库配件库存数量
|
// 扣减个人库配件库存数量
|
||||||
int res = repairMapper.updateStorageNum(partDetails);
|
int res = repairMapper.updateStorageNum(partDetails);
|
||||||
if (res == 0) {
|
if (0 == res) {
|
||||||
throw new ServiceException("个人配件库存不足");
|
throw new ServiceException("个人配件库存不足");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue