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 b5d603d6..ea749ead 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 @@ -20,6 +20,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.config.PoiOutPage; +import com.bonus.common.biz.constant.GlobalConstants; import com.bonus.common.biz.utils.RequestContext; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.ServletUtils; @@ -28,9 +29,9 @@ import com.bonus.common.log.enums.OperatorType; import com.bonus.material.basic.domain.BmProject; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.common.domain.dto.SelectDto; +import com.bonus.material.part.domain.PartLeaseInfo; import com.bonus.material.settlement.domain.*; -import com.bonus.material.settlement.domain.vo.SltInfoVo; -import com.bonus.material.settlement.domain.vo.SltLeaseInfo; +import com.bonus.material.settlement.domain.vo.*; import com.bonus.material.settlement.mapper.SltAgreementInfoMapper; import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; import com.bonus.material.settlement.service.SltHistoryReportService; @@ -50,8 +51,6 @@ import org.springframework.web.bind.annotation.*; import com.bonus.common.log.annotation.SysLog; import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.material.settlement.domain.dto.PeriodCostQueryDto; -import com.bonus.material.settlement.domain.vo.PeriodCostResultVo; -import com.bonus.material.settlement.domain.vo.PeriodCostSummaryVo; import com.bonus.material.settlement.service.ISltAgreementInfoService; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; @@ -1465,6 +1464,20 @@ public class SltAgreementInfoController extends BaseController { return getDataTable(list); } + /** + * 导出丢失费用报表 + * @param response + * @param bean + */ + @ApiOperation("导出丢失费用报表") + @PostMapping("/exportLostList") + public void exportLostList(HttpServletResponse response, SltAgreementInfoLose bean) + { + List list = sltAgreementInfoService.getLostReportListExport(bean); + ExcelUtil util = new ExcelUtil<>(SltAgreementInfoLose.class); + util.exportExcel(response, list, "导出丢失费用报表"); + } + /** * 维修报表--列表 */ @@ -1476,6 +1489,20 @@ public class SltAgreementInfoController extends BaseController { return getDataTable(list); } + /** + * 导出维修费用报表 + * @param response + * @param bean + */ + @ApiOperation("导出维修费用报表") + @PostMapping("/exportRepairList") + public void exportRepairList(HttpServletResponse response, SltAgreementInfoRepair bean) + { + List list = sltAgreementInfoService.getRepairReportListExport(bean); + ExcelUtil util = new ExcelUtil<>(SltAgreementInfoRepair.class); + util.exportExcel(response, list, "导出维修费用报表"); + } + /** * 报废报表--列表 */ @@ -1487,6 +1514,20 @@ public class SltAgreementInfoController extends BaseController { return getDataTable(list); } + /** + * 导出报废费用报表 + * @param response + * @param bean + */ + @ApiOperation("导出报废费用报表") + @PostMapping("/exportScrapList") + public void exportScrapList(HttpServletResponse response, SltAgreementInfoScrap bean) + { + List list = sltAgreementInfoService.getScrapReportListExport(bean); + ExcelUtil util = new ExcelUtil<>(SltAgreementInfoScrap.class); + util.exportExcel(response, list, "导出报废费用报表"); + } + /** * 已结算报表--列表 */ @@ -1548,6 +1589,9 @@ public class SltAgreementInfoController extends BaseController { vo.setAgreementId(info.getAgreementId()); vo.setAgreementCode(info.getAgreementCode()); vo.setSettlementType(settlementType); + vo.setTotalCostAll(vo.getLeaseCost().add(vo.getRepairCost()) + .add(vo.getScrapCost()).add(vo.getLoseCost()) + .subtract(vo.getReductionCost())); dataList.add(vo); } } catch (Exception e) { @@ -1576,6 +1620,60 @@ public class SltAgreementInfoController extends BaseController { } + /** + * 导出未结算报表列表 + * @param response + * @param query + */ + @ApiOperation("导出未结算报表列表") + @PostMapping("/exportUnreported") + public void exportUnreported(HttpServletResponse response, SltAgreementInfo query) + { + // ----------- 查询未结算的全部协议 --------------- + List list = sltAgreementInfoService.getSltReportList(query); + if(CollectionUtils.isEmpty(list)){ + throw new ServiceException("未查询到未结算协议"); + } + // ----------- 给查询出来的协议设置权限控制(例如只查询工器具) --------------- + int settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); + + // --------- 拿到list中所有的agreementId存成集合,给每个info赋值 ------------------ + List agreementIdsArray = list.stream() + .map(SltAgreementInfo::getAgreementId) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + if (agreementIdsArray.isEmpty()) { + throw new ServiceException("未查询到未结算协议"); + } + + // --------- 定义返回集合 ------------------ + List dataList = new ArrayList<>(list.size()); + + // 批量处理,减少单个查询 + list.forEach(info -> { + + info.setSettlementType(settlementType); + info.setAgreementIds(agreementIdsArray); + + // 查询每个协议的各项费用明细 + SltInfoVo vo = sltAgreementInfoService.getSltInfoReportBatch(info); + if (vo != null) { + vo.setAgreementId(info.getAgreementId()); + vo.setAgreementCode(info.getAgreementCode()); + vo.setSettlementType(settlementType); + vo.setTotalCostAll(vo.getLeaseCost().add(vo.getRepairCost()) + .add(vo.getScrapCost()).add(vo.getLoseCost()) + .subtract(vo.getReductionCost()).setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); + dataList.add(vo); + } + + }); + ExcelUtil util = new ExcelUtil<>(SltInfoVo.class); + util.exportExcel(response, dataList, "导出未结算报表列表"); + } + + /** * 查询历史报表列表(按年月) * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoLose.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoLose.java new file mode 100644 index 00000000..9bee20c8 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoLose.java @@ -0,0 +1,269 @@ +package com.bonus.material.settlement.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.bonus.common.core.web.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 结算信息对象 slt_agreement_info + */ +@EqualsAndHashCode(callSuper = false) +@Data +@ToString +@Accessors(chain = true) +public class SltAgreementInfoLose extends BaseEntity { + + private static final long serialVersionUID = -3531370525106104195L; + + /** ID */ + private Long id; + + /** 协议id */ + @ApiModelProperty(value = "协议id") + private Long agreementId; + + /** + * 协议id集合,用作查询一次性查多个协议的数据 + */ + private List agreementIds; + + /** + * 协议编号 + */ + @Excel(name = "协议编号",sort = 1) + @ApiModelProperty(value = "协议编号") + private String agreementCode; + + @ApiModelProperty("结算申请单号") + private String sltApplyCode; + + /** 机具规格id */ + private Long typeId; + + /** + * 设备名称 + */ + @Excel(name = "机具名称",sort = 4) + @ApiModelProperty(value = "机具名称") + private String typeName; + /** + * 规格型号 + */ + @Excel(name = "规格型号",sort = 5) + @ApiModelProperty(value = "规格型号") + private String modelName; + + /** + * 计量单位 + */ + @Excel(name = "单位",sort = 6) + @ApiModelProperty(value = "计量单位") + private String mtUnitName; + /** + * 租赁天数 + */ + private String leaseDays; + + /** 机具id */ + @ApiModelProperty(value = "机具id") + private Long maId; + + /** 领料数量 */ + @Excel(name = "丢失数量",sort = 7, cellType = Excel.ColumnType.NUMERIC) + @ApiModelProperty(value = "丢失数量") + private BigDecimal num; + + private Long userId; + + private BigDecimal backNum; + + /** 领料时间 */ + @ApiModelProperty(value = "领料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTime; + + /** 退料时间 */ + @ApiModelProperty(value = "退料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTime; + + /** 0在用1退回 */ + @ApiModelProperty(value = "0在用1退回") + private String status; + + /** 领料id */ + @ApiModelProperty(value = "领料id") + private Long leaseId; + + /** 退料id */ + @ApiModelProperty(value = "退料id") + private Long backId; + + /** 租赁单价 */ + @ApiModelProperty(value = "租赁单价") + private BigDecimal leasePrice; + + /** 原值 */ + @Excel(name = "单价(元)",sort = 8) + @ApiModelProperty(value = "原值") + private BigDecimal buyPrice; + + /** 是否结算 */ + @ApiModelProperty(value = "是否结算") + private String isSlt; + + /** 结算时间 */ + @ApiModelProperty(value = "结算时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date sltTime; + + /** 结算类型 1工器具 2安全工器具 */ + private Integer settlementType; + + /** $column.columnComment */ + private Long companyId; + + /** 领用类型(0工程1长期) */ + private String leaseType; + + /** 调整天数 */ + + @ApiModelProperty(value = "调整天数") + private Long trimDay; + + /** + * 租赁天数 + */ + + @ApiModelProperty(value = "租赁天数") + private Long leaseDay; + + /** + * 租赁费用 + */ + @ApiModelProperty(value = "租赁费用") + private BigDecimal costs; + + /** + * 项目名称 + */ + @Excel(name = "结算单位",sort = 2) + private String unitName; + /** + * 工程名称 + */ + @Excel(name = "结算工程",sort = 3) + private String projectName; + + @ApiModelProperty(value = "往来单位id") + private Long unitId; + + private List unitIds; + /** + * 工程标段ID + */ + @ApiModelProperty(value = "工程标段ID") + private Long projectId; + + @ApiModelProperty(value = "结算状态") + private String sltStatus; + + /** + * 维修类型 + */ + private String repairType; + + /** + * 是否收费 + */ + private String partType; + + /** + * 费用id + */ + private Long costId; + + /** + * 维修状态 + */ + private String repairStatus; + + private String typeModelName; + + private String maCode; + + private BigDecimal useNum; + + private String keyWord; + + /** 审核人 */ + @ApiModelProperty(value = "审核人") + private String auditor; + + /** 审核时间 */ + @ApiModelProperty(value = "审核时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date auditTime; + + @ApiModelProperty(value = "领料人") + private String leasePerson; + + private Long parentId; + + private Integer type; + + private Integer taskStatus; + + private String startDate; + + private String endDate; + + private Integer isApp; + + private BigDecimal leaseCost; + private BigDecimal consumeCost; + private BigDecimal repairCost; + private BigDecimal scrapCost; + + @Excel(name = "丢失费用(元)",sort = 9) + private BigDecimal loseCost; + private BigDecimal reductionCost; + + //结算费用 + private BigDecimal totalCostAll; + + @ApiModelProperty(value = "领料方式 0材料领料 1工器具领料 2数据同步") + private String leaseStyle; + + private String source; + + private String repairCode; + + private String unitValue; + private String nextCheckTime; + + /** + * 是否查询已结算的费用 + */ + private Boolean enableQuerySltData = false; + + @ApiModelProperty(value = "待转数量") + private BigDecimal waitTransNum; + + @ApiModelProperty(value = "可转数量") + private BigDecimal transNum; + + @ApiModelProperty("年月") + private String yearMonth; + + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoRepair.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoRepair.java new file mode 100644 index 00000000..9a33c333 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoRepair.java @@ -0,0 +1,272 @@ +package com.bonus.material.settlement.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.bonus.common.core.web.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 结算信息对象 slt_agreement_info + */ +@EqualsAndHashCode(callSuper = false) +@Data +@ToString +@Accessors(chain = true) +public class SltAgreementInfoRepair extends BaseEntity { + + private static final long serialVersionUID = -3531370525106104195L; + + /** ID */ + private Long id; + + /** 协议id */ + @ApiModelProperty(value = "协议id") + private Long agreementId; + + /** + * 协议id集合,用作查询一次性查多个协议的数据 + */ + private List agreementIds; + + /** + * 协议编号 + */ + @Excel(name = "协议编号",sort = 1) + @ApiModelProperty(value = "协议编号") + private String agreementCode; + + @ApiModelProperty("结算申请单号") + private String sltApplyCode; + + /** 机具规格id */ + private Long typeId; + + /** + * 设备名称 + */ + @Excel(name = "机具名称",sort = 4) + @ApiModelProperty(value = "机具名称") + private String typeName; + /** + * 规格型号 + */ + @Excel(name = "规格型号",sort = 5) + @ApiModelProperty(value = "规格型号") + private String modelName; + + /** + * 计量单位 + */ + @Excel(name = "单位",sort = 6) + @ApiModelProperty(value = "计量单位") + private String mtUnitName; + /** + * 租赁天数 + */ + private String leaseDays; + + /** 机具id */ + @ApiModelProperty(value = "机具id") + private Long maId; + + /** 领料数量 */ + @Excel(name = "报废数量",sort = 7, cellType = Excel.ColumnType.NUMERIC) + @ApiModelProperty(value = "报废数量") + private BigDecimal num; + + private Long userId; + + private BigDecimal backNum; + + /** 领料时间 */ + @ApiModelProperty(value = "领料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTime; + + /** 退料时间 */ + @ApiModelProperty(value = "退料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTime; + + /** 0在用1退回 */ + @ApiModelProperty(value = "0在用1退回") + private String status; + + /** 领料id */ + @ApiModelProperty(value = "领料id") + private Long leaseId; + + /** 退料id */ + @ApiModelProperty(value = "退料id") + private Long backId; + + /** 租赁单价 */ + @ApiModelProperty(value = "租赁单价") + private BigDecimal leasePrice; + + /** 原值 */ + @ApiModelProperty(value = "原值") + private BigDecimal buyPrice; + + /** 是否结算 */ + @ApiModelProperty(value = "是否结算") + private String isSlt; + + /** 结算时间 */ + @ApiModelProperty(value = "结算时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date sltTime; + + /** 结算类型 1工器具 2安全工器具 */ + private Integer settlementType; + + /** $column.columnComment */ + private Long companyId; + + /** 领用类型(0工程1长期) */ + private String leaseType; + + /** 调整天数 */ + + @ApiModelProperty(value = "调整天数") + private Long trimDay; + + /** + * 租赁天数 + */ + + @ApiModelProperty(value = "租赁天数") + private Long leaseDay; + + /** + * 租赁费用 + */ + @ApiModelProperty(value = "租赁费用") + @Excel(name = "报废费用(元)",sort = 8) + private BigDecimal costs; + + /** + * 项目名称 + */ + @Excel(name = "结算单位",sort = 2) + private String unitName; + /** + * 工程名称 + */ + @Excel(name = "结算工程",sort = 3) + private String projectName; + + @ApiModelProperty(value = "往来单位id") + private Long unitId; + + private List unitIds; + /** + * 工程标段ID + */ + @ApiModelProperty(value = "工程标段ID") + private Long projectId; + + @ApiModelProperty(value = "结算状态") + private String sltStatus; + + /** + * 维修类型 + */ + @Excel(name = "维修方式",sort = 9) + @ApiModelProperty(value = "维修类型") + private String repairType; + + /** + * 是否收费 + */ + @Excel(name = "费用类型",sort = 10) + @ApiModelProperty(value = "是否收费") + private String partType; + + /** + * 费用id + */ + private Long costId; + + /** + * 维修状态 + */ + private String repairStatus; + + private String typeModelName; + + private String maCode; + + private BigDecimal useNum; + + private String keyWord; + + /** 审核人 */ + @ApiModelProperty(value = "审核人") + private String auditor; + + /** 审核时间 */ + @ApiModelProperty(value = "审核时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date auditTime; + + @ApiModelProperty(value = "领料人") + private String leasePerson; + + private Long parentId; + + private Integer type; + + private Integer taskStatus; + + private String startDate; + + private String endDate; + + private Integer isApp; + + private BigDecimal leaseCost; + private BigDecimal consumeCost; + private BigDecimal repairCost; + private BigDecimal scrapCost; + + private BigDecimal loseCost; + private BigDecimal reductionCost; + + //结算费用 + private BigDecimal totalCostAll; + + @ApiModelProperty(value = "领料方式 0材料领料 1工器具领料 2数据同步") + private String leaseStyle; + + private String source; + + private String repairCode; + + private String unitValue; + private String nextCheckTime; + + /** + * 是否查询已结算的费用 + */ + private Boolean enableQuerySltData = false; + + @ApiModelProperty(value = "待转数量") + private BigDecimal waitTransNum; + + @ApiModelProperty(value = "可转数量") + private BigDecimal transNum; + + @ApiModelProperty("年月") + private String yearMonth; + + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoScrap.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoScrap.java new file mode 100644 index 00000000..9b91e9af --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltAgreementInfoScrap.java @@ -0,0 +1,268 @@ +package com.bonus.material.settlement.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.bonus.common.core.web.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 结算信息对象 slt_agreement_info + */ +@EqualsAndHashCode(callSuper = false) +@Data +@ToString +@Accessors(chain = true) +public class SltAgreementInfoScrap extends BaseEntity { + + private static final long serialVersionUID = -3531370525106104195L; + + /** ID */ + private Long id; + + /** 协议id */ + @ApiModelProperty(value = "协议id") + private Long agreementId; + + /** + * 协议id集合,用作查询一次性查多个协议的数据 + */ + private List agreementIds; + + /** + * 协议编号 + */ + @Excel(name = "协议编号",sort = 1) + @ApiModelProperty(value = "协议编号") + private String agreementCode; + + @ApiModelProperty("结算申请单号") + private String sltApplyCode; + + /** 机具规格id */ + private Long typeId; + + /** + * 设备名称 + */ + @Excel(name = "机具名称",sort = 4) + @ApiModelProperty(value = "机具名称") + private String typeName; + /** + * 规格型号 + */ + @Excel(name = "规格型号",sort = 5) + @ApiModelProperty(value = "规格型号") + private String modelName; + + /** + * 计量单位 + */ + @Excel(name = "单位",sort = 6) + @ApiModelProperty(value = "计量单位") + private String mtUnitName; + /** + * 租赁天数 + */ + private String leaseDays; + + /** 机具id */ + @ApiModelProperty(value = "机具id") + private Long maId; + + /** 领料数量 */ + @Excel(name = "报废数量",sort = 7, cellType = Excel.ColumnType.NUMERIC) + @ApiModelProperty(value = "报废数量") + private BigDecimal num; + + private Long userId; + + private BigDecimal backNum; + + /** 领料时间 */ + @ApiModelProperty(value = "领料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTime; + + /** 退料时间 */ + @ApiModelProperty(value = "退料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTime; + + /** 0在用1退回 */ + @ApiModelProperty(value = "0在用1退回") + private String status; + + /** 领料id */ + @ApiModelProperty(value = "领料id") + private Long leaseId; + + /** 退料id */ + @ApiModelProperty(value = "退料id") + private Long backId; + + /** 租赁单价 */ + @ApiModelProperty(value = "租赁单价") + private BigDecimal leasePrice; + + /** 原值 */ + @ApiModelProperty(value = "原值") + private BigDecimal buyPrice; + + /** 是否结算 */ + @ApiModelProperty(value = "是否结算") + private String isSlt; + + /** 结算时间 */ + @ApiModelProperty(value = "结算时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date sltTime; + + /** 结算类型 1工器具 2安全工器具 */ + private Integer settlementType; + + /** $column.columnComment */ + private Long companyId; + + /** 领用类型(0工程1长期) */ + private String leaseType; + + /** 调整天数 */ + + @ApiModelProperty(value = "调整天数") + private Long trimDay; + + /** + * 租赁天数 + */ + + @ApiModelProperty(value = "租赁天数") + private Long leaseDay; + + /** + * 租赁费用 + */ + @ApiModelProperty(value = "租赁费用") + @Excel(name = "报废费用(元)",sort = 9) + private BigDecimal costs; + + /** + * 项目名称 + */ + @Excel(name = "结算单位",sort = 2) + private String unitName; + /** + * 工程名称 + */ + @Excel(name = "结算工程",sort = 3) + private String projectName; + + @ApiModelProperty(value = "往来单位id") + private Long unitId; + + private List unitIds; + /** + * 工程标段ID + */ + @ApiModelProperty(value = "工程标段ID") + private Long projectId; + + @ApiModelProperty(value = "结算状态") + private String sltStatus; + + /** + * 维修类型 + */ + private String repairType; + + /** + * 是否收费 + */ + private String partType; + + /** + * 费用id + */ + private Long costId; + + /** + * 维修状态 + */ + private String repairStatus; + + private String typeModelName; + + private String maCode; + + private BigDecimal useNum; + + private String keyWord; + + /** 审核人 */ + @ApiModelProperty(value = "审核人") + private String auditor; + + /** 审核时间 */ + @ApiModelProperty(value = "审核时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date auditTime; + + @ApiModelProperty(value = "领料人") + private String leasePerson; + + private Long parentId; + + private Integer type; + + private Integer taskStatus; + + private String startDate; + + private String endDate; + + private Integer isApp; + + private BigDecimal leaseCost; + private BigDecimal consumeCost; + private BigDecimal repairCost; + private BigDecimal scrapCost; + + private BigDecimal loseCost; + private BigDecimal reductionCost; + + //结算费用 + private BigDecimal totalCostAll; + + @ApiModelProperty(value = "领料方式 0材料领料 1工器具领料 2数据同步") + private String leaseStyle; + + private String source; + + private String repairCode; + + private String unitValue; + private String nextCheckTime; + + /** + * 是否查询已结算的费用 + */ + private Boolean enableQuerySltData = false; + + @ApiModelProperty(value = "待转数量") + private BigDecimal waitTransNum; + + @ApiModelProperty(value = "可转数量") + private BigDecimal transNum; + + @ApiModelProperty("年月") + private String yearMonth; + + +} 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 e5817352..a9de42f9 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 @@ -24,10 +24,12 @@ public class SltInfoVo { /** * 结算单位 */ + @Excel(name = "结算单位",sort = 2) private String unitName; /** * 结算工程 */ + @Excel(name = "结算工程",sort = 3) private String projectName; /** * 租赁费用列表 @@ -56,30 +58,35 @@ public class SltInfoVo { /** * 租赁费用小计 */ + @Excel(name = "租赁费用",sort = 5) @ApiModelProperty(value = "租赁费用小计") private BigDecimal leaseCost; /** * 维修费用小计 */ + @Excel(name = "维修费用",sort = 6) @ApiModelProperty(value = "维修费用小计") private BigDecimal repairCost; /** * 报废费用小计 */ + @Excel(name = "报废费用",sort = 8) @ApiModelProperty(value = "报废费用小计") private BigDecimal scrapCost; /** * 丢失费用小计 */ + @Excel(name = "丢失费用",sort = 7) @ApiModelProperty(value = "丢失费用小计") private BigDecimal loseCost; /** * 减免费用小计 */ + @Excel(name = "减免费用",sort = 9) @ApiModelProperty(value = "减免费用小计") private BigDecimal reductionCost; @@ -87,13 +94,12 @@ public class SltInfoVo { * 合计 */ @ApiModelProperty(value = "合计") + @Excel(name = "合计费用",sort = 10) private BigDecimal totalCostAll; - @Excel(name = "创建人") private String createBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; private String updateBy; @@ -109,6 +115,7 @@ public class SltInfoVo { * 协议编号 */ @ApiModelProperty(value = "协议编号") + @Excel(name = "协议编号",sort = 1) private String agreementCode; /** 协议 ids */ @@ -128,6 +135,7 @@ public class SltInfoVo { /** * 结算物资类型 1工器具 2安全工器具 */ + @Excel(name = "结算类型",sort = 4,readConverterExp = "1=工器具,2=安全工器具,0=其他") private Integer settlementType; @ApiModelProperty(value = "申请时间") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index e2238747..4d4edd86 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -8,9 +8,8 @@ import com.bonus.material.common.domain.vo.AgreementVo; import com.bonus.material.ma.domain.Type; import com.bonus.material.repair.domain.RepairApplyDetails; import com.bonus.material.settlement.domain.*; -import com.bonus.material.settlement.domain.vo.SltInfoVo; +import com.bonus.material.settlement.domain.vo.*; import com.bonus.material.settlement.domain.dto.PeriodCostQueryDto; -import com.bonus.material.settlement.domain.vo.PeriodCostResultVo; import com.bonus.material.task.domain.TmTask; import org.apache.ibatis.annotations.Param; @@ -136,12 +135,18 @@ public interface SltAgreementInfoMapper { // 查询多个协议号的维修详情 List getRepairDetailsListBatch(@Param("info") SltAgreementInfo info, @Param("taskList") List taskList); + // 查询多个协议号的维修详情 + List getRepairDetailsListBatchExport(@Param("info") SltAgreementInfoRepair info, @Param("taskList") List taskList); + // 查询一个协议号的报废详情(根据taskIds) List getScrapDetailsList(@Param("info") SltAgreementInfo info, @Param("taskList") List taskList); // 查询多个协议号的报废详情 List getScrapDetailsListBatch(@Param("info") SltAgreementInfo info); + // 查询多个协议号的报废详情(用于导出) + List getScrapDetailsListBatchExport(@Param("info") SltAgreementInfoScrap info); + // 获取一个协议号的丢失详情 List getLoseList(SltAgreementInfo bean); @@ -151,6 +156,9 @@ public interface SltAgreementInfoMapper { // 获取丢失报表 List getLostReportList(SltAgreementInfo bean); + // 获取丢失报表(用于导出) + List getLostReportListExport(SltAgreementInfoLose bean); + int updateRelation(SltAgreementApply apply); int updateApply(SltAgreementApply apply); 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 8f697acb..9ef3714c 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 @@ -8,10 +8,8 @@ import com.bonus.material.basic.domain.BmProject; import com.bonus.material.common.domain.dto.SelectDto; import com.bonus.material.settlement.domain.SltAgreementApply; import com.bonus.material.settlement.domain.SltAgreementInfo; -import com.bonus.material.settlement.domain.vo.SltInfoVo; +import com.bonus.material.settlement.domain.vo.*; import com.bonus.material.settlement.domain.dto.PeriodCostQueryDto; -import com.bonus.material.settlement.domain.vo.PeriodCostResultVo; -import com.bonus.material.settlement.domain.vo.PeriodCostSummaryVo; /** * 结算信息Service接口 @@ -119,16 +117,33 @@ public interface ISltAgreementInfoService { */ List getLostReportList(SltAgreementInfo info); + /** + * 查询丢失报表(用于导出) + */ + List getLostReportListExport(SltAgreementInfoLose info); + /** * 维修报表list */ List getRepairReportList(SltAgreementInfo bean); + /** + * 维修报表list(用于导出) + */ + List getRepairReportListExport(SltAgreementInfoRepair bean); + /** * 报废报表list */ List getScrapReportList(SltAgreementInfo bean); + /** + * 报废报表list(用于导出) + */ + List getScrapReportListExport(SltAgreementInfoScrap bean); + + + /** * 进行结算审批 */ 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 424fb9f1..6825776c 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 @@ -28,7 +28,7 @@ import com.bonus.material.common.domain.vo.AgreementVo; 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.domain.vo.*; import com.bonus.material.settlement.mapper.SltAgreementApplyMapper; import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; import com.bonus.material.task.domain.TmTask; @@ -40,8 +40,6 @@ import org.springframework.stereotype.Service; import com.bonus.material.settlement.mapper.SltAgreementInfoMapper; import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.domain.dto.PeriodCostQueryDto; -import com.bonus.material.settlement.domain.vo.PeriodCostResultVo; -import com.bonus.material.settlement.domain.vo.PeriodCostSummaryVo; import com.bonus.material.settlement.service.ISltAgreementInfoService; import org.springframework.transaction.annotation.Transactional; @@ -343,11 +341,11 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { reducCost = reducCost.add(reduction.getLeaseMoney()); } } - sltInfoVo.setLeaseCost(leaseCost); - sltInfoVo.setRepairCost(repairCost); - sltInfoVo.setScrapCost(scrapCost); - sltInfoVo.setLoseCost(loseCost); - sltInfoVo.setReductionCost(reducCost); + sltInfoVo.setLeaseCost(leaseCost.setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); + sltInfoVo.setRepairCost(repairCost.setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); + sltInfoVo.setScrapCost(scrapCost.setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); + sltInfoVo.setLoseCost(loseCost.setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); + sltInfoVo.setReductionCost(reducCost.setScale(GlobalConstants.INT_2, RoundingMode.DOWN)); List relations = getRelations(leaseList, repairList, scrapList, loseList, info); sltInfoVo.setRelations(relations); return sltInfoVo; @@ -562,7 +560,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal num = bean.getNum(); // 原价 x 数量 - BigDecimal costs = buyPrice.multiply(num); + BigDecimal costs = buyPrice.multiply(num).setScale(GlobalConstants.INT_2, RoundingMode.DOWN); //计算租赁费用 bean.setCosts(costs); } @@ -927,6 +925,26 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return loseList; } + /** + * 查询丢失报表(用于导出) + */ + @Override + public List getLostReportListExport(SltAgreementInfoLose info) { + List loseList = sltAgreementInfoMapper.getLostReportListExport(info); + + loseList.removeIf(Objects::isNull); + + for (SltAgreementInfoLose bean : loseList) { + if (null == bean.getBuyPrice()) { + bean.setBuyPrice(BigDecimal.ZERO); + } + if (null == bean.getNum()) { + bean.setNum(BigDecimal.ZERO); + } + } + return loseList; + } + /** * 维修报表list */ @@ -935,6 +953,14 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return sltAgreementInfoMapper.getRepairDetailsListBatch(bean, null); } + /** + * 维修报表list(用于导出) + */ + @Override + public List getRepairReportListExport(SltAgreementInfoRepair bean) { + return sltAgreementInfoMapper.getRepairDetailsListBatchExport(bean, null); + } + /** * 报废报表list */ @@ -943,6 +969,14 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return sltAgreementInfoMapper.getScrapDetailsListBatch(bean); } + /** + * 报废报表list(用于导出) + */ + @Override + public List getScrapReportListExport(SltAgreementInfoScrap bean) { + return sltAgreementInfoMapper.getScrapDetailsListBatchExport(bean); + } + /** * 判断以逗号分隔的字符串是否包含指定的值(严格判断) * @param strings 以逗号分隔的字符串 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowTypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowTypeController.java index a3f90dee..c55cc75d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowTypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowTypeController.java @@ -4,6 +4,7 @@ package com.bonus.material.work.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.work.domain.CostConfig; import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.service.SysWorkflowTypeService; import io.swagger.annotations.Api; @@ -83,4 +84,66 @@ public class SysWorkflowTypeController extends BaseController { } } + + /** + * 结算人员配置列表 + */ + @ApiOperation(value = "结算人员配置列表") + @GetMapping("/costConfigList") + public TableDataInfo costConfigList(CostConfig bean) + { + try { + startPage(); + List list = sysWorkflowTypeService.getCostConfigList(bean); + return getDataTable(list); + }catch (Exception e){ + return getDataTableError(null); + } + } + + /** + * 人员信息列表 + */ + @ApiOperation(value = "结算人员配置列表") + @GetMapping("/costConfigUserList") + public TableDataInfo costConfigUserList(CostConfig bean) + { + try { + List list = sysWorkflowTypeService.getCostConfigUserList(bean); + return getDataTable(list); + }catch (Exception e){ + return getDataTableError(null); + } + } + + /** + * 修改结算人员配置 + */ + @ApiOperation(value = "修改结算人员配置") + @PostMapping("/updateCostConfig") + public AjaxResult updateCostConfig(@RequestBody CostConfig bean) + { + try { + sysWorkflowTypeService.updateCostConfig(bean); + return new AjaxResult(200,"修改成功!"); + }catch (Exception e){ + return error(); + } + } + + /** + * 删除结算人员配置 + */ + @ApiOperation(value = "删除结算人员配置") + @PostMapping("/deleteCostConfig") + public AjaxResult deleteCostConfig(@RequestBody CostConfig bean) + { + try { + sysWorkflowTypeService.deleteCostConfig(bean); + return new AjaxResult(200,"删除成功!"); + }catch (Exception e){ + return error(); + } + } + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/domain/CostConfig.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/domain/CostConfig.java new file mode 100644 index 00000000..320154d7 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/domain/CostConfig.java @@ -0,0 +1,37 @@ +package com.bonus.material.work.domain; + + +import lombok.Data; +import lombok.ToString; + +@Data +@ToString +public class CostConfig { + + /** + * 主键 + */ + private Integer id; + + private Integer processId; + + private Long userId; + + private String processName; + + private String itemName; + + private String itemValue; + + /** + * 是否为结算配置(0:不是,1:是) + */ + private Integer isShowCost; + + + private String nickName; + + private String userNameStr; + + private String[] userIds; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/mapper/SysWorkflowTypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/mapper/SysWorkflowTypeMapper.java index fee49d91..18677d86 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/mapper/SysWorkflowTypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/mapper/SysWorkflowTypeMapper.java @@ -1,7 +1,9 @@ package com.bonus.material.work.mapper; import com.bonus.material.warehouse.domain.WhDirectApplyDetails; +import com.bonus.material.work.domain.CostConfig; import com.bonus.material.work.domain.SysWorkflowType; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,4 +16,14 @@ public interface SysWorkflowTypeMapper { int deleteSysWorkflowType(SysWorkflowType sysWorkflowType); int updateSysWorkflowType(SysWorkflowType sysWorkflowType); + + List getCostConfigList(CostConfig bean); + + List getCostConfigUserList(CostConfig bean); + + String getCostUserName(@Param("userIds") String[] userIds); + + int updateCostConfig(CostConfig bean); + + int deleteCostConfig(CostConfig bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/SysWorkflowTypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/SysWorkflowTypeService.java index a248ca9f..f0e72e89 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/SysWorkflowTypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/SysWorkflowTypeService.java @@ -1,6 +1,7 @@ package com.bonus.material.work.service; +import com.bonus.material.work.domain.CostConfig; import com.bonus.material.work.domain.SysWorkflowType; import java.util.List; @@ -13,4 +14,12 @@ public interface SysWorkflowTypeService { int deleteSysWorkflowType(SysWorkflowType sysWorkflowType); int updateSysWorkflowType(SysWorkflowType sysWorkflowType); + + List getCostConfigList(CostConfig bean); + + List getCostConfigUserList(CostConfig bean); + + int updateCostConfig(CostConfig bean); + + int deleteCostConfig(CostConfig bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowTypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowTypeServiceImpl.java index 64a896d0..36751205 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowTypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/service/impl/SysWorkflowTypeServiceImpl.java @@ -2,12 +2,14 @@ package com.bonus.material.work.service.impl; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.material.work.domain.CostConfig; import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.mapper.SysWorkflowTypeMapper; import com.bonus.material.work.service.SysWorkflowTypeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; @Service @@ -52,4 +54,53 @@ public class SysWorkflowTypeServiceImpl implements SysWorkflowTypeService { public int updateSysWorkflowType(SysWorkflowType sysWorkflowType) { return sysWorkflowTypeMapper.updateSysWorkflowType(sysWorkflowType); } + + /** + * 结算人员配置列表 + */ + @Override + public List getCostConfigList(CostConfig bean) { + List list = sysWorkflowTypeMapper.getCostConfigList(bean); + if(list != null && list.size() > 0){ + for (CostConfig costConfig : list) { + if(costConfig.getItemValue() != null && !costConfig.getItemValue().isEmpty()) { + String[] userIds = costConfig.getItemValue().split(","); + for (int i = 0; i < userIds.length; i++) { + userIds[i] = userIds[i].trim(); // 处理可能的空格 + } + costConfig.setUserNameStr(sysWorkflowTypeMapper.getCostUserName(userIds)); + } + } + } + return list; + } + + /** + * 人员信息列表 + */ + @Override + public List getCostConfigUserList(CostConfig bean) { + return sysWorkflowTypeMapper.getCostConfigUserList(bean); + } + + /** + * 修改结算人员配置 + */ + @Override + public int updateCostConfig(CostConfig bean) { + if(bean.getUserIds() != null && bean.getUserIds().length > 0){ + bean.setItemValue(String.join(",", bean.getUserIds())); + }else{ + bean.setItemValue(null); + } + return sysWorkflowTypeMapper.updateCostConfig(bean); + } + + /** + * 删除结算人员配置 + */ + @Override + public int deleteCostConfig(CostConfig bean) { + return sysWorkflowTypeMapper.deleteCostConfig(bean); + } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index c477c886..b88c8455 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -1077,6 +1077,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{aid} + + and bai.agreement_code like concat('%',#{info.agreementCode},'%') + + + + + + + + + + + + + update bm_config + set item_value = #{itemValue} + where id = #{id} + - + + update bm_config + set is_showCost = 0 + where id = #{id} +