From 9cd60c3e1a452ee2af10261094ce688f0225acb0 Mon Sep 17 00:00:00 2001 From: mashuai Date: Mon, 23 Dec 2024 14:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/domain/lease/LeaseApplyInfo.java | 94 +++++++++---------- .../biz/domain/repair/RepairInputDetails.java | 11 +-- .../controller/LeaseApplyInfoController.java | 12 +++ .../lease/domain/LeaseApplyDetails.java | 18 ++-- .../lease/service/ILeaseApplyInfoService.java | 8 ++ .../impl/LeaseApplyInfoServiceImpl.java | 10 ++ .../repair/domain/RepairAuditDetails.java | 3 + .../mapper/RepairAuditDetailsMapper.java | 6 ++ .../impl/RepairAuditDetailsServiceImpl.java | 2 + .../impl/RepairInputDetailsServiceImpl.java | 21 ++++- .../material/lease/LeaseApplyInfoMapper.xml | 3 + .../repair/RepairAuditDetailsMapper.xml | 11 +++ 12 files changed, 134 insertions(+), 65 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java index 27e59ab8..563ce031 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeaseApplyInfo.java @@ -22,20 +22,53 @@ import com.bonus.common.core.web.domain.BaseEntity; @EqualsAndHashCode(callSuper = false) @Data @ToString -public class LeaseApplyInfo extends BaseEntity { +public class LeaseApplyInfo extends BaseEntity{ private static final long serialVersionUID = 1L; /** ID */ private Long id; + @ApiModelProperty(value = "申请时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "申请时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Excel(name = "申请人") + @ApiModelProperty(value = "申请人") + private String createBy; + + @ApiModelProperty(value = "领料单位") + @Excel(name = "租赁单位") + private String leaseUnit; + + @ApiModelProperty(value = "领料id") + private Integer leaseUnitId; + + @ApiModelProperty(value = "租赁工程") + @Excel(name = "租赁工程") + private String leaseProject; + + @ApiModelProperty(value = "领料工程id") + private Integer leaseProjectId; + + /** + * 领料物资名称汇总 + */ + @ApiModelProperty(value = "领料物资名称汇总") + @Excel(name = "领料物资类型") + private String maTypeNames; + + @ApiModelProperty(value = "协议号") + @Excel(name = "协议号") + private String agreementCode; + /** 任务编号: 领料单号 */ - @Excel(name = "领料单号") @ApiModelProperty(value = "领料单号") + @Excel(name = "租赁申请单号") private String code; /** 任务ID */ - @Excel(name = "任务ID") @ApiModelProperty(value = "任务ID") private Long taskId; @@ -44,66 +77,54 @@ public class LeaseApplyInfo extends BaseEntity { @ApiModelProperty(value = "领料人") private String leasePerson; - /** 联系方式 */ - @Excel(name = "联系方式") + @Excel(name = "领料人电话") @ApiModelProperty(value = "联系方式") private String phone; /** 1:1级审批,2:2级审批 */ - @Excel(name = "1:1级审批,2:2级审批") @ApiModelProperty(value = "1:1级审批,2:2级审批") private String type; /** 公司审批人 */ - @Excel(name = "公司审批人") @ApiModelProperty(value = "公司审批人") private Long companyAuditBy; /** 公司审批时间 */ @ApiModelProperty(value = "公司审批时间") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "公司审批时间", width = 30, dateFormat = "yyyy-MM-dd") private Date companyAuditTime; /** 公司审批备注 */ - @Excel(name = "公司审批备注") @ApiModelProperty(value = "公司审批备注") private String companyAuditRemark; /** 分管审批人 */ - @Excel(name = "分管审批人") @ApiModelProperty(value = "分管审批人") private Long deptAuditBy; /** 分管审批时间 */ @ApiModelProperty(value = "分管审批时间") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "分管审批时间", width = 30, dateFormat = "yyyy-MM-dd") private Date deptAuditTime; /** 分管审批备注 */ - @Excel(name = "分管审批备注") @ApiModelProperty(value = "分管审批备注") private String deptAuditRemark; /** 机具分公司审批 */ - @Excel(name = "机具分公司审批") @ApiModelProperty(value = "机具分公司审批") private Long directAuditBy; /** 机具分公司审批时间 */ @ApiModelProperty(value = "机具分公司审批时间") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "机具分公司审批时间", width = 30, dateFormat = "yyyy-MM-dd") private Date directAuditTime; /** 机具分公司审批备注 */ - @Excel(name = "机具分公司审批备注") @ApiModelProperty(value = "机具分公司审批备注") private String directAuditRemark; /** 数据所属组织 */ - @Excel(name = "数据所属组织") @ApiModelProperty(value = "数据所属组织") private Long companyId; @@ -113,68 +134,46 @@ public class LeaseApplyInfo extends BaseEntity { // private String status; /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private Long directId; /** 0工程1长期 */ - @Excel(name = "领用类型",readConverterExp = "0=工程,1=长期") @ApiModelProperty(value = "0工程1长期") private String leaseType; /** 预领料时间 */ @ApiModelProperty(value = "预领料时间") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "预领料时间", width = 30, dateFormat = "yyyy-MM-dd") private Date estimateLeaseTime; /** 费用承担方(01项目03分包) */ - @Excel(name = "费用承担方(01项目03分包)") @ApiModelProperty(value = "费用承担方(01项目03分包)") private String costBearingParty; - @ApiModelProperty(value = "租赁工程") - @Excel(name = "领料工程") - private String leaseProject; - - @ApiModelProperty(value = "领料工程id") - private Integer leaseProjectId; - - @ApiModelProperty(value = "领料单位") - @Excel(name = "领料单位") - private String leaseUnit; - - @ApiModelProperty(value = "领料id") - private Integer leaseUnitId; - @ApiModelProperty(value = "协议id") private Long agreementId; - @ApiModelProperty(value = "协议号") - @Excel(name = "协议号") - private String agreementCode; - /** 任务类型(定义数据字典) */ - @Excel(name = "任务类型(定义数据字典)") @ApiModelProperty(value = "任务类型(定义数据字典)") private Integer taskType; /** 任务状态(定义数据字典) */ - @Excel(name = "任务状态") @ApiModelProperty(value = "任务状态(定义数据字典)") private Integer taskStatus; + @Excel(name = "状态") + @ApiModelProperty(value = "任务状态(定义数据字典)") + private String taskStatusName; + @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型") private Integer monthOrder; @ApiModelProperty(value = "领料人手机号") - //@Excel(name = "联系电话", sort = 6) private String leasePhone; @ApiModelProperty(value = "往来单位id") private Long unitId; @ApiModelProperty(value = "往来单位") - //@Excel(name = "领料单位", sort = 2) private String unitName; @ApiModelProperty(value = "工程id") @@ -184,15 +183,8 @@ public class LeaseApplyInfo extends BaseEntity { * 工程名称 */ @ApiModelProperty(value = "工程名称") - @Excel(name = "领料工程", sort = 3) private String projectName; - /** - * 领料物资名称汇总 - */ - @ApiModelProperty(value = "领料物资名称汇总") - private String maTypeNames; - /** * 预领料合计数 */ @@ -211,6 +203,10 @@ public class LeaseApplyInfo extends BaseEntity { @ApiModelProperty(value = "关键字") private String keyWord; + @ApiModelProperty(value = "备注") + @Excel(name = "备注") + private String remark; + @ApiModelProperty(value = "任务状态列表") private List statusList; diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/repair/RepairInputDetails.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/repair/RepairInputDetails.java index bc588616..30c580fe 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/repair/RepairInputDetails.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/repair/RepairInputDetails.java @@ -28,7 +28,6 @@ public class RepairInputDetails extends BaseEntity { private Long id; /** 任务ID */ - @Excel(name = "任务ID") @ApiModelProperty(value = "任务ID") private Long taskId; @@ -36,17 +35,14 @@ public class RepairInputDetails extends BaseEntity { private List outTaskList; /** 维修审核ID */ - @Excel(name = "维修审核ID") @ApiModelProperty(value = "维修审核ID") private Long auditId; /** 维修ID */ - @Excel(name = "维修ID") @ApiModelProperty(value = "维修ID") private Long repairId; /** 机具ID */ - @Excel(name = "机具ID") @ApiModelProperty(value = "机具ID") private Long maId; @@ -54,7 +50,6 @@ public class RepairInputDetails extends BaseEntity { private String maCode; /** 规格ID */ - @Excel(name = "规格ID") @ApiModelProperty(value = "规格ID") private Long typeId; @@ -62,13 +57,13 @@ public class RepairInputDetails extends BaseEntity { * 退料单位名称 */ @ApiModelProperty(value = "退料单位名称") - @Excel(name = "退料单位名称",sort = 1) + @Excel(name = "退料单位",sort = 1) private String backUnit; /** * 退料工程名称 */ @ApiModelProperty(value = "退料工程名称") - @Excel(name = "退料工程名称",sort = 2) + @Excel(name = "工程名称",sort = 2) private String backPro; @ApiModelProperty(value = "修饰入库编码") @@ -94,7 +89,7 @@ public class RepairInputDetails extends BaseEntity { @Excel(name = "状态") private String statusName; - //@Excel(name = "备注") + @Excel(name = "备注") private String remark; @ApiModelProperty(value = "驳回原因") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java index 98814301..98d05d5f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java @@ -9,6 +9,7 @@ import com.bonus.common.log.annotation.SysLog; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.material.lease.domain.LeaseApplyDetails; import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo; import com.bonus.common.biz.domain.lease.LeaseOutRequestVo; import com.bonus.material.lease.service.ILeaseApplyInfoService; @@ -71,6 +72,17 @@ public class LeaseApplyInfoController extends BaseController { return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord)); } + @ApiOperation(value = "导出领料任务详情") + @PreventRepeatSubmit + //@RequiresPermissions("lease:info:export") + @SysLog(title = "领料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料任务详情") + @PostMapping("/exportDetails") + public void exportDetails(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) { + List list = leaseApplyInfoService.selectLeaseApplyDetailsList(leaseApplyInfo); + ExcelUtil util = new ExcelUtil<>(LeaseApplyDetails.class); + util.exportExcel(response, list, "领料任务详情数据"); + } + /** * 新增领料任务 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java index 37ceb558..2e871b80 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java @@ -24,12 +24,12 @@ public class LeaseApplyDetails extends BaseEntity { private Long id; /** 任务ID */ - @Excel(name = "任务ID") @ApiModelProperty(value = "任务ID") private Long parentId; /** 物资类型 */ @ApiModelProperty(value = "物资类型名称") + @Excel(name = "类型名称") private String maTypeName; /** 规格型号id */ @@ -38,10 +38,12 @@ public class LeaseApplyDetails extends BaseEntity { /** 规格型号 */ @ApiModelProperty(value = "规格型号名称") + @Excel(name = "规格型号") private String typeName; /** 计量单位 */ @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") private String unitName; /** 计量单位数值 */ @@ -49,20 +51,19 @@ public class LeaseApplyDetails extends BaseEntity { private String unitValue; /** 库存数量 */ @ApiModelProperty(value = "库存数量") + @Excel(name = "当前库存") private BigDecimal storageNum; /** 预领料数 */ - @Excel(name = "预领料数") + @Excel(name = "预领数量") @ApiModelProperty(value = "预领料数") private BigDecimal preNum; /** 审批数量 */ - @Excel(name = "审批数量") @ApiModelProperty(value = "审批数量") private BigDecimal auditNum; /** 已领数量 */ - @Excel(name = "已领数量") @ApiModelProperty(value = "已领数量") private BigDecimal alNum; @@ -70,21 +71,24 @@ public class LeaseApplyDetails extends BaseEntity { * 此数量是剩余需要出库的数量(preNum - alNum) */ @ApiModelProperty(value = "剩余最大出库数量") + @Excel(name = "出库数量") private BigDecimal outNum; + /** 备注 */ + @ApiModelProperty(value = "备注") + @Excel(name = "备注") + private String remark; + /** * 装备管理方式(0编号 1计数) */ @ApiModelProperty(name = "装备管理方式") - @Excel(name = "装备管理方式", readConverterExp = "0=编号,1=计数") private int manageType; /** 状态(0待审批,1进行中,2已出库) */ - @Excel(name = "状态", readConverterExp = "0=待审批,1=进行中,2=已出库") private String status; /** 数据所属组织 */ - @Excel(name = "数据所属组织") @ApiModelProperty(value = "数据所属组织") private Long companyId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java index 35a8a6de..53e9546a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java @@ -3,6 +3,7 @@ package com.bonus.material.lease.service; import java.util.List; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.material.lease.domain.LeaseApplyDetails; import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo; import com.bonus.common.biz.domain.lease.LeaseOutRequestVo; @@ -78,4 +79,11 @@ public interface ILeaseApplyInfoService { * @return 结果 */ int deleteLeaseApplyInfoById(Long id); + + /** + * 领料任务详情 + * @param leaseApplyInfo + * @return + */ + List selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index 1ab2953d..c5979ed3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -288,4 +288,14 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { public int deleteLeaseApplyInfoById(Long id) { return leaseApplyInfoMapper.deleteLeaseApplyInfoById(id); } + + /** + * 领料任务详情 + * @param leaseApplyInfo + * @return + */ + @Override + public List selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo) { + return leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(leaseApplyInfo.getId(), leaseApplyInfo.getKeyWord())); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetails.java index 864b7c8b..f1849146 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetails.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetails.java @@ -119,4 +119,7 @@ public class RepairAuditDetails extends BaseEntity { @Excel(name = "设备类型") @ApiModelProperty(value = "设备类型") private String typeName; + + @ApiModelProperty(value = "管理模式") + private String manageType; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairAuditDetailsMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairAuditDetailsMapper.java index 4d95bcf7..6bb9122b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairAuditDetailsMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/mapper/RepairAuditDetailsMapper.java @@ -130,4 +130,10 @@ public interface RepairAuditDetailsMapper { List getRepairApplyRecordId(Long repairId); void updateRecodeStatus(String id); + + /** + * 修改机具状态 + * @param details + */ + void updateMachine(RepairAuditDetails details); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java index a6a6cf82..25179b0b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java @@ -561,6 +561,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService insertTta(newTaskId, agreementId); List inputList = new ArrayList<>(); for (RepairAuditDetails details : repairAuditDetailsByQuery) { + //修改机具状态 + repairAuditDetailsMapper.updateMachine(details); RepairInputDetails inputVo = new RepairInputDetails(); BeanUtils.copyProperties(details, inputVo); inputVo.setRepairNum(details.getRepairedNum()); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java index 856c8d3f..50a9d68e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairInputDetailsServiceImpl.java @@ -100,7 +100,26 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService */ @Override public List selectRepairInputDetailsList(RepairInputDetails repairInputDetails) { - return repairInputDetailsMapper.selectRepairInputDetailsList(repairInputDetails); + List list = repairInputDetailsMapper.selectRepairInputDetailsList(repairInputDetails); + if (CollectionUtils.isNotEmpty(list)) { + for (RepairInputDetails inputDetails : list) { + List inputInfos = repairInputDetailsMapper.selectRepairInputDetailsById(inputDetails); + if (CollectionUtils.isNotEmpty(inputInfos)) { + BigDecimal totalRepairNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP); + BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP); + BigDecimal totalPendingInputNum = BigDecimal.ZERO.setScale(3, BigDecimal.ROUND_HALF_UP); + for (RepairInputInfo inputInfo : inputInfos) { + totalRepairNum = totalRepairNum.add(inputInfo.getRepairNum()); + totalInputNum = totalInputNum.add(inputInfo.getInputNum()); + totalPendingInputNum = totalPendingInputNum.add(inputInfo.getPendingInputNum()); + } + inputDetails.setRepairNum(totalRepairNum); + inputDetails.setInputNum(totalInputNum); + inputDetails.setPendingInputNum(totalPendingInputNum); + } + } + } + return list; } /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index 83d80de0..291ae199 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id, lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus, + sda.dict_label as taskStatusName, IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.al_num),0) as alNum from @@ -54,6 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id left join bm_unit bu on bu.unit_id = bai.unit_id left join bm_project bp on bp.pro_id = bai.project_id + left join sys_dict_data sda on tt.task_status = sda.dict_value + and sda.dict_type = 'lease_task_status' select rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as ma_id + ,mt.manage_type as manageType from repair_audit_details rad left join ma_type mt on rad.type_id = mt.type_id @@ -508,6 +509,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + UPDATE ma_machine + SET ma_status = '5' + WHERE + 1 = 1 + + and ma_id = #{maId} + + +