This commit is contained in:
parent
cf4ea24379
commit
62bfb600d4
|
|
@ -1163,6 +1163,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
} else if (dto != null && dto.getBackApplyInfo() != null && dto.getBackApplyInfo().getId() != null
|
} else if (dto != null && dto.getBackApplyInfo() != null && dto.getBackApplyInfo().getId() != null
|
||||||
&& ((dto.getBackApplyDetails() != null) || CollectionUtils.isNotEmpty(dto.getBackApplyDetailsList()))) {
|
&& ((dto.getBackApplyDetails() != null) || CollectionUtils.isNotEmpty(dto.getBackApplyDetailsList()))) {
|
||||||
if (dto.getBackApplyDetails() != null) {
|
if (dto.getBackApplyDetails() != null) {
|
||||||
|
//编码退料入库
|
||||||
dto.getBackApplyInfo().setTypeId(String.valueOf(dto.getBackApplyDetails().getTypeId()));
|
dto.getBackApplyInfo().setTypeId(String.valueOf(dto.getBackApplyDetails().getTypeId()));
|
||||||
result = getResultMaCode(dto, result);
|
result = getResultMaCode(dto, result);
|
||||||
}
|
}
|
||||||
|
|
@ -1335,44 +1336,30 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
}
|
}
|
||||||
// 设置公共字段
|
// 设置公共字段
|
||||||
setCommonFields(details, dto.getBackApplyInfo().getId());
|
setCommonFields(details, dto.getBackApplyInfo().getId());
|
||||||
// 插入 CheckDetails
|
|
||||||
//根据id查询back_check_details表,看数据是否存在,存在则对数量进行更新,不存在则插入
|
//根据id查询back_check_details表,看数据是否存在,存在则对数量进行更新,不存在则插入
|
||||||
for(MaCodeDto maCodeDto : details.getMaVos()){
|
for(MaCodeDto maCodeDto : details.getMaVos()){
|
||||||
BackApplyDetails backInfo = new BackApplyDetails();
|
details.setPreNum(BigDecimal.ONE);
|
||||||
backInfo = details;
|
details.setMaId(maCodeDto.getMaId());
|
||||||
backInfo.setMaId(maCodeDto.getMaId());
|
// 如果details.getGoodNum()大于0
|
||||||
backInfo.setMaCode(maCodeDto.getMaCode());
|
if (details.getGoodNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
BackApplyDetails checkDetails = backApplyInfoMapper.selectCheckDetails(details);
|
details.setGoodNum(BigDecimal.ONE);
|
||||||
if (checkDetails != null) {
|
details.setBadNum(BigDecimal.ZERO);
|
||||||
checkDetails.setId(checkDetails.getId());
|
|
||||||
result += backApplyInfoMapper.updateCheck(checkDetails);
|
|
||||||
} else {
|
} else {
|
||||||
result += backApplyInfoMapper.insertCheckDetails(details);
|
details.setGoodNum(BigDecimal.ZERO);
|
||||||
|
details.setBadNum(BigDecimal.ONE);
|
||||||
}
|
}
|
||||||
|
result += backApplyInfoMapper.insertCheckDetails(details);
|
||||||
if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
||||||
for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
||||||
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||||
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
bmFileInfo.setTaskId(details.getId());
|
bmFileInfo.setTaskId(details.getId());
|
||||||
bmFileInfo.setTaskType(3);
|
bmFileInfo.setTaskType(3);
|
||||||
bmFileInfo.setModelId(backInfo.getMaId());
|
bmFileInfo.setModelId(maCodeDto.getMaId());
|
||||||
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新ma_machine表状态为3(退料检修)
|
|
||||||
// result += machineMapper.updateStatus(details.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus());
|
|
||||||
// if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
|
||||||
// for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
|
||||||
// bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
||||||
// bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
|
||||||
// bmFileInfo.setTaskId(details.getId());
|
|
||||||
// bmFileInfo.setTaskType(3);
|
|
||||||
// bmFileInfo.setModelId(details.getMaId());
|
|
||||||
// result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateDetails">
|
<update id="updateDetails">
|
||||||
update back_apply_details set pre_num = pre_num + COALESCE(#{preNum} ,0) where id = #{id}
|
update back_apply_details set pre_num = pre_num + COALESCE(#{preNum} ,0) ,
|
||||||
|
audit_num = audit_num + COALESCE(#{preNum} ,0)
|
||||||
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateCheck">
|
<update id="updateCheck">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue