Merge branch 'master' of http://192.168.30.2:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
e1760ce857
|
|
@ -1591,6 +1591,12 @@ public class RepairServiceImpl implements RepairService {
|
|||
// 构建报废费用记录
|
||||
RepairApplyRecord scrapCostsRecord = buildScrapCostsRecord(repairDevice);
|
||||
|
||||
// SQL: 新增【报废费用记录表】
|
||||
int count = repairMapper.getCostCount(scrapCostsRecord);
|
||||
if (count==0){
|
||||
repairMapper.addRepairCost(scrapCostsRecord, repairDetails.getBuyPrice(), repairDevice.getCodeScrapRepairPartList().get(0).getScrapType());
|
||||
}
|
||||
|
||||
// 更新报废数量
|
||||
repairMapper.updateScrapNumAndStatus(repairDevice.getId(), BigDecimal.ONE, 1, loginUser.getUserid());
|
||||
|
||||
|
|
@ -1923,6 +1929,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
*/
|
||||
private void saveScrapFileAndRecord(RepairDeviceVO repairDevice, RepairPartDetails firstPart,
|
||||
BigDecimal scrapNum, BigDecimal scrapCosts, LoginUser loginUser) {
|
||||
RepairApplyRecord bean = new RepairApplyRecord();
|
||||
bean.setTaskId(repairDevice.getTaskId());
|
||||
int count = repairMapper.getCostCount(bean);
|
||||
if (CollectionUtil.isNotEmpty(firstPart.getFileList())) {
|
||||
for (BmFileInfo fileInfo : firstPart.getFileList()) {
|
||||
// 插入报废文件
|
||||
|
|
@ -1932,7 +1941,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
loginUser, String.valueOf(fileInfo.getId()));
|
||||
repairMapper.addRecord(repairApplyRecord);
|
||||
// 新增报废费用记录
|
||||
repairMapper.addRepairCost(repairApplyRecord, scrapCosts, repairApplyRecord.getScrapType());
|
||||
if (count==0){
|
||||
repairMapper.addRepairCost(repairApplyRecord, scrapCosts, repairApplyRecord.getScrapType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 构建并插入报废维修记录(无文件ID)
|
||||
|
|
@ -1940,7 +1951,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
loginUser, "");
|
||||
repairMapper.addRecord(repairApplyRecord);
|
||||
// 新增报废费用记录
|
||||
repairMapper.addRepairCost(repairApplyRecord, scrapCosts, repairApplyRecord.getScrapType());
|
||||
if (count==0){
|
||||
repairMapper.addRepairCost(repairApplyRecord, scrapCosts, repairApplyRecord.getScrapType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2048,9 +2061,17 @@ public class RepairServiceImpl implements RepairService {
|
|||
*/
|
||||
private void copeNumberManageInListNew(RepairDeviceVO bean, List<RepairPartDetails> partList, LoginUser loginUser, Integer manageType) {
|
||||
// 过滤无效数据(保留partId不为null的数据),生成新集合
|
||||
List<RepairPartDetails> validPartList = partList.stream()
|
||||
.filter(partDetails -> partDetails.getPartId() != null)
|
||||
.collect(Collectors.toList());
|
||||
List<RepairPartDetails> validPartList;
|
||||
if (bean.getRepairType() != null && bean.getRepairType() != 2) {
|
||||
validPartList = partList.stream()
|
||||
.filter(partDetails -> partDetails.getPartId() != null)
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
validPartList = partList.stream()
|
||||
.filter(partDetails -> partDetails.getPartName() != null && partDetails.getPartPrice() != null && partDetails.getPartNum() != null)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
// 替换原集合
|
||||
partList.clear();
|
||||
|
|
@ -2318,7 +2339,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairMapper.addRecord(repairApplyRecord);
|
||||
|
||||
// 统计并保存费用记录
|
||||
BigDecimal partCost = Optional.ofNullable(partDetails.getBackCost()).orElse(BigDecimal.ZERO);
|
||||
BigDecimal partCost = Optional.ofNullable(partDetails.getPartPrice()).orElse(BigDecimal.ZERO);
|
||||
saveRepairCostRecord(repairApplyRecord, partCost, partDetails.getPartType().toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -2347,7 +2368,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
.setRepairContent(partDetails.getRepairContent())
|
||||
.setSupplierId(partDetails.getSupplierId())
|
||||
.setPartNum(partDetails.getPartNum())
|
||||
.setPartPrice(Optional.ofNullable(partDetails.getBackCost()).orElse(BigDecimal.ZERO))
|
||||
.setPartPrice(Optional.ofNullable(partDetails.getPartPrice()).orElse(BigDecimal.ZERO))
|
||||
.setCreateBy(loginUser.getSysUser().getNickName());
|
||||
|
||||
// 设置维修/报废数量
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
WHERE
|
||||
pmc.type = 1 and
|
||||
( pmc.LEASE_MONEY > 0 OR pmc.LOST_MONEY > 0 OR pmc.REPAIR_MONEY > 0 OR pmc.SCRAP_MONEY > 0 )
|
||||
( pmc.LEASE_MONEY > 0 OR pmc.LOST_MONEY != 0 OR pmc.REPAIR_MONEY > 0 OR pmc.SCRAP_MONEY > 0 )
|
||||
<if test="pushStatus != null">
|
||||
AND a.pushStatus = #{pushStatus}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue