diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java new file mode 100644 index 00000000..ff49300d --- /dev/null +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/lease/LeasePublishInfo.java @@ -0,0 +1,268 @@ +package com.bonus.common.biz.domain.lease; + +import com.bonus.common.biz.domain.BmFileInfo; +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 java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 领料任务对象 lease_apply_info + * + * @author xsheng + * @date 2024-10-16 + */ + +@EqualsAndHashCode(callSuper = false) +@Data +@ToString +public class LeasePublishInfo extends BaseEntity{ + + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + + @ApiModelProperty(value = "登录用户id") + private Long userId; + + @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 impUnitName; + + @ApiModelProperty(value = "合同主体") + private String contractPart; + + @ApiModelProperty(value = "领料单位") + @Excel(name = "申请项目部") + private String leaseUnit; + + @ApiModelProperty(value = "发料单位") + private String sendUnit; + + @ApiModelProperty(value = "领料id") + private Integer leaseUnitId; + + @ApiModelProperty(value = "租赁工程") + @Excel(name = "申请工程") + private String leaseProject; + + @ApiModelProperty(value = "领料工程id") + private Integer leaseProjectId; + + @ApiModelProperty(value = "领料人签名URL") + private String leaseSignUrl; + + @ApiModelProperty(value = "领料人签名类型") + private Byte leaseSignType; + + /** + * 领料物资名称汇总 + */ + @ApiModelProperty(value = "领料物资名称汇总") + @Excel(name = "领料物资类型") + private String maTypeNames; + + @ApiModelProperty(value = "协议号") + private String agreementCode; + + /** 任务编号: 领料单号 */ + @ApiModelProperty(value = "业务联系单号") + @Excel(name = "业务联系单号") + private String code; + + /** 任务ID */ + @ApiModelProperty(value = "任务ID") + private Long taskId; + + /** 领料人 */ + @Excel(name = "领料人") + @ApiModelProperty(value = "领料人") + private String leasePerson; + + @ApiModelProperty(value = "联系方式") + @Excel(name = "领料人电话") + private String phone; + + /** 1:1级审批,2:2级审批 */ + @ApiModelProperty(value = "1:1级审批,2:2级审批") + private String type; + + /** 公司审批人 */ + @ApiModelProperty(value = "公司审批人") + private Long companyAuditBy; + + /** 公司审批时间 */ + @ApiModelProperty(value = "公司审批时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date companyAuditTime; + + /** 公司审批备注 */ + @ApiModelProperty(value = "公司审批备注") + private String companyAuditRemark; + + /** 分管审批人 */ + @ApiModelProperty(value = "分管审批人") + private Long deptAuditBy; + + /** 分管审批时间 */ + @ApiModelProperty(value = "分管审批时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date deptAuditTime; + + /** 分管审批备注 */ + @ApiModelProperty(value = "分管审批备注") + private String deptAuditRemark; + + /** 机具分公司审批 */ + @ApiModelProperty(value = "机具分公司审批") + private Long directAuditBy; + + /** 机具分公司审批时间 */ + @ApiModelProperty(value = "机具分公司审批时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date directAuditTime; + + /** 机具分公司审批备注 */ + @ApiModelProperty(value = "机具分公司审批备注") + private String directAuditRemark; + + /** 数据所属组织 */ + @ApiModelProperty(value = "数据所属组织") + private Long companyId; + + /** 1机具分公司审核通过,2调试分公司审核通过3机具分公司审核驳回4调试分公司审核驳回5出库进行中5出库完成 */ +// @Excel(name = "1机具分公司审核通过,2调试分公司审核通过3机具分公司审核驳回4调试分公司审核驳回5出库进行中5出库完成") +// @ApiModelProperty(value = "1机具分公司审核通过,2调试分公司审核通过3机具分公司审核驳回4调试分公司审核驳回5出库进行中5出库完成") +// private String status; + + /** $column.columnComment */ + private Long directId; + + /** 0工程1长期 */ + @ApiModelProperty(value = "0工程1长期") + private String leaseType; + + /** 预领料时间 */ + @ApiModelProperty(value = "预领料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date estimateLeaseTime; + + /** 费用承担方(01项目03分包) */ + @ApiModelProperty(value = "费用承担方(01项目03分包)") + private String costBearingParty; + + @ApiModelProperty(value = "协议id") + private Long agreementId; + + /** 任务类型(定义数据字典) */ + @ApiModelProperty(value = "任务类型(定义数据字典)") + private Integer taskType; + + /** 任务状态(定义数据字典) */ + @ApiModelProperty(value = "任务状态(定义数据字典)") + private Integer taskStatus; + + @Excel(name = "状态") + @ApiModelProperty(value = "任务状态(定义数据字典)") + private String taskStatusName; + + @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型") + private Integer monthOrder; + + @ApiModelProperty(value = "领料人手机号") + private String leasePhone; + + @ApiModelProperty(value = "往来单位id") + private Long unitId; + + @ApiModelProperty(value = "往来单位") + private String unitName; + + @ApiModelProperty(value = "工程id") + private Long projectId; + + /** + * 工程名称 + */ + @ApiModelProperty(value = "工程名称") + private String projectName; + + /** + * 预领料合计数 + */ + @ApiModelProperty(value = "预领料合计数") + private BigDecimal preCountNum; + + @ApiModelProperty(value = "已出库数量") + private BigDecimal alNum; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "关键字") + private String keyWord; + + @ApiModelProperty(value = "备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(value = "任务状态列表") + private List statusList; + + @ApiModelProperty(value = "审批人人签名URL") + private String directAuditSignUrl; + + /** + * 分包商单位委托书 + */ + @ApiModelProperty(value = "分包商单位委托书") + List bmFileInfos; + + + /** + * 标准配置id + */ + @ApiModelProperty(value = "标准配置id") + private Long configId; + + /** + * 是否为领用申请 + */ + @ApiModelProperty(value = "是否为领用申请") + private Integer isLease; + + @ApiModelProperty(value = "采购申请编号") + private String applyCode; + + private Integer isApp; + + @ApiModelProperty(value = "供应时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date supplierTime; + + @ApiModelProperty(value = "供应地点") + private String supplierPlace; + + @ApiModelProperty(value = "公司名称") + private String companyName; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java index 0c421d70..66914395 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java @@ -3,6 +3,7 @@ package com.bonus.material.lease.controller; import cn.hutool.core.convert.Convert; import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.common.biz.domain.lease.LeasePublishInfo; import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; @@ -106,6 +107,57 @@ public class LeaseTaskController extends BaseController { } } + /** + * 领用发布查询 + * @param leaseApplyInfo + * @return + */ + @ApiOperation(value = "领用发布查询") + @GetMapping("/getPublishList") + public AjaxResult getPublishList(LeaseApplyInfo leaseApplyInfo) { + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + try { + List list = service.getPublishList(leaseApplyInfo); + if (leaseApplyInfo.getIsApp()==null){ + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); + }else { + return AjaxResult.success(list); + } + } catch (Exception e) { + if (leaseApplyInfo.getIsApp()==null){ + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>())); + }else { + return AjaxResult.success(new ArrayList<>()); + } + } + } + + /** + * 领用发布详情 + * @param leaseApplyInfo + * @return + */ + @ApiOperation(value = "领用发布详情") + @GetMapping("/getDetailsById") + public AjaxResult getDetailsById(LeaseApplyInfo leaseApplyInfo) { + return success(service.getDetailsById(leaseApplyInfo)); + } + + /** + * 导出领料发布列表 + * @param response + * @param leaseApplyInfo + */ + @ApiOperation(value = "导出领料发布列表") + @PostMapping("/exportPublish") + public void exportPublish(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) { + List list = service.getPublishList(leaseApplyInfo); + ExcelUtil util = new ExcelUtil<>(LeasePublishInfo.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 6344f601..c7e39d0f 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 @@ -73,6 +73,12 @@ public class LeaseApplyDetails extends BaseEntity { @Excel(name = "当前库存") private BigDecimal storageNum; + @ApiModelProperty(value = "已发布数量") + private BigDecimal publishNum; + + @ApiModelProperty(value = "待发布数量") + private BigDecimal pendingNum; + /** 预领料数 */ @Excel(name = "预领数量") @ApiModelProperty(value = "预领料数") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java index 7dd21cb8..45f110df 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java @@ -2,6 +2,7 @@ package com.bonus.material.lease.mapper; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.common.biz.domain.lease.LeasePublishInfo; import com.bonus.material.lease.domain.LeaseApplyDetails; import com.bonus.material.lease.domain.vo.LeaseDeptInfo; import com.bonus.material.ma.domain.Type; @@ -97,4 +98,18 @@ public interface LeaseTaskMapper { LeaseApplyInfo getApplyInfo(Long taskId); List getApplyDetails(Long taskId); + + /** + * 领用申请发布查询 + * @param leaseApplyInfo + * @return + */ + List getPublishList(LeaseApplyInfo leaseApplyInfo); + + /** + * 领用申请发布详情查询 + * @param leaseApplyInfo + * @return + */ + List selectPublishDetails(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseTaskService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseTaskService.java index 02ee42ca..cf5a26e0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseTaskService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseTaskService.java @@ -2,6 +2,7 @@ package com.bonus.material.lease.service; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.common.biz.domain.lease.LeasePublishInfo; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.lease.domain.LeaseApplyDetails; import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo; @@ -92,5 +93,19 @@ public interface ILeaseTaskService { List getApplyDetails(Long taskId); + + /** + * 领用申请发布查询 + * @param leaseApplyInfo + * @return + */ + List getPublishList(LeaseApplyInfo leaseApplyInfo); + + /** + * 领用申请发布详情查询 + * @param leaseApplyInfo + * @return + */ + LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index 529ecd11..e10215ed 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; +import com.bonus.common.biz.domain.lease.LeasePublishInfo; import com.bonus.common.biz.enums.LeaseTaskStatusEnum; import com.bonus.common.biz.enums.TmTaskTypeEnum; import com.bonus.common.core.exception.ServiceException; @@ -394,7 +395,6 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { (item.getCreateBy() != null && item.getCreateBy().contains(keyWord)) || (item.getLeasePerson() != null && item.getLeasePerson().contains(keyWord)) || (item.getLeasePhone() != null && item.getLeasePhone().contains(keyWord)) || - (item.getContractPart() != null && item.getContractPart().contains(keyWord)) || (item.getImpUnitName() != null && item.getImpUnitName().contains(keyWord)); } @@ -528,4 +528,72 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { throw new RuntimeException("失败", e); } } + + /** + * 领用发布查询 + * @param leaseApplyInfo + * @return + */ + @Override + public List getPublishList(LeaseApplyInfo leaseApplyInfo) { + Long userId = SecurityUtils.getUserId(); + leaseApplyInfo.setUserId(userId == 0 ? null : userId); + List list = mapper.getPublishList(leaseApplyInfo); + if (!CollectionUtils.isEmpty(list)) { + String keyWord = leaseApplyInfo.getKeyWord(); + // 如果关键字不为空,进行过滤 + if (!StringUtils.isBlank(keyWord)) { + list = list.stream() + .filter(item -> containsKeyWord(item, keyWord)) + .collect(Collectors.toList()); + } + } + return list; + } + + /** + * 判断关键字是否包含在item中 + * @param item + * @param keyWord + * @return + */ + private boolean containsKeyWord(LeasePublishInfo item, String keyWord) { + return (item.getMaTypeNames() != null && item.getMaTypeNames().contains(keyWord)) || + (item.getUnitName() != null && item.getUnitName().contains(keyWord)) || + (item.getProjectName() != null && item.getProjectName().contains(keyWord)) || + (item.getCode() != null && item.getCode().contains(keyWord)) || + (item.getCreateBy() != null && item.getCreateBy().contains(keyWord)) || + (item.getLeasePerson() != null && item.getLeasePerson().contains(keyWord)) || + (item.getPhone() != null && item.getPhone().contains(keyWord)) || + (item.getImpUnitName() != null && item.getImpUnitName().contains(keyWord)); + } + + /** + * 获取详情 + * @param leaseApplyInfo + * @return + */ + @Override + public LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo) { + try { + /*LeaseApplyInfo applyInfo = new LeaseApplyInfo(); + leaseApplyInfo.setId(leaseApplyInfo.getId()); + Long userId = SecurityUtils.getUserId(); + applyInfo.setUserId(userId);*/ + Optional optionalInfo = Optional.ofNullable(mapper.selectLeaseApplyInfoById(leaseApplyInfo)); + LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo(); + + optionalInfo.ifPresent(info -> { + leaseApplyRequestVo.setLeaseApplyInfo(info); + // 获取领料单详情 + List details = mapper.selectPublishDetails(leaseApplyInfo); + if (!CollectionUtils.isEmpty(details)) { + leaseApplyRequestVo.setLeaseApplyDetailsList(details); + } + }); + return leaseApplyRequestVo; + } catch (Exception e) { + throw new RuntimeException("Failed to select lease apply info", e); + } + } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 7aeb6079..c5100b1d 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -635,4 +635,107 @@ left join ma_type ma2 on ma1.parent_id = ma2.type_id where lai.task_id = #{taskId} and ma1.del_flag = 0 and ma2.del_flag = 0 + + + +