设备工程领用配件统计
This commit is contained in:
parent
fc67b62448
commit
8466b4d9d4
|
|
@ -60,6 +60,8 @@ public class MachinesVo extends PageInfo {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
private String num;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,5 +181,9 @@ public class PartApplyAppVo extends PageInfo implements java.io.Serializable {
|
|||
*/
|
||||
private String statusName;
|
||||
|
||||
private String partName;
|
||||
|
||||
private String partModel;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,12 @@ public class PartApplyDetailAppVo {
|
|||
|
||||
private String proId;
|
||||
|
||||
private String proName;
|
||||
|
||||
private int num;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.gzgqj.business.bases.controller;
|
|||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.*;
|
||||
|
|
@ -221,6 +222,58 @@ public class StatisticsController {
|
|||
|
||||
|
||||
|
||||
/** ---------------------设备工程领用统计-开始--------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备工程领用统计分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("findListByPage")
|
||||
@DecryptAndVerify(decryptedClass = MachinesVo.class)
|
||||
public PageInfo<MachinesVo> findListByPage(EncryptedReq<MachinesVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<MachinesVo> list = service.findListByPage(dto.getData());;
|
||||
PageInfo<MachinesVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备工程领用统计分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getListDetails")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyDetailAppVo.class)
|
||||
public PageInfo<PartApplyDetailAppVo> getListDetails(EncryptedReq<PartApplyDetailAppVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartApplyDetailAppVo> list = service.getListDetails(dto.getData());;
|
||||
PageInfo<PartApplyDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 配件详情分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPartList")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public PageInfo<PartApplyAppVo> getPartList(EncryptedReq<PartApplyAppVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartApplyAppVo> list = service.getPartList(dto.getData());;
|
||||
PageInfo<PartApplyAppVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/** ---------------------设备工程领用统计-结束--------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.mapper;
|
||||
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
|
|
@ -56,4 +57,32 @@ public interface StatisticsMapper {
|
|||
* @return
|
||||
*/
|
||||
ProjectInfoVo getProDetails(PartApplyAppVo data);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<MachinesVo> findListByPage(MachinesVo data);
|
||||
|
||||
/**
|
||||
* 查询工程
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
String getProNum(MachinesVo vo);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartApplyDetailAppVo> getListDetails(PartApplyDetailAppVo data);
|
||||
|
||||
/**
|
||||
* 获取配件列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartApplyAppVo> getPartList(PartApplyAppVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
|
|
@ -120,4 +121,37 @@ public class StatisticsServiceImpl {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<MachinesVo> findListByPage(MachinesVo data) {
|
||||
try {
|
||||
List<MachinesVo> list = mapper.findListByPage(data);
|
||||
if (list.size() > 0) {
|
||||
for (MachinesVo vo : list) {
|
||||
vo.setNum(mapper.getProNum(vo));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PartApplyDetailAppVo> getListDetails(PartApplyDetailAppVo data) {
|
||||
try {
|
||||
return mapper.getListDetails(data);
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PartApplyAppVo> getPartList(PartApplyAppVo data) {
|
||||
try {
|
||||
return mapper.getPartList(data);
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,4 +124,101 @@
|
|||
GROUP BY pro_id ) mm on mm.pro_id=pro.id
|
||||
where pro.id=#{proId}
|
||||
</select>
|
||||
|
||||
<select id="findListByPage" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
SELECT
|
||||
mm.id,
|
||||
mm.DEVICE_CODE deviceCode,
|
||||
mm.REMARK as remark,
|
||||
concat(mt3.NAME,'/',mt2.NAME,'/',mt.NAME) module
|
||||
FROM
|
||||
mm_machines mm
|
||||
LEFT JOIN mm_type mt ON mt.id = mm.TYPE
|
||||
AND mt.`LEVEL` = 4
|
||||
AND mt.IS_ACTIVE = 1
|
||||
LEFT JOIN mm_type mt2 ON mt.PARENT_ID = mt2.id
|
||||
LEFT JOIN mm_type mt3 ON mt2.PARENT_ID = mt3.id
|
||||
WHERE
|
||||
mm.BATCH_STATUS = 7
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
mt.NAME like concat('%',#{keyWord},'%') or
|
||||
mm.DEVICE_CODE like concat('%',#{keyWord},'%') or
|
||||
mm.REMARK like concat('%',#{keyWord},'%') or
|
||||
mt2.NAME like concat('%',#{keyWord},'%') or
|
||||
mt3.NAME like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getProNum" resultType="java.lang.String">
|
||||
SELECT COUNT(*) as num
|
||||
FROM (SELECT wir.sup_id,
|
||||
wat.AGREEMENT_ID,
|
||||
wir.id,
|
||||
pro.`NAME` proName,
|
||||
pro.id proId
|
||||
FROM wf_info_record wir
|
||||
LEFT JOIN wf_return_material_details rmd ON wir.SUP_ID = rmd.id
|
||||
LEFT JOIN wf_agreement_task wat ON rmd.TASK_ID = wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla ON wat.AGREEMENT_ID = wla.id
|
||||
LEFT JOIN bm_project pro ON pro.id = wla.PROJECT
|
||||
WHERE TYPE = 4
|
||||
AND wir.MA_ID = #{id}
|
||||
GROUP BY pro.id
|
||||
ORDER BY wir.TIME DESC) a
|
||||
</select>
|
||||
|
||||
<select id="getListDetails" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
SELECT
|
||||
wir.sup_id,
|
||||
wat.AGREEMENT_ID,
|
||||
wir.id,
|
||||
pro.`NAME` proName,
|
||||
pro.id proId,
|
||||
wir.MA_ID as deviceId
|
||||
FROM
|
||||
wf_info_record wir
|
||||
LEFT JOIN wf_return_material_details rmd ON wir.SUP_ID = rmd.id
|
||||
LEFT JOIN wf_agreement_task wat ON rmd.TASK_ID = wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla ON wat.AGREEMENT_ID = wla.id
|
||||
LEFT JOIN bm_project pro ON pro.id = wla.PROJECT
|
||||
WHERE
|
||||
TYPE = 4
|
||||
AND wir.MA_ID = #{id}
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
pro.NAME like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
pro.id
|
||||
ORDER BY
|
||||
wir.TIME DESC
|
||||
|
||||
</select>
|
||||
<select id="getPartList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
SELECT
|
||||
tpa.pro_name as proName,
|
||||
tpa.`code`,
|
||||
tpad.part_name as partName,
|
||||
tpad.part_model as partModel,
|
||||
tpad.apply_num as applyNum,
|
||||
tpa.create_time as createTime
|
||||
FROM
|
||||
t_part_apply_details tpad
|
||||
LEFT JOIN t_part_apply tpa on tpa.id=tpad.apply_id
|
||||
WHERE
|
||||
tpa.dev_id=#{deviceId}
|
||||
and tpa.pro_id=#{proId}
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
tpa.`code` like concat('%',#{keyWord},'%') or
|
||||
tpad.part_name like concat('%',#{keyWord},'%') or
|
||||
tpad.part_model like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!='' ">
|
||||
and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue