From 98f6d4201007ac5f283db1174c81230ece970851 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 30 Jul 2024 17:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/api/domain/SltAgreementInfo.java | 5 ++- .../base/api/domain/SltAgreementRelation.java | 12 ++--- .../SltAgreementInfoController.java | 45 ++++++++++++++++--- .../bonus/sgzb/material/domain/LeaseInfo.java | 27 ++++++++--- .../bonus/sgzb/material/domain/LoseInfo.java | 14 +++--- .../mapper/SltAgreementInfoMapper.java | 2 + .../service/SltAgreementInfoService.java | 1 + .../impl/SltAgreementInfoServiceImpl.java | 32 ++++++++++--- .../material/SltAgreementInfoMapper.xml | 24 +++++++++- sgzb-ui/src/views/system/user/index.vue | 4 +- 10 files changed, 132 insertions(+), 34 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java index 98cfbd6e..63692b90 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementInfo.java @@ -136,6 +136,9 @@ public class SltAgreementInfo { * 实际结算天数 */ private BigDecimal realDays; - + /** + * 是否结算(0 未结算 1已结算) + */ + private String isSlt; } diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementRelation.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementRelation.java index a00a6316..c9ee9fd9 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementRelation.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/SltAgreementRelation.java @@ -43,11 +43,13 @@ public class SltAgreementRelation { */ private String status; - String loseCost; - String leaseCostOne; - String leaseCostThree; - String scrapCost; - String repairCost; + private String loseCost; + private String leaseCostOne; + private String leaseCostThree; + private String scrapCost; + private String repairCost; + private String isSltOne; + private String isSltThree; /** * 项目名称 */ 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 7b3278aa..395488c6 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 @@ -56,14 +56,24 @@ public class SltAgreementInfoController extends BaseController { return AjaxResult.success(bean); } + /** + * 根据协议获取完工结算清单 + */ + @ApiOperation(value = "根据协议获取结算清单") + @PostMapping("/getSltInfoMonth") + public AjaxResult getSltInfoMonth(@RequestBody List list) { + SltInfoVo bean = sltAgreementInfoService.getSltInfo(list); + return AjaxResult.success(bean); + } + /** * 调整天数 */ - @ApiOperation(value = "调整天数") + @ApiOperation(value = "调整天数和日期") @PostMapping("/updateTrimDay") public AjaxResult updateTrimDay(@RequestBody List sltAgreementInfo) { int bean = sltAgreementInfoService.updateTrimDay(sltAgreementInfo); - if (bean == 0){ + if (bean == 0) { return AjaxResult.error("修改失败"); } return AjaxResult.success("修改成功"); @@ -73,9 +83,21 @@ public class SltAgreementInfoController extends BaseController { * 租赁明细导出 */ @Log(title = "租赁明细导出", businessType = BusinessType.EXPORT) - @PostMapping("/exportLease") - public void exportLease(HttpServletResponse response, @RequestBody List list) { - List explist = sltAgreementInfoService.getLeaseList(list); + @PostMapping("/exportLeaseOne") + public void exportLeaseOne(HttpServletResponse response, @RequestBody List list) { + List explist = sltAgreementInfoService.getLeaseListOne(list); + List leaseInfoList = Convert.toList(LeaseInfo.class, explist); + ExcelUtil util = new ExcelUtil(LeaseInfo.class); + util.exportExcel(response, leaseInfoList, "租赁明细导出"); + } + + /** + * 租赁明细导出 + */ + @Log(title = "租赁明细导出", businessType = BusinessType.EXPORT) + @PostMapping("/exportLeaseThree") + public void exportLeaseThree(HttpServletResponse response, @RequestBody List list) { + List explist = sltAgreementInfoService.getLeaseListThree(list); List leaseInfoList = Convert.toList(LeaseInfo.class, explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); util.exportExcel(response, leaseInfoList, "租赁明细导出"); @@ -98,7 +120,7 @@ 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, List list) { List explist = sltAgreementInfoService.getRepairList(list); List leaseInfoList = Convert.toList(LeaseInfo.class, explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); @@ -110,7 +132,7 @@ 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, List list) { List explist = sltAgreementInfoService.getScrapList(list); List leaseInfoList = Convert.toList(ScrapInfo.class, explist); ExcelUtil util = new ExcelUtil(ScrapInfo.class); @@ -126,6 +148,15 @@ public class SltAgreementInfoController extends BaseController { return sltAgreementInfoService.submitFee(apply); } + /** + * 费用结算提交 + */ + @ApiOperation(value = "费用结算提交-承担方") + @PostMapping("/submitFeeBear") + public AjaxResult submitFeeBear(@RequestBody SltAgreementInfo apply) { + return sltAgreementInfoService.submitFeeOne(apply); + } + /** * 获取结算审核列表 */ diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseInfo.java index 41ae2dd7..a4dddf20 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseInfo.java @@ -75,22 +75,22 @@ public class LeaseInfo { /** *租赁单价 */ - @Excel(name = "租赁单价") + @Excel(name = "台班费单价(元/天)") private String leasePrice; /** *领料数量 */ - @Excel(name = "租赁数量") + @Excel(name = "数量") private String num; /** *领料时间 */ - @Excel(name = "租赁日期") + @Excel(name = "起租日期") private String startTime; /** *退料时间 */ - @Excel(name = "归还日期") + @Excel(name = "终止日期") private String endTime; /** * 租赁天数 @@ -98,10 +98,25 @@ public class LeaseInfo { @Excel(name = "租赁天数") private String leaseDays; /** - * 租赁费用 + * 实际结算天数 */ - @Excel(name = "外部租赁费用") + @Excel(name = "实际结算天数") + private String realDays; + /** + * 应结算金额 + */ + @Excel(name = "应结算金额(元)") private String costs; + /** + * 实际结算金额 + */ + @Excel(name = "实际结算金额(元)") + private String realCosts; + /** + * 实际结算金额 + */ + @Excel(name = "调整天数") + private String trimDay; /** * 类型(0不收费,1收费) */ diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LoseInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LoseInfo.java index 10c44c88..94544054 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LoseInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LoseInfo.java @@ -41,6 +41,7 @@ public class LoseInfo { /** *原值 */ + @Excel(name = "赔偿单价") private String buyPrice; /** * @@ -49,12 +50,10 @@ public class LoseInfo { /** * 项目名称 */ - @Excel(name = "结算单位名称") private String unitName; /** * 工程名称 */ - @Excel(name = "结算工程名称") private String projectName; /** * 设备名称 @@ -66,10 +65,15 @@ public class LoseInfo { */ @Excel(name = "规格型号") private String modelName; + /** + * 设备编码 + */ + @Excel(name = "设备编码") + private String maCode; /** * 计量单位 */ - @Excel(name = "计量单位") + @Excel(name = "单位") private String nuitName; /** *租赁单价 @@ -78,7 +82,7 @@ public class LoseInfo { /** *领料数量 */ - @Excel(name = "丢失数量") + @Excel(name = "未还数量") private String num; /** *领料时间 @@ -95,7 +99,7 @@ public class LoseInfo { /** * 租赁费用 */ - @Excel(name = "丢失费用") + @Excel(name = "赔偿金额") private String costs; /** * 类型(0不收费,1收费) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java index 037e04f6..d66d39aa 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java @@ -54,4 +54,6 @@ public interface SltAgreementInfoMapper { int updateMaStatus(SltAgreementInfo agreementInfo); int updateTrimDay(SltAgreementInfo sltAgreementInfo); + + int updateInfoOneStatus(SltAgreementInfo apply); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java index 986b4381..3477d3c5 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java @@ -19,6 +19,7 @@ public interface SltAgreementInfoService { SltInfoVo getSltInfo(List list); AjaxResult submitFee(SltAgreementApply apply); + AjaxResult submitFeeOne(SltAgreementInfo apply); List getSltExam(AgreementInfo bean); 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 76b829b1..7e57f452 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 @@ -192,10 +192,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 leaseCostOne = BigDecimal.ZERO; BigDecimal leaseCostThree = BigDecimal.ZERO; @@ -207,7 +203,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { relation.setProjectName(lease.getProjectName()); relation.setUnitName(lease.getUnitName()); relation.setCompanyId(lease.getCompanyId()); - BigDecimal cost = new BigDecimal(lease.getCosts()); + BigDecimal cost = new BigDecimal(lease.getRealCosts()); leaseCostOne = leaseCostOne.add(cost); } } @@ -217,7 +213,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { relation.setProjectName(lease.getProjectName()); relation.setUnitName(lease.getUnitName()); relation.setCompanyId(lease.getCompanyId()); - BigDecimal cost = new BigDecimal(lease.getCosts()); + BigDecimal cost = new BigDecimal(lease.getRealCosts()); leaseCostThree = leaseCostThree.add(cost); } } @@ -244,6 +240,20 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { loseCost = loseCost.add(cost); } } + // 判断是否已经结算(01承担方) + boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt())); + if (b) { + relation.setIsSltOne("1"); + } else { + relation.setIsSltOne("0"); + } + // 判断是否已经结算(03承担方) + boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt())); + if (f) { + relation.setIsSltThree("1"); + } else { + relation.setIsSltThree("0"); + } relation.setLeaseCostOne(leaseCostOne.toString()); relation.setLeaseCostThree(leaseCostThree.toString()); relation.setRepairCost(repairCost.toString()); @@ -333,6 +343,16 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { return AjaxResult.success(); } + @Override + public AjaxResult submitFeeOne(SltAgreementInfo apply) { + int i = sltAgreementInfoMapper.updateInfoOneStatus(apply); + if (i > 0) { + return AjaxResult.success("结算成功"); + } else { + return AjaxResult.error("结算失败"); + } + } + @Override public List getSltExam(AgreementInfo bean) { return sltAgreementInfoMapper.getSltExam(bean); 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 b141bba3..db15081e 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 @@ -87,12 +87,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update slt_agreement_info - set trim_day = #{trimDay} + + + trim_day = #{trimDay}, + + + end_time = #{endTime}, + + where agreement_id = #{agreementId} and type_id = #{typeId} and ma_id = #{maId} + + UPDATE slt_agreement_info sai + LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id + SET sai.is_slt = '1' + WHERE + sai.agreement_id = #{agreementId} + AND sai.lease_type = 0 + AND lai.cost_bearing_party = #{costBearingParty} +