结算全部导出,结算权限页面接口

This commit is contained in:
hongchao 2025-11-04 17:05:03 +08:00
parent dfdc2e8340
commit c6028b6166
15 changed files with 1329 additions and 24 deletions

View File

@ -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<SltAgreementInfoLose> list = sltAgreementInfoService.getLostReportListExport(bean);
ExcelUtil<SltAgreementInfoLose> 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<SltAgreementInfoRepair> list = sltAgreementInfoService.getRepairReportListExport(bean);
ExcelUtil<SltAgreementInfoRepair> 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<SltAgreementInfoScrap> list = sltAgreementInfoService.getScrapReportListExport(bean);
ExcelUtil<SltAgreementInfoScrap> 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<SltAgreementInfo> list = sltAgreementInfoService.getSltReportList(query);
if(CollectionUtils.isEmpty(list)){
throw new ServiceException("未查询到未结算协议");
}
// ----------- 给查询出来的协议设置权限控制例如只查询工器具 ---------------
int settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission();
// --------- 拿到list中所有的agreementId存成集合给每个info赋值 ------------------
List<Long> agreementIdsArray = list.stream()
.map(SltAgreementInfo::getAgreementId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (agreementIdsArray.isEmpty()) {
throw new ServiceException("未查询到未结算协议");
}
// --------- 定义返回集合 ------------------
List<SltInfoVo> 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<SltInfoVo> util = new ExcelUtil<>(SltInfoVo.class);
util.exportExcel(response, dataList, "导出未结算报表列表");
}
/**
* 查询历史报表列表按年月
*

View File

@ -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<Long> 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<Long> 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;
}

View File

@ -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<Long> 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<Long> 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;
}

View File

@ -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<Long> 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<Long> 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;
}

View File

@ -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 = "申请时间")

View File

@ -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<SltAgreementInfo> getRepairDetailsListBatch(@Param("info") SltAgreementInfo info, @Param("taskList") List<TmTask> taskList);
// 查询多个协议号的维修详情
List<SltAgreementInfoRepair> getRepairDetailsListBatchExport(@Param("info") SltAgreementInfoRepair info, @Param("taskList") List<TmTask> taskList);
// 查询一个协议号的报废详情根据taskIds
List<SltAgreementInfo> getScrapDetailsList(@Param("info") SltAgreementInfo info, @Param("taskList") List<TmTask> taskList);
// 查询多个协议号的报废详情
List<SltAgreementInfo> getScrapDetailsListBatch(@Param("info") SltAgreementInfo info);
// 查询多个协议号的报废详情(用于导出)
List<SltAgreementInfoScrap> getScrapDetailsListBatchExport(@Param("info") SltAgreementInfoScrap info);
// 获取一个协议号的丢失详情
List<SltAgreementInfo> getLoseList(SltAgreementInfo bean);
@ -151,6 +156,9 @@ public interface SltAgreementInfoMapper {
// 获取丢失报表
List<SltAgreementInfo> getLostReportList(SltAgreementInfo bean);
// 获取丢失报表(用于导出)
List<SltAgreementInfoLose> getLostReportListExport(SltAgreementInfoLose bean);
int updateRelation(SltAgreementApply apply);
int updateApply(SltAgreementApply apply);

View File

@ -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<SltAgreementInfo> getLostReportList(SltAgreementInfo info);
/**
* 查询丢失报表(用于导出)
*/
List<SltAgreementInfoLose> getLostReportListExport(SltAgreementInfoLose info);
/**
* 维修报表list
*/
List<SltAgreementInfo> getRepairReportList(SltAgreementInfo bean);
/**
* 维修报表list(用于导出)
*/
List<SltAgreementInfoRepair> getRepairReportListExport(SltAgreementInfoRepair bean);
/**
* 报废报表list
*/
List<SltAgreementInfo> getScrapReportList(SltAgreementInfo bean);
/**
* 报废报表list(用于导出)
*/
List<SltAgreementInfoScrap> getScrapReportListExport(SltAgreementInfoScrap bean);
/**
* 进行结算审批
*/

View File

@ -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<SltAgreementRelation> 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<SltAgreementInfoLose> getLostReportListExport(SltAgreementInfoLose info) {
List<SltAgreementInfoLose> 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<SltAgreementInfoRepair> 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<SltAgreementInfoScrap> getScrapReportListExport(SltAgreementInfoScrap bean) {
return sltAgreementInfoMapper.getScrapDetailsListBatchExport(bean);
}
/**
* 判断以逗号分隔的字符串是否包含指定的值(严格判断)
* @param strings 以逗号分隔的字符串

View File

@ -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<CostConfig> list = sysWorkflowTypeService.getCostConfigList(bean);
return getDataTable(list);
}catch (Exception e){
return getDataTableError(null);
}
}
/**
* 人员信息列表
*/
@ApiOperation(value = "结算人员配置列表")
@GetMapping("/costConfigUserList")
public TableDataInfo costConfigUserList(CostConfig bean)
{
try {
List<CostConfig> 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();
}
}
}

View File

@ -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;
}

View File

@ -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<CostConfig> getCostConfigList(CostConfig bean);
List<CostConfig> getCostConfigUserList(CostConfig bean);
String getCostUserName(@Param("userIds") String[] userIds);
int updateCostConfig(CostConfig bean);
int deleteCostConfig(CostConfig bean);
}

View File

@ -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<CostConfig> getCostConfigList(CostConfig bean);
List<CostConfig> getCostConfigUserList(CostConfig bean);
int updateCostConfig(CostConfig bean);
int deleteCostConfig(CostConfig bean);
}

View File

@ -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<CostConfig> getCostConfigList(CostConfig bean) {
List<CostConfig> 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<CostConfig> 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);
}
}

View File

@ -1077,6 +1077,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{aid}
</foreach>
</if>
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
</select>
<select id="getRepairDetailsListBatchExport" resultType="com.bonus.material.settlement.domain.vo.SltAgreementInfoRepair">
select
tta.agreement_id as agreementId,
bai.agreement_code as agreementCode,
bui.unit_name as unitName,
bp.pro_name as projectName,
rc.id as costId,
rc.type_id as typeId,
rc.ma_id as maId,
mt1.type_name as typeName,
mt.type_name as modelName,
mt.unit_name as mtUnitName,
rc.repair_num as num,
rc.costs as costs,
case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType,
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus
from repair_cost rc
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 bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_project bp ON bp.pro_id = bai.project_id
left join bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on rc.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where rc.status in ('0','1')
and rc.repair_type in ('1','2')
<if test="info.settlementType != null and info.settlementType != 0">
and mt.jiju_type = #{info.settlementType}
</if>
<if test="info.agreementIds != null and info.agreementIds.size > 0">
and tta.agreement_id in
<foreach item="aid" collection="info.agreementIds" open="(" separator="," close=")">
#{aid}
</foreach>
</if>
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
</select>
<select id="getScrapDetailsListBatch" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -1092,7 +1137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name as modelName,
mt.unit_name as mtUnitName,
rc.repair_num as num,
rc.costs as costs,
Round(rc.costs,2) as costs,
case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType,
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' when '3' then '其他维修' else '' end as repairType,
rc.company_id as companyId,
@ -1116,6 +1161,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{aid}
</foreach>
</if>
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
</select>
<select id="getScrapDetailsListBatchExport" resultType="com.bonus.material.settlement.domain.vo.SltAgreementInfoScrap">
select
tta.agreement_id as agreementId,
bai.agreement_code as agreementCode,
bui.unit_name as unitName,
bp.pro_name as projectName,
rc.id as costId,
rc.type_id as typeId,
rc.ma_id as maId,
mt1.type_name as typeName,
mt.type_name as modelName,
mt.unit_name as mtUnitName,
rc.repair_num as num,
Round(rc.costs,2) as costs,
case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType,
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' when '3' then '其他维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus
from repair_cost rc
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 bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt on rc.type_id = mt.type_id
LEFT JOIN ma_type mt1 on mt.parent_id = mt1.type_id
where rc.status in ('0','1')
and rc.repair_type = '3'
<if test="info.settlementType != null and info.settlementType != 0">
and mt.jiju_type = #{info.settlementType}
</if>
<if test="info.agreementIds != null and info.agreementIds.size > 0">
and tta.agreement_id in
<foreach item="aid" collection="info.agreementIds" open="(" separator="," close=")">
#{aid}
</foreach>
</if>
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
</select>
<select id="getLostReportList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -1129,8 +1219,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt1.type_name as typeName,
mt.type_name as modelName,
mt.unit_name as mtUnitName,
mt.buy_price as buyPrice,
sum(sai.num) as num
ROUND(mt.buy_price, 2) as buyPrice,
sum(sai.num) as num,
ROUND(mt.buy_price * sum(sai.num), 2) as loseCost
from
slt_agreement_info sai
LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id
@ -1153,6 +1244,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.agreement_id,mt.type_id
</select>
<select id="getLostReportListExport" resultType="com.bonus.material.settlement.domain.vo.SltAgreementInfoLose">
select sai.id,
sai.agreement_id as agreementId,
bai.agreement_code as agreementCode,
bui.unit_name as unitName,
bp.pro_name as projectName,
sai.type_id as typeId,
sai.ma_id as maId,
mt1.type_name as typeName,
mt.type_name as modelName,
mt.unit_name as mtUnitName,
ROUND(mt.buy_price, 2) as buyPrice,
sum(sai.num) as num,
ROUND(mt.buy_price * sum(sai.num), 2) as loseCost
from
slt_agreement_info sai
LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
<where>
<if test="settlementType != null and settlementType != 0">
and mt.jiju_type = #{settlementType}
</if>
<if test="startTime != null and endTime != null">
and sai.create_time between #{startTime} and #{endTime}
</if>
<if test="agreementCode != null and agreementCode != ''">
and bai.agreement_code like concat('%',#{agreementCode},'%')
</if>
</where>
GROUP BY
sai.agreement_id,mt.type_id
</select>
<select id="selectLeasePeriodCostList" parameterType="com.bonus.material.settlement.domain.dto.PeriodCostQueryDto" resultMap="PeriodCostResultMap">
SELECT

View File

@ -58,7 +58,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isEnable != null "> and is_enable = #{isEnable}</if>
<if test="keyWord != null "> and type_name like concat('%', #{keyWord}, '%')</if>
</select>
<select id="getCostConfigList" resultType="com.bonus.material.work.domain.CostConfig">
select id,
item_name as itemName,
item_value as itemValue,
case when item_name = 'equipment_cost_users' then '工器具'
when item_name = 'safety_equipment_cost_users' then '安全工器具'
else '' end as processName
from bm_config
where is_showCost = 1
</select>
<select id="getCostConfigUserList" resultType="com.bonus.material.work.domain.CostConfig">
select
su.user_id as userId,
su.nick_name as nickName
from sys_user su
where
su.del_flag = 0
</select>
<select id="getCostUserName" resultType="java.lang.String">
select group_concat(nick_name) as userName from sys_user where user_id in
<foreach collection="userIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and del_flag = 0
</select>
<update id="updateCostConfig" parameterType="com.bonus.material.work.domain.CostConfig">
update bm_config
set item_value = #{itemValue}
where id = #{id}
</update>
<update id="deleteCostConfig" parameterType="com.bonus.material.work.domain.CostConfig">
update bm_config
set is_showCost = 0
where id = #{id}
</update>
</mapper>