diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmReportController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmReportController.java new file mode 100644 index 00000000..5f7c0869 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmReportController.java @@ -0,0 +1,409 @@ +package com.bonus.material.basic.controller; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.bonus.common.core.utils.poi.ExcelUtil; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.basic.domain.report.*; +import com.bonus.material.basic.service.BmReportService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * @Author ma_sh + * @create 2025/1/22 9:52 + */ +@Api(tags = "报表查询") +@RestController +@RequestMapping("/bm_report") +public class BmReportController extends BaseController { + + @Resource + private BmReportService bmReportService; + + /** + * 新购入库报表查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--新购入库报表查询") + @GetMapping("/getPurChaseReportList") + public AjaxResult getPurChaseReportList(PurChaseReportInfo bean) { + bean.setIsExport(1); + startPage(); + List pageList = bmReportService.getPurChaseReportList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + @ApiOperation(value = "设备追溯查询--新购入库报表查询不分页") + @GetMapping("/getPurChaseReportListNoPage") + public AjaxResult getPurChaseReportListNoPage(PurChaseReportInfo bean) { + bean.setIsExport(0); + List list = bmReportService.getPurChaseReportList(bean); + PurChaseReportInfo reportInfo = new PurChaseReportInfo(); + if (CollectionUtils.isNotEmpty(list)) { + PurChaseReportInfo info = list.get(0); + reportInfo.setPurchaseNum(info.getPurchaseNum()); + reportInfo.setPassNum(info.getPassNum()); + reportInfo.setInputNum(info.getInputNum()); + reportInfo.setPurchasePrice(info.getPurchasePrice()); + reportInfo.setPurchasePriceNoTax(info.getPurchasePriceNoTax()); + reportInfo.setPendingInputNum(info.getPendingInputNum()); + } + return AjaxResult.success(reportInfo); + } + + /** + * 新购入库报表详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--新购入库报表详情查询") + @GetMapping("/getPurChaseReportDetailsList") + public AjaxResult getPurChaseReportDetailsList(PurChaseReportInfo bean) { + startPage(); + List pageList = bmReportService.getPurChaseReportDetailsList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 导出设备追溯查询-新购入库报表 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-新购入库报表") + @PostMapping("/exportPurChaseReportList") + public void exportPurChaseReportList(HttpServletResponse response, PurChaseReportInfo bean) + { + bean.setIsExport(0); + List list = bmReportService.getPurChaseReportList(bean); + ExcelUtil util = new ExcelUtil<>(PurChaseReportInfo.class); + util.exportExcel(response, list, "设备追溯查询-新购入库报表"); + } + + /** + * 导出设备追溯查询-新购入库报表详情 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-新购入库报表详情") + @PostMapping("/exportPurChaseReportDetailsList") + public void exportPurChaseReportDetailsList(HttpServletResponse response, PurChaseReportInfo bean) + { + List list = bmReportService.getPurChaseReportDetailsList(bean); + ExcelUtil util = new ExcelUtil<>(PurChaseReportDetails.class); + util.exportExcel(response, list, "设备追溯查询-新购入库报表详情"); + } + + /** + * 领料出库报表查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--领料出库报表查询") + @GetMapping("/getLeaseOutList") + public AjaxResult getLeaseOutList(LeaseOutInfo bean) { + bean.setIsExport(1); + startPage(); + List pageList = bmReportService.getLeaseOutList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 领料出库报表查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--领料出库报表查询不分页") + @GetMapping("/getLeaseOutListNoPage") + public AjaxResult getLeaseOutListNoPage(LeaseOutInfo bean) { + bean.setIsExport(0); + List list = bmReportService.getLeaseOutList(bean); + LeaseOutInfo info = new LeaseOutInfo(); + if (CollectionUtils.isNotEmpty(list)) { + LeaseOutInfo leaseOutInfo = list.get(0); + info.setLeaseNum(leaseOutInfo.getLeaseNum()); + info.setOutNum(leaseOutInfo.getOutNum()); + info.setPendingOutNum(leaseOutInfo.getPendingOutNum()); + } + return AjaxResult.success(info); + } + + /** + * 领料出库报表详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--领料出库报表详情查询") + @GetMapping("/getLeaseOutDetailsList") + public AjaxResult getLeaseOutDetailsList(LeaseOutInfo bean) { + startPage(); + List pageList = bmReportService.getLeaseOutDetailsList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 导出设备追溯查询-领料出库报表查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-领料出库报表查询") + @PostMapping("/exportLeaseOutList") + public void exportLeaseOutList(HttpServletResponse response, LeaseOutInfo bean) + { + bean.setIsExport(0); + List list = bmReportService.getLeaseOutList(bean); + ExcelUtil util = new ExcelUtil<>(LeaseOutInfo.class); + util.exportExcel(response, list, "设备追溯查询-领料出库报表查询"); + } + + /** + * 导出设备追溯查询-领料出库报表详情查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-领料出库报表详情查询") + @PostMapping("/exportLeaseOutDetailsList") + public void exportLeaseOutDetailsList(HttpServletResponse response, LeaseOutInfo bean) + { + List list = bmReportService.getLeaseOutDetailsList(bean); + ExcelUtil util = new ExcelUtil<>(LeaseOutDetails.class); + util.exportExcel(response, list, "设备追溯查询-领料出库报表详情查询"); + } + + /** + * 退料报表查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--退料报表查询") + @GetMapping("/getBackInputList") + public AjaxResult getBackInputList(BackInputInfo bean) { + bean.setIsExport(1); + startPage(); + List pageList = bmReportService.getBackInputList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 退料报表查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--退料报表查询不分页") + @GetMapping("/getBackInputListNoPage") + public AjaxResult getBackInputListNoPage(BackInputInfo bean) { + bean.setIsExport(0); + List list = bmReportService.getBackInputList(bean); + BackInputInfo info = new BackInputInfo(); + if (CollectionUtils.isNotEmpty(list)) { + BackInputInfo backInputInfo = list.get(0); + info.setBackNum(backInputInfo.getBackNum()); + } + return AjaxResult.success(info); + } + + /** + * 退料报表查询详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--退料报表查询详情") + @GetMapping("/getBackDetailsInputList") + public AjaxResult getBackDetailsInputList(BackInputInfo bean) { + startPage(); + List pageList = bmReportService.getBackDetailsInputList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 导出设备追溯查询-退料报表查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-退料报表查询") + @PostMapping("/exportBackInputList") + public void exportBackInputList(HttpServletResponse response, BackInputInfo bean) + { + bean.setIsExport(0); + List list = bmReportService.getBackInputList(bean); + ExcelUtil util = new ExcelUtil<>(BackInputInfo.class); + util.exportExcel(response, list, "设备追溯查询-退料报表查询"); + } + + /** + * 导出设备追溯查询-退料报表查询详情 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-退料报表查询详情") + @PostMapping("/exportBackDetailsInputList") + public void exportBackDetailsInputList(HttpServletResponse response, BackInputInfo bean) + { + List list = bmReportService.getBackDetailsInputList(bean); + ExcelUtil util = new ExcelUtil<>(BackInputDetails.class); + util.exportExcel(response, list, "设备追溯查询-退料报表查询详情"); + } + + /** + * 维修报表 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--维修报表") + @GetMapping("/getRepairList") + public AjaxResult getRepairList(RepairInfo bean) { + bean.setIsExport(1); + startPage(); + List pageList = bmReportService.getRepairList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 维修报表查询不分页 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--维修报表查询不分页") + @GetMapping("/getRepairListNoPage") + public AjaxResult getRepairListNoPage(RepairInfo bean) { + bean.setIsExport(0); + List list = bmReportService.getRepairList(bean); + RepairInfo info = new RepairInfo(); + if (CollectionUtils.isNotEmpty(list)) { + RepairInfo repairInfo = list.get(0); + info.setBackNum(repairInfo.getBackNum()); + info.setRepairedNum(repairInfo.getRepairedNum()); + info.setPendingScrapNum(repairInfo.getPendingScrapNum()); + info.setPendingRepairNum(repairInfo.getPendingRepairNum()); + } + return AjaxResult.success(info); + } + + /** + * 维修报表查询详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--维修报表查询详情") + @GetMapping("/getRepairDetailsList") + public AjaxResult getRepairDetailsList(RepairInfo bean) { + startPage(); + List list = bmReportService.getRepairDetailsList(bean); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 导出设备追溯查询-维修报表查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-维修报表查询") + @PostMapping("/exportRepairList") + public void exportRepairList(HttpServletResponse response, RepairInfo bean) + { + bean.setIsExport(0); + List list = bmReportService.getRepairList(bean); + ExcelUtil util = new ExcelUtil<>(RepairInfo.class); + util.exportExcel(response, list, "设备追溯查询-维修报表查询"); + } + + /** + * 导出设备追溯查询-维修报表查询详情 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-维修报表查询详情") + @PostMapping("/exportRepairDetailsList") + public void exportRepairDetailsList(HttpServletResponse response, RepairInfo bean) + { + List list = bmReportService.getRepairDetailsList(bean); + ExcelUtil util = new ExcelUtil<>(RepairDetails.class); + util.exportExcel(response, list, "设备追溯查询-维修报表查询详情"); + } + + /** + * 修饰入库报表 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--修饰入库报表") + @GetMapping("/getRepairInputList") + public AjaxResult getRepairInputList(RepairInputDto bean) { + bean.setIsExport(1); + startPage(); + List pageList = bmReportService.getRepairInputList(bean); + return AjaxResult.success(getDataTable(pageList)); + } + + /** + * 修饰入库报表查询不分页 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--修饰入库报表查询不分页") + @GetMapping("/getRepairInputListNoPage") + public AjaxResult getRepairInputListNoPage(RepairInputDto bean) { + bean.setIsExport(0); + List pageList = bmReportService.getRepairInputList(bean); + RepairInputDto info = new RepairInputDto(); + if (CollectionUtils.isNotEmpty(pageList)) { + RepairInputDto repairInputInfo = pageList.get(0); + info.setRepairedNum(repairInputInfo.getRepairedNum()); + info.setInputNum(repairInputInfo.getInputNum()); + info.setPendingInputNum(repairInputInfo.getPendingInputNum()); + } + return AjaxResult.success(info); + } + + /** + * 修饰入库报表查询详情查询 + * @param bean + * @return + */ + @ApiOperation(value = "设备追溯查询--修饰入库报表查询详情") + @GetMapping("/getRepairInputDetailsList") + public AjaxResult getRepairInputDetailsList(RepairInputDto bean) { + startPage(); + List list = bmReportService.getRepairInputDetailsList(bean); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 导出设备追溯查询-修饰入库报表查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-修饰入库报表查询") + @PostMapping("/exportRepairInputList") + public void exportRepairList(HttpServletResponse response, RepairInputDto bean) + { + bean.setIsExport(0); + List list = bmReportService.getRepairInputList(bean); + ExcelUtil util = new ExcelUtil<>(RepairInputDto.class); + util.exportExcel(response, list, "设备追溯查询-修饰入库报表"); + } + + /** + * 导出设备追溯查询-修饰入库报表查询详情查询 + * @param response + * @param bean + */ + @ApiOperation("导出设备追溯查询-修饰入库报表详情查询") + @PostMapping("/exportRepairInputDetailsList") + public void exportRepairInputDetailsList(HttpServletResponse response, RepairInputDto bean) + { + List list = bmReportService.getRepairInputDetailsList(bean); + ExcelUtil util = new ExcelUtil<>(RepairInputDetails.class); + util.exportExcel(response, list, "设备追溯查询-修饰入库报表详情查询"); + } + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputDetails.java new file mode 100644 index 00000000..ba24d844 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputDetails.java @@ -0,0 +1,38 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 退料报表详情 + * @Author ma_sh + * @create 2025/1/22 16:40 + */ +@Data +public class BackInputDetails { + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; + + @ApiModelProperty(value = "入库人员") + @Excel(name = "入库人员") + private String inputPersonName; + + @ApiModelProperty(value = "入库时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "入库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inputTime; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputInfo.java new file mode 100644 index 00000000..851553bb --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/BackInputInfo.java @@ -0,0 +1,80 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 退料入库报表 + * @Author ma_sh + * @create 2025/1/22 16:36 + */ +@Data +public class BackInputInfo { + + @ApiModelProperty(value = "是否导出 0 是,1 否") + private Integer isExport; + + @ApiModelProperty(value = "父级id") + private Long parentId; + + @ApiModelProperty(value = "物资类型id") + private Long typeId; + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + @ApiModelProperty(value = "退料数量") + @Excel(name = "退料数量") + private BigDecimal backNum; + + @ApiModelProperty(value = "退料日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "退料日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date backTime; + + @ApiModelProperty(value = "退料单位") + @Excel(name = "退料单位") + private String backUnitName; + + @ApiModelProperty(value = "退料工程") + @Excel(name = "退料工程") + private String backProjectName; + + @ApiModelProperty(value = "退料人") + @Excel(name = "退料人") + private String backPersonName; + + @ApiModelProperty(value = "操作人") + @Excel(name = "操作人") + private String createBy; + + @ApiModelProperty(value = "退料单号") + @Excel(name = "退料单号") + private String code; + + @ApiModelProperty(value = "管理方式") + private String manageType; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutDetails.java new file mode 100644 index 00000000..c8b61cc6 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutDetails.java @@ -0,0 +1,38 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 领料出库报表详情 + * @Author ma_sh + * @create 2025/1/22 16:07 + */ +@Data +public class LeaseOutDetails { + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; + + @ApiModelProperty(value = "出库人员") + @Excel(name = "出库人员") + private String outPersonName; + + @ApiModelProperty(value = "出库时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "出库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date outTime; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java new file mode 100644 index 00000000..1ba85c9c --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/LeaseOutInfo.java @@ -0,0 +1,93 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 领料出库报表 + * @Author ma_sh + * @create 2025/1/22 14:58 + */ +@Data +public class LeaseOutInfo { + + @ApiModelProperty(value = "是否导出 0 是,1 否") + private Integer isExport; + + @ApiModelProperty(value = "父级id") + private Long parentId; + + @ApiModelProperty(value = "物资类型id") + private Long typeId; + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + @ApiModelProperty(value = "领料数量") + @Excel(name = "领料数量") + private BigDecimal leaseNum; + + @ApiModelProperty(value = "出库数量") + @Excel(name = "出库数量") + private BigDecimal outNum; + + @ApiModelProperty(value = "待出库数量") + @Excel(name = "待出库数量") + private BigDecimal pendingOutNum; + + @ApiModelProperty(value = "领料日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "领料日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date leaseTime; + + @ApiModelProperty(value = "出库日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "出库日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date outTime; + + @ApiModelProperty(value = "领料单位") + @Excel(name = "领料单位") + private String leaseUnitName; + + @ApiModelProperty(value = "领料工程") + @Excel(name = "领料工程") + private String leaseProjectName; + + @ApiModelProperty(value = "领料人") + @Excel(name = "领料人") + private String leasePersonName; + + @ApiModelProperty(value = "出库人") + @Excel(name = "出库人") + private String outPersonName; + + @ApiModelProperty(value = "领料单号") + @Excel(name = "领料单号") + private String code; + + @ApiModelProperty(value = "管理方式") + private String manageType; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportDetails.java new file mode 100644 index 00000000..1d5892d1 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportDetails.java @@ -0,0 +1,36 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 新购入库报表弹窗详情 + * @Author ma_sh + * @create 2025/1/22 13:29 + */ +@Data +public class PurChaseReportDetails { + + @ApiModelProperty(value = "物资名称") + @Excel(name = "机具名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "采购价格含税") + @Excel(name = "采购价格(含税)") + private BigDecimal purchasePrice; + + @ApiModelProperty(value = "采购价格不含税") + @Excel(name = "采购价格(不含税)") + private BigDecimal purchasePriceNoTax; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportInfo.java new file mode 100644 index 00000000..57539ae8 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/PurChaseReportInfo.java @@ -0,0 +1,102 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 新购入库报表详情 + * @Author ma_sh + * @create 2025/1/22 9:56 + */ +@Data +public class PurChaseReportInfo { + + private Long id; + + @ApiModelProperty(value = "是否导出 0 是,1 否") + private Integer isExport; + + private Long taskId; + + private Long typeId; + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + @ApiModelProperty(value = "采购数量") + @Excel(name = "采购数量") + private BigDecimal purchaseNum; + + @ApiModelProperty(value = "验收合格数量") + @Excel(name = "验收合格数量") + private BigDecimal passNum; + + @ApiModelProperty(value = "入库数量") + @Excel(name = "入库数量") + private BigDecimal inputNum; + + @ApiModelProperty(value = "采购价格含税") + @Excel(name = "采购价格(含税)") + private BigDecimal purchasePrice; + + @ApiModelProperty(value = "采购价格不含税") + @Excel(name = "采购价格(不含税)") + private BigDecimal purchasePriceNoTax; + + @ApiModelProperty(value = "物资厂家") + @Excel(name = "物资厂家") + private String supplierName; + + @ApiModelProperty(value = "采购时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "采购时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date purchaseTime; + + @ApiModelProperty(value = "验收时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "验收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date passTime; + + @ApiModelProperty(value = "入库时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inputTime; + + @ApiModelProperty(value = "入库人员") + @Excel(name = "入库人员") + private String inputUser; + + @ApiModelProperty(value = "待入库数量") + @Excel(name = "待入库数量") + private BigDecimal pendingInputNum; + + @ApiModelProperty(value = "入库单号") + @Excel(name = "入库单号") + private String inputCode; + + @ApiModelProperty(value = "管理方式") + private String manageType; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairDetails.java new file mode 100644 index 00000000..cb84d1d5 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairDetails.java @@ -0,0 +1,38 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author ma_sh + * @create 2025/1/23 10:31 + */ +@Data +public class RepairDetails { + @ApiModelProperty(value = "物资名称") + @Excel(name = "机具名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; + + @ApiModelProperty(value = "维修人") + @Excel(name = "维修人") + private String repairPersonName; + + @ApiModelProperty(value = "维修时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "维修时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date repairTime; + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInfo.java new file mode 100644 index 00000000..2ecd4e4f --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInfo.java @@ -0,0 +1,93 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 维修报表 + * @Author ma_sh + * @create 2025/1/23 10:31 + */ +@Data +public class RepairInfo { + + private Long id; + + @ApiModelProperty(value = "是否导出 0 是,1 否") + private Integer isExport; + + private Long taskId; + + private Long typeId; + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + @ApiModelProperty(value = "退料数量") + @Excel(name = "退料数量") + private BigDecimal backNum; + + @ApiModelProperty(value = "维修合格数量") + @Excel(name = "维修合格数量") + private BigDecimal repairedNum; + + @ApiModelProperty(value = "待报废数量") + @Excel(name = "待报废数量") + private BigDecimal pendingScrapNum; + + @ApiModelProperty(value = "待修数量") + @Excel(name = "待修数量") + private BigDecimal pendingRepairNum; + + @ApiModelProperty(value = "退料日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "退料日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date backTime; + + @ApiModelProperty(value = "维修日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "维修日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date repairTime; + + @ApiModelProperty(value = "领料单位") + @Excel(name = "领料单位") + private String leaseUnitName; + + @ApiModelProperty(value = "领料工程") + @Excel(name = "领料工程") + private String leaseProjectName; + + @ApiModelProperty(value = "维修人") + @Excel(name = "维修人") + private String repairPersonName; + + @ApiModelProperty(value = "维修单号") + @Excel(name = "维修单号") + private String code; + + @ApiModelProperty(value = "管理方式") + private String manageType; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDetails.java new file mode 100644 index 00000000..89eee4aa --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDetails.java @@ -0,0 +1,38 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 维修报表详情 + * @Author ma_sh + * @create 2025/1/23 14:47 + */ +@Data +public class RepairInputDetails { + + @ApiModelProperty(value = "机具名称") + @Excel(name = "机具名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; + + @ApiModelProperty(value = "入库人") + @Excel(name = "入库人") + private String inputPersonName; + + @ApiModelProperty(value = "入库时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "入库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inputTime; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDto.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDto.java new file mode 100644 index 00000000..2263dff3 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/report/RepairInputDto.java @@ -0,0 +1,81 @@ +package com.bonus.material.basic.domain.report; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 修饰后入库报表 + * @Author ma_sh + * @create 2025/1/23 14:43 + */ +@Data +public class RepairInputDto { + + private Long id; + + @ApiModelProperty(value = "是否导出 0 是,1 否") + private Integer isExport; + + private Long taskId; + + private Long typeId; + + @ApiModelProperty(value = "物资名称") + @Excel(name = "物资名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + @ApiModelProperty(value = "维修合格数量") + @Excel(name = "维修合格数量") + private BigDecimal repairedNum; + + @ApiModelProperty(value = "入库数量") + @Excel(name = "入库数量") + private BigDecimal inputNum; + + @ApiModelProperty(value = "维修提交时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "维修提交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date repairTime; + + @ApiModelProperty(value = "入库时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inputTime; + + @ApiModelProperty(value = "入库人员") + @Excel(name = "入库人员") + private String inputPersonName; + + @ApiModelProperty(value = "待入库数量") + @Excel(name = "待入库数量") + private BigDecimal pendingInputNum; + + @ApiModelProperty(value = "入库单号") + @Excel(name = "入库单号") + private String code; + + @ApiModelProperty(value = "管理方式") + private String manageType; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmReportMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmReportMapper.java new file mode 100644 index 00000000..60c25cc2 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmReportMapper.java @@ -0,0 +1,83 @@ +package com.bonus.material.basic.mapper; + +import com.bonus.material.basic.domain.report.*; + +import java.util.List; + +/** + * @ClassName BmReportMapper + * @Author ma_sh + * @create 2025/1/22 9:55 + */ +public interface BmReportMapper { + + /** + * 新购入库报表查询 + * @param bean + * @return + */ + List getPurChaseReportList(PurChaseReportInfo bean); + + /** + * 新购入库报表查询详情 + * @param bean + * @return + */ + List getPurChaseReportDetailsList(PurChaseReportInfo bean); + + /** + * 领料出库报表查询 + * @param bean + * @return + */ + List getLeaseOutList(LeaseOutInfo bean); + + /** + * 领料出库报表查询详情 + * @param bean + * @return + */ + List getLeaseOutDetailsList(LeaseOutInfo bean); + + /** + * 退料入库报表查询 + * @param bean + * @return + */ + List getBackInputList(BackInputInfo bean); + + /** + * 退料入库报表查询详情 + * @param bean + * @return + */ + List getBackDetailsInputList(BackInputInfo bean); + + /** + * 维修报表 + * @param bean + * @return + */ + List getRepairList(RepairInfo bean); + + /** + * 维修报表详情 + * @param bean + * @return + */ + List getRepairDetailsList(RepairInfo bean); + + /** + * 修饰入库报表 + * @param bean + * @return + */ + List getRepairInputList(RepairInputDto bean); + + /** + * 修饰入库报表查询详情查询 + * @param bean + * @return + */ + List getRepairInputDetailsList(RepairInputDto bean); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmReportService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmReportService.java new file mode 100644 index 00000000..7e7ced84 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/BmReportService.java @@ -0,0 +1,83 @@ +package com.bonus.material.basic.service; + +import com.bonus.material.basic.domain.report.*; + +import java.util.List; + +/** + * 报表服务service + * @Author ma_sh + * @create 2025/1/22 9:53 + */ +public interface BmReportService { + + /** + * 新购入库报表查询 + * @param bean + * @return + */ + List getPurChaseReportList(PurChaseReportInfo bean); + + /** + * 新购入库报表详情查询 + * @param bean + * @return + */ + List getPurChaseReportDetailsList(PurChaseReportInfo bean); + + /** + * 领料出库报表查询 + * @param bean + * @return + */ + List getLeaseOutList(LeaseOutInfo bean); + + /** + * 领料出库报表详情查询 + * @param bean + * @return + */ + List getLeaseOutDetailsList(LeaseOutInfo bean); + + /** + * 退料报表查询 + * @param bean + * @return + */ + List getBackInputList(BackInputInfo bean); + + /** + * 退料报表详情查询 + * @param bean + * @return + */ + List getBackDetailsInputList(BackInputInfo bean); + + /** + * 维修报表 + * @param bean + * @return + */ + List getRepairList(RepairInfo bean); + + /** + * 维修报表查询详情查询 + * @param bean + * @return + */ + List getRepairDetailsList(RepairInfo bean); + + /** + * 修饰入库报表 + * @param bean + * @return + */ + List getRepairInputList(RepairInputDto bean); + + /** + * 修饰入库报表查询详情查询 + * @param bean + * @return + */ + List getRepairInputDetailsList(RepairInputDto bean); +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmProjectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmProjectServiceImpl.java index a3d539aa..5106da17 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmProjectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmProjectServiceImpl.java @@ -11,6 +11,7 @@ import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.enums.HttpCodeEnum; import com.bonus.common.core.constant.SecurityConstants; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.core.utils.encryption.Sm4Utils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.purchase.config.RemoteConfig; @@ -90,6 +91,9 @@ public class BmProjectServiceImpl implements IBmProjectService */ private void extractedImpUnit(BmProject project) { try { + if (!StringUtils.isBlank(project.getTelphone())) { + project.setTelphone(Sm4Utils.decrypt(project.getTelphone())); + } AjaxResult ajaxResult = remoteDeptService.getInfo(Long.parseLong(project.getImpUnit()), SecurityConstants.INNER); //健壮性判断 if (ajaxResult.isSuccess()) { @@ -169,7 +173,7 @@ public class BmProjectServiceImpl implements IBmProjectService return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), "工程名称或工程编码与库中重复"); } //校验输入的经纬度是否合规 - if (bmProject.getLon() != null) { + /*if (bmProject.getLon() != null) { if (!bmProject.getLon().matches(MaterialConstants.LONGITUDE_PATTERN)){ return AjaxResult.error(HttpCodeEnum.INVALID_LONGITUDE_FORMAT.getCode(), HttpCodeEnum.INVALID_LONGITUDE_FORMAT.getMsg()); } @@ -178,13 +182,15 @@ public class BmProjectServiceImpl implements IBmProjectService if (!bmProject.getLat().matches(MaterialConstants.LATITUDE_PATTERN)){ return AjaxResult.error(HttpCodeEnum.INVALID_LATITUDE_FORMAT.getCode(), HttpCodeEnum.INVALID_LATITUDE_FORMAT.getMsg()); } - } + }*/ //判断手机号是否合法 if (StringUtils.isNotBlank(bmProject.getTelphone()) && !PhoneUtil.isMobile(bmProject.getTelphone())) { return AjaxResult.error(HttpCodeEnum.INVALID_PHONE_FORMAT.getCode(), HttpCodeEnum.INVALID_PHONE_FORMAT.getMsg()); } + String telPhone = Sm4Utils.encrypt(bmProject.getTelphone()); bmProject.setCreateTime(DateUtils.getNowDate()); bmProject.setCreateBy(SecurityUtils.getUserId().toString()); + bmProject.setTelphone(telPhone); int result = bmProjectMapper.insertBmProject(bmProject); if (result > 0) { return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result); @@ -215,7 +221,7 @@ public class BmProjectServiceImpl implements IBmProjectService } } //校验输入的经纬度是否合规 - if (bmProject.getLon() != null) { + /*if (bmProject.getLon() != null) { if (!bmProject.getLon().matches(MaterialConstants.LONGITUDE_PATTERN)){ return AjaxResult.error(HttpCodeEnum.INVALID_LONGITUDE_FORMAT.getCode(), HttpCodeEnum.INVALID_LONGITUDE_FORMAT.getMsg()); } @@ -224,11 +230,13 @@ public class BmProjectServiceImpl implements IBmProjectService if (!bmProject.getLat().matches(MaterialConstants.LATITUDE_PATTERN)){ return AjaxResult.error(HttpCodeEnum.INVALID_LATITUDE_FORMAT.getCode(), HttpCodeEnum.INVALID_LATITUDE_FORMAT.getMsg()); } - } + }*/ //判断手机号是否合法 if (StringUtils.isNotBlank(bmProject.getTelphone()) && !PhoneUtil.isMobile(bmProject.getTelphone())) { return AjaxResult.error(HttpCodeEnum.INVALID_PHONE_FORMAT.getCode(), HttpCodeEnum.INVALID_PHONE_FORMAT.getMsg()); } + String telPhone = Sm4Utils.encrypt(bmProject.getTelphone()); + bmProject.setTelphone(telPhone); bmProject.setUpdateTime(DateUtils.getNowDate()); bmProject.setUpdateBy(SecurityUtils.getUserId().toString()); int result = bmProjectMapper.updateBmProject(bmProject); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmReportServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmReportServiceImpl.java new file mode 100644 index 00000000..8055bc59 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmReportServiceImpl.java @@ -0,0 +1,225 @@ +package com.bonus.material.basic.service.impl; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.bonus.material.basic.domain.report.*; +import com.bonus.material.basic.mapper.BmReportMapper; +import com.bonus.material.basic.service.BmReportService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @ClassName BmReportServiceImpl + * @Author ma_sh + * @create 2025/1/22 9:53 + */ +@Service +public class BmReportServiceImpl implements BmReportService { + + @Resource + private BmReportMapper bmReportMapper; + + /** + * 新购入库报表查询 + * @param bean + * @return + */ + @Override + public List getPurChaseReportList(PurChaseReportInfo bean) { + BigDecimal totalPurchaseNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPassNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPurchasePrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); + BigDecimal totalPurchasePriceNoTax = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); + BigDecimal totalPendingInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = bmReportMapper.getPurChaseReportList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (PurChaseReportInfo purChaseReportInfo : list) { + totalPurchaseNum = totalPurchaseNum.add(purChaseReportInfo.getPurchaseNum()); + totalPassNum = totalPassNum.add(purChaseReportInfo.getPassNum()); + totalInputNum = totalInputNum.add(purChaseReportInfo.getInputNum()); + totalPurchasePrice = totalPurchasePrice.add(purChaseReportInfo.getPurchasePrice()); + totalPurchasePriceNoTax = totalPurchasePriceNoTax.add(purChaseReportInfo.getPurchasePriceNoTax()); + totalPendingInputNum = totalPendingInputNum.add(purChaseReportInfo.getPendingInputNum()); + } + } + if (bean.getIsExport() == 0) { + PurChaseReportInfo info = new PurChaseReportInfo(); + info.setPurchaseNum(totalPurchaseNum); + info.setPassNum(totalPassNum); + info.setInputNum(totalInputNum); + info.setPurchasePrice(totalPurchasePrice); + info.setPurchasePriceNoTax(totalPurchasePriceNoTax); + info.setPendingInputNum(totalPendingInputNum); + info.setUnitName("合计"); + list.add(0, info); + } + return list; + } + + /** + * 新购入库报表查询详情 + * @param bean + * @return + */ + @Override + public List getPurChaseReportDetailsList(PurChaseReportInfo bean) { + return bmReportMapper.getPurChaseReportDetailsList(bean); + } + + /** + * 领料出库报表查询 + * @param bean + * @return + */ + @Override + public List getLeaseOutList(LeaseOutInfo bean) { + BigDecimal totalLeaseNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalOutNumNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPendingOutNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = bmReportMapper.getLeaseOutList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (LeaseOutInfo leaseOutInfo : list) { + totalLeaseNum = totalLeaseNum.add(leaseOutInfo.getLeaseNum()); + totalOutNumNum = totalOutNumNum.add(leaseOutInfo.getOutNum()); + totalPendingOutNum = totalPendingOutNum.add(leaseOutInfo.getPendingOutNum()); + } + } + if (bean.getIsExport() == 0) { + LeaseOutInfo info = new LeaseOutInfo(); + info.setLeaseNum(totalLeaseNum); + info.setOutNum(totalOutNumNum); + info.setPendingOutNum(totalPendingOutNum); + info.setUnitName("合计"); + list.add(0, info); + } + return list; + } + + /** + * 领料出库报表查询详情 + * @param bean + * @return + */ + @Override + public List getLeaseOutDetailsList(LeaseOutInfo bean) { + return bmReportMapper.getLeaseOutDetailsList(bean); + } + + /** + * 退料报表查询 + * @param bean + * @return + */ + @Override + public List getBackInputList(BackInputInfo bean) { + BigDecimal totalBackNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = bmReportMapper.getBackInputList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (BackInputInfo backInputInfo : list) { + totalBackNum = totalBackNum.add(backInputInfo.getBackNum()); + } + } + if (bean.getIsExport() == 0) { + BackInputInfo info = new BackInputInfo(); + info.setBackNum(totalBackNum); + info.setUnitName("合计"); + list.add(0, info); + } + return list; + } + + /** + * 退料报表查询详情 + * @param bean + * @return + */ + @Override + public List getBackDetailsInputList(BackInputInfo bean) { + return bmReportMapper.getBackDetailsInputList(bean); + } + + /** + * 维修报表 + * @param bean + * @return + */ + @Override + public List getRepairList(RepairInfo bean) { + BigDecimal totalBackNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalRepairedNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPendingScrapNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPendingRepairNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = bmReportMapper.getRepairList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (RepairInfo repairInfo : list) { + totalBackNum = totalBackNum.add(repairInfo.getBackNum()); + totalRepairedNum = totalRepairedNum.add(repairInfo.getRepairedNum()); + totalPendingScrapNum = totalPendingScrapNum.add(repairInfo.getPendingScrapNum()); + totalPendingRepairNum = totalPendingRepairNum.add(repairInfo.getPendingRepairNum()); + } + } + if (bean.getIsExport() == 0) { + RepairInfo info = new RepairInfo(); + info.setBackNum(totalBackNum); + info.setRepairedNum(totalRepairedNum); + info.setPendingScrapNum(totalPendingScrapNum); + info.setPendingRepairNum(totalPendingRepairNum); + info.setUnitName("合计"); + list.add(0, info); + } + return list; + } + + /** + * 维修报表详情 + * @param bean + * @return + */ + @Override + public List getRepairDetailsList(RepairInfo bean) { + return bmReportMapper.getRepairDetailsList(bean); + } + + /** + * 修饰入库报表 + * @param bean + * @return + */ + @Override + public List getRepairInputList(RepairInputDto bean) { + BigDecimal totalRepairedNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalPendingInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = bmReportMapper.getRepairInputList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (RepairInputDto repairInputInfo : list) { + totalRepairedNum = totalRepairedNum.add(repairInputInfo.getRepairedNum()); + totalInputNum = totalInputNum.add(repairInputInfo.getInputNum()); + totalPendingInputNum = totalPendingInputNum.add(repairInputInfo.getPendingInputNum()); + } + } + if (bean.getIsExport() == 0) { + RepairInputDto info = new RepairInputDto(); + info.setRepairedNum(totalRepairedNum); + info.setInputNum(totalInputNum); + info.setPendingInputNum(totalPendingInputNum); + info.setUnitName("合计"); + list.add(0, info); + } + return list; + } + + /** + * 修饰入库报表查询详情查询 + * @param bean + * @return + */ + @Override + public List getRepairInputDetailsList(RepairInputDto bean) { + return bmReportMapper.getRepairInputDetailsList(bean); + } +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 9344b32c..ab500102 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -46,7 +46,6 @@ public class TypeController extends BaseController { */ @ApiOperation(value = "查询物资类型管理列表") @RequiresPermissions("ma:type:list") - @StoreLog(title = "物资类型管理", module = "仓储管理->物资类型查询库存记录") @GetMapping("/list") public TableDataInfo list(MaTypeVo type) { startPage(); @@ -61,7 +60,6 @@ public class TypeController extends BaseController { @PreventRepeatSubmit @RequiresPermissions("ma:type:export") @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") - @StoreLog(title = "物资类型管理", module = "仓储管理->导出物资类型查询库存记录") @PostMapping("/export") public void export(HttpServletResponse response, MaTypeVo maTypeVo) { List parentIds = typeService.selectParentId(maTypeVo); @@ -92,7 +90,6 @@ public class TypeController extends BaseController { */ @ApiOperation(value = "根据左列表类型id查询右表格") @GetMapping("/getListByMaType") - @StoreLog(title = "物资类型管理", module = "仓储管理->导出物资类型查询库存记录") public AjaxResult getListByMaType(MaTypeVo maTypeVo) { List parentIds = typeService.selectParentId(maTypeVo); if (CollectionUtils.isEmpty(parentIds)) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/vo/ScrapTaskListVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/vo/ScrapTaskListVo.java index 9db73e67..79132567 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/vo/ScrapTaskListVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/vo/ScrapTaskListVo.java @@ -24,11 +24,6 @@ public class ScrapTaskListVo { @ApiModelProperty(value = "任务类型") private Byte taskType; - @ApiModelProperty(value = "报废单号") - private String scrapCode; - - - @ApiModelProperty(value = "组织id") private Long companyId; @@ -46,6 +41,10 @@ public class ScrapTaskListVo { @Excel(name = "工程名称") private String backPro; + @ApiModelProperty(value = "报废单号") + @Excel(name = "报废单号") + private String scrapCode; + @ApiModelProperty(value = "维修单号") @Excel(name = "维修单号") private String repairCode; @@ -55,7 +54,7 @@ public class ScrapTaskListVo { private String type; @ApiModelProperty(value = "任务创建人昵称") - @Excel(name = "提交人",sort = 4) + @Excel(name = "提交人") private String createName; @ApiModelProperty(value = "任务创建人") diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmProjectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmProjectMapper.xml index dd5d9448..9d239b47 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmProjectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmProjectMapper.xml @@ -77,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and actual_start_date = #{actualStartDate} and actual_end_date = #{actualEndDate} + order by bp.create_time desc + SELECT + pcd.task_id as taskId, + pcd.type_id as typeId, + mt2.type_name as typeName, + mt1.type_name as typeModelName, + mt1.unit_name as unitName, + IFNULL(pcd.purchase_num, 0) as purchaseNum, + IFNULL(pcd.check_num, 0) as passNum, + IFNULL(pcd.input_num, 0) as inputNum, + IFNULL(pcd.purchase_price, 0) as purchasePrice, + IFNULL(pcd.purchase_tax_price, 0) as purchasePriceNoTax, + msi.supplier as supplierName, + pci.create_time as purchaseTime, + pcd.check_time as passTime, + pcd.input_time as inputTime, + a.creator as inputUser, + IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0) as pendingInputNum, + tt.`code` as inputCode, + mt1.manage_type as manageType + FROM + purchase_check_details pcd + LEFT JOIN ma_type mt1 ON pcd.type_id = mt1.type_id + AND mt1.del_flag = '0' + LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id + AND mt2.del_flag = '0' + LEFT JOIN tm_task tt ON pcd.task_id = tt.task_id + LEFT JOIN purchase_check_info pci ON pcd.task_id = pci.task_id + LEFT JOIN ma_supplier_info msi ON pci.supplier_id = msi.supplier_id + LEFT JOIN ( + SELECT GROUP_CONCAT(DISTINCT creator) AS creator, task_id, type_id + FROM bm_storage_log + GROUP BY task_id, type_id + ) a ON pcd.task_id = a.task_id AND pcd.type_id = a.type_id + WHERE + pcd.check_num > 0 + + AND ( + mt2.type_name LIKE CONCAT('%', #{keyWord}, '%') + OR mt1.type_name LIKE CONCAT('%', #{keyWord}, '%') + OR msi.supplier LIKE CONCAT('%', #{keyWord}, '%') + OR a.creator LIKE CONCAT('%', #{keyWord}, '%') + OR tt.`code` LIKE CONCAT('%', #{keyWord}, '%') + ) + + + + + + + + + + + + + + + + + + + + + + + + +