bug修复
This commit is contained in:
parent
d144384267
commit
bb3428c32f
|
|
@ -24,6 +24,8 @@ public interface RepairAuditDetailsMapper {
|
||||||
|
|
||||||
List<RepairPart> getPartDetailsByTaskId(RepairAuditDetails repairAuditDetails);
|
List<RepairPart> getPartDetailsByTaskId(RepairAuditDetails repairAuditDetails);
|
||||||
|
|
||||||
|
List<RepairPart> getPartRecordNum(RepairAuditDetails repairAuditDetails);
|
||||||
|
|
||||||
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -150,14 +150,15 @@ public class RepairServiceImpl implements RepairService {
|
||||||
.map(RepairDeviceVO::getScrapNum)
|
.map(RepairDeviceVO::getScrapNum)
|
||||||
.map(num -> Optional.ofNullable(num).orElse(BigDecimal.ZERO))
|
.map(num -> Optional.ofNullable(num).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
// BigDecimal typeCostSum = tempList.stream().map(RepairDeviceVO::getTotalCost).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
|
BigDecimal typeCostSum = tempList.stream().map(RepairDeviceVO::getTotalCost).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
vo.setRepairDeviceList(tempList)
|
vo.setRepairDeviceList(tempList)
|
||||||
.setIds(ids).setTypeRepairNum(repairNumSum).setTypeRepairedNum(repairedNumSum)
|
.setIds(ids).setTypeRepairNum(repairNumSum).setTypeRepairedNum(repairedNumSum)
|
||||||
.setTypeScrapNum(scrapNumSum).setTaskId(tempList.get(0).getTaskId())
|
.setTypeScrapNum(scrapNumSum).setTaskId(tempList.get(0).getTaskId())
|
||||||
.setCode(tempList.get(0).getCode()).setTypeName(tempList.get(0).getTypeName())
|
.setCode(tempList.get(0).getCode()).setTypeName(tempList.get(0).getTypeName())
|
||||||
.setTypeId(tempList.get(0).getTypeId()).setType(tempList.get(0).getType())
|
.setTypeId(tempList.get(0).getTypeId()).setType(tempList.get(0).getType())
|
||||||
.setUnitName(tempList.get(0).getUnitName()).setManageType(tempList.get(0).getManageType());
|
.setUnitName(tempList.get(0).getUnitName()).setManageType(tempList.get(0).getManageType())
|
||||||
// .setTypeCost(typeCostSum);
|
.setTypeCost(typeCostSum);
|
||||||
repairDeviceSummaryVoList.add(vo);
|
repairDeviceSummaryVoList.add(vo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -251,6 +252,10 @@ public class RepairServiceImpl implements RepairService {
|
||||||
|
|
||||||
List<RepairPart> repairPartList = repairAuditDetailsMapper.getPartDetailsByTaskId(new RepairAuditDetails().setTaskId(taskId));
|
List<RepairPart> repairPartList = repairAuditDetailsMapper.getPartDetailsByTaskId(new RepairAuditDetails().setTaskId(taskId));
|
||||||
repairPartList = mergePartsNum(repairPartList);
|
repairPartList = mergePartsNum(repairPartList);
|
||||||
|
List<RepairPart> repairPartList2 = repairAuditDetailsMapper.getPartRecordNum(new RepairAuditDetails().setTaskId(taskId));
|
||||||
|
if(!repairPartList2.isEmpty()){
|
||||||
|
repairPartList.addAll(repairPartList2);
|
||||||
|
}
|
||||||
RepairTicketVo result = new RepairTicketVo().setRepairTaskInfo(repairTaskInfo)
|
RepairTicketVo result = new RepairTicketVo().setRepairTaskInfo(repairTaskInfo)
|
||||||
.setRepairDeviceSummaryList(repairDeviceSummaryList)
|
.setRepairDeviceSummaryList(repairDeviceSummaryList)
|
||||||
.setRepairPartArray(Optional.of(repairPartList).orElse(Collections.emptyList()));
|
.setRepairPartArray(Optional.of(repairPartList).orElse(Collections.emptyList()));
|
||||||
|
|
@ -599,8 +604,10 @@ public class RepairServiceImpl implements RepairService {
|
||||||
// 新增【维修记录表】
|
// 新增【维修记录表】
|
||||||
repairMapper.addRecord(repairApplyRecord);
|
repairMapper.addRecord(repairApplyRecord);
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < partList.size(); i++) {
|
||||||
sfCosts = countPartCosts(partList, sfCosts);
|
sfCosts = sfCosts.add(partList.get(i).getPartPrice());
|
||||||
|
}
|
||||||
|
// sfCosts = countPartCosts(partList, sfCosts);
|
||||||
// TODO: 判断是否是收费配件,因数据存在多条,可能有些是免费配件 有些收费,所以这里用价格统一做处理,后续讨论
|
// TODO: 判断是否是收费配件,因数据存在多条,可能有些是免费配件 有些收费,所以这里用价格统一做处理,后续讨论
|
||||||
// SQL: 新增【维修费用记录表】
|
// SQL: 新增【维修费用记录表】
|
||||||
repairMapper.addRepairCost(repairApplyRecord, sfCosts, sfCosts.equals(BigDecimal.ZERO) ? "0" : "1");
|
repairMapper.addRepairCost(repairApplyRecord, sfCosts, sfCosts.equals(BigDecimal.ZERO) ? "0" : "1");
|
||||||
|
|
@ -869,7 +876,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
throw new ServiceException("请选择返厂厂家");
|
throw new ServiceException("请选择返厂厂家");
|
||||||
}
|
}
|
||||||
repairApplyRecord.setSupplierId(partList.get(0).getSupplierId());
|
repairApplyRecord.setSupplierId(partList.get(0).getSupplierId());
|
||||||
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(0).getPartPrice()).orElse(BigDecimal.ZERO));
|
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(0).getBackCost()).orElse(BigDecimal.ZERO));
|
||||||
// 新增【维修记录表】
|
// 新增【维修记录表】
|
||||||
repairMapper.addRecord(repairApplyRecord);
|
repairMapper.addRecord(repairApplyRecord);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -680,16 +680,22 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
// @RequiresPermissions("settlement:info:export")
|
// @RequiresPermissions("settlement:info:export")
|
||||||
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出丢失费用明细")
|
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出丢失费用明细")
|
||||||
@PostMapping("/exportLose")
|
@PostMapping("/exportLose")
|
||||||
public void exportLose(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) {
|
public void exportLose(HttpServletResponse response, @RequestParam("params") String params) {
|
||||||
try {
|
try {
|
||||||
String fileName = "丢失费用明细表";
|
String fileName = "丢失费用明细表";
|
||||||
String projectName = sltAgreementInfo.getProjectName();
|
List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
|
||||||
String unitName = sltAgreementInfo.getUnitName();
|
List<String> projectNames = new ArrayList<>();
|
||||||
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
List<String> unitNames = new ArrayList<>();
|
||||||
List<SltAgreementInfo> loseList = new ArrayList<>();
|
List<SltAgreementInfo> loseList = new ArrayList<>();
|
||||||
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLoseList(sltAgreementInfo);
|
projectNames.add(info.getProjectName());
|
||||||
|
unitNames.add(info.getUnitName());
|
||||||
|
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLoseList(info);
|
||||||
loseList.addAll(oneOfList);
|
loseList.addAll(oneOfList);
|
||||||
|
}
|
||||||
|
String projectName = handleData(projectNames);
|
||||||
|
String unitName = handleData(unitNames);
|
||||||
|
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
||||||
for (SltAgreementInfo bean : loseList) {
|
for (SltAgreementInfo bean : loseList) {
|
||||||
if (null == bean.getBuyPrice()) {
|
if (null == bean.getBuyPrice()) {
|
||||||
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
||||||
|
|
@ -722,25 +728,36 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
// @RequiresPermissions("settlement:info:export")
|
// @RequiresPermissions("settlement:info:export")
|
||||||
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修费用明细")
|
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修费用明细")
|
||||||
@PostMapping("/exportRepair")
|
@PostMapping("/exportRepair")
|
||||||
public void exportRepair(HttpServletResponse response,SltAgreementInfo sltAgreementInfo) {
|
public void exportRepair(HttpServletResponse response, @RequestParam("params") String params) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String fileName = "维修费用明细表";
|
String fileName = "维修费用明细表";
|
||||||
String projectName = sltAgreementInfo.getProjectName();
|
List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
|
||||||
String unitName = sltAgreementInfo.getUnitName();
|
List<String> projectNames = new ArrayList<>();
|
||||||
|
List<String> unitNames = new ArrayList<>();
|
||||||
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementInfo> repairList = new ArrayList<>();
|
List<SltAgreementInfo> repairList = new ArrayList<>();
|
||||||
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
List<TmTask> taskList = taskMapper.getTaskIdList(sltAgreementInfo);
|
projectNames.add(info.getProjectName());
|
||||||
|
unitNames.add(info.getUnitName());
|
||||||
|
List<TmTask> taskList = taskMapper.getTaskIdList(info);
|
||||||
if (null != taskList && !taskList.isEmpty()) {
|
if (null != taskList && !taskList.isEmpty()) {
|
||||||
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
|
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
|
||||||
repairList.addAll(repairDetailsList);
|
repairList.addAll(repairDetailsList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// List<TmTask> taskList = taskMapper.getTaskIdList(sltAgreementInfo);
|
||||||
|
// if (null != taskList && !taskList.isEmpty()) {
|
||||||
|
// List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
|
||||||
|
// repairList.addAll(repairDetailsList);
|
||||||
|
// }
|
||||||
for (SltAgreementInfo bean : repairList) {
|
for (SltAgreementInfo bean : repairList) {
|
||||||
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
||||||
totalCost = totalCost.add(bean.getCosts());
|
totalCost = totalCost.add(bean.getCosts());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String projectName = handleData(projectNames);
|
||||||
|
String unitName = handleData(unitNames);
|
||||||
List<SltLeaseInfo> repair = Convert.toList(SltLeaseInfo.class, repairList);
|
List<SltLeaseInfo> repair = Convert.toList(SltLeaseInfo.class, repairList);
|
||||||
expOutExcel(response,repair,fileName,projectName,unitName,totalCost,3);
|
expOutExcel(response,repair,fileName,projectName,unitName,totalCost,3);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -756,23 +773,37 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
// @RequiresPermissions("settlement:info:export")
|
// @RequiresPermissions("settlement:info:export")
|
||||||
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出减免费用明细")
|
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出减免费用明细")
|
||||||
@PostMapping("/exportReduction")
|
@PostMapping("/exportReduction")
|
||||||
public void exportReduction(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) {
|
public void exportReduction(HttpServletResponse response, @RequestParam("params") String params) {
|
||||||
try {
|
try {
|
||||||
String fileName = "减免费用明细表";
|
String fileName = "减免费用明细表";
|
||||||
String projectName = sltAgreementInfo.getProjectName();
|
List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
|
||||||
String unitName = sltAgreementInfo.getUnitName();
|
List<String> projectNames = new ArrayList<>();
|
||||||
|
List<String> unitNames = new ArrayList<>();
|
||||||
BigDecimal reductionCost = BigDecimal.valueOf(0.00);
|
BigDecimal reductionCost = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
||||||
if (sltAgreementInfo.getAgreementId() != null){
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
|
projectNames.add(info.getProjectName());
|
||||||
|
unitNames.add(info.getUnitName());
|
||||||
|
if (info.getAgreementId() != null){
|
||||||
SltAgreementReduce bean =new SltAgreementReduce();
|
SltAgreementReduce bean =new SltAgreementReduce();
|
||||||
bean.setAgreementId(sltAgreementInfo.getAgreementId());
|
bean.setAgreementId(info.getAgreementId());
|
||||||
reductionList = sltAgreementRecudceMapper.getReductionList(bean);
|
List<SltAgreementReduce> oneOfList = sltAgreementRecudceMapper.getReductionList(bean);
|
||||||
|
reductionList.addAll(oneOfList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// if (sltAgreementInfo.getAgreementId() != null){
|
||||||
|
// SltAgreementReduce bean =new SltAgreementReduce();
|
||||||
|
// bean.setAgreementId(sltAgreementInfo.getAgreementId());
|
||||||
|
// reductionList = sltAgreementRecudceMapper.getReductionList(bean);
|
||||||
|
// }
|
||||||
for (SltAgreementReduce reduction : reductionList) {
|
for (SltAgreementReduce reduction : reductionList) {
|
||||||
if(reduction.getLeaseMoney()!=null){
|
if(reduction.getLeaseMoney()!=null){
|
||||||
reductionCost = reductionCost.add(reduction.getLeaseMoney());
|
reductionCost = reductionCost.add(reduction.getLeaseMoney());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String projectName = handleData(projectNames);
|
||||||
|
String unitName = handleData(unitNames);
|
||||||
List<SltLeaseInfo> repair = Convert.toList(SltLeaseInfo.class, reductionList);
|
List<SltLeaseInfo> repair = Convert.toList(SltLeaseInfo.class, reductionList);
|
||||||
expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,5);
|
expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,5);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -788,24 +819,37 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
// @RequiresPermissions("settlement:info:export")
|
// @RequiresPermissions("settlement:info:export")
|
||||||
@SysLog(title = "报废信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出报废费用明细")
|
@SysLog(title = "报废信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出报废费用明细")
|
||||||
@PostMapping("/exportScrap")
|
@PostMapping("/exportScrap")
|
||||||
public void exportScrap(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) {
|
public void exportScrap(HttpServletResponse response, @RequestParam("params") String params) {
|
||||||
try {
|
try {
|
||||||
String fileName = "报废费用明细表";
|
String fileName = "报废费用明细表";
|
||||||
String projectName = sltAgreementInfo.getProjectName();
|
List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
|
||||||
String unitName = sltAgreementInfo.getUnitName();
|
List<String> projectNames = new ArrayList<>();
|
||||||
|
List<String> unitNames = new ArrayList<>();
|
||||||
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
BigDecimal totalCost = BigDecimal.valueOf(0.00);
|
||||||
|
|
||||||
List<SltAgreementInfo> scrapList = new ArrayList<>();
|
List<SltAgreementInfo> scrapList = new ArrayList<>();
|
||||||
List<TmTask> taskList = taskMapper.getTaskIdList(sltAgreementInfo);
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
|
projectNames.add(info.getProjectName());
|
||||||
|
unitNames.add(info.getUnitName());
|
||||||
|
List<TmTask> taskList = taskMapper.getTaskIdList(info);
|
||||||
if (null != taskList && !taskList.isEmpty()) {
|
if (null != taskList && !taskList.isEmpty()) {
|
||||||
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
|
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
|
||||||
scrapList.addAll(scrapDetailsList);
|
scrapList.addAll(scrapDetailsList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List<TmTask> taskList = taskMapper.getTaskIdList(sltAgreementInfo);
|
||||||
|
// if (null != taskList && !taskList.isEmpty()) {
|
||||||
|
// List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
|
||||||
|
// scrapList.addAll(scrapDetailsList);
|
||||||
|
// }
|
||||||
for (SltAgreementInfo bean : scrapList) {
|
for (SltAgreementInfo bean : scrapList) {
|
||||||
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
||||||
totalCost = totalCost.add(bean.getCosts());
|
totalCost = totalCost.add(bean.getCosts());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String projectName = handleData(projectNames);
|
||||||
|
String unitName = handleData(unitNames);
|
||||||
List<SltLeaseInfo> scrap = Convert.toList(SltLeaseInfo.class, scrapList);
|
List<SltLeaseInfo> scrap = Convert.toList(SltLeaseInfo.class, scrapList);
|
||||||
expOutExcel(response,scrap,fileName,projectName,unitName,totalCost,4);
|
expOutExcel(response,scrap,fileName,projectName,unitName,totalCost,4);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -948,17 +992,24 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@SysLog(title = "结算记录查询", businessType = OperaType.EXPORT, logType = 1,module = "结算记录查询->导出全部结算费用明细")
|
@SysLog(title = "结算记录查询", businessType = OperaType.EXPORT, logType = 1,module = "结算记录查询->导出全部结算费用明细")
|
||||||
@PostMapping("/exportAlls")
|
@PostMapping("/exportAlls")
|
||||||
public void exportAlls(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) {
|
public void exportAlls(HttpServletResponse response, @RequestParam("params") String params) {
|
||||||
try {
|
try {
|
||||||
String fileName = "结算费用明细";
|
String fileName = "结算费用明细";
|
||||||
String projectName = sltAgreementInfo.getProjectName();
|
List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
|
||||||
String unitName = sltAgreementInfo.getUnitName();
|
List<String> projectNames = new ArrayList<>();
|
||||||
|
List<String> unitNames = new ArrayList<>();
|
||||||
|
// String projectName = sltAgreementInfo.getProjectName();
|
||||||
|
// String unitName = sltAgreementInfo.getUnitName();
|
||||||
|
|
||||||
//租赁费用明细
|
//租赁费用明细
|
||||||
BigDecimal totalCostLease = BigDecimal.valueOf(0.00);
|
BigDecimal totalCostLease = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementInfo> leaseList = new ArrayList<>();
|
List<SltAgreementInfo> leaseList = new ArrayList<>();
|
||||||
List<SltAgreementInfo> oneOfListLease = sltAgreementInfoMapper.getLeaseList(sltAgreementInfo);
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
leaseList.addAll(oneOfListLease);
|
projectNames.add(info.getProjectName());
|
||||||
|
unitNames.add(info.getUnitName());
|
||||||
|
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLeaseList(info);
|
||||||
|
leaseList.addAll(oneOfList);
|
||||||
|
}
|
||||||
for (SltAgreementInfo bean : leaseList) {
|
for (SltAgreementInfo bean : leaseList) {
|
||||||
if (null == bean.getLeasePrice()) {
|
if (null == bean.getLeasePrice()) {
|
||||||
bean.setLeasePrice(BigDecimal.valueOf(0.00));
|
bean.setLeasePrice(BigDecimal.valueOf(0.00));
|
||||||
|
|
@ -984,8 +1035,11 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
BigDecimal totalCostLose = BigDecimal.valueOf(0.00);
|
BigDecimal totalCostLose = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementInfo> loseList = new ArrayList<>();
|
List<SltAgreementInfo> loseList = new ArrayList<>();
|
||||||
|
|
||||||
List<SltAgreementInfo> oneOfListLose = sltAgreementInfoMapper.getLoseList(sltAgreementInfo);
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
loseList.addAll(oneOfListLose);
|
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLoseList(info);
|
||||||
|
loseList.addAll(oneOfList);
|
||||||
|
}
|
||||||
|
|
||||||
for (SltAgreementInfo bean : loseList) {
|
for (SltAgreementInfo bean : loseList) {
|
||||||
if (null == bean.getBuyPrice()) {
|
if (null == bean.getBuyPrice()) {
|
||||||
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
||||||
|
|
@ -1008,11 +1062,14 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
//维修费用明细
|
//维修费用明细
|
||||||
BigDecimal totalCostRepair = BigDecimal.valueOf(0.00);
|
BigDecimal totalCostRepair = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementInfo> repairList = new ArrayList<>();
|
List<SltAgreementInfo> repairList = new ArrayList<>();
|
||||||
List<TmTask> taskListRepair = taskMapper.getTaskIdList(sltAgreementInfo);
|
|
||||||
if (null != taskListRepair && !taskListRepair.isEmpty()) {
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskListRepair);
|
List<TmTask> taskList = taskMapper.getTaskIdList(info);
|
||||||
|
if (null != taskList && !taskList.isEmpty()) {
|
||||||
|
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
|
||||||
repairList.addAll(repairDetailsList);
|
repairList.addAll(repairDetailsList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (SltAgreementInfo bean : repairList) {
|
for (SltAgreementInfo bean : repairList) {
|
||||||
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
||||||
totalCostRepair = totalCostRepair.add(bean.getCosts());
|
totalCostRepair = totalCostRepair.add(bean.getCosts());
|
||||||
|
|
@ -1023,11 +1080,14 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
//报废费用明细
|
//报废费用明细
|
||||||
BigDecimal totalCostScrap = BigDecimal.valueOf(0.00);
|
BigDecimal totalCostScrap = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementInfo> scrapList = new ArrayList<>();
|
List<SltAgreementInfo> scrapList = new ArrayList<>();
|
||||||
List<TmTask> taskListScrap = taskMapper.getTaskIdList(sltAgreementInfo);
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
if (null != taskListScrap && !taskListScrap.isEmpty()) {
|
List<TmTask> taskList = taskMapper.getTaskIdList(info);
|
||||||
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskListScrap);
|
if (null != taskList && !taskList.isEmpty()) {
|
||||||
|
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
|
||||||
scrapList.addAll(scrapDetailsList);
|
scrapList.addAll(scrapDetailsList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (SltAgreementInfo bean : scrapList) {
|
for (SltAgreementInfo bean : scrapList) {
|
||||||
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) {
|
||||||
totalCostScrap = totalCostScrap.add(bean.getCosts());
|
totalCostScrap = totalCostScrap.add(bean.getCosts());
|
||||||
|
|
@ -1038,18 +1098,34 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
//减免费用明细
|
//减免费用明细
|
||||||
BigDecimal totalCostReduction = BigDecimal.valueOf(0.00);
|
BigDecimal totalCostReduction = BigDecimal.valueOf(0.00);
|
||||||
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
||||||
if (sltAgreementInfo.getAgreementId()!=null){
|
// if (sltAgreementInfo.getAgreementId()!=null){
|
||||||
|
// SltAgreementReduce bean =new SltAgreementReduce();
|
||||||
|
// bean.setAgreementId(sltAgreementInfo.getAgreementId());
|
||||||
|
// reductionList = sltAgreementRecudceMapper.getReductionList(bean);
|
||||||
|
// for (SltAgreementReduce reduction : reductionList){
|
||||||
|
// if(reduction.getLeaseMoney()!=null){
|
||||||
|
// totalCostReduction = totalCostReduction.add(reduction.getLeaseMoney());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
for (SltAgreementInfo info : sltAgreementInfo) {
|
||||||
|
if (info.getAgreementId() != null){
|
||||||
SltAgreementReduce bean =new SltAgreementReduce();
|
SltAgreementReduce bean =new SltAgreementReduce();
|
||||||
bean.setAgreementId(sltAgreementInfo.getAgreementId());
|
bean.setAgreementId(info.getAgreementId());
|
||||||
reductionList = sltAgreementRecudceMapper.getReductionList(bean);
|
List<SltAgreementReduce> oneOfList = sltAgreementRecudceMapper.getReductionList(bean);
|
||||||
|
reductionList.addAll(oneOfList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
for (SltAgreementReduce reduction : reductionList) {
|
for (SltAgreementReduce reduction : reductionList) {
|
||||||
if(reduction.getLeaseMoney()!=null){
|
if(reduction.getLeaseMoney()!=null){
|
||||||
totalCostReduction = totalCostReduction.add(reduction.getLeaseMoney());
|
totalCostReduction = totalCostReduction.add(reduction.getLeaseMoney());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
List<SltLeaseInfo> reduction = Convert.toList(SltLeaseInfo.class, reductionList);
|
List<SltLeaseInfo> reduction = Convert.toList(SltLeaseInfo.class, reductionList);
|
||||||
|
String projectName = handleData(projectNames);
|
||||||
|
String unitName = handleData(unitNames);
|
||||||
expOutExcelAlls(response,lease,lose,repair,scrap,reduction,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction);
|
expOutExcelAlls(response,lease,lose,repair,scrap,reduction,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
|
|
|
||||||
|
|
@ -523,13 +523,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select
|
select
|
||||||
mpt.pa_name as partName,
|
mpt.pa_name as partName,
|
||||||
rpd.part_num as partNum,
|
rpd.part_num as partNum,
|
||||||
rpd.part_cost as partPrice,
|
mpt.buy_price as partPrice,
|
||||||
rpd.part_type as partType,
|
rpd.part_type as partType,
|
||||||
rpd.type_id as typeId,
|
rpd.type_id as typeId,
|
||||||
mt.type_name as typeName,
|
mt.type_name as typeName,
|
||||||
mt1.type_name as maTypeName,
|
mt1.type_name as maTypeName,
|
||||||
rpd.remark as remark,
|
rpd.remark as remark,
|
||||||
rpd.repair_content as repairContent
|
rpd.repair_content as repairContent,
|
||||||
|
ROUND(IFNULL(rpd.part_num, 0) * IFNULL(mpt.buy_price, 0), 2) as partCost
|
||||||
from
|
from
|
||||||
repair_part_details rpd
|
repair_part_details rpd
|
||||||
left join ma_part_type mpt on mpt.pa_id = rpd.part_id
|
left join ma_part_type mpt on mpt.pa_id = rpd.part_id
|
||||||
|
|
@ -548,6 +549,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getPartRecordNum" resultType="com.bonus.material.repair.domain.RepairPart">
|
||||||
|
select
|
||||||
|
rar.part_name as partName,
|
||||||
|
rar.part_num as partNum,
|
||||||
|
0 as partPrice,
|
||||||
|
rar.part_price as partCost,
|
||||||
|
rar.type_id as typeId,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
mt1.type_name as maTypeName
|
||||||
|
from repair_apply_record rar
|
||||||
|
left join ma_type mt on rar.type_id = mt.type_id and mt.del_flag = 0
|
||||||
|
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = 0
|
||||||
|
|
||||||
|
where rar.part_type = 1 and rar.part_id is null
|
||||||
|
<if test="taskId != null and taskId != ''">
|
||||||
|
and rar.task_id = #{taskId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getDetailsList" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
<select id="getDetailsList" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||||
SELECT
|
SELECT
|
||||||
mt1.type_name as typeName,
|
mt1.type_name as typeName,
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,7 @@
|
||||||
rad.create_time,
|
rad.create_time,
|
||||||
bai.CODE AS backCode,
|
bai.CODE AS backCode,
|
||||||
( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords,
|
( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords,
|
||||||
( SELECT SUM( IFNULL( rc.costs, 0 )) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost
|
( SELECT COALESCE(SUM(rc.costs), 0) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost
|
||||||
from
|
from
|
||||||
repair_apply_details rad
|
repair_apply_details rad
|
||||||
left join ma_type mt on rad.type_id = mt.type_id
|
left join ma_type mt on rad.type_id = mt.type_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue