From f4ca04f11b71743bde6799dd0bb2b85302228edd Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 19 Feb 2025 20:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=B8=9A=E5=8A=A1=E5=8A=9E?= =?UTF-8?q?=E7=90=86=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=EF=BC=8Capp?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8A=9E=E7=90=86=E8=AE=B0=E5=BD=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/domain/lease/LeaseApplyInfo.java | 2 + .../lease/controller/LeaseTaskController.java | 12 ++- .../controller/DirectRotationController.java | 14 +++ .../material/ma/domain/DirectApplyInfo.java | 4 + .../DerateRecordQueryController.java | 76 +++++++++++++++ .../controller/SltRecordQueryController.java | 62 ++++++++++++ .../mapper/DerateRecordQueryMapper.java | 29 ++++++ .../record/mapper/SltRecordQueryMapper.java | 21 +++++ .../service/IDerateReocrdQueryService.java | 29 ++++++ .../service/ISltReocrdQueryService.java | 21 +++++ .../impl/DerateRecordQueryServiceImpl.java | 38 ++++++++ .../impl/SltRecordQueryServiceImpl.java | 34 +++++++ .../SltAgreementInfoController.java | 94 ++++++++++++++++++- .../settlement/domain/SltAgreementInfo.java | 8 ++ .../settlement/domain/SltAgreementReduce.java | 8 ++ .../settlement/domain/vo/SltInfoVo.java | 12 +++ .../settlement/domain/vo/SltLeaseInfo.java | 2 + .../mapper/SltAgreementReduceMapper.java | 7 ++ .../service/ISltAgreementInfoService.java | 8 ++ .../impl/SltAgreementInfoServiceImpl.java | 80 ++++++++++++++++ .../mapper/material/lease/LeaseTaskMapper.xml | 15 ++- .../material/ma/DirectRotationMapper.xml | 2 + .../record/DerateRecordQueryMapper.xml | 70 ++++++++++++++ .../material/record/SltRecordQueryMapper.xml | 54 +++++++++++ .../settlement/SltAgreementReduceMapper.xml | 17 ++++ 25 files changed, 709 insertions(+), 10 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/SltRecordQueryMapper.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java create mode 100644 bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml create mode 100644 bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java index 06b94543..127e62dd 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java @@ -253,4 +253,6 @@ public class LeaseApplyInfo extends BaseEntity{ @ApiModelProperty(value = "采购申请编号") private String applyCode; + + private Integer isApp; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java index 39d746dc..cc5ec151 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java @@ -61,9 +61,17 @@ public class LeaseTaskController extends BaseController { Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); try { List list = service.selectLeaseApplyInfoList(leaseApplyInfo); - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); + if (leaseApplyInfo.getIsApp()==null){ + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); + }else { + return AjaxResult.success(list); + } } catch (Exception e) { - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>())); + if (leaseApplyInfo.getIsApp()==null){ + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>())); + }else { + return AjaxResult.success(new ArrayList<>()); + } } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java index 4a6e7ce4..786db2a9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java @@ -103,6 +103,20 @@ public class DirectRotationController extends BaseController { } } + /** + * 直转记录查询列表--app + */ + @ApiOperation(value = "直转记录查询列表") + @GetMapping("/appList") + public AjaxResult appList(DirectApplyInfo directApplyInfo) { + try { + List directApplyInfos = service.getList(directApplyInfo); + return AjaxResult.success(directApplyInfos); + } catch (Exception e) { + return AjaxResult.success(new ArrayList<>()); + } + } + @ApiOperation(value = "查看详情") @GetMapping("/getInfo") public AjaxResult getInfo(SltAgreementInfo sltAgreementInfo) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/DirectApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/DirectApplyInfo.java index a5f35c45..ea4fbb4f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/DirectApplyInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/DirectApplyInfo.java @@ -150,4 +150,8 @@ public class DirectApplyInfo extends BaseEntity { */ private List directApplyDetails; + private Integer isApp; + + private Integer taskStatus; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java new file mode 100644 index 00000000..25232071 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java @@ -0,0 +1,76 @@ +package com.bonus.material.record.controller; + +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.common.log.annotation.SysLog; +import com.bonus.common.log.enums.OperaType; +import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.record.service.IDerateReocrdQueryService; +import com.bonus.material.record.service.ISltReocrdQueryService; +import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.SltAgreementReduce; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** +* @description 减免记录查询 +* @author hay +* @date 2025/2/19 10:43 +*/ +@Api(tags = "减免记录查询") +@RestController +@RequestMapping("/derateRecordQuery") +@Slf4j +public class DerateRecordQueryController extends BaseController { + + @Autowired + private IDerateReocrdQueryService service; + + /** + * 减免记录查询列表 + */ + @ApiOperation(value = "减免记录查询列表") + @GetMapping("/getList") + public TableDataInfo getList(SltAgreementInfo bean) { + startPage(); + try { + List list = service.getList(bean); + return getDataTable(list); + } catch (Exception e) { + return getDataTable(new ArrayList<>()); + } + } + + /** + * 减免记录查询列表--app + */ + @ApiOperation(value = "减免记录查询列表") + @GetMapping("/getAppList") + public AjaxResult getAppList(SltAgreementInfo bean) { + try { + List list = service.getList(bean); + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.success(new ArrayList<>()); + } + } + + /** + * 删除减免记录 + */ + @ApiOperation(value = "删除减免记录") + @PreventRepeatSubmit + @SysLog(title = "直转记录查询", businessType = OperaType.DELETE, logType = 1,module = "减免申请记录查询->删除减免记录") + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { + return toAjax(service.delData(id)); + } + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java new file mode 100644 index 00000000..c656a50a --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java @@ -0,0 +1,62 @@ +package com.bonus.material.record.controller; + +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.material.record.service.ISltReocrdQueryService; +import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.service.ISltAgreementInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** +* @description 结算记录查询 +* @author hay +* @date 2025/2/19 10:43 +*/ +@Api(tags = "结算记录查询") +@RestController +@RequestMapping("/sltRecordQuery") +@Slf4j +public class SltRecordQueryController extends BaseController { + + @Autowired + private ISltReocrdQueryService service; + + /** + * 结算记录查询列表 + */ + @ApiOperation(value = "结算记录查询列表") + @GetMapping("/getList") + public TableDataInfo getList(SltAgreementInfo bean) { + startPage(); + try { + List list = service.getList(bean); + return getDataTable(list); + } catch (Exception e) { + return getDataTable(new ArrayList<>()); + } + } + + + /** + * 结算记录查询列表--app + */ + @ApiOperation(value = "结算记录查询列表") + @GetMapping("/getAppList") + public AjaxResult getAppList(SltAgreementInfo bean) { + try { + List list = service.getList(bean); + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.success(new ArrayList<>()); + } + } + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java new file mode 100644 index 00000000..426cc273 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java @@ -0,0 +1,29 @@ +package com.bonus.material.record.mapper; + + +import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.SltAgreementReduce; + +import java.util.List; + +/** +* @description 减免记录查询 +* @author hay +* @date 2025/2/19 10:50 +*/ +public interface DerateRecordQueryMapper { + + /** + * 减免记录查询列表 + * @param bean + * @return + */ + List getList(SltAgreementInfo bean); + + /** + * 删除减免记录 + * @param id + * @return + */ + int delData(Long id); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/SltRecordQueryMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/SltRecordQueryMapper.java new file mode 100644 index 00000000..df26b9fd --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/SltRecordQueryMapper.java @@ -0,0 +1,21 @@ +package com.bonus.material.record.mapper; + + +import com.bonus.material.settlement.domain.SltAgreementInfo; + +import java.util.List; + +/** +* @description 结算记录查询 +* @author hay +* @date 2025/2/19 10:50 +*/ +public interface SltRecordQueryMapper { + + /** + * 结算记录查询列表 + * @param bean + * @return + */ + List getList(SltAgreementInfo bean); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java new file mode 100644 index 00000000..187da5be --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java @@ -0,0 +1,29 @@ +package com.bonus.material.record.service; + + +import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.SltAgreementReduce; + +import java.util.List; + +/** +* @description 减免记录查询 +* @author hay +* @date 2025/2/19 10:46 +*/ +public interface IDerateReocrdQueryService { + + /** + * 根据条件获取减免记录 + * @param bean + * @return + */ + List getList(SltAgreementInfo bean); + + /** + * 删除减免记录 + * @param id + * @return + */ + int delData(Long id); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java new file mode 100644 index 00000000..fa90da75 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java @@ -0,0 +1,21 @@ +package com.bonus.material.record.service; + + +import com.bonus.material.settlement.domain.SltAgreementInfo; + +import java.util.List; + +/** +* @description 结算记录查询 +* @author hay +* @date 2025/2/19 10:46 +*/ +public interface ISltReocrdQueryService { + + /** + * 根据条件获取结算记录 + * @param bean + * @return + */ + List getList(SltAgreementInfo bean); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java new file mode 100644 index 00000000..26402e42 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java @@ -0,0 +1,38 @@ +package com.bonus.material.record.service.impl; + +import com.bonus.material.record.mapper.DerateRecordQueryMapper; +import com.bonus.material.record.mapper.SltRecordQueryMapper; +import com.bonus.material.record.service.IDerateReocrdQueryService; +import com.bonus.material.record.service.ISltReocrdQueryService; +import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.SltAgreementReduce; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** +* @description 减免记录查询 +* @author hay +* @date 2025/2/19 10:47 +*/ +@Service +public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService { + @Resource + private DerateRecordQueryMapper mapper; + + @Override + public List getList(SltAgreementInfo bean) { + return mapper.getList(bean); + } + + @Override + public int delData(Long id) { + try { + mapper.delData(id); + return 1; + } catch (Exception e) { + return 0; + } + } +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java new file mode 100644 index 00000000..0b06a609 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java @@ -0,0 +1,34 @@ +package com.bonus.material.record.service.impl; + +import com.bonus.material.record.mapper.SltRecordQueryMapper; +import com.bonus.material.record.service.ISltReocrdQueryService; +import com.bonus.material.settlement.domain.SltAgreementInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** +* @description 结算记录查询 +* @author hay +* @date 2025/2/19 10:47 +*/ +@Service +public class SltRecordQueryServiceImpl implements ISltReocrdQueryService { + @Resource + private SltRecordQueryMapper mapper; + + @Override + public List getList(SltAgreementInfo bean) { + List list = mapper.getList(bean); + if (list.size()>0){ + for (SltAgreementInfo sltAgreementInfo : list) { + if (sltAgreementInfo.getAgreementId()!=null){ + + } + } + } + return list; + } +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index 7d9b0d26..96b8bb7f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.convert.Convert; @@ -19,9 +20,11 @@ import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.countersign.domain.SignConfigVo; import com.bonus.material.lease.domain.vo.LeaseOutVo; import com.bonus.material.settlement.domain.SltAgreementApply; +import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.vo.SltInfoVo; import com.bonus.material.settlement.domain.vo.SltLeaseInfo; import com.bonus.material.settlement.mapper.SltAgreementInfoMapper; +import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; import com.bonus.material.task.domain.TmTask; import com.bonus.material.task.mapper.TmTaskMapper; import io.swagger.annotations.Api; @@ -67,6 +70,9 @@ public class SltAgreementInfoController extends BaseController { @Autowired private TmTaskMapper taskMapper; + @Resource + private SltAgreementReduceMapper sltAgreementRecudceMapper; + /** * 查询结算信息列表 */ @@ -97,6 +103,18 @@ public class SltAgreementInfoController extends BaseController { return AjaxResult.success(bean); } + @ApiOperation(value = "结算记录查询明细") + @PostMapping("/getSltRecordDetailsList") + public AjaxResult getSltRecordDetailsList(@RequestBody SltAgreementInfo info) { + try { + SltInfoVo bean = sltAgreementInfoService.getSltRecordDetailsList(info); + return AjaxResult.success(bean); + } catch (Exception e) { + return AjaxResult.success(new SltInfoVo()); + } + + } + /** * 获取结算审核列表 */ @@ -189,13 +207,14 @@ public class SltAgreementInfoController extends BaseController { * 导出结算单--all * @throws Exception */ - private void expOutExcelAll(HttpServletResponse response, List lease,List lose,List repair,List scrap, - String filename,String projectName,String unitName,BigDecimal totalCostLease,BigDecimal totalCostLose,BigDecimal totalCostRepair,BigDecimal totalCostScrap) + private void expOutExcelAll(HttpServletResponse response, List lease,List lose,List repair,List scrap,List reduction, + String filename,String projectName,String unitName,BigDecimal totalCostLease,BigDecimal totalCostLose,BigDecimal totalCostRepair,BigDecimal totalCostScrap,BigDecimal totalCostReduction) throws Exception { List> resultsLease = new ArrayList>(); List> resultsLose = new ArrayList>(); List> resultsRepair = new ArrayList>(); List> resultsScrap = new ArrayList>(); + List> resultsReduction = new ArrayList>(); if (lease!= null) { int sizeLease = lease.size(); @@ -230,6 +249,15 @@ public class SltAgreementInfoController extends BaseController { } } + if (reduction!= null) { + int sizeReduction = reduction.size(); + for (int i = 0; i < sizeReduction; i++) { + SltLeaseInfo bean = reduction.get(i); + Map maps = outReceiveDetailsBeanToMap(bean,5,1); + resultsReduction.add(maps); + } + } + List headersLease = receiveDetailsHeader(1,1); List headersLose = receiveDetailsHeader(2,1); List headersRepair = receiveDetailsHeader(3,1); @@ -325,7 +353,18 @@ public class SltAgreementInfoController extends BaseController { maps.put("t3", ""); maps.put("t4", ""); } - } + } else if(type==5){ + maps.put("typeName", bean.getTypeName()); + maps.put("modelName", bean.getModelName()); + maps.put("mtUnitName", bean.getMtUnitName()); + maps.put("leasePrice", bean.getLeasePrice()); + maps.put("num", bean.getNum()); + maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); + maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); + maps.put("leaseDays", bean.getLeaseDays()); + maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); + maps.put("remark", bean.getRemark()); + } return maps; } @@ -532,6 +571,38 @@ public class SltAgreementInfoController extends BaseController { } } + /** + * 导出减免费用明细 + */ + @ApiOperation(value = "导出减免费用明细") + @PreventRepeatSubmit +// @RequiresPermissions("settlement:info:export") + @SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出减免费用明细") + @PostMapping("/exportReduction") + public void exportReduction(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) { + try { + String fileName = "减免费用明细表"; + String projectName = sltAgreementInfo.getProjectName(); + String unitName = sltAgreementInfo.getUnitName(); + BigDecimal reductionCost = BigDecimal.valueOf(0.00); + List reductionList = new ArrayList<>(); + if (sltAgreementInfo.getAgreementId() != null){ + SltAgreementReduce bean =new SltAgreementReduce(); + bean.setAgreementId(sltAgreementInfo.getAgreementId()); + reductionList = sltAgreementRecudceMapper.getReductionList(bean); + } + for (SltAgreementReduce reduction : reductionList) { + if(reduction.getLeaseMoney()!=null){ + reductionCost = reductionCost.add(reduction.getLeaseMoney()); + } + } + List repair = Convert.toList(SltLeaseInfo.class, reductionList); + expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,3); + } catch (Exception e) { + log.error(e.toString(), e); + } + } + /** * 导出报废费用明细 */ @@ -686,7 +757,22 @@ public class SltAgreementInfoController extends BaseController { } List scrap = Convert.toList(SltLeaseInfo.class, scrapList); - expOutExcelAll(response,lease,lose,repair,scrap,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap); + //减免费用明细 + BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + List reductionList = new ArrayList<>(); + 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()); + } + } + } + List reduction = Convert.toList(SltLeaseInfo.class, reductionList); + + expOutExcelAll(response,lease,lose,repair,scrap,reduction,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction); } catch (Exception e) { log.error(e.toString(), e); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java index c8d5bd1d..00b3ba2c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java @@ -213,4 +213,12 @@ public class SltAgreementInfo extends BaseEntity { private Integer type; + private Integer taskStatus; + + private String startDate; + + private String endDate; + + private Integer isApp; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java index 9eb9df2a..4ec0a0d7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java @@ -92,6 +92,9 @@ public class SltAgreementReduce extends BaseEntity { @ApiModelProperty(value = "租赁金额") private BigDecimal leaseMoney; + @ApiModelProperty(value = "累计减免费用") + private BigDecimal leaseMoneyAll; + @ApiModelProperty(value = "减免数量") private BigDecimal reduceNum; @@ -117,4 +120,9 @@ public class SltAgreementReduce extends BaseEntity { private BmFileInfo file; private List detailList; + + private String typeName; + private String modeName; + private String unitName; + private String projectName; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java index 27919272..5357f02a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java @@ -2,6 +2,7 @@ package com.bonus.material.settlement.domain.vo; import com.bonus.common.core.annotation.Excel; import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.SltAgreementRelation; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; @@ -43,6 +44,11 @@ public class SltInfoVo { */ List loseList; + /** + * 减免费用列表 + */ + List reductionList; + List relations; /** @@ -69,6 +75,12 @@ public class SltInfoVo { @ApiModelProperty(value = "丢失费用小计") private BigDecimal loseCost; + /** + * 减免费用小计 + */ + @ApiModelProperty(value = "减免费用小计") + private BigDecimal reductionCost; + /** * 合计 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java index a2fbeaa2..b2c7a2e8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java @@ -206,4 +206,6 @@ public class SltLeaseInfo extends BaseEntity { private String keyWord; + private String remark; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java index e62bc6c5..b11358ba 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java @@ -31,4 +31,11 @@ public interface SltAgreementReduceMapper { List selectByMatype(SltAgreementReduce sltAgreement); List selectByMaModel(SltAgreementReduce sltAgreement); + + /** + * 根据协议Id查询减免明细 + * @param bean + * @return + */ + List getReductionList(SltAgreementReduce bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java index 4639160b..9ad9ab11 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java @@ -97,4 +97,12 @@ public interface ISltAgreementInfoService { * @return 结果 */ AjaxResult costExamine(SltAgreementApply sltAgreementApply); + + /** + * 结算记录查询明细 + * + * @param info 结算信息 + * @return 结果 + */ + SltInfoVo getSltRecordDetailsList(SltAgreementInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 9899d1cc..7921b3ad 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -11,8 +11,10 @@ import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.countersign.domain.SignConfigVo; import com.bonus.material.settlement.domain.SltAgreementApply; +import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.SltAgreementRelation; import com.bonus.material.settlement.domain.vo.SltInfoVo; +import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; import com.bonus.material.task.domain.TmTask; import com.bonus.material.task.mapper.TmTaskMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -38,6 +40,9 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { @Autowired private TmTaskMapper taskMapper; + @Resource + private SltAgreementReduceMapper sltAgreementRecudceMapper; + /** * 查询结算信息 * @@ -320,6 +325,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return loseList; } + private List getReductionList(SltAgreementInfo info) { + SltAgreementReduce bean =new SltAgreementReduce(); + bean.setAgreementId(info.getAgreementId()); + List reductionList = sltAgreementRecudceMapper.getReductionList(bean); + return reductionList; + } + private List getRelations(List leaseList, List repairList, List scrapList, List loseList, SltAgreementInfo sltInfo) { @@ -497,4 +509,72 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return AjaxResult.error(); } } + + @Override + public SltInfoVo getSltRecordDetailsList(SltAgreementInfo info) { + SltInfoVo sltInfoVo = new SltInfoVo(); + sltInfoVo.setUnitName(info.getUnitName()); + sltInfoVo.setProjectName(info.getProjectName()); + BigDecimal leaseCost = BigDecimal.valueOf(0.00); + BigDecimal repairCost = BigDecimal.valueOf(0.00); + BigDecimal scrapCost = BigDecimal.valueOf(0.00); + BigDecimal loseCost = BigDecimal.valueOf(0.00); + BigDecimal reductionCost = BigDecimal.valueOf(0.00); + //租赁费用列表 + List leaseList = getLeaseList(info); + //维修费用列表 + List repairList = getRepairList(info); + //报废费用列表 + List scrapList = getScrapList(info); + //丢失费用列表 + List loseList = getLoseList(info); + //减免费用列表 + List reductionList = getReductionList(info); + sltInfoVo.setLeaseList(leaseList); + sltInfoVo.setRepairList(repairList); + sltInfoVo.setScrapList(scrapList); + sltInfoVo.setLoseList(loseList); + sltInfoVo.setReductionList(reductionList); + + for (SltAgreementInfo lease : leaseList) { + if(lease.getCosts()!=null){ + leaseCost = leaseCost.add(lease.getCosts()); + } + } + for (SltAgreementInfo repair : repairList) { + if(repair.getCosts()!=null && (repair.getPartType().equals("收费"))){ + repairCost = repairCost.add(repair.getCosts()); + } + } + for (SltAgreementInfo scrap : scrapList) { + if(scrap.getCosts()!=null && (scrap.getPartType().equals("收费"))){ + scrapCost = scrapCost.add(scrap.getCosts()); + } + } + for (SltAgreementInfo lose : loseList) { + if(lose.getCosts()!=null){ + loseCost = loseCost.add(lose.getCosts()); + } + } + + for (SltAgreementReduce reduction : reductionList){ + if(reduction.getLeaseMoney()!=null){ + reductionCost = reductionCost.add(reduction.getLeaseMoney()); + } + } + sltInfoVo.setLeaseCost(leaseCost); + sltInfoVo.setRepairCost(repairCost); + sltInfoVo.setScrapCost(scrapCost); + sltInfoVo.setLoseCost(loseCost); + sltInfoVo.setReductionCost(reductionCost); + List relations = getRelations(leaseList, repairList, scrapList, loseList, info); + //加上减免 + if (relations.size()>0){ + relations.get(0).setSubCost(reductionCost); + } + sltInfoVo.setRelations(relations); + return sltInfoVo; + } + + } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 08218308..3405fd9e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -110,7 +110,13 @@ lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type, bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus, - sda.dict_label as taskStatusName, + case tt.task_status + when 0 then '待审核' + when 1 then '待审核' + when 2 then '审核中' + when 3 then '已完成' + when 4 then '已完成' + end as taskStatusName, IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.al_num),0) as alNum, GROUP_CONCAT(DISTINCT mt1.type_name) AS maTypeNames, @@ -276,7 +282,7 @@ diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml index a8e139d2..18844e68 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml @@ -128,6 +128,8 @@ and dai.status = #{status} + and dai.status = 0 + and (dai.status = 1 or dai.status = 2) GROUP BY dai.id order by dai.create_time desc diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml new file mode 100644 index 00000000..76dec806 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml @@ -0,0 +1,70 @@ + + + + + + + + + delete + from slt_reduce_apply + where id = #{id}; + delete + from slt_reduce_details + where apply_id = #{id} + + \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml new file mode 100644 index 00000000..7236dc06 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml @@ -0,0 +1,54 @@ + + + + + + \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml index 9a1d6bf2..f2aea133 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml @@ -228,4 +228,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sai.agreement_id = #{agreementId} and mt2.type_id = #{typeId} group by mt.type_id +