领用申请详情导出
This commit is contained in:
parent
4b52f8076c
commit
30ea1e4aa6
|
|
@ -13,7 +13,7 @@ public enum LeaseTaskStatusEnum {
|
|||
LEASE_TASK_ZERO(0, "待审核"),
|
||||
LEASE_TASK_SUBMIT(5, "待提交"),
|
||||
LEASE_TASK_TO_PUBLISHED(1, "待发布"),
|
||||
LEASE_TASK_TO_AUDIT(2, "已终结"),
|
||||
LEASE_TASK_TO_AUDIT(2, "已终止"),
|
||||
LEASE_TASK_IN_PROGRESS(3, "出库进行中"),
|
||||
LEASE_TASK_FINISHED(4, "出库已完成");
|
||||
private final Integer status;
|
||||
|
|
|
|||
|
|
@ -10,47 +10,31 @@ import com.bonus.common.core.web.controller.BaseController;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.domain.LeasePublishDetails;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||
import com.bonus.material.lease.service.ILeaseTaskService;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
||||
import com.bonus.material.ma.domain.vo.MaTypeVoLevelTwo;
|
||||
import com.bonus.material.ma.domain.vo.StandardConfigDetailsVo;
|
||||
import com.bonus.system.api.RemoteFileService;
|
||||
import com.itextpdf.text.Paragraph;
|
||||
|
||||
import feign.Param;
|
||||
import fr.opensagres.poi.xwpf.converter.pdf.PdfConverter;
|
||||
import fr.opensagres.poi.xwpf.converter.pdf.PdfOptions;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.awt.Font;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
|
|
@ -144,6 +128,20 @@ public class LeaseTaskController extends BaseController {
|
|||
return success(service.getDetailsById(leaseApplyInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出领料发布详情
|
||||
* @param response
|
||||
* @param leaseApplyInfo
|
||||
*/
|
||||
@ApiOperation(value = "导出领料发布详情")
|
||||
@PostMapping("/exportPublishDetails")
|
||||
public void exportPublishDetails(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
||||
List<LeasePublishDetails> list = service.getPublishDetails(leaseApplyInfo);
|
||||
ExcelUtil<LeasePublishDetails> util = new ExcelUtil<>(LeasePublishDetails.class);
|
||||
util.exportExcel(response, list, "领料发布详情数据");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布数据保存
|
||||
* @param leaseApplyRequestVo
|
||||
|
|
@ -155,6 +153,17 @@ public class LeaseTaskController extends BaseController {
|
|||
return service.addPublish(leaseApplyRequestVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 领用发布终结
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "领用发布终结")
|
||||
@PostMapping("/endPublish")
|
||||
public AjaxResult endPublish(@RequestBody LeaseApplyInfo leaseApplyInfo) {
|
||||
return service.endPublish(leaseApplyInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出领料发布列表
|
||||
* @param response
|
||||
|
|
|
|||
|
|
@ -0,0 +1,145 @@
|
|||
package com.bonus.material.lease.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领料任务详细对象 lease_apply_details
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class LeasePublishDetails extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
/** 物资类型 */
|
||||
@ApiModelProperty(value = "物资类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String maTypeName;
|
||||
|
||||
/** 规格型号id */
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long newTypeId;
|
||||
|
||||
@ApiModelProperty(value = "三级id")
|
||||
private Long thirdTypeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long taskId;
|
||||
|
||||
/** 规格型号 */
|
||||
@ApiModelProperty(value = "规格型号名称")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
/** 计量单位 */
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
/** 计量单位数值 */
|
||||
@ApiModelProperty(value = "计量单位数值")
|
||||
private String unitValue;
|
||||
|
||||
@Excel(name = "需求数量")
|
||||
@ApiModelProperty(value = "需求数量")
|
||||
private BigDecimal preNum;
|
||||
|
||||
/** 库存数量 */
|
||||
@ApiModelProperty(value = "库存数量")
|
||||
@Excel(name = "当前库存")
|
||||
private BigDecimal storageNum;
|
||||
|
||||
@ApiModelProperty(value = "已发布数量")
|
||||
@Excel(name = "已发布数量")
|
||||
private BigDecimal publishNum;
|
||||
|
||||
@ApiModelProperty(value = "剩余最大出库数量")
|
||||
@Excel(name = "已供应数量")
|
||||
private BigDecimal outNum;
|
||||
|
||||
@ApiModelProperty(value = "待发布数量")
|
||||
@Excel(name = "待发布数量")
|
||||
private BigDecimal pendingNum;
|
||||
|
||||
@ApiModelProperty(value = "本次发布数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/** 审批数量 */
|
||||
@ApiModelProperty(value = "审批数量")
|
||||
private BigDecimal auditNum;
|
||||
|
||||
/** 已领数量 */
|
||||
@ApiModelProperty(value = "已领数量")
|
||||
private BigDecimal alNum;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 装备管理方式(0编号 1计数)
|
||||
*/
|
||||
@ApiModelProperty(name = "装备管理方式")
|
||||
private int manageType;
|
||||
|
||||
/** 状态(0待审批,1进行中,2已出库) */
|
||||
private String status;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "编码类型集合")
|
||||
private List<MaCodeVo> maCodeVoList;
|
||||
|
||||
@ApiModelProperty(value = "往来单位id")
|
||||
private Long unitId;
|
||||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
private String leasePerson;
|
||||
|
||||
@ApiModelProperty(value = "联系方式")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||
private Integer monthOrder;
|
||||
|
||||
@ApiModelProperty(value = "发布批次")
|
||||
private String publishTask;
|
||||
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@ 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.LeasePublishDetails;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseDeptInfo;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
||||
import com.bonus.material.ma.domain.vo.MaTypeVoLevelTwo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -114,5 +114,19 @@ public interface ILeaseTaskService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult addPublish(LeaseApplyRequestVo leaseApplyRequestVo);
|
||||
|
||||
/**
|
||||
* 领用发布终结
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult endPublish(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 导出领料发布详情
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeasePublishDetails> getPublishDetails(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,16 +5,19 @@ 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.HttpCodeEnum;
|
||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.bean.BeanUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.domain.LeasePublishDetails;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseDeptInfo;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||
|
|
@ -704,7 +707,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
boolean allMatch = true;
|
||||
if (!CollectionUtils.isEmpty(leaseApplyDetails)) {
|
||||
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||
if (leaseApplyDetail.getPreNum().compareTo(leaseApplyDetail.getPublishNum()) != 0) {
|
||||
if (leaseApplyDetail.getPreNum().compareTo(leaseApplyDetail.getPublishNum()) <= 0) {
|
||||
allMatch = false;
|
||||
break;
|
||||
}
|
||||
|
|
@ -726,6 +729,44 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束发布
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult endPublish(LeaseApplyInfo leaseApplyInfo) {
|
||||
if (leaseApplyInfo == null || leaseApplyInfo.getTaskId() == null) {
|
||||
return AjaxResult.error("参数不能为空");
|
||||
}
|
||||
// 根据taskId修改任务状态为终结
|
||||
int result = tmTaskMapper.updateTaskStatus(String.valueOf(leaseApplyInfo.getTaskId()), LeaseTaskStatusEnum.LEASE_TASK_TO_AUDIT.getStatus());
|
||||
if (result == 0) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出领料发布详情
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LeasePublishDetails> getPublishDetails(LeaseApplyInfo leaseApplyInfo) {
|
||||
List<LeasePublishDetails> list = new ArrayList<>();
|
||||
// 获取领料单详情
|
||||
List<LeaseApplyDetails> details = mapper.selectPublishDetails(leaseApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
LeasePublishDetails leasePublishDetails = new LeasePublishDetails();
|
||||
BeanUtils.copyProperties(detail, leasePublishDetails);
|
||||
list.add(leasePublishDetails);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成发布批次任务
|
||||
* @param thisMonthMaxOrder
|
||||
|
|
|
|||
|
|
@ -105,6 +105,43 @@
|
|||
<result property="isTest" column="is_test"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.bonus.common.biz.domain.lease.LeasePublishInfo" id="LeasePublishInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="leasePerson" column="lease_person"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="companyAuditBy" column="company_audit_by"/>
|
||||
<result property="companyAuditTime" column="company_audit_time"/>
|
||||
<result property="companyAuditRemark" column="company_audit_remark"/>
|
||||
<result property="deptAuditBy" column="dept_audit_by"/>
|
||||
<result property="deptAuditTime" column="dept_audit_time"/>
|
||||
<result property="deptAuditRemark" column="dept_audit_remark"/>
|
||||
<result property="directAuditBy" column="direct_audit_by"/>
|
||||
<result property="directAuditTime" column="direct_audit_time"/>
|
||||
<result property="directAuditRemark" column="direct_audit_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="directId" column="direct_id"/>
|
||||
<result property="leaseType" column="lease_type"/>
|
||||
<result property="estimateLeaseTime" column="estimate_lease_time"/>
|
||||
<result property="costBearingParty" column="cost_bearing_party"/>
|
||||
<result property="leaseProject" column="pro_name"/>
|
||||
<result property="leaseProjectId" column="project_id"/>
|
||||
<result property="leaseUnit" column="unit_name"/>
|
||||
<result property="leaseUnitId" column="unit_id"/>
|
||||
<result property="agreementId" column="agreement_id"/>
|
||||
<result property="agreementCode" column="agreement_code"/>
|
||||
<result property="leaseSignUrl" column="lease_sign_url"/>
|
||||
<result property="leaseSignType" column="lease_sign_type"/>
|
||||
<result property="applyCode" column="apply_code"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectLeaseApplyInfoVo">
|
||||
|
|
@ -741,7 +778,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getPublishList" resultType="com.bonus.common.biz.domain.lease.LeasePublishInfo"
|
||||
resultMap="LeaseApplyInfoResult">
|
||||
resultMap="LeasePublishInfoResult">
|
||||
select
|
||||
lai.id, lai.code, lai.task_id, lai.lease_person, lai.phone, lai.type, lai.company_audit_by,lai.apply_code,
|
||||
lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by, lai.dept_audit_time,
|
||||
|
|
@ -753,7 +790,7 @@
|
|||
|
||||
case tt.task_status
|
||||
when 1 then '未完成'
|
||||
when 2 then '已终结'
|
||||
when 2 then '已终止'
|
||||
when 3 then '已完成'
|
||||
end as taskStatusName,
|
||||
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||
|
|
@ -778,6 +815,9 @@
|
|||
</if>
|
||||
where tt.task_type = '19'
|
||||
and tt.task_status in (1, 2, 3)
|
||||
<!--<if test="taskStatus != null and taskStatus != ''">
|
||||
and tt.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
|
||||
<if test="statusList != null and statusList.size() > 0">
|
||||
and tt.task_status in
|
||||
|
|
@ -789,7 +829,7 @@
|
|||
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
|
||||
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
|
||||
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>-->
|
||||
GROUP BY lai.id
|
||||
ORDER BY tt.task_status,tt.create_time desc
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue