直转问题处理
This commit is contained in:
parent
e46a636739
commit
a3158e6bb3
|
|
@ -1,5 +1,8 @@
|
||||||
package com.bonus.material.ma.controller;
|
package com.bonus.material.ma.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.bonus.common.biz.config.PoiOutPage;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
|
@ -13,14 +16,20 @@ import com.bonus.material.ma.domain.*;
|
||||||
import com.bonus.material.ma.service.DirectRotationService;
|
import com.bonus.material.ma.service.DirectRotationService;
|
||||||
import com.bonus.material.ma.service.ITypeService;
|
import com.bonus.material.ma.service.ITypeService;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
|
import com.bonus.material.settlement.domain.vo.SltLeaseInfo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -214,6 +223,33 @@ public class DirectRotationController extends BaseController {
|
||||||
util.exportExcel(response, list, fileName, title);
|
util.exportExcel(response, list, fileName, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出直转记录详情
|
||||||
|
*
|
||||||
|
* @param response
|
||||||
|
* @param directApplyInfo
|
||||||
|
*/
|
||||||
|
@PostMapping("/exportDetail")
|
||||||
|
public void exportDetail(HttpServletResponse response, DirectApplyInfo directApplyInfo) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
String fileName = "直转申请详情";
|
||||||
|
List<DirectApplyExportDetails> details = service.getDetailList(directApplyInfo);
|
||||||
|
// 根据list集合数,去填充序号
|
||||||
|
for (int i = 0; i < details.size(); i++) {
|
||||||
|
details.get(i).setSerialNumber(i + 1);
|
||||||
|
}
|
||||||
|
ExcelUtil<DirectApplyExportDetails> util = new ExcelUtil<>(DirectApplyExportDetails.class);
|
||||||
|
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||||
|
String title = "直转申请详情" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||||
|
util.exportExcel(response, details, fileName, title);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直转记录查询列表--app
|
* 直转记录查询列表--app
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
package com.bonus.material.ma.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/6/17 10:00
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
public class DirectApplyExportDetails {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "序号")
|
||||||
|
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||||
|
private Integer serialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 直转单号(ZZ20240226-1)
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 退料单位协议
|
||||||
|
*/
|
||||||
|
private Integer backAgreementId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料工程id
|
||||||
|
*/
|
||||||
|
private String backProId;
|
||||||
|
/**
|
||||||
|
* 关键字
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "申请时间", sort = 1, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 退料工程名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "转出工程", sort = 4, width = 30)
|
||||||
|
private String backProName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料单位id
|
||||||
|
*/
|
||||||
|
private String backUnitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料单位名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "转出单位", sort = 3, width = 30)
|
||||||
|
private String backUnitName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料工程id
|
||||||
|
*/
|
||||||
|
private String leaseProId;
|
||||||
|
/**
|
||||||
|
* 领料工程名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "转入工程", sort = 6, width = 30)
|
||||||
|
private String leaseProName;
|
||||||
|
/**
|
||||||
|
* 领料单位id
|
||||||
|
*/
|
||||||
|
private String leaseUnitId;
|
||||||
|
/**
|
||||||
|
* 领料单位名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "转入单位", sort = 5, width = 30)
|
||||||
|
private String leaseUnitName;
|
||||||
|
/**
|
||||||
|
* 退料人
|
||||||
|
*/
|
||||||
|
private String backMan;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String backPhone;
|
||||||
|
|
||||||
|
private String backManAndPhone;
|
||||||
|
/**
|
||||||
|
* 退料备注
|
||||||
|
*/
|
||||||
|
private String backRemark;
|
||||||
|
/**
|
||||||
|
* 领料单位协议
|
||||||
|
*/
|
||||||
|
private int leaseAgreementId;
|
||||||
|
/**
|
||||||
|
* 领料人
|
||||||
|
*/
|
||||||
|
private String leaseMan;
|
||||||
|
/**
|
||||||
|
* 领料联系电话
|
||||||
|
*/
|
||||||
|
private String leasePhone;
|
||||||
|
|
||||||
|
private String leaseManAndPhone;
|
||||||
|
/**
|
||||||
|
* 领料备注
|
||||||
|
*/
|
||||||
|
private String leaseRemark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0待审批1审批同意2驳回
|
||||||
|
*/
|
||||||
|
@Excel(name = "状态", sort = 7, readConverterExp = "0=待审核,1=审核中,2=已完成,3=已驳回")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料单位协议
|
||||||
|
*/
|
||||||
|
private String backAgreementCode;
|
||||||
|
/**
|
||||||
|
* 领料单位协议
|
||||||
|
*/
|
||||||
|
private String leaseAgreementCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料工程id
|
||||||
|
*/
|
||||||
|
private String lotId;
|
||||||
|
/**
|
||||||
|
* 退料单位id
|
||||||
|
*/
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
@Excel(name = "类型名称", sort = 8, width = 30)
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@Excel(name = "规格型号", sort = 9, width = 30)
|
||||||
|
private String typeModelName;
|
||||||
|
|
||||||
|
@Excel(name = "直转数量", sort = 10, align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private BigDecimal directNum;
|
||||||
|
|
||||||
|
@Excel(name = "机具编号", sort = 11, width = 30)
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
|
@Excel(name = "计量单位", sort = 12, width = 30)
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@Excel(name = "申请人", sort = 2)
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "业务联系单号")
|
||||||
|
private String businessCode;
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
||||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||||
|
import com.bonus.material.ma.domain.DirectApplyExportDetails;
|
||||||
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
||||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
|
|
@ -137,4 +138,6 @@ public interface DirectRotationMapper {
|
||||||
List<SltAgreementInfo> getXmList(DirectApplyDetails applyDetail);
|
List<SltAgreementInfo> getXmList(DirectApplyDetails applyDetail);
|
||||||
|
|
||||||
List<SltAgreementInfo> getClzList(DirectApplyDetails applyDetail);
|
List<SltAgreementInfo> getClzList(DirectApplyDetails applyDetail);
|
||||||
|
|
||||||
|
List<DirectApplyExportDetails> getDetailList(DirectApplyInfo directApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@ package com.bonus.material.ma.service;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
import com.bonus.material.ma.domain.*;
|
||||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
|
||||||
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
|
|
||||||
import com.bonus.material.ma.domain.DirectApplySignInfo;
|
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -48,6 +45,7 @@ public interface DirectRotationService {
|
||||||
*/
|
*/
|
||||||
DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo);
|
DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看详情
|
* 查看详情
|
||||||
* @param sltAgreementInfo
|
* @param sltAgreementInfo
|
||||||
|
|
@ -129,4 +127,6 @@ public interface DirectRotationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult getCodeList(DirectApplyInfo directApplyInfo);
|
AjaxResult getCodeList(DirectApplyInfo directApplyInfo);
|
||||||
|
|
||||||
|
List<DirectApplyExportDetails> getDetailList(DirectApplyInfo directApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,12 @@ public class DirectRotationImpl implements DirectRotationService {
|
||||||
return directApplyInfo;
|
return directApplyInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DirectApplyExportDetails> getDetailList(DirectApplyInfo directApplyInfo) {
|
||||||
|
List<DirectApplyExportDetails> detailById = mapper.getDetailList(directApplyInfo);
|
||||||
|
return detailById;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DirectApplyInfo getInfoApp(SltAgreementInfo sltAgreementInfo) {
|
public DirectApplyInfo getInfoApp(SltAgreementInfo sltAgreementInfo) {
|
||||||
DirectApplyInfo directApplyInfo = mapper.getInfoById(sltAgreementInfo);
|
DirectApplyInfo directApplyInfo = mapper.getInfoById(sltAgreementInfo);
|
||||||
|
|
|
||||||
|
|
@ -325,4 +325,14 @@ public class SltAgreementInfo extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "结算协议书编号")
|
@ApiModelProperty(value = "结算协议书编号")
|
||||||
private String bookCode;
|
private String bookCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料工程id
|
||||||
|
*/
|
||||||
|
private String backProId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料工程id
|
||||||
|
*/
|
||||||
|
private String leaseProId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -641,6 +641,7 @@
|
||||||
<if test="taskStatus==1">and swr.workflow_status = 1 </if>
|
<if test="taskStatus==1">and swr.workflow_status = 1 </if>
|
||||||
<if test="taskStatus==2">and swr.workflow_status = 2 </if>
|
<if test="taskStatus==2">and swr.workflow_status = 2 </if>
|
||||||
<if test="taskStatus==3">and swr.workflow_status = 3 </if>
|
<if test="taskStatus==3">and swr.workflow_status = 3 </if>
|
||||||
|
<if test="impUnitName != null and impUnitName != ''">and sd.dept_name = #{impUnitName}</if>
|
||||||
GROUP BY lai.id
|
GROUP BY lai.id
|
||||||
ORDER BY tt.create_time desc
|
ORDER BY tt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,12 @@
|
||||||
left join sys_user su on dai.create_by = su.user_id
|
left join sys_user su on dai.create_by = su.user_id
|
||||||
left join sys_workflow_record swr on swr.task_id = dai.id
|
left join sys_workflow_record swr on swr.task_id = dai.id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="backProId != null">
|
||||||
|
and bpl.pro_id = #{backProId}
|
||||||
|
</if>
|
||||||
|
<if test="leaseProId != null">
|
||||||
|
and bpl1.pro_id = #{leaseProId}
|
||||||
|
</if>
|
||||||
<if test="lotId != null and lotId != ''">
|
<if test="lotId != null and lotId != ''">
|
||||||
and bpl.pro_id = #{lotId}
|
and bpl.pro_id = #{lotId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -145,6 +151,7 @@
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND DATE_FORMAT( dai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
AND DATE_FORMAT( dai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
GROUP BY dai.id
|
GROUP BY dai.id
|
||||||
order by dai.create_time desc
|
order by dai.create_time desc
|
||||||
|
|
@ -520,4 +527,68 @@
|
||||||
</if>
|
</if>
|
||||||
order by start_time asc
|
order by start_time asc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDetailList" resultType="com.bonus.material.ma.domain.DirectApplyExportDetails">
|
||||||
|
SELECT
|
||||||
|
dad.id as id,
|
||||||
|
dai.create_time AS createTime,
|
||||||
|
su.nick_name AS createName,
|
||||||
|
bui.unit_id AS backUnitId,
|
||||||
|
bui.unit_name AS backUnitName,
|
||||||
|
bpl.pro_id AS backProId,
|
||||||
|
bpl.pro_name AS backProName,
|
||||||
|
bui1.unit_id AS leaseUnitId,
|
||||||
|
bui1.unit_name AS leaseUnitName,
|
||||||
|
bpl1.pro_id AS leaseProId,
|
||||||
|
bpl1.pro_name AS leaseProName,
|
||||||
|
dad.direct_num AS directNum,
|
||||||
|
dad.type_id AS typeId,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
mt.unit_name AS unitName,
|
||||||
|
mm.ma_code AS maCode,
|
||||||
|
mm.ma_id AS maId,
|
||||||
|
mt.manage_type as manageType,
|
||||||
|
dai.back_agreement_id as backAgreementId,
|
||||||
|
dai.lease_agreement_id as leaseAgreementId,
|
||||||
|
IFNULL(swr.workflow_status,2) as status
|
||||||
|
FROM
|
||||||
|
direct_apply_info dai
|
||||||
|
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
|
||||||
|
LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
|
||||||
|
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
||||||
|
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
|
||||||
|
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||||
|
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
|
||||||
|
LEFT JOIN direct_apply_details dad ON dai.id = dad.direct_id
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = dad.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
|
LEFT JOIN ma_machine mm ON dad.ma_id = mm.ma_id
|
||||||
|
left join sys_user su on dai.create_by = su.user_id
|
||||||
|
left join sys_workflow_record swr on swr.task_id = dai.id
|
||||||
|
where
|
||||||
|
1 = 1
|
||||||
|
<if test="backProId != null">
|
||||||
|
and bpl.pro_id = #{backProId}
|
||||||
|
</if>
|
||||||
|
<if test="leaseProId != null">
|
||||||
|
and bpl1.pro_id = #{leaseProId}
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
|
AND DATE_FORMAT( dai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
and swr.workflow_status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
|
AND (
|
||||||
|
INSTR(mt2.type_name,#{keyWord}) > 0 OR
|
||||||
|
INSTR(bui.unit_name,#{keyWord}) > 0 OR
|
||||||
|
INSTR(bpl.pro_name,#{keyWord}) > 0 OR
|
||||||
|
INSTR(bui1.unit_name,#{keyWord}) > 0 OR
|
||||||
|
INSTR(bpl1.pro_name,#{keyWord}) > 0
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
ORDER BY
|
||||||
|
dai.create_time DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue