diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java index 55a37bdc..0b1f9e29 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java @@ -82,10 +82,10 @@ public class RepairServiceImpl implements RepairService { List partList = bean.getPartList(); BigDecimal sfCosts = new BigDecimal("0"); BigDecimal bsfCosts = new BigDecimal("0"); - String nbType = "1"; - String fcType = "2"; - String sfPart = "1"; - String bsfPart = "0"; + String nbType = "1"; // 内部维修 + String fcType = "2"; //返厂维修 + String sfPart = "1"; //收费 + String bsfPart = "0"; // 不收费 if (partList != null && partList.size() > 0) { bean.setRepairNum(partList.get(0).getRepairNum()); bean.setRepairer(partList.get(0).getRepairer()); @@ -134,6 +134,10 @@ public class RepairServiceImpl implements RepairService { partDetails.setCreateBy(loginUser.getUserid()); partDetails.setCompanyId(bean.getCompanyId()); mapper.addPart(partDetails); + bean.setPartPrice(partDetails.getPartCost()); + bean.setPartNum(partDetails.getPartNum()); + bean.setRepairContent(partDetails.getRepairContent()); + bean.setPartType(partDetails.getPartType()); } } } @@ -146,11 +150,7 @@ public class RepairServiceImpl implements RepairService { } else { bean.setSupplierId(partList.get(0).getSupplierId()); } - if (bean.getPartPrice() == null || bean.getPartPrice().isEmpty()) { - bean.setPartPrice("0"); - } else { - bean.setPartPrice(partList.get(0).getPartPrice()); - } + bean.setPartPrice(partList.get(0).getPartPrice()); bean.setPartNum(partList.get(0).getPartNum()); } for (RepairPartDetails partDetails : partList) { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java index 398d3f4d..c16e4aa9 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java @@ -61,10 +61,9 @@ public class SltAgreementInfoController extends BaseController { */ @Log(title = "租赁明细导出", businessType = BusinessType.EXPORT) @PostMapping("/exportLease") - public void exportLease(HttpServletResponse response,@RequestBody List list) - { + public void exportLease(HttpServletResponse response, @RequestBody List list) { List explist = sltAgreementInfoService.getLeaseList(list); - List leaseInfoList = Convert.toList(LeaseInfo.class,explist); + List leaseInfoList = Convert.toList(LeaseInfo.class, explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); util.exportExcel(response, leaseInfoList, "租赁明细导出"); } @@ -74,10 +73,9 @@ public class SltAgreementInfoController extends BaseController { */ @Log(title = "丢失明细导出", businessType = BusinessType.EXPORT) @PostMapping("/exportLose") - public void exportLose(HttpServletResponse response,@RequestBody List list) - { + public void exportLose(HttpServletResponse response, @RequestBody List list) { List explist = sltAgreementInfoService.getLoseList(list); - List leaseInfoList = Convert.toList(LoseInfo.class,explist); + List leaseInfoList = Convert.toList(LoseInfo.class, explist); ExcelUtil util = new ExcelUtil(LoseInfo.class); util.exportExcel(response, leaseInfoList, "丢失明细导出"); } @@ -87,10 +85,9 @@ public class SltAgreementInfoController extends BaseController { */ @Log(title = "维修明细导出", businessType = BusinessType.EXPORT) @PostMapping("/exportRepair") - public void exportRepair(HttpServletResponse response,@RequestBody List list) - { + public void exportRepair(HttpServletResponse response, @RequestBody List list) { List explist = sltAgreementInfoService.getRepairList(list); - List leaseInfoList = Convert.toList(LeaseInfo.class,explist); + List leaseInfoList = Convert.toList(LeaseInfo.class, explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); util.exportExcel(response, leaseInfoList, "维修明细导出"); } @@ -100,10 +97,9 @@ public class SltAgreementInfoController extends BaseController { */ @Log(title = "报废明细导出", businessType = BusinessType.EXPORT) @PostMapping("/exportScrap") - public void exportScrap(HttpServletResponse response,@RequestBody List list) - { + public void exportScrap(HttpServletResponse response, @RequestBody List list) { List explist = sltAgreementInfoService.getScrapList(list); - List leaseInfoList = Convert.toList(ScrapInfo.class,explist); + List leaseInfoList = Convert.toList(ScrapInfo.class, explist); ExcelUtil util = new ExcelUtil(ScrapInfo.class); util.exportExcel(response, leaseInfoList, "维修明细导出"); } @@ -113,8 +109,10 @@ public class SltAgreementInfoController extends BaseController { */ @ApiOperation(value = "费用结算提交") @PostMapping("/submitFee") - public AjaxResult submitFee(@RequestBody SltAgreementApply apply) - { + public AjaxResult submitFee(@RequestBody SltAgreementApply apply) { + if (apply.getRelations().get(0).getAgreementId() == null) { + return AjaxResult.error("该协议还未领取机具"); + } return sltAgreementInfoService.submitFee(apply); } @@ -123,8 +121,7 @@ public class SltAgreementInfoController extends BaseController { */ @ApiOperation(value = "获取结算审核列表") @GetMapping("/getSltExam") - public TableDataInfo getSltExam(AgreementInfo bean) - { + public TableDataInfo getSltExam(AgreementInfo bean) { startPage(); List list = sltAgreementInfoService.getSltExam(bean); return getDataTable(list); @@ -135,8 +132,7 @@ public class SltAgreementInfoController extends BaseController { */ @ApiOperation(value = "获取结算审核清单") @GetMapping("/getSltExamInfo") - public AjaxResult getSltExamInfo(SltAgreementApply apply) - { + public AjaxResult getSltExamInfo(SltAgreementApply apply) { SltInfoVo bean = sltAgreementInfoService.getSltExamInfo(apply); return AjaxResult.success(bean); } @@ -146,11 +142,9 @@ public class SltAgreementInfoController extends BaseController { */ @ApiOperation(value = "结算审核") @GetMapping("/settlementReview") - public AjaxResult settlementReview(SltAgreementApply apply) - { + public AjaxResult settlementReview(SltAgreementApply apply) { return toAjax(sltAgreementInfoService.settlementReview(apply)); } - } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index ff21a0c2..5e923164 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -117,10 +117,6 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { List relations = new ArrayList<>(); for (AgreementInfo info : list){ SltAgreementRelation relation = new SltAgreementRelation(); - /*BigDecimal loseCost = new BigDecimal("0"); - BigDecimal leaseCost = new BigDecimal("0"); - BigDecimal scrapCost = new BigDecimal("0"); - BigDecimal repairCost = new BigDecimal("0");*/ BigDecimal loseCost = BigDecimal.ZERO; BigDecimal leaseCost = BigDecimal.ZERO; BigDecimal scrapCost = BigDecimal.ZERO; @@ -344,15 +340,6 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); bean.setCosts(String.valueOf(costs)); - /* BigDecimal costs = BigDecimal.ZERO; - //当单价,数量,租赁天数都不为空时计算总价 - if(bean.getLeasePrice() != null && bean.getNum() != null && bean.getLeaseDays() != null){ - BigDecimal leasePrice = new BigDecimal(bean.getLeasePrice()); - BigDecimal num = new BigDecimal(bean.getNum()); - BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); - costs = leasePrice.multiply(num).multiply(leaseDays); - } - bean.setCosts(String.valueOf(costs));*/ } return leaseList; } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml index d31d3297..5e807611 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml @@ -184,13 +184,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt1.type_name as typeName, mt.type_name as modelName, mt.unit_name as nuitName, - sum(rc.repair_num) as num, - sum(rc.costs) as costs, + sum(rc.repair_num ) as num, + sum(rc.costs * rc.repair_num) as costs, case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType, - rc.status as repairStatus, + sd.name as repairStatus, rc.company_id as companyId from repair_cost rc - left join tm_task_agreement tta on rc.task_id = tta.task_id + LEFT JOIN tm_task_agreement tta on rc.task_id = tta.task_id + LEFT JOIN tm_task tt on rc.task_id = tt.task_id + LEFT JOIN sys_dic sd on sd.id = tt.task_status LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id