检验标识查询
This commit is contained in:
parent
9f59f802ca
commit
7e6a9a3c83
|
|
@ -611,10 +611,17 @@ public class MaterialMachineController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--材料站供应需求平衡数据查询")
|
||||
@PostMapping("/exportDemandAndSupply")
|
||||
public void exportDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
|
||||
String fileName = "材料站供需平衡表";
|
||||
bean.setIsExport(0);
|
||||
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);
|
||||
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 = "综合查询--材料站供应需求平衡数据在用二级页面查询")
|
||||
@PostMapping("/exportUseDemandAndSupply")
|
||||
public void exportUseDemandAndSupply(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
|
||||
String fileName = "材料站供需平衡表详情";
|
||||
bean.setIsExport(0);
|
||||
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);
|
||||
util.exportExcel(response, list, "综合查询--材料站供应需求平衡数据在用二级页面查询");
|
||||
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||
String title = "材料站供需平衡表详情" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ public class MaterialProvideNumInfo {
|
|||
@ApiModelProperty(value = "是否app 0 是,1 否")
|
||||
private Integer isApp;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||
private Integer serialNumber;
|
||||
|
||||
@ApiModelProperty(value = "是否导出 0 是,1 否")
|
||||
private Integer isExport;
|
||||
|
||||
|
|
@ -36,9 +40,11 @@ public class MaterialProvideNumInfo {
|
|||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "分公司")
|
||||
@Excel(name = "分公司")
|
||||
private String impUnitName;
|
||||
|
||||
@ApiModelProperty(value = "项目部")
|
||||
@Excel(name = "项目部")
|
||||
private String departName;
|
||||
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
|
|
@ -63,6 +69,7 @@ public class MaterialProvideNumInfo {
|
|||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "机具类型")
|
||||
@Excel(name = "机具类型")
|
||||
private String jiJuType;
|
||||
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ public class MaterialSecondInfo {
|
|||
|
||||
private static final long serialVersionUID = 2227217051604273598L;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||
private Integer serialNumber;
|
||||
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Integer id;
|
||||
|
||||
|
|
|
|||
|
|
@ -246,12 +246,12 @@ public class MachineServiceImpl implements IMachineService
|
|||
dto.setIsJj(1);
|
||||
}
|
||||
}
|
||||
// 获取领料单详情
|
||||
/*// 获取领料单详情
|
||||
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(dto.getMaId());
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
Long id = details.get(0).getId();
|
||||
dto.setId(id);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
|
|
|
|||
|
|
@ -291,4 +291,7 @@ public class SltAgreementInfo extends BaseEntity {
|
|||
private Integer isFinish;
|
||||
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("机具类型(1机具,2安全工器具)")
|
||||
private int jiJuType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2117,6 +2117,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
sd.dept_name like concat('%', #{keyWord}, '%') or
|
||||
df.project_dept like concat('%', #{keyWord}, '%') or
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
|
|
@ -2193,6 +2195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
sd.dept_name like concat('%', #{keyWord}, '%') or
|
||||
df.project_dept like concat('%', #{keyWord}, '%') or
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
|
|
@ -2268,7 +2272,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SUM( sai.num ) AS leaseNum,
|
||||
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,
|
||||
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
|
||||
clz_slt_agreement_info sai
|
||||
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 ma_type mt ON sai.type_id = mt.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
|
||||
AND bz.bzmc = bui.unit_name
|
||||
LEFT JOIN clz_lease_apply_info cla ON sai.lease_id = cla.id
|
||||
LEFT JOIN `micro-tool`.bzgl_bz bz ON bz.bzmc = bui.unit_name
|
||||
WHERE
|
||||
bp.pro_id = #{proId}
|
||||
AND sai.type_id = #{typeId}
|
||||
|
|
@ -2287,13 +2294,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.type_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
bui.unit_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>
|
||||
GROUP BY
|
||||
bp.pro_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 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.imp_unit AS impUnit,
|
||||
bu.bzz_idcard AS idCard,
|
||||
df.project_dept AS proCenter,
|
||||
sd.dept_name AS departName,
|
||||
df.project_dept AS departName,
|
||||
sd.dept_name AS impUnitName,
|
||||
GROUP_CONCAT(DISTINCT sai.agreement_id) AS agreementId
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
|
|
@ -2758,7 +2774,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center = #{departName}
|
||||
AND df.project_dept = #{departName}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name = #{typeName}
|
||||
|
|
@ -2780,6 +2796,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
sd.dept_name like concat('%', #{keyWord}, '%') or
|
||||
df.project_dept like concat('%', #{keyWord}, '%') or
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
|
|
|
|||
|
|
@ -482,16 +482,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.ex_code as exCode,
|
||||
mm.ex_url as exUrl,
|
||||
mm.is_jj as isJj,
|
||||
mm.type_id as typeId
|
||||
mm.type_id as typeId,
|
||||
lod.parent_id as id
|
||||
FROM
|
||||
ma_machine mm
|
||||
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_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
|
||||
mm.ma_code like concat('%', #{maCode}, '%')
|
||||
<if test="maId != null">
|
||||
and mm.ma_id = #{maId}
|
||||
</if>
|
||||
GROUP BY mm.ma_id
|
||||
ORDER BY lod.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectMaId" resultType="java.lang.Long">
|
||||
|
|
@ -985,14 +997,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'合格' AS inspectStatus,
|
||||
wmi.supplier as maVender,
|
||||
'0' as isJj,
|
||||
wmi.model_id as typeId
|
||||
wmi.model_id as typeId,
|
||||
lod.parent_id as id
|
||||
FROM
|
||||
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
|
||||
wmi.ma_code like concat('%', #{maCode}, '%')
|
||||
<if test="maId != null">
|
||||
and wmi.id = #{maId}
|
||||
</if>
|
||||
GROUP BY wmi.id
|
||||
ORDER BY lod.create_time DESC
|
||||
</select>
|
||||
<select id="getHisByCodeNewByWsMaInfo" resultType="com.bonus.material.ma.domain.Machine">
|
||||
SELECT
|
||||
|
|
|
|||
Loading…
Reference in New Issue