kangwei : 隐患排查接口
正在显示
18 个修改的文件
包含
241 行增加
和
138 行删除
... | @@ -14,6 +14,7 @@ import com.skua.core.service.ISequenceService; | ... | @@ -14,6 +14,7 @@ import com.skua.core.service.ISequenceService; |
14 | import com.skua.core.util.ConvertUtils; | 14 | import com.skua.core.util.ConvertUtils; |
15 | import com.skua.modules.erp.entity.PurchaseMaterial; | 15 | import com.skua.modules.erp.entity.PurchaseMaterial; |
16 | import com.skua.modules.erp.entity.PurchasePlan; | 16 | import com.skua.modules.erp.entity.PurchasePlan; |
17 | import com.skua.modules.erp.entity.PurchasePlanItem; | ||
17 | import com.skua.modules.erp.service.IPurchaseMaterialService; | 18 | import com.skua.modules.erp.service.IPurchaseMaterialService; |
18 | import com.skua.modules.erp.service.IPurchasePlanService; | 19 | import com.skua.modules.erp.service.IPurchasePlanService; |
19 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 20 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
... | @@ -53,8 +54,6 @@ import io.swagger.annotations.ApiOperation; | ... | @@ -53,8 +54,6 @@ import io.swagger.annotations.ApiOperation; |
53 | public class PurchasePlanController { | 54 | public class PurchasePlanController { |
54 | @Autowired | 55 | @Autowired |
55 | private IPurchasePlanService purchasePlanService; | 56 | private IPurchasePlanService purchasePlanService; |
56 | @Autowired | ||
57 | private IPurchaseMaterialService purchaseMaterialService; | ||
58 | 57 | ||
59 | @AutoLog(value = "erp采购计划表-分页列表查询") | 58 | @AutoLog(value = "erp采购计划表-分页列表查询") |
60 | @ApiOperation(value="erp采购计划表-分页列表查询", notes="erp采购计划表-分页列表查询") | 59 | @ApiOperation(value="erp采购计划表-分页列表查询", notes="erp采购计划表-分页列表查询") |
... | @@ -283,15 +282,15 @@ public class PurchasePlanController { | ... | @@ -283,15 +282,15 @@ public class PurchasePlanController { |
283 | @AutoLog(value = "erp采购计划表-按物料统计列表") | 282 | @AutoLog(value = "erp采购计划表-按物料统计列表") |
284 | @ApiOperation(value="erp采购计划表-按物料统计列表", notes="erp采购计划表-按物料统计列表") | 283 | @ApiOperation(value="erp采购计划表-按物料统计列表", notes="erp采购计划表-按物料统计列表") |
285 | @GetMapping(value = "/statisticsList") | 284 | @GetMapping(value = "/statisticsList") |
286 | public Result<IPage<PurchaseMaterial>> statisticsList(PurchasePlanSearchVO purchasePlanSearchVO, | 285 | public Result<IPage<PurchasePlanItem>> statisticsList(PurchasePlanSearchVO purchasePlanSearchVO, |
287 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 286 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
288 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 287 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
289 | HttpServletRequest req) { | 288 | HttpServletRequest req) { |
290 | Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>(); | 289 | Result<IPage<PurchasePlanItem>> result = new Result<IPage<PurchasePlanItem>>(); |
291 | Page<PurchaseMaterial> page = new Page<PurchaseMaterial>(pageNo, pageSize); | 290 | Page<PurchasePlanItem> page = new Page<PurchasePlanItem>(pageNo, pageSize); |
292 | //purchasePlanSearchVO.setDepats(); | 291 | //purchasePlanSearchVO.setDepats(); |
293 | purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts()); | 292 | purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts()); |
294 | IPage<PurchaseMaterial> pageList = purchaseMaterialService.statisticsPage(page,purchasePlanSearchVO); | 293 | IPage<PurchasePlanItem> pageList = purchasePlanService.statisticsPage(page,purchasePlanSearchVO); |
295 | result.setSuccess(true); | 294 | result.setSuccess(true); |
296 | result.setResult(pageList); | 295 | result.setResult(pageList); |
297 | return result; | 296 | return result; |
... | @@ -300,15 +299,15 @@ public class PurchasePlanController { | ... | @@ -300,15 +299,15 @@ public class PurchasePlanController { |
300 | @AutoLog(value = "erp采购计划表-统计详情") | 299 | @AutoLog(value = "erp采购计划表-统计详情") |
301 | @ApiOperation(value="erp采购计划表-统计详情", notes="erp采购计划表-统计详情") | 300 | @ApiOperation(value="erp采购计划表-统计详情", notes="erp采购计划表-统计详情") |
302 | @GetMapping(value = "/statisticsDetail") | 301 | @GetMapping(value = "/statisticsDetail") |
303 | public Result<IPage<PurchaseMaterial>> statisticsDetail(PurchasePlanSearchVO purchasePlanSearchVO, | 302 | public Result<IPage<PurchasePlanItem>> statisticsDetail(PurchasePlanSearchVO purchasePlanSearchVO, |
304 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 303 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
305 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 304 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
306 | HttpServletRequest req) { | 305 | HttpServletRequest req) { |
307 | Result<IPage<PurchaseMaterial>> result = new Result<IPage<PurchaseMaterial>>(); | 306 | Result<IPage<PurchasePlanItem>> result = new Result<IPage<PurchasePlanItem>>(); |
308 | 307 | ||
309 | Page<PurchaseMaterial> page = new Page<PurchaseMaterial>(pageNo, pageSize); | 308 | Page<PurchasePlanItem> page = new Page<PurchasePlanItem>(pageNo, pageSize); |
310 | purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts()); | 309 | purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts()); |
311 | IPage<PurchaseMaterial> pageList = purchaseMaterialService.statisticsPageBySparepartId(page,purchasePlanSearchVO); | 310 | IPage<PurchasePlanItem> pageList = purchasePlanService.statisticsPageBySparepartId(page,purchasePlanSearchVO); |
312 | result.setSuccess(true); | 311 | result.setSuccess(true); |
313 | result.setResult(pageList); | 312 | result.setResult(pageList); |
314 | return result; | 313 | return result; | ... | ... |
... | @@ -42,6 +42,9 @@ public class PurchasePlanItem implements Serializable{ | ... | @@ -42,6 +42,9 @@ public class PurchasePlanItem implements Serializable{ |
42 | 42 | ||
43 | /**物料编号*/ | 43 | /**物料编号*/ |
44 | @Excel(name = "物料编号", width = 15) | 44 | @Excel(name = "物料编号", width = 15) |
45 | @ApiModelProperty(value = "物料名称") | ||
46 | private String sparepartName; | ||
47 | |||
45 | @ApiModelProperty(value = "物料编号") | 48 | @ApiModelProperty(value = "物料编号") |
46 | //@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") | 49 | //@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") |
47 | private String sparepartId; | 50 | private String sparepartId; |
... | @@ -84,6 +87,9 @@ public class PurchasePlanItem implements Serializable{ | ... | @@ -84,6 +87,9 @@ public class PurchasePlanItem implements Serializable{ |
84 | @ApiModelProperty(value = "物料类别名称") | 87 | @ApiModelProperty(value = "物料类别名称") |
85 | private String sparepartTypeName; | 88 | private String sparepartTypeName; |
86 | 89 | ||
87 | @ApiModelProperty(value = "物料名称") | 90 | |
88 | private String sparepartName; | 91 | |
92 | @TableField(exist=false) | ||
93 | @ApiModelProperty(value = "所属厂站名称") | ||
94 | private String departName; | ||
89 | } | 95 | } | ... | ... |
... | @@ -40,20 +40,6 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> { | ... | @@ -40,20 +40,6 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> { |
40 | IPage<PurchaseMaterial> queryByPage(@Param("page")Page<PurchaseMaterial> page, @Param("goodCode")String goodCode, @Param("departId")String departId); | 40 | IPage<PurchaseMaterial> queryByPage(@Param("page")Page<PurchaseMaterial> page, @Param("goodCode")String goodCode, @Param("departId")String departId); |
41 | 41 | ||
42 | /*** | 42 | /*** |
43 | * 统计分页 | ||
44 | * @param page | ||
45 | * @param purchasePlanSearchVO | ||
46 | * @return | ||
47 | */ | ||
48 | IPage<PurchaseMaterial> statisticsPage(@Param("page")Page<PurchaseMaterial> page, @Param("ev")PurchasePlanSearchVO purchasePlanSearchVO); | ||
49 | |||
50 | /*** | ||
51 | * 查询某一物料的的采购计划物料清单 | ||
52 | * @param page | ||
53 | * @return | ||
54 | */ | ||
55 | IPage<PurchaseMaterial> statisticsPageBySparepartId(@Param("page")Page<PurchaseMaterial> page, @Param("ev")PurchasePlanSearchVO purchasePlanSearchVO); | ||
56 | /*** | ||
57 | * 根据货号查询采购合同物料清单 | 43 | * 根据货号查询采购合同物料清单 |
58 | * @param goodCode | 44 | * @param goodCode |
59 | * @param departId | 45 | * @param departId | ... | ... |
... | @@ -2,6 +2,11 @@ package com.skua.modules.erp.mapper; | ... | @@ -2,6 +2,11 @@ package com.skua.modules.erp.mapper; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | import com.skua.modules.erp.entity.PurchaseMaterial; | ||
8 | import com.skua.modules.erp.entity.PurchasePlanItem; | ||
9 | import com.skua.modules.erp.vo.PurchasePlanSearchVO; | ||
5 | import org.apache.ibatis.annotations.Param; | 10 | import org.apache.ibatis.annotations.Param; |
6 | import com.skua.modules.erp.entity.PurchasePlan; | 11 | import com.skua.modules.erp.entity.PurchasePlan; |
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 12 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
... | @@ -11,4 +16,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ... | @@ -11,4 +16,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
11 | */ | 16 | */ |
12 | public interface PurchasePlanMapper extends BaseMapper<PurchasePlan> { | 17 | public interface PurchasePlanMapper extends BaseMapper<PurchasePlan> { |
13 | 18 | ||
19 | |||
20 | /*** | ||
21 | * 统计分页 | ||
22 | * @param page | ||
23 | * @param purchasePlanSearchVO | ||
24 | * @return | ||
25 | */ | ||
26 | IPage<PurchasePlanItem> statisticsPage(Page<PurchasePlanItem> page, @Param("ev") PurchasePlanSearchVO purchasePlanSearchVO); | ||
27 | |||
28 | /*** | ||
29 | * 查询某一物料的的采购计划物料清单 | ||
30 | * @param page | ||
31 | * @return | ||
32 | */ | ||
33 | IPage<PurchasePlanItem> statisticsPageBySparepartId(Page<PurchasePlanItem> page, @Param("ev")PurchasePlanSearchVO purchasePlanSearchVO); | ||
34 | |||
14 | } | 35 | } | ... | ... |
... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
22 | <select id="queryByPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> | 22 | <select id="queryByPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> |
23 | select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.* | 23 | select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.* |
24 | from ( | 24 | from ( |
25 | select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id and pc.departs like '%13%' | 25 | select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id |
26 | <if test="goodCode != null and goodCode != ''"> | 26 | <if test="goodCode != null and goodCode != ''"> |
27 | AND m.good_code like concat('%', #{goodCode}, '%') | 27 | AND m.good_code like concat('%', #{goodCode}, '%') |
28 | </if> | 28 | </if> |
... | @@ -38,7 +38,7 @@ | ... | @@ -38,7 +38,7 @@ |
38 | <select id="queryByList" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> | 38 | <select id="queryByList" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> |
39 | select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.* | 39 | select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.* |
40 | from ( | 40 | from ( |
41 | select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id and pc.departs like '%13%' | 41 | select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id |
42 | <if test="goodCode != null and goodCode != ''"> | 42 | <if test="goodCode != null and goodCode != ''"> |
43 | AND m.good_code like concat('%', #{goodCode}, '%') | 43 | AND m.good_code like concat('%', #{goodCode}, '%') |
44 | </if> | 44 | </if> |
... | @@ -51,55 +51,5 @@ | ... | @@ -51,55 +51,5 @@ |
51 | left join ajh_supplier_manage sm on sm.id = aaa.supplier_id | 51 | left join ajh_supplier_manage sm on sm.id = aaa.supplier_id |
52 | </select> | 52 | </select> |
53 | 53 | ||
54 | <!-- 统计查询--> | ||
55 | <select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> | ||
56 | select ss.sparepart_name,ss.sparepart_type,ss.specification,ss.measuring_unit, aaa.* from ( | ||
57 | select pi.sparepart_id,sum(pi.purchase_num ) as 'purchase_num' , sum(pi.total_price) 'total_price' | ||
58 | from erp_purchase_plan_item pi ,erp_purchase_plan pp | ||
59 | where | ||
60 | pp.id = pi.plan_id | ||
61 | <if test="ev.applyYear != null "> | ||
62 | and pp.apply_year = #{ev.applyYear} | ||
63 | </if> | ||
64 | <if test="ev.departId != null "> | ||
65 | and pp.depart_id = #{ev.departId} | ||
66 | </if> | ||
67 | <if test="ev.startTime != null "> | ||
68 | and pp.apply_time >= #{ev.startTime} | ||
69 | </if> | ||
70 | <if test="ev.endTime != null "> | ||
71 | and pp.apply_time <= #{ev.startTime} | ||
72 | </if> | ||
73 | and pp.depart_id in (#{departs}) | ||
74 | -- and pi.sparepart_name like '%%' and pi.sparepart_type ='123' | ||
75 | group by pi.sparepart_id | ||
76 | )aaa | ||
77 | left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id | ||
78 | |||
79 | </select> | ||
80 | 54 | ||
81 | <select id="statisticsPageBySparepartId" resultType="com.skua.modules.erp.entity.PurchaseMaterial"> | ||
82 | select st.item_text as 'sparepart_type_name' , d.depart_name , aaa.* | ||
83 | from ( | ||
84 | select pi.* ,pp.depart_id | ||
85 | from erp_purchase_plan_item pi ,erp_purchase_plan pp | ||
86 | where | ||
87 | pp.id = pi.plan_id and pp.sparepart_id=#{ev.sparepartId} | ||
88 | <if test="ev.applyYear != null "> | ||
89 | and pp.apply_year = #{ev.applyYear} | ||
90 | </if> | ||
91 | <if test="ev.departId != null "> | ||
92 | and pp.depart_id = #{ev.departId} | ||
93 | </if> | ||
94 | <if test="ev.startTime != null "> | ||
95 | and pp.apply_time >= #{ev.startTime} | ||
96 | </if> | ||
97 | <if test="ev.endTime != null "> | ||
98 | and pp.apply_time <= #{ev.startTime} | ||
99 | </if> | ||
100 | and pp.depart_id in (#{departs}) | ||
101 | )aaa | ||
102 | left join equipment_sparepart_type st on st.id = aaa.sparepart_type | ||
103 | left join sys_depart d on d.id = aaa.depart_id | ||
104 | </select> | ||
105 | </mapper> | 55 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -2,4 +2,64 @@ | ... | @@ -2,4 +2,64 @@ |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper"> | 3 | <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper"> |
4 | 4 | ||
5 | |||
6 | <!-- 统计查询--> | ||
7 | <select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchasePlanItem"> | ||
8 | select ss.sparepart_name,ss.sparepart_type,ss.specification,ss.measuring_unit, aaa.* from ( | ||
9 | select pi.sparepart_id,sum(pi.purchase_num ) as 'purchase_num' , sum(pi.total_price) 'total_price' | ||
10 | from erp_purchase_plan_item pi ,erp_purchase_plan pp | ||
11 | where | ||
12 | pp.id = pi.plan_id | ||
13 | <if test="ev.sparepartType != null and ev.sparepartType != '' "> | ||
14 | and pi.sparepart_type = #{ev.sparepartType} | ||
15 | </if> <if test="ev.sparepartName != null and ev.sparepartName != '' "> | ||
16 | AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%') | ||
17 | </if> | ||
18 | <if test="ev.applyYear != null and ev.applyYear != '' "> | ||
19 | and pp.apply_year = #{ev.applyYear} | ||
20 | </if> | ||
21 | <if test="ev.departId != null and ev.departId!= ''"> | ||
22 | and pp.depart_id = #{ev.departId} | ||
23 | </if> | ||
24 | <if test="ev.startTime != null and ev.startTime!= ''"> | ||
25 | and pp.apply_time >= #{ev.startTime} | ||
26 | </if> | ||
27 | <if test="ev.endTime != null and ev.endTime != ''"> | ||
28 | and pp.apply_time <= #{ev.endTime} | ||
29 | </if> | ||
30 | group by pi.sparepart_id | ||
31 | )aaa | ||
32 | left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id | ||
33 | |||
34 | </select> | ||
35 | |||
36 | <select id="statisticsPageBySparepartId" resultType="com.skua.modules.erp.entity.PurchasePlanItem"> | ||
37 | select st.item_text as 'sparepart_type_name' , d.depart_name , aaa.* | ||
38 | from ( | ||
39 | select pi.* ,pp.depart_id | ||
40 | from erp_purchase_plan_item pi ,erp_purchase_plan pp | ||
41 | where pp.id = pi.plan_id and pi.sparepart_id=#{ev.sparepartId} | ||
42 | <if test="ev.sparepartType != null and ev.sparepartType != '' "> | ||
43 | and pi.sparepart_type = #{ev.sparepartType} | ||
44 | </if> <if test="ev.sparepartName != null and ev.sparepartName != '' "> | ||
45 | AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%') | ||
46 | </if> | ||
47 | <if test="ev.applyYear != null and ev.applyYear != '' "> | ||
48 | and pp.apply_year = #{ev.applyYear} | ||
49 | </if> | ||
50 | <if test="ev.departId != null and ev.departId!= ''"> | ||
51 | and pp.depart_id = #{ev.departId} | ||
52 | </if> | ||
53 | <if test="ev.startTime != null and ev.startTime!= ''"> | ||
54 | and pp.apply_time >= #{ev.startTime} | ||
55 | </if> | ||
56 | <if test="ev.endTime != null and ev.endTime != ''"> | ||
57 | and pp.apply_time <= #{ev.endTime} | ||
58 | </if> | ||
59 | |||
60 | )aaa | ||
61 | left join equipment_sparepart_type st on st.id = aaa.sparepart_type | ||
62 | left join sys_depart d on d.id = aaa.depart_id | ||
63 | </select> | ||
64 | <!-- and pp.depart_id in (#{ev.departs})--> | ||
5 | </mapper> | 65 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | package com.skua.modules.erp.service; | 1 | package com.skua.modules.erp.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.erp.entity.ERPPurchaseContract; | 5 | import com.skua.modules.erp.entity.ERPPurchaseContract; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.erp.entity.PurchaseMaterial; | 7 | import com.skua.modules.erp.entity.PurchaseMaterial; |
8 | import com.skua.modules.erp.entity.PurchasePlanItem; | ||
6 | import com.skua.modules.erp.vo.PurchaseContractVO; | 9 | import com.skua.modules.erp.vo.PurchaseContractVO; |
10 | import com.skua.modules.erp.vo.PurchasePlanSearchVO; | ||
7 | 11 | ||
8 | import java.util.List; | 12 | import java.util.List; |
9 | 13 | ||
... | @@ -50,4 +54,7 @@ public interface IEROPurchaseContractService extends IService<ERPPurchaseContrac | ... | @@ -50,4 +54,7 @@ public interface IEROPurchaseContractService extends IService<ERPPurchaseContrac |
50 | * @param purchaseContractVO | 54 | * @param purchaseContractVO |
51 | */ | 55 | */ |
52 | public void auditPurchaseContract(PurchaseContractVO purchaseContractVO); | 56 | public void auditPurchaseContract(PurchaseContractVO purchaseContractVO); |
57 | |||
58 | |||
59 | |||
53 | } | 60 | } | ... | ... |
... | @@ -31,18 +31,5 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> { | ... | @@ -31,18 +31,5 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> { |
31 | */ | 31 | */ |
32 | List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId); | 32 | List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId); |
33 | 33 | ||
34 | /*** | ||
35 | * 统计分页:按照物料分组 | ||
36 | * @param page | ||
37 | * @param purchasePlanSearchVO | ||
38 | * @return | ||
39 | */ | ||
40 | IPage<PurchaseMaterial> statisticsPage(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO); | ||
41 | 34 | ||
42 | /*** | ||
43 | * 查询某一物料的的采购计划物料清单 | ||
44 | * @param page | ||
45 | * @return | ||
46 | */ | ||
47 | IPage<PurchaseMaterial> statisticsPageBySparepartId(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO); | ||
48 | } | 35 | } | ... | ... |
1 | package com.skua.modules.erp.service; | 1 | package com.skua.modules.erp.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.erp.entity.PurchasePlan; | 5 | import com.skua.modules.erp.entity.PurchasePlan; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.erp.entity.PurchasePlanItem; | 7 | import com.skua.modules.erp.entity.PurchasePlanItem; |
8 | import com.skua.modules.erp.vo.PurchasePlanSearchVO; | ||
6 | import com.skua.modules.erp.vo.PurchasePlanVO; | 9 | import com.skua.modules.erp.vo.PurchasePlanVO; |
7 | 10 | ||
8 | import java.util.List; | 11 | import java.util.List; |
... | @@ -52,4 +55,20 @@ public interface IPurchasePlanService extends IService<PurchasePlan> { | ... | @@ -52,4 +55,20 @@ public interface IPurchasePlanService extends IService<PurchasePlan> { |
52 | * @param purchasePlanVO | 55 | * @param purchasePlanVO |
53 | */ | 56 | */ |
54 | public void auditPurchasePlan(PurchasePlanVO purchasePlanVO); | 57 | public void auditPurchasePlan(PurchasePlanVO purchasePlanVO); |
58 | |||
59 | /*** | ||
60 | * 统计分页:按照物料分组 | ||
61 | * @param page | ||
62 | * @param purchasePlanSearchVO | ||
63 | * @return | ||
64 | */ | ||
65 | IPage<PurchasePlanItem> statisticsPage(Page<PurchasePlanItem> page, PurchasePlanSearchVO purchasePlanSearchVO); | ||
66 | |||
67 | /*** | ||
68 | * 查询某一物料的的采购计划物料清单 | ||
69 | * @param page | ||
70 | * @return | ||
71 | */ | ||
72 | IPage<PurchasePlanItem> statisticsPageBySparepartId(Page<PurchasePlanItem> page, PurchasePlanSearchVO purchasePlanSearchVO); | ||
73 | |||
55 | } | 74 | } | ... | ... |
... | @@ -38,22 +38,5 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap | ... | @@ -38,22 +38,5 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap |
38 | return this.baseMapper.queryByList(goodCode,departId); | 38 | return this.baseMapper.queryByList(goodCode,departId); |
39 | } | 39 | } |
40 | 40 | ||
41 | /*** | ||
42 | * 统计分页 | ||
43 | * @param page | ||
44 | * @param purchasePlanSearchVO | ||
45 | * @return | ||
46 | */ | ||
47 | public IPage<PurchaseMaterial> statisticsPage(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO){ | ||
48 | return this.baseMapper.statisticsPage(page,purchasePlanSearchVO); | ||
49 | } | ||
50 | 41 | ||
51 | /*** | ||
52 | * 查询某一物料的的采购计划物料清单 | ||
53 | * @param page | ||
54 | * @return | ||
55 | */ | ||
56 | public IPage<PurchaseMaterial> statisticsPageBySparepartId(Page<PurchaseMaterial> page, PurchasePlanSearchVO purchasePlanSearchVO){ | ||
57 | return this.baseMapper.statisticsPageBySparepartId(page,purchasePlanSearchVO); | ||
58 | } | ||
59 | } | 42 | } | ... | ... |
1 | package com.skua.modules.erp.service.impl; | 1 | package com.skua.modules.erp.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.core.context.BaseContextHandler; | 5 | import com.skua.core.context.BaseContextHandler; |
4 | import com.skua.modules.erp.entity.ApproveRecord; | 6 | import com.skua.modules.erp.entity.ApproveRecord; |
7 | import com.skua.modules.erp.entity.PurchaseMaterial; | ||
5 | import com.skua.modules.erp.entity.PurchasePlan; | 8 | import com.skua.modules.erp.entity.PurchasePlan; |
6 | import com.skua.modules.erp.entity.PurchasePlanItem; | 9 | import com.skua.modules.erp.entity.PurchasePlanItem; |
7 | import com.skua.modules.erp.mapper.ApproveRecordMapper; | 10 | import com.skua.modules.erp.mapper.ApproveRecordMapper; |
8 | import com.skua.modules.erp.mapper.PurchasePlanItemMapper; | 11 | import com.skua.modules.erp.mapper.PurchasePlanItemMapper; |
9 | import com.skua.modules.erp.mapper.PurchasePlanMapper; | 12 | import com.skua.modules.erp.mapper.PurchasePlanMapper; |
10 | import com.skua.modules.erp.service.IPurchasePlanService; | 13 | import com.skua.modules.erp.service.IPurchasePlanService; |
14 | import com.skua.modules.erp.vo.PurchasePlanSearchVO; | ||
11 | import com.skua.modules.erp.vo.PurchasePlanVO; | 15 | import com.skua.modules.erp.vo.PurchasePlanVO; |
12 | import org.springframework.beans.BeanUtils; | 16 | import org.springframework.beans.BeanUtils; |
13 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
... | @@ -145,4 +149,23 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur | ... | @@ -145,4 +149,23 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur |
145 | 149 | ||
146 | } | 150 | } |
147 | } | 151 | } |
152 | |||
153 | /*** | ||
154 | * 统计分页 | ||
155 | * @param page | ||
156 | * @param purchasePlanSearchVO | ||
157 | * @return | ||
158 | */ | ||
159 | public IPage<PurchasePlanItem> statisticsPage(Page<PurchasePlanItem> page, PurchasePlanSearchVO purchasePlanSearchVO){ | ||
160 | return this.baseMapper.statisticsPage(page,purchasePlanSearchVO); | ||
161 | } | ||
162 | |||
163 | /*** | ||
164 | * 查询某一物料的的采购计划物料清单 | ||
165 | * @param page | ||
166 | * @return | ||
167 | */ | ||
168 | public IPage<PurchasePlanItem> statisticsPageBySparepartId(Page<PurchasePlanItem> page, PurchasePlanSearchVO purchasePlanSearchVO){ | ||
169 | return this.baseMapper.statisticsPageBySparepartId(page,purchasePlanSearchVO); | ||
170 | } | ||
148 | } | 171 | } | ... | ... |
... | @@ -60,14 +60,18 @@ public class APPDangerInspectionController { | ... | @@ -60,14 +60,18 @@ public class APPDangerInspectionController { |
60 | DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO();// dangerInspection ; | 60 | DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO();// dangerInspection ; |
61 | 61 | ||
62 | BeanUtils.copyProperties(dangerInspection , dangerLevelManageVO); | 62 | BeanUtils.copyProperties(dangerInspection , dangerLevelManageVO); |
63 | //查询:上次巡检时间 | 63 | //查询:上次巡检时间(查询还有未完成的巡检记录) |
64 | DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,null ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录 | 64 | DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"1" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录 |
65 | if(inspectionRecord == null ){//查询完成的数据 | ||
66 | inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"2" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录 | ||
67 | } | ||
65 | if(inspectionRecord != null ){ | 68 | if(inspectionRecord != null ){ |
66 | dangerLevelManageVO.setLastInspectionTime( inspectionRecord.getReportDate() ); | 69 | dangerLevelManageVO.setLastInspectionTime( inspectionRecord.getReportDate() ); |
67 | dangerLevelManageVO.setLastInspectionStatus( inspectionRecord.getStatus()); | 70 | dangerLevelManageVO.setLastInspectionStatus( inspectionRecord.getStatus()); |
71 | dangerLevelManageVO.setLastInspectionRecordId( inspectionRecord.getId() ); | ||
68 | String dangerId = id; | 72 | String dangerId = id; |
69 | if( !"2".equals(inspectionRecord.getStatus()) ){ | 73 | if( !"2".equals(inspectionRecord.getStatus()) ){ |
70 | List<DangerInspectionInfo> inspectionInfoList = inspectionRecordService.queryInspectionInfoByDangerId(dangerId ,BaseContextHandler.getUserId()); | 74 | List<DangerInspectionInfo> inspectionInfoList = inspectionRecordService.queryListByInspectionRecordId(inspectionRecord.getId() ,BaseContextHandler.getUserId()); |
71 | dangerLevelManageVO.setInspectionInfoList( inspectionInfoList ) ; | 75 | dangerLevelManageVO.setInspectionInfoList( inspectionInfoList ) ; |
72 | } | 76 | } |
73 | } | 77 | } | ... | ... |
... | @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.IdType; | ... | @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.IdType; |
8 | import com.baomidou.mybatisplus.annotation.TableId; | 8 | import com.baomidou.mybatisplus.annotation.TableId; |
9 | import com.baomidou.mybatisplus.annotation.TableName; | 9 | import com.baomidou.mybatisplus.annotation.TableName; |
10 | import com.baomidou.mybatisplus.annotation.TableField; | 10 | import com.baomidou.mybatisplus.annotation.TableField; |
11 | import com.skua.core.aspect.annotation.Dict; | ||
11 | import io.swagger.annotations.ApiModel; | 12 | import io.swagger.annotations.ApiModel; |
12 | import io.swagger.annotations.ApiModelProperty; | 13 | import io.swagger.annotations.ApiModelProperty; |
13 | import lombok.Data; | 14 | import lombok.Data; |
... | @@ -39,27 +40,31 @@ public class DangerInspectionRecord implements Serializable{ | ... | @@ -39,27 +40,31 @@ public class DangerInspectionRecord implements Serializable{ |
39 | @Excel(name = "风险等级编号", width = 15) | 40 | @Excel(name = "风险等级编号", width = 15) |
40 | @ApiModelProperty(value = "风险等级编号") | 41 | @ApiModelProperty(value = "风险等级编号") |
41 | private String dangerId; | 42 | private String dangerId; |
42 | |||
43 | /**风险等级编号*/ | 43 | /**风险等级编号*/ |
44 | @Excel(name = "风险等级名称", width = 15) | 44 | @Excel(name = "风险等级名称", width = 15) |
45 | @ApiModelProperty(value = "风险等级名称") | 45 | @ApiModelProperty(value = "风险等级名称") |
46 | private String dangerName; | 46 | private String dangerName; |
47 | |||
48 | /**风险点类型*/ | ||
49 | @Excel(name = "风险点类型", width = 15) | ||
50 | @ApiModelProperty(value = "风险点类型") | ||
51 | @Dict(dicCode = "dangerType") | ||
52 | private String dangerType; | ||
47 | /**上报人(用户id)*/ | 53 | /**上报人(用户id)*/ |
48 | @Excel(name = "上报人(用户id)", width = 15) | 54 | @Excel(name = "上报人(用户id)", width = 15) |
49 | @ApiModelProperty(value = "上报人(用户id)") | 55 | @ApiModelProperty(value = "上报人(用户id)") |
56 | @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") | ||
50 | private String reportUser; | 57 | private String reportUser; |
51 | /**上报时间*/ | 58 | /**上报时间*/ |
52 | @Excel(name = "上报时间", width = 15) | 59 | @Excel(name = "上报时间", width = 15) |
53 | @ApiModelProperty(value = "上报时间") | 60 | @ApiModelProperty(value = "上报时间") |
54 | private String reportDate; | 61 | private String reportDate; |
55 | 62 | ||
56 | |||
57 | /**上报时间*/ | 63 | /**上报时间*/ |
58 | @Excel(name = "结束时间", width = 15) | 64 | @Excel(name = "结束时间", width = 15) |
59 | @ApiModelProperty(value = "结束时间") | 65 | @ApiModelProperty(value = "结束时间") |
60 | private String endDate; | 66 | private String endDate; |
61 | 67 | ||
62 | |||
63 | /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/ | 68 | /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/ |
64 | @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15) | 69 | @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15) |
65 | @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)") | 70 | @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)") | ... | ... |
... | @@ -2,6 +2,7 @@ package com.skua.modules.safe.mapper; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.safe.mapper; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.skua.modules.safe.vo.DangerLevelManageVO; | ||
5 | import org.apache.ibatis.annotations.Param; | 6 | import org.apache.ibatis.annotations.Param; |
6 | import com.skua.modules.safe.entity.DangerInspectionRecord; | 7 | import com.skua.modules.safe.entity.DangerInspectionRecord; |
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
... | @@ -16,4 +17,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio | ... | @@ -16,4 +17,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio |
16 | * @param dangerInspection | 17 | * @param dangerInspection |
17 | */ | 18 | */ |
18 | public void batchSaveInspectionInfo(DangerInspectionRecord dangerInspection); | 19 | public void batchSaveInspectionInfo(DangerInspectionRecord dangerInspection); |
20 | |||
21 | /*** | ||
22 | * 获取巡查对象与风险点对象 | ||
23 | * @param inspectionRecordId | ||
24 | * @return | ||
25 | */ | ||
26 | public DangerLevelManageVO queryDangerLevelAndInspectionRecord(@Param("inspectionRecordId") String inspectionRecordId); | ||
19 | } | 27 | } | ... | ... |
... | @@ -2,4 +2,14 @@ | ... | @@ -2,4 +2,14 @@ |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.safe.mapper.DangerInspectionRecordMapper"> | 3 | <mapper namespace="com.skua.modules.safe.mapper.DangerInspectionRecordMapper"> |
4 | 4 | ||
5 | <select id="queryDangerLevelAndInspectionRecord" resultType="com.skua.modules.safe.vo.DangerLevelManageVO"> | ||
6 | select ir.id 'last_inspection_record_id',ir.report_date 'start_time' , ir.end_date 'end_time' , | ||
7 | u.realname 'report_user' , d.depart_name , m.* | ||
8 | from danger_inspection_record ir | ||
9 | left join sys_user u on ir.report_user = u.id | ||
10 | left join danger_level_manage m on ir.danger_id = m.id | ||
11 | left join sys_depart d on m.depart_id = d.id | ||
12 | |||
13 | where ir.id = #{inspectionRecordId} | ||
14 | </select> | ||
5 | </mapper> | 15 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -40,12 +40,12 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio | ... | @@ -40,12 +40,12 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio |
40 | 40 | ||
41 | 41 | ||
42 | /*** | 42 | /*** |
43 | * 根据检查点编号,获取用户的巡检检查集合 | 43 | * 根据检查对象编号,获取用户的巡检检查集合 |
44 | * @param dangerId | 44 | * @param repordId |
45 | * @param userId | 45 | * @param userId |
46 | * @return | 46 | * @return |
47 | */ | 47 | */ |
48 | public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId); | 48 | public List<DangerInspectionInfo> queryListByInspectionRecordId(String repordId,String userId); |
49 | 49 | ||
50 | /*** | 50 | /*** |
51 | * 根据巡检记录编号获取巡检对象集合 | 51 | * 根据巡检记录编号获取巡检对象集合 | ... | ... |
... | @@ -43,7 +43,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -43,7 +43,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
43 | public DangerInspectionRecord queryOneByDangerId(String dangerId,String status,String userId){ | 43 | public DangerInspectionRecord queryOneByDangerId(String dangerId,String status,String userId){ |
44 | LambdaQueryWrapper<DangerInspectionRecord> queryWrapper = new LambdaQueryWrapper<DangerInspectionRecord>(); | 44 | LambdaQueryWrapper<DangerInspectionRecord> queryWrapper = new LambdaQueryWrapper<DangerInspectionRecord>(); |
45 | queryWrapper.eq(DangerInspectionRecord::getDangerId, dangerId); | 45 | queryWrapper.eq(DangerInspectionRecord::getDangerId, dangerId); |
46 | if(status != null ){ | 46 | if(status != null && status.length() > 0 ){ |
47 | queryWrapper.eq(DangerInspectionRecord::getStatus , status); | 47 | queryWrapper.eq(DangerInspectionRecord::getStatus , status); |
48 | } | 48 | } |
49 | queryWrapper.eq(DangerInspectionRecord::getReportUser , userId); | 49 | queryWrapper.eq(DangerInspectionRecord::getReportUser , userId); |
... | @@ -65,18 +65,19 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -65,18 +65,19 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
65 | @Transactional | 65 | @Transactional |
66 | public DangerInspectionRecord startInspection(String dangerId,String status , String userId){ | 66 | public DangerInspectionRecord startInspection(String dangerId,String status , String userId){ |
67 | 67 | ||
68 | DangerInspectionRecord dangerInspection = queryOneByDangerId(dangerId ,status ,userId ); | 68 | DangerInspectionRecord dangerInspectionRecord = queryOneByDangerId(dangerId ,status ,userId ); |
69 | if(dangerInspection == null ){ | 69 | if(dangerInspectionRecord == null ){ |
70 | DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId ); | 70 | DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId ); |
71 | dangerInspection = new DangerInspectionRecord(); | 71 | dangerInspectionRecord = new DangerInspectionRecord(); |
72 | dangerInspection.setDepartId(dangerLevelManage.getDepartId()); | 72 | dangerInspectionRecord.setDepartId(dangerLevelManage.getDepartId()); |
73 | dangerInspection.setDangerName(dangerLevelManage.getDangerName() );//风险等级名称 | 73 | dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() );//风险等级名称 |
74 | dangerInspection.setDangerId( dangerId ); | 74 | dangerInspectionRecord.setDangerType( dangerLevelManage.getDangerType() );//风险类型 |
75 | dangerInspection.setStatus( status); | 75 | dangerInspectionRecord.setDangerId( dangerId ); |
76 | dangerInspection.setReportUser( userId ); | 76 | dangerInspectionRecord.setStatus( status); |
77 | dangerInspection.setReportDate(DateUtil.getCurrentDate()); | 77 | dangerInspectionRecord.setReportUser( userId ); |
78 | dangerInspectionRecord.setReportDate(DateUtil.getCurrentDate()); | ||
78 | 79 | ||
79 | this.baseMapper.insert( dangerInspection ) ; | 80 | this.baseMapper.insert( dangerInspectionRecord ) ; |
80 | 81 | ||
81 | //添加检查对象 | 82 | //添加检查对象 |
82 | //批量插入检查内容对象 | 83 | //批量插入检查内容对象 |
... | @@ -94,7 +95,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -94,7 +95,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
94 | inspectionInfo = new DangerInspectionInfo(); | 95 | inspectionInfo = new DangerInspectionInfo(); |
95 | // ( depart_id , user_id, danger_id , inspect_obj_id,inspect_name,inspect_standard , inspect_method,report_user, ) | 96 | // ( depart_id , user_id, danger_id , inspect_obj_id,inspect_name,inspect_standard , inspect_method,report_user, ) |
96 | inspectionInfo.setDepartId(dangerLevelManage.getDepartId() ) ; | 97 | inspectionInfo.setDepartId(dangerLevelManage.getDepartId() ) ; |
97 | inspectionInfo.setInspectionRecordId( dangerInspection.getId()); | 98 | inspectionInfo.setInspectionRecordId( dangerInspectionRecord.getId()); |
98 | inspectionInfo.setDangerId( dangerInspectInfo.getDangerId() ); | 99 | inspectionInfo.setDangerId( dangerInspectInfo.getDangerId() ); |
99 | inspectionInfo.setInspectName( dangerInspectInfo.getInspectName() ); | 100 | inspectionInfo.setInspectName( dangerInspectInfo.getInspectName() ); |
100 | inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod()); | 101 | inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod()); |
... | @@ -145,9 +146,9 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -145,9 +146,9 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
145 | // 添加检查对象的检查项目 | 146 | // 添加检查对象的检查项目 |
146 | } | 147 | } |
147 | 148 | ||
148 | List<DangerInspectionInfo> inspectionInfoList = queryInspectionInfoByDangerId( dangerId ,userId); | 149 | List<DangerInspectionInfo> inspectionInfoList = queryListByInspectionRecordId( dangerInspectionRecord.getId() ,userId); |
149 | dangerInspection.setInspectionInfoList( inspectionInfoList ) ; | 150 | dangerInspectionRecord.setInspectionInfoList( inspectionInfoList ) ; |
150 | return dangerInspection; | 151 | return dangerInspectionRecord; |
151 | } | 152 | } |
152 | 153 | ||
153 | /*** | 154 | /*** |
... | @@ -156,7 +157,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -156,7 +157,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
156 | * @param userId | 157 | * @param userId |
157 | * @return | 158 | * @return |
158 | */ | 159 | */ |
159 | public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId){ | 160 | /* public List<DangerInspectionInfo> queryInspectionInfoByDangerId(String dangerId ,String userId){ |
160 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); | 161 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); |
161 | queryWrapper.eq(DangerInspectionInfo::getReportUser, userId); | 162 | queryWrapper.eq(DangerInspectionInfo::getReportUser, userId); |
162 | queryWrapper.eq(DangerInspectionInfo::getDangerId, dangerId); | 163 | queryWrapper.eq(DangerInspectionInfo::getDangerId, dangerId); |
... | @@ -164,6 +165,22 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -164,6 +165,22 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
164 | List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList( queryWrapper) ; | 165 | List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList( queryWrapper) ; |
165 | 166 | ||
166 | return inspectionInfoList; | 167 | return inspectionInfoList; |
168 | }*/ | ||
169 | |||
170 | /** | ||
171 | * 根据巡检对象编号获取用户的巡检检查集合 | ||
172 | * @param inspectionRecordId | ||
173 | * @param userId | ||
174 | * @return | ||
175 | */ | ||
176 | public List<DangerInspectionInfo> queryListByInspectionRecordId(String inspectionRecordId ,String userId){ | ||
177 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); | ||
178 | queryWrapper.eq(DangerInspectionInfo::getReportUser, userId); | ||
179 | queryWrapper.eq(DangerInspectionInfo::getInspectionRecordId, inspectionRecordId); | ||
180 | queryWrapper.orderByAsc( DangerInspectionInfo::getCreateTime ); | ||
181 | List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList( queryWrapper) ; | ||
182 | |||
183 | return inspectionInfoList; | ||
167 | } | 184 | } |
168 | 185 | ||
169 | /*** | 186 | /*** |
... | @@ -172,13 +189,14 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -172,13 +189,14 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
172 | * @return | 189 | * @return |
173 | */ | 190 | */ |
174 | public DangerLevelManageVO queryListByRecordId(String inspectionRecordId){ | 191 | public DangerLevelManageVO queryListByRecordId(String inspectionRecordId){ |
175 | DangerInspectionRecord dangerInspectionRecord = this.baseMapper.selectById(inspectionRecordId); | 192 | /* DangerInspectionRecord dangerInspectionRecord = this.baseMapper.selectById(inspectionRecordId); |
176 | DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO(); | 193 | DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO(); |
177 | DangerLevelManage dangerLevelManage = null;// | 194 | DangerLevelManage dangerLevelManage = null;// |
178 | if(dangerInspectionRecord != null ){ | 195 | if(dangerInspectionRecord != null ){ |
179 | dangerLevelManage = dangerLevelManageMapper.selectById(dangerInspectionRecord.getDangerId()); | 196 | dangerLevelManage = dangerLevelManageMapper.selectById(dangerInspectionRecord.getDangerId()); |
180 | BeanUtils.copyProperties(dangerLevelManage, dangerLevelManageVO); | 197 | BeanUtils.copyProperties(dangerLevelManage, dangerLevelManageVO); |
181 | } | 198 | }*/ |
199 | DangerLevelManageVO dangerLevelManageVO = this.baseMapper.queryDangerLevelAndInspectionRecord(inspectionRecordId); | ||
182 | 200 | ||
183 | //巡查对象 | 201 | //巡查对象 |
184 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); | 202 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); | ... | ... |
1 | package com.skua.modules.safe.vo; | 1 | package com.skua.modules.safe.vo; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.annotation.TableField; | ||
3 | import com.skua.modules.safe.entity.DangerInspectionInfo; | 4 | import com.skua.modules.safe.entity.DangerInspectionInfo; |
4 | import com.skua.modules.safe.entity.DangerLevelManage; | 5 | import com.skua.modules.safe.entity.DangerLevelManage; |
5 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
... | @@ -27,7 +28,23 @@ public class DangerLevelManageVO extends DangerLevelManage { | ... | @@ -27,7 +28,23 @@ public class DangerLevelManageVO extends DangerLevelManage { |
27 | @ApiModelProperty(value = "上次巡检状态 ") | 28 | @ApiModelProperty(value = "上次巡检状态 ") |
28 | private String lastInspectionStatus; | 29 | private String lastInspectionStatus; |
29 | 30 | ||
31 | @ApiModelProperty(value = "上次巡检编号 ") | ||
32 | private String lastInspectionRecordId; | ||
30 | 33 | ||
31 | @ApiModelProperty(value = "巡检内容对象集合") | 34 | @ApiModelProperty(value = "巡检内容对象集合") |
32 | private List<DangerInspectionInfo> inspectionInfoList; | 35 | private List<DangerInspectionInfo> inspectionInfoList; |
36 | |||
37 | |||
38 | @TableField(exist=false) | ||
39 | @ApiModelProperty(value = "开始时间") | ||
40 | private String startTime; | ||
41 | |||
42 | @TableField(exist=false) | ||
43 | @ApiModelProperty(value = "结束时间") | ||
44 | private String endTime; | ||
45 | |||
46 | @TableField(exist=false) | ||
47 | @ApiModelProperty(value = "巡检人员") | ||
48 | private String reportUser; | ||
49 | |||
33 | } | 50 | } | ... | ... |
-
请 注册 或 登录 后发表评论