检验标识查询

This commit is contained in:
mashuai 2025-12-01 09:41:47 +08:00
parent 9f59f802ca
commit 7e6a9a3c83
7 changed files with 84 additions and 14 deletions

View File

@ -611,10 +611,17 @@ public class MaterialMachineController extends BaseController {
@ApiOperation(value = "综合查询--材料站供应需求平衡数据查询") @ApiOperation(value = "综合查询--材料站供应需求平衡数据查询")
@PostMapping("/exportDemandAndSupply") @PostMapping("/exportDemandAndSupply")
public void exportDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) { public void exportDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
String fileName = "材料站供需平衡表";
bean.setIsExport(0); bean.setIsExport(0);
List<MaterialProvideNumInfo> list = materialMachineService.getDemandAndSupply(bean); List<MaterialProvideNumInfo> list = materialMachineService.getDemandAndSupply(bean);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
list.get(i).setSerialNumber(i + 1);
}
ExcelUtil<MaterialProvideNumInfo> util = new ExcelUtil<>(MaterialProvideNumInfo.class); ExcelUtil<MaterialProvideNumInfo> util = new ExcelUtil<>(MaterialProvideNumInfo.class);
util.exportExcel(response, list, "综合查询--材料站供应需求平衡数据查询"); // 获取当前年月日时分秒导出时间用括号拼接在后面
String title = "材料站供需平衡表" + "" + "导出时间:" + DateUtils.getTime() + "";
util.exportExcel(response, list, fileName, title);
} }
/** /**
@ -639,9 +646,16 @@ public class MaterialMachineController extends BaseController {
@ApiOperation(value = "综合查询--材料站供应需求平衡数据在用二级页面查询") @ApiOperation(value = "综合查询--材料站供应需求平衡数据在用二级页面查询")
@PostMapping("/exportUseDemandAndSupply") @PostMapping("/exportUseDemandAndSupply")
public void exportUseDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) { public void exportUseDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
String fileName = "材料站供需平衡表详情";
bean.setIsExport(0); bean.setIsExport(0);
List<MaterialSecondInfo> list = materialMachineService.getUseDemandAndSupply(bean); List<MaterialSecondInfo> list = materialMachineService.getUseDemandAndSupply(bean);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
list.get(i).setSerialNumber(i + 1);
}
ExcelUtil<MaterialSecondInfo> util = new ExcelUtil<>(MaterialSecondInfo.class); ExcelUtil<MaterialSecondInfo> util = new ExcelUtil<>(MaterialSecondInfo.class);
util.exportExcel(response, list, "综合查询--材料站供应需求平衡数据在用二级页面查询"); // 获取当前年月日时分秒导出时间用括号拼接在后面
String title = "材料站供需平衡表详情" + "" + "导出时间:" + DateUtils.getTime() + "";
util.exportExcel(response, list, fileName, title);
} }
} }

View File

@ -26,6 +26,10 @@ public class MaterialProvideNumInfo {
@ApiModelProperty(value = "是否app 0 是1 否") @ApiModelProperty(value = "是否app 0 是1 否")
private Integer isApp; private Integer isApp;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
private Integer serialNumber;
@ApiModelProperty(value = "是否导出 0 是1 否") @ApiModelProperty(value = "是否导出 0 是1 否")
private Integer isExport; private Integer isExport;
@ -36,9 +40,11 @@ public class MaterialProvideNumInfo {
private String proId; private String proId;
@ApiModelProperty(value = "分公司") @ApiModelProperty(value = "分公司")
@Excel(name = "分公司")
private String impUnitName; private String impUnitName;
@ApiModelProperty(value = "项目部") @ApiModelProperty(value = "项目部")
@Excel(name = "项目部")
private String departName; private String departName;
@ApiModelProperty(value = "工程名称") @ApiModelProperty(value = "工程名称")
@ -63,6 +69,7 @@ public class MaterialProvideNumInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "机具类型") @ApiModelProperty(value = "机具类型")
@Excel(name = "机具类型")
private String jiJuType; private String jiJuType;
@ApiModelProperty(value = "计量单位") @ApiModelProperty(value = "计量单位")

View File

@ -22,6 +22,10 @@ public class MaterialSecondInfo {
private static final long serialVersionUID = 2227217051604273598L; private static final long serialVersionUID = 2227217051604273598L;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
private Integer serialNumber;
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
private Integer id; private Integer id;

View File

@ -246,12 +246,12 @@ public class MachineServiceImpl implements IMachineService
dto.setIsJj(1); dto.setIsJj(1);
} }
} }
// 获取领料单详情 /*// 获取领料单详情
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(dto.getMaId()); List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(dto.getMaId());
if (CollectionUtils.isNotEmpty(details)) { if (CollectionUtils.isNotEmpty(details)) {
Long id = details.get(0).getId(); Long id = details.get(0).getId();
dto.setId(id); dto.setId(id);
} }*/
} }
} }
return AjaxResult.success(list); return AjaxResult.success(list);

View File

@ -291,4 +291,7 @@ public class SltAgreementInfo extends BaseEntity {
private Integer isFinish; private Integer isFinish;
private String taskId; private String taskId;
@ApiModelProperty("机具类型1机具2安全工器具")
private int jiJuType;
} }

View File

@ -2117,6 +2117,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (
sd.dept_name like concat('%', #{keyWord}, '%') or
df.project_dept like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%') or mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or mt.type_name like concat('%', #{keyWord}, '%') or
bp.pro_name like concat('%', #{keyWord}, '%') bp.pro_name like concat('%', #{keyWord}, '%')
@ -2193,6 +2195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (
sd.dept_name like concat('%', #{keyWord}, '%') or
df.project_dept like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%') or mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or mt.type_name like concat('%', #{keyWord}, '%') or
bp.pro_name like concat('%', #{keyWord}, '%') bp.pro_name like concat('%', #{keyWord}, '%')
@ -2268,7 +2272,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM( sai.num ) AS leaseNum, SUM( sai.num ) AS leaseNum,
SUM( CASE WHEN sai.STATUS = 0 THEN sai.num ELSE 0 END ) AS useNum, SUM( CASE WHEN sai.STATUS = 0 THEN sai.num ELSE 0 END ) AS useNum,
SUM( CASE WHEN sai.STATUS = 1 THEN sai.num ELSE 0 END ) AS backNum, SUM( CASE WHEN sai.STATUS = 1 THEN sai.num ELSE 0 END ) AS backNum,
bz.ssfbdw AS subUnitName CASE
WHEN cla.sub_unit_name IS NOT NULL AND cla.sub_unit_name != '' THEN cla.sub_unit_name
ELSE bz.ssfbdw
END AS subUnitName
FROM FROM
clz_slt_agreement_info sai clz_slt_agreement_info sai
LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
@ -2276,8 +2283,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN `micro-tool`.bzgl_bz bz ON bp.external_id = bz.project_id LEFT JOIN clz_lease_apply_info cla ON sai.lease_id = cla.id
AND bz.bzmc = bui.unit_name LEFT JOIN `micro-tool`.bzgl_bz bz ON bz.bzmc = bui.unit_name
WHERE WHERE
bp.pro_id = #{proId} bp.pro_id = #{proId}
AND sai.type_id = #{typeId} AND sai.type_id = #{typeId}
@ -2287,13 +2294,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name LIKE CONCAT('%',#{keyWord},'%') OR mt.type_name LIKE CONCAT('%',#{keyWord},'%') OR
bui.unit_name LIKE CONCAT('%',#{keyWord},'%') OR bui.unit_name LIKE CONCAT('%',#{keyWord},'%') OR
bp.pro_name LIKE CONCAT('%',#{keyWord},'%') OR bp.pro_name LIKE CONCAT('%',#{keyWord},'%') OR
bz.ssfbdw LIKE CONCAT('%',#{keyWord},'%') (
CASE
WHEN cla.sub_unit_name IS NOT NULL AND cla.sub_unit_name != '' THEN cla.sub_unit_name
ELSE bz.ssfbdw
END
) LIKE CONCAT('%',#{keyWord},'%')
) )
</if> </if>
GROUP BY GROUP BY
bp.pro_id, bp.pro_id,
sai.type_id, sai.type_id,
bui.unit_name bui.unit_name,
CASE
WHEN cla.sub_unit_name IS NOT NULL AND cla.sub_unit_name != '' THEN cla.sub_unit_name
ELSE bz.ssfbdw
END
</select> </select>
<select id="batchQueryLeaseDemand" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo"> <select id="batchQueryLeaseDemand" resultType="com.bonus.material.clz.domain.vo.MaterialProvideNumInfo">
@ -2730,8 +2746,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.external_id as externalId, bp.external_id as externalId,
bp.imp_unit AS impUnit, bp.imp_unit AS impUnit,
bu.bzz_idcard AS idCard, bu.bzz_idcard AS idCard,
df.project_dept AS proCenter, df.project_dept AS departName,
sd.dept_name AS departName, sd.dept_name AS impUnitName,
GROUP_CONCAT(DISTINCT sai.agreement_id) AS agreementId GROUP_CONCAT(DISTINCT sai.agreement_id) AS agreementId
FROM FROM
slt_agreement_info sai slt_agreement_info sai
@ -2758,7 +2774,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bp.pro_name = #{proName} AND bp.pro_name = #{proName}
</if> </if>
<if test="departName != null and departName != ''"> <if test="departName != null and departName != ''">
AND bp.pro_center = #{departName} AND df.project_dept = #{departName}
</if> </if>
<if test="typeName != null and typeName != ''"> <if test="typeName != null and typeName != ''">
AND mt2.type_name = #{typeName} AND mt2.type_name = #{typeName}
@ -2780,6 +2796,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (
sd.dept_name like concat('%', #{keyWord}, '%') or
df.project_dept like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%') or mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or mt.type_name like concat('%', #{keyWord}, '%') or
bp.pro_name like concat('%', #{keyWord}, '%') bp.pro_name like concat('%', #{keyWord}, '%')

View File

@ -482,16 +482,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mm.ex_code as exCode, mm.ex_code as exCode,
mm.ex_url as exUrl, mm.ex_url as exUrl,
mm.is_jj as isJj, mm.is_jj as isJj,
mm.type_id as typeId mm.type_id as typeId,
lod.parent_id as id
FROM FROM
ma_machine mm ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id LEFT JOIN ma_type mt on mt.type_id=mm.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
LEFT JOIN (
-- 第一步聚合每个ma_id的最新时间
SELECT ma_id, MAX(create_time) as max_create_time
FROM lease_out_details
GROUP BY ma_id
) lod_max ON mm.ma_id = lod_max.ma_id
-- 第二步关联取最新时间对应的parent_id
LEFT JOIN lease_out_details lod
ON lod.ma_id = lod_max.ma_id AND lod.create_time = lod_max.max_create_time
WHERE WHERE
mm.ma_code like concat('%', #{maCode}, '%') mm.ma_code like concat('%', #{maCode}, '%')
<if test="maId != null"> <if test="maId != null">
and mm.ma_id = #{maId} and mm.ma_id = #{maId}
</if> </if>
GROUP BY mm.ma_id
ORDER BY lod.create_time DESC
</select> </select>
<select id="selectMaId" resultType="java.lang.Long"> <select id="selectMaId" resultType="java.lang.Long">
@ -985,14 +997,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'合格' AS inspectStatus, '合格' AS inspectStatus,
wmi.supplier as maVender, wmi.supplier as maVender,
'0' as isJj, '0' as isJj,
wmi.model_id as typeId wmi.model_id as typeId,
lod.parent_id as id
FROM FROM
ws_ma_info wmi ws_ma_info wmi
LEFT JOIN (
-- 第一步聚合每个ma_id的最新时间
SELECT ma_id, MAX(create_time) as max_create_time
FROM lease_out_details
GROUP BY ma_id
) lod_max ON wmi.id = lod_max.ma_id
-- 第二步关联取最新时间对应的parent_id
LEFT JOIN lease_out_details lod
ON lod.ma_id = lod_max.ma_id AND lod.create_time = lod_max.max_create_time
WHERE WHERE
wmi.ma_code like concat('%', #{maCode}, '%') wmi.ma_code like concat('%', #{maCode}, '%')
<if test="maId != null"> <if test="maId != null">
and wmi.id = #{maId} and wmi.id = #{maId}
</if> </if>
GROUP BY wmi.id
ORDER BY lod.create_time DESC
</select> </select>
<select id="getHisByCodeNewByWsMaInfo" resultType="com.bonus.material.ma.domain.Machine"> <select id="getHisByCodeNewByWsMaInfo" resultType="com.bonus.material.ma.domain.Machine">
SELECT SELECT