f7392619 康伟

kangwei : 采购计划添加物料用途

            列表添加物料属性查询条件
            采购计划统计添加物料用途
1 个父辈 7a610143
正在显示 17 个修改的文件 包含 184 行增加50 行删除
...@@ -104,9 +104,9 @@ public class MaterialINController { ...@@ -104,9 +104,9 @@ public class MaterialINController {
104 @ApiOperation(value="erp--物料(药剂)入库-集团审核列表", notes="erp--物料(药剂)入库-集团审核列表") 104 @ApiOperation(value="erp--物料(药剂)入库-集团审核列表", notes="erp--物料(药剂)入库-集团审核列表")
105 @GetMapping(value = "/handleList") 105 @GetMapping(value = "/handleList")
106 public Result<IPage<MaterialIN>> handleList(MaterialIN materialIN, 106 public Result<IPage<MaterialIN>> handleList(MaterialIN materialIN,
107 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, 107 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
108 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 108 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
109 HttpServletRequest req) { 109 HttpServletRequest req) {
110 Result<IPage<MaterialIN>> result = new Result<IPage<MaterialIN>>(); 110 Result<IPage<MaterialIN>> result = new Result<IPage<MaterialIN>>();
111 QueryWrapper<MaterialIN> queryWrapper = new QueryWrapper();//QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap()); 111 QueryWrapper<MaterialIN> queryWrapper = new QueryWrapper();//QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap());
112 Page<MaterialIN> page = new Page<MaterialIN>(pageNo, pageSize); 112 Page<MaterialIN> page = new Page<MaterialIN>(pageNo, pageSize);
...@@ -133,6 +133,31 @@ public class MaterialINController { ...@@ -133,6 +133,31 @@ public class MaterialINController {
133 result.setResult(pageList); 133 result.setResult(pageList);
134 return result; 134 return result;
135 } 135 }
136
137 @AutoLog(value = "erp--物料(药剂)入库--药剂到货日验收记录")
138 @ApiOperation(value="erp--物料(药剂)入库-药剂到货日验收记录", notes="erp--物料(药剂)入库-药剂到货日验收记录")
139 @GetMapping(value = "/arrivalRecordList")
140 public Result<List<MaterialIN>> arrivalRecordList(MaterialIN materialIN,HttpServletRequest req) {
141 Result<List<MaterialIN>> result = new Result<List<MaterialIN>>();
142 QueryWrapper<MaterialIN> queryWrapper = new QueryWrapper();//QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap());
143 if(StringUtils.isNotBlank(materialIN.getGoodCode())){
144 queryWrapper.like("good_code",materialIN.getGoodCode());
145 }
146 if(StringUtils.isNotBlank(materialIN.getStartTime())){
147 queryWrapper.ge("arrive_time",materialIN.getStartTime());
148 }
149 if(StringUtils.isNotBlank(materialIN.getEndTime())){
150 queryWrapper.le("arrive_time",materialIN.getEndTime());
151 }
152 List<MaterialIN> pageList = materialINService.list( queryWrapper);
153 result.setSuccess(true);
154 result.setResult(pageList);
155 return result;
156 }
157
158
159
160 //arrivalRecord
136 /** 161 /**
137 * <pre> 162 * <pre>
138 * 添加 163 * 添加
......
...@@ -25,7 +25,9 @@ import com.skua.modules.erp.vo.PurchasePlanSearchVO; ...@@ -25,7 +25,9 @@ import com.skua.modules.erp.vo.PurchasePlanSearchVO;
25 import com.skua.modules.erp.vo.PurchasePlanStatisticsVO; 25 import com.skua.modules.erp.vo.PurchasePlanStatisticsVO;
26 import com.skua.modules.erp.vo.PurchasePlanVO; 26 import com.skua.modules.erp.vo.PurchasePlanVO;
27 import com.skua.modules.guest.util.DateUtil; 27 import com.skua.modules.guest.util.DateUtil;
28 import com.skua.modules.quartz.util.BaseUtil;
28 import com.skua.modules.supplies.service.IEquipmentSparepartTypeService; 29 import com.skua.modules.supplies.service.IEquipmentSparepartTypeService;
30 import com.skua.modules.system.service.ISysDepartService;
29 import lombok.extern.slf4j.Slf4j; 31 import lombok.extern.slf4j.Slf4j;
30 32
31 import org.apache.commons.lang3.StringUtils; 33 import org.apache.commons.lang3.StringUtils;
...@@ -60,6 +62,8 @@ public class PurchasePlanController { ...@@ -60,6 +62,8 @@ public class PurchasePlanController {
60 private IPurchasePlanService purchasePlanService; 62 private IPurchasePlanService purchasePlanService;
61 @Autowired 63 @Autowired
62 private IEquipmentSparepartTypeService equipmentSparepartTypeService; 64 private IEquipmentSparepartTypeService equipmentSparepartTypeService;
65 @Autowired
66 private ISysDepartService departService;
63 67
64 @AutoLog(value = "erp采购计划表-分页列表查询") 68 @AutoLog(value = "erp采购计划表-分页列表查询")
65 @ApiOperation(value="erp采购计划表-分页列表查询", notes="erp采购计划表-分页列表查询") 69 @ApiOperation(value="erp采购计划表-分页列表查询", notes="erp采购计划表-分页列表查询")
...@@ -114,7 +118,6 @@ public class PurchasePlanController { ...@@ -114,7 +118,6 @@ public class PurchasePlanController {
114 queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(",")); 118 queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
115 } 119 }
116 } 120 }
117
118 if(StringUtils.isNotEmpty( purchasePlan.getStatus() ) ){ 121 if(StringUtils.isNotEmpty( purchasePlan.getStatus() ) ){
119 queryWrapper.eq("status", purchasePlan.getStatus()); 122 queryWrapper.eq("status", purchasePlan.getStatus());
120 }else{ 123 }else{
...@@ -141,7 +144,6 @@ public class PurchasePlanController { ...@@ -141,7 +144,6 @@ public class PurchasePlanController {
141 Result<PurchasePlan> result = new Result<PurchasePlan>(); 144 Result<PurchasePlan> result = new Result<PurchasePlan>();
142 try { 145 try {
143 purchasePlanVO.setApplyTime(DateUtil.getCurrentDate()); 146 purchasePlanVO.setApplyTime(DateUtil.getCurrentDate());
144
145 //purchasePlan.setApplyUser(BaseContextHandler.getUserId()); 147 //purchasePlan.setApplyUser(BaseContextHandler.getUserId());
146 purchasePlanService.savePurchasePlan(purchasePlanVO); 148 purchasePlanService.savePurchasePlan(purchasePlanVO);
147 result.success("添加成功!"); 149 result.success("添加成功!");
...@@ -244,9 +246,6 @@ public class PurchasePlanController { ...@@ -244,9 +246,6 @@ public class PurchasePlanController {
244 } 246 }
245 return result; 247 return result;
246 } 248 }
247
248
249
250 @AutoLog(value = "erp采购计划表-送审") 249 @AutoLog(value = "erp采购计划表-送审")
251 @ApiOperation(value="erp采购计划表-送审", notes="erp采购计划表-送审") 250 @ApiOperation(value="erp采购计划表-送审", notes="erp采购计划表-送审")
252 @GetMapping(value = "/sendAudit") 251 @GetMapping(value = "/sendAudit")
...@@ -285,9 +284,6 @@ public class PurchasePlanController { ...@@ -285,9 +284,6 @@ public class PurchasePlanController {
285 return result; 284 return result;
286 } 285 }
287 286
288
289
290
291 @AutoLog(value = "erp采购计划表-按物料统计列表") 287 @AutoLog(value = "erp采购计划表-按物料统计列表")
292 @ApiOperation(value="erp采购计划表-按物料统计列表", notes="erp采购计划表-按物料统计列表") 288 @ApiOperation(value="erp采购计划表-按物料统计列表", notes="erp采购计划表-按物料统计列表")
293 @GetMapping(value = "/statisticsList") 289 @GetMapping(value = "/statisticsList")
...@@ -298,10 +294,7 @@ public class PurchasePlanController { ...@@ -298,10 +294,7 @@ public class PurchasePlanController {
298 Result<IPage<PurchasePlanItem>> result = new Result<IPage<PurchasePlanItem>>(); 294 Result<IPage<PurchasePlanItem>> result = new Result<IPage<PurchasePlanItem>>();
299 Page<PurchasePlanItem> page = new Page<PurchasePlanItem>(pageNo, pageSize); 295 Page<PurchasePlanItem> page = new Page<PurchasePlanItem>(pageNo, pageSize);
300 //purchasePlanSearchVO.setDepats(); 296 //purchasePlanSearchVO.setDepats();
301 purchasePlanSearchVO.setDeparts(BaseContextHandler.getDeparts()); 297 Set<String> sparepartTypeSet = new HashSet<String>();
302
303
304 Set<String> sparepartTypeSet = new HashSet<>();
305 String sparepartTypeStr = ""; 298 String sparepartTypeStr = "";
306 if (StringUtils.isNotEmpty(purchasePlanSearchVO.getSparepartType())) { 299 if (StringUtils.isNotEmpty(purchasePlanSearchVO.getSparepartType())) {
307 // 查询子集 300 // 查询子集
...@@ -312,6 +305,26 @@ public class PurchasePlanController { ...@@ -312,6 +305,26 @@ public class PurchasePlanController {
312 } 305 }
313 purchasePlanSearchVO.setSparepartType( sparepartTypeStr ); 306 purchasePlanSearchVO.setSparepartType( sparepartTypeStr );
314 } 307 }
308 log.debug("查询物料子分类集合:{}",sparepartTypeStr);
309 //查询下一级部门集合
310 if (!"1".equals(BaseContextHandler.get("userType"))) {
311 Set<String> departsSet = new HashSet<String>();
312 String departIds = "";
313 if (StringUtils.isNotEmpty(purchasePlanSearchVO.getDepartId())) {
314 // 查询子集
315 departsSet = departService.getAllChildrenDepartIds( purchasePlanSearchVO.getDepartId() );
316 if(departsSet.size() > 0 ) departIds = String.join(",", departsSet);// 使用String.join()方法转换Set为字符串,以逗号分隔
317 purchasePlanSearchVO.setDepartIds( departIds );
318 log.debug("查询部门集合:{}",departIds);
319 }else{
320 purchasePlanSearchVO.setDepartIds( BaseContextHandler.getDeparts() );
321 log.debug("查询权限部门集合:{}", BaseUtil.quoteEach(BaseContextHandler.getDeparts(),","));
322 }
323 }
324 if(StringUtils.isNotEmpty(purchasePlanSearchVO.getSparepartAttribute() )){
325 purchasePlanSearchVO.setSparepartAttribute( BaseUtil.quoteEach(purchasePlanSearchVO.getSparepartAttribute(),",") ) ;
326 }
327 log.debug("查询物料属性:{}",purchasePlanSearchVO.getSparepartAttribute());
315 328
316 IPage<PurchasePlanItem> pageList = purchasePlanService.statisticsPage(page,purchasePlanSearchVO); 329 IPage<PurchasePlanItem> pageList = purchasePlanService.statisticsPage(page,purchasePlanSearchVO);
317 result.setSuccess(true); 330 result.setSuccess(true);
...@@ -336,4 +349,7 @@ public class PurchasePlanController { ...@@ -336,4 +349,7 @@ public class PurchasePlanController {
336 return result; 349 return result;
337 } 350 }
338 351
352
353
354
339 } 355 }
......
...@@ -56,6 +56,12 @@ public class PurchasePlanItem implements Serializable{ ...@@ -56,6 +56,12 @@ public class PurchasePlanItem implements Serializable{
56 @Excel(name = "计量单位", width = 15) 56 @Excel(name = "计量单位", width = 15)
57 @ApiModelProperty(value = "计量单位") 57 @ApiModelProperty(value = "计量单位")
58 private String measuringUnit; 58 private String measuringUnit;
59
60 @Excel(name = "物料属性", width = 15)
61 @ApiModelProperty(value = "物料属性")
62 @Dict(dicCode = "sparepart_attribute")
63 private String sparepartAttribute;
64
59 /**计划采购数量*/ 65 /**计划采购数量*/
60 @Excel(name = "计划采购数量", width = 15) 66 @Excel(name = "计划采购数量", width = 15)
61 @ApiModelProperty(value = "计划采购数量") 67 @ApiModelProperty(value = "计划采购数量")
...@@ -70,6 +76,10 @@ public class PurchasePlanItem implements Serializable{ ...@@ -70,6 +76,10 @@ public class PurchasePlanItem implements Serializable{
70 @ApiModelProperty(value = "备注") 76 @ApiModelProperty(value = "备注")
71 private String remark; 77 private String remark;
72 78
79 @Excel(name = "物料用途", width = 15)
80 @ApiModelProperty(value = "物料用途")
81 private String purpose;
82
73 83
74 @Excel(name = "去年出库数量", width = 15) 84 @Excel(name = "去年出库数量", width = 15)
75 @ApiModelProperty(value = "去年出库数量") 85 @ApiModelProperty(value = "去年出库数量")
......
...@@ -3,32 +3,36 @@ ...@@ -3,32 +3,36 @@
3 <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper"> 3 <mapper namespace="com.skua.modules.erp.mapper.PurchasePlanMapper">
4 <!-- 统计查询--> 4 <!-- 统计查询-->
5 <select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchasePlanItem"> 5 <select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchasePlanItem">
6 select ss.id, ss.sparepart_name,ss.sparepart_type, st.item_textstatisticsPage as 'sparepart_type_name' ,ss.sparepart_code, ss.specification,ss.measuring_unit, aaa.* from ( 6 select ss.id, ss.sparepart_name,ss.sparepart_type, st.item_text as 'sparepart_type_name' ,ss.sparepart_attribute,ss.sparepart_code, ss.specification,ss.measuring_unit, aaa.* from (
7 select pi.sparepart_id,sum(pi.purchase_num ) as 'purchase_num' , sum(pi.total_price) 'total_price' 7 select pi.sparepart_id,sum(pi.purchase_num ) as 'purchase_num' , sum(pi.total_price) 'total_price' , group_concat(DISTINCT purpose ) purpose
8 from erp_purchase_plan_item pi ,erp_purchase_plan pp 8 from erp_purchase_plan_item pi ,erp_purchase_plan pp
9 where 9 where
10 pp.id = pi.plan_id 10 pp.id = pi.plan_id and pp.status = 3
11 <if test="ev.sparepartType != null and ev.sparepartType != '' "> 11 <if test="ev.sparepartType != null and ev.sparepartType != '' ">
12 and pi.sparepart_type in ( ${ev.sparepartType}) 12 and pi.sparepart_type in ( ${ev.sparepartType})
13 </if> 13 </if>
14 <if test="ev.sparepartCode != null and ev.sparepartCode != '' "> 14 <if test="ev.sparepartCode != null and ev.sparepartCode != '' ">
15 AND pi.sparepart_code like concat('%', #{ev.sparepartCode}, '%') 15 AND pi.sparepart_code like '%'#{ev.sparepartCode}'%'
16 </if> 16 </if>
17 <if test="ev.sparepartName != null and ev.sparepartName != '' "> 17 <if test="ev.sparepartName != null and ev.sparepartName != '' ">
18 AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%') 18 AND pi.sparepart_name like '%'#{ev.sparepartName}'%'
19 </if> 19 </if>
20 <if test="ev.applyYear != null and ev.applyYear != '' "> 20 <if test="ev.applyYear != null and ev.applyYear != '' ">
21 and pp.apply_year = #{ev.applyYear} 21 and pp.apply_year = #{ev.applyYear}
22 </if> 22 </if>
23 <if test="ev.departId != null and ev.departId!= ''"> 23 <if test="ev.departIds != null and ev.departIds!= ''">
24 and pp.depart_id in ( ${ev.departId} ) 24 and pp.depart_id in ( ${ev.departIds} )
25 </if> 25 </if>
26
26 <if test="ev.startTime != null and ev.startTime!= ''"> 27 <if test="ev.startTime != null and ev.startTime!= ''">
27 and pp.apply_time &gt;= #{ev.startTime} 28 and pp.apply_time &gt;= #{ev.startTime}
28 </if> 29 </if>
29 <if test="ev.endTime != null and ev.endTime != ''"> 30 <if test="ev.endTime != null and ev.endTime != ''">
30 and pp.apply_time &lt;= #{ev.endTime} 31 and pp.apply_time &lt;= #{ev.endTime}
31 </if> 32 </if>
33 <if test="ev.sparepartAttribute != null and ev.sparepartAttribute != ''">
34 and pi.sparepart_attribute in (${ev.sparepartAttribute})
35 </if>
32 group by pi.sparepart_id 36 group by pi.sparepart_id
33 )aaa 37 )aaa
34 left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id 38 left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
...@@ -37,15 +41,13 @@ ...@@ -37,15 +41,13 @@
37 </select> 41 </select>
38 42
39 <select id="statisticsPageBySparepartId" resultType="com.skua.modules.erp.vo.PurchasePlanStatisticsVO"> 43 <select id="statisticsPageBySparepartId" resultType="com.skua.modules.erp.vo.PurchasePlanStatisticsVO">
40 44 select pi.purpose, pi.purchase_num ,pi.measuring_unit, pi.sparepart_name, pi.specification,pi.sparepart_type, pi.unit_price , pi.total_price , pp.*
41 select u.realname 'apply_user_name', aaa.* from ( 45 from erp_purchase_plan_item pi ,erp_purchase_plan pp
42 select pi.purchase_num ,pi.measuring_unit,pi.sparepart_name, pi.unit_price , pi.total_price , pp.* 46 where pp.status = 3 and pp.id = pi.plan_id and pi.sparepart_id=#{ev.sparepartId}
43 from erp_purchase_plan_item pi ,erp_purchase_plan pp
44 where pp.id = pi.plan_id and pi.sparepart_id=#{ev.sparepartId}
45 <if test="ev.sparepartType != null and ev.sparepartType != '' "> 47 <if test="ev.sparepartType != null and ev.sparepartType != '' ">
46 and pi.sparepart_type = #{ev.sparepartType} 48 and pi.sparepart_type = #{ev.sparepartType}
47 </if> <if test="ev.sparepartName != null and ev.sparepartName != '' "> 49 </if> <if test="ev.sparepartName != null and ev.sparepartName != '' ">
48 AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%') 50 AND pi.sparepart_name like '%'#{ev.sparepartName}'%'
49 </if> 51 </if>
50 <if test="ev.applyYear != null and ev.applyYear != '' "> 52 <if test="ev.applyYear != null and ev.applyYear != '' ">
51 and pp.apply_year = #{ev.applyYear} 53 and pp.apply_year = #{ev.applyYear}
...@@ -59,9 +61,6 @@ ...@@ -59,9 +61,6 @@
59 <if test="ev.endTime != null and ev.endTime != ''"> 61 <if test="ev.endTime != null and ev.endTime != ''">
60 and pp.apply_time &lt;= #{ev.endTime} 62 and pp.apply_time &lt;= #{ev.endTime}
61 </if> 63 </if>
62 )aaa
63 left join sys_depart d on d.id = aaa.depart_id
64 left join sys_user u on u.id = aaa.apply_user
65 </select> 64 </select>
66 <!-- and pp.depart_id in (#{ev.departs})--> 65 <!-- and pp.depart_id in (#{ev.departs})-->
67 </mapper> 66 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
1 package com.skua.modules.erp.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import lombok.Data;
5 import lombok.EqualsAndHashCode;
6 import lombok.experimental.Accessors;
7
8 @Data
9 @EqualsAndHashCode(callSuper = false)
10 @Accessors(chain = true)
11 @ApiModel(value="ArrivalRecordVO到货验收记录", description="到货验收记录")
12 public class ArrivalRecordVO {
13
14
15 }
...@@ -29,12 +29,16 @@ public class PurchasePlanSearchVO { ...@@ -29,12 +29,16 @@ public class PurchasePlanSearchVO {
29 public String sparepartCode; 29 public String sparepartCode;
30 30
31 @ApiModelProperty(value = "权限下的部门编号集合") 31 @ApiModelProperty(value = "权限下的部门编号集合")
32 private String departs; 32 private String departIds;
33
34 @ApiModelProperty(value = "物料属性")
35 private String sparepartAttribute;
36
37
33 38
34 @ApiModelProperty(value = "开始时间") 39 @ApiModelProperty(value = "开始时间")
35 private String startTime; 40 private String startTime;
36 41
37
38 @ApiModelProperty(value = "结束时间") 42 @ApiModelProperty(value = "结束时间")
39 private String endTime; 43 private String endTime;
40 44
......
1 package com.skua.modules.erp.vo; 1 package com.skua.modules.erp.vo;
2 2
3 import com.skua.core.aspect.annotation.Dict;
3 import com.skua.modules.erp.entity.PurchasePlan; 4 import com.skua.modules.erp.entity.PurchasePlan;
4 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
...@@ -18,10 +19,28 @@ public class PurchasePlanStatisticsVO extends PurchasePlan { ...@@ -18,10 +19,28 @@ public class PurchasePlanStatisticsVO extends PurchasePlan {
18 @ApiModelProperty(value = "物料名称") 19 @ApiModelProperty(value = "物料名称")
19 private String sparepartName; 20 private String sparepartName;
20 21
21 @ApiModelProperty(value = "物料名称") 22 @ApiModelProperty(value = "申请人名称")
22 private String applyUserName; 23 private String applyUserName;
23 24
24 25
26 /**物料类别编号*/
27 @Excel(name = "物料类别编号", width = 15)
28 @ApiModelProperty(value = "物料类别编号")
29 @Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
30 private String sparepartType;
31
32 @Excel(name = "规格型号", width = 15)
33 @ApiModelProperty(value = "规格型号")
34 private String specification;
35 /**计量单位*/
36 @Excel(name = "计量单位", width = 15)
37 @ApiModelProperty(value = "计量单位")
38 private String measuringUnit;
39
40 @Excel(name = "物料用途", width = 15)
41 @ApiModelProperty(value = "物料用途")
42 private String purpose;
43
25 /**计划采购数量*/ 44 /**计划采购数量*/
26 @Excel(name = "计划采购数量", width = 15) 45 @Excel(name = "计划采购数量", width = 15)
27 @ApiModelProperty(value = "计划采购数量") 46 @ApiModelProperty(value = "计划采购数量")
...@@ -31,7 +50,6 @@ public class PurchasePlanStatisticsVO extends PurchasePlan { ...@@ -31,7 +50,6 @@ public class PurchasePlanStatisticsVO extends PurchasePlan {
31 @ApiModelProperty(value = "单价") 50 @ApiModelProperty(value = "单价")
32 private String unitPrice; 51 private String unitPrice;
33 52
34
35 @Excel(name = "总价", width = 15) 53 @Excel(name = "总价", width = 15)
36 @ApiModelProperty(value = "总价") 54 @ApiModelProperty(value = "总价")
37 private String totalPrice; 55 private String totalPrice;
......
...@@ -19,6 +19,28 @@ public class BaseUtil { ...@@ -19,6 +19,28 @@ public class BaseUtil {
19 return df.format(pram); 19 return df.format(pram);
20 } 20 }
21 21
22 /***
23 * 分割字符串,然后拼接
24 * @param str 带分隔字符串
25 * @param splitStr 分割符号
26 * @return
27 */
28 public static String quoteEach(String str,String splitStr) {
29 if( str != null && str.length() > 0 ){
30 String[] items = str.split(splitStr);
31 StringBuilder sb = new StringBuilder();
32 for (int i = 0; i < items.length; i++) {
33 if (i > 0) {
34 sb.append(", ");
35 }
36 sb.append('\'').append(items[i]).append('\'');
37 }
38 return sb.toString();
39 }
40 return str;
41
42 }
43
22 /** 44 /**
23 * 获取当前天0点的时间戳 45 * 获取当前天0点的时间戳
24 * 46 *
......
...@@ -255,17 +255,16 @@ public class HealthRecordsController { ...@@ -255,17 +255,16 @@ public class HealthRecordsController {
255 Result<HealthRecordsStatisticsVO> result = new Result<HealthRecordsStatisticsVO>(); 255 Result<HealthRecordsStatisticsVO> result = new Result<HealthRecordsStatisticsVO>();
256 256
257 // 查询子集 257 // 查询子集
258 String departAncestors = ""; 258 /*String departAncestors = "";
259
260 Set<String> departSet = new HashSet<>(); 259 Set<String> departSet = new HashSet<>();
261 // 查询子集 260 // 查询子集
262 departSet = departService.getAllChildrenDepartIds(departId); 261 departSet = departService.getAllChildrenDepartIds(departId);
263 if(departSet.size() > 0 ){ 262 if(departSet.size() > 0 ){
264 // 使用String.join()方法转换Set为字符串,以逗号分隔 263 // 使用String.join()方法转换Set为字符串,以逗号分隔
265 departAncestors = String.join(",", departSet); 264 departAncestors = String.join(",", departSet);
266 } 265 }*/
267 266
268 HealthRecordsStatisticsVO statisticsVO = healthRecordsService.statistics(departAncestors); 267 HealthRecordsStatisticsVO statisticsVO = healthRecordsService.statistics(departId);
269 result.setResult(statisticsVO); 268 result.setResult(statisticsVO);
270 result.setSuccess(true); 269 result.setSuccess(true);
271 return result; 270 return result;
......
...@@ -16,11 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -16,11 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
16 public interface HealthRecordsMapper extends BaseMapper<HealthRecords> { 16 public interface HealthRecordsMapper extends BaseMapper<HealthRecords> {
17 17
18 public IPage<HealthRecordsVO> queryByPage(Page<HealthRecordsVO> page,@Param("healthRecordsVO") HealthRecordsVO healthRecordsVO); 18 public IPage<HealthRecordsVO> queryByPage(Page<HealthRecordsVO> page,@Param("healthRecordsVO") HealthRecordsVO healthRecordsVO);
19
20 /*** 19 /***
21 * 统计接口 20 * 统计接口
22 * @param departAncestors 21 * @param departId
23 * @return 22 * @return
24 */ 23 */
25 public HealthRecordsStatisticsVO statistics(@Param("departAncestors") String departAncestors ); 24 public HealthRecordsStatisticsVO statistics(@Param("departId") String departId );
26 } 25 }
......
...@@ -32,10 +32,20 @@ ...@@ -32,10 +32,20 @@
32 32
33 <!-- 统计接口--> 33 <!-- 统计接口-->
34 <select id="statistics" resultType="com.skua.modules.safe.vo.HealthRecordsStatisticsVO"> 34 <select id="statistics" resultType="com.skua.modules.safe.vo.HealthRecordsStatisticsVO">
35 select 35 SELECT
36 ( SELECT count( 1 ) FROM sys_factory_user_info WHERE depart_id = #{departId}) 'totalNum',
37 (SELECT count( 1 ) FROM
38 ( SELECT DISTINCT user_id FROM safety_health_records hr WHERE hr.depart_id = #{departId} ) aa
39 ) 'useNum'
40 FROM
41 DUAL
42 </select>
43 <!--
44 select
36 (select count(1) from sys_user_depart where dep_id in (${departAncestors}) ) 'totalNum', 45 (select count(1) from sys_user_depart where dep_id in (${departAncestors}) ) 'totalNum',
37 (select count(1 ) from (select DISTINCT user_id from safety_health_records hr where hr.depart_id in ( ${departAncestors} ) ) aa) 'useNum' 46 (select count(1 ) from (select DISTINCT user_id from safety_health_records hr where hr.depart_id in ( ${departAncestors} ) ) aa) 'useNum'
38 from dual 47 from dual
39 </select> 48 -->
49
40 50
41 </mapper> 51 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -21,8 +21,8 @@ public interface IHealthRecordsService extends IService<HealthRecords> { ...@@ -21,8 +21,8 @@ public interface IHealthRecordsService extends IService<HealthRecords> {
21 21
22 /*** 22 /***
23 * 统计 23 * 统计
24 * @param departAncestors 24 * @param departId
25 * @return 25 * @return
26 */ 26 */
27 public HealthRecordsStatisticsVO statistics(String departAncestors); 27 public HealthRecordsStatisticsVO statistics(String departId);
28 } 28 }
......
...@@ -29,10 +29,10 @@ public class HealthRecordsServiceImpl extends ServiceImpl<HealthRecordsMapper, H ...@@ -29,10 +29,10 @@ public class HealthRecordsServiceImpl extends ServiceImpl<HealthRecordsMapper, H
29 29
30 /*** 30 /***
31 * 统计 31 * 统计
32 * @param departAncestors 32 * @param departId
33 * @return 33 * @return
34 */ 34 */
35 public HealthRecordsStatisticsVO statistics(String departAncestors){ 35 public HealthRecordsStatisticsVO statistics(String departId){
36 return this.baseMapper.statistics( departAncestors ); 36 return this.baseMapper.statistics( departId );
37 } 37 }
38 } 38 }
......
...@@ -80,6 +80,9 @@ public class EquipmentSparepartTypeController { ...@@ -80,6 +80,9 @@ public class EquipmentSparepartTypeController {
80 if (StringUtils.isNotBlank(itemText)) { 80 if (StringUtils.isNotBlank(itemText)) {
81 queryWrapper.like("item_text",itemText); 81 queryWrapper.like("item_text",itemText);
82 } 82 }
83 if (equipmentSparepartType.isMedicament()) {//查询药剂类别
84 queryWrapper.eq("is_medicament",equipmentSparepartType.isMedicament());
85 }
83 List<EquipmentSparepartType> equipmentSparepartTypeList = equipmentSparepartTypeService.list(queryWrapper); 86 List<EquipmentSparepartType> equipmentSparepartTypeList = equipmentSparepartTypeService.list(queryWrapper);
84 87
85 List<EquipmentSparepartTypeVO> voList = new ArrayList<>(); 88 List<EquipmentSparepartTypeVO> voList = new ArrayList<>();
......
...@@ -242,6 +242,10 @@ public class EquipmentSparepartSupplies { ...@@ -242,6 +242,10 @@ public class EquipmentSparepartSupplies {
242 private String sparepartAttribute; 242 private String sparepartAttribute;
243 243
244 244
245 @ApiModelProperty(value = "扩展:物料用途")
246 @TableField(exist=false)
247 private String purpose;
248
245 249
246 @ApiModelProperty(value = "扩展:物料类别名称") 250 @ApiModelProperty(value = "扩展:物料类别名称")
247 @TableField(exist=false) 251 @TableField(exist=false)
...@@ -272,7 +276,7 @@ public class EquipmentSparepartSupplies { ...@@ -272,7 +276,7 @@ public class EquipmentSparepartSupplies {
272 276
273 public String getOutNum(){ 277 public String getOutNum(){
274 if(this.outNum == null ){ 278 if(this.outNum == null ){
275 return "0.0"; 279 return "0";
276 } 280 }
277 return this.outNum; 281 return this.outNum;
278 } 282 }
......
...@@ -68,6 +68,10 @@ public class EquipmentSparepartType { ...@@ -68,6 +68,10 @@ public class EquipmentSparepartType {
68 @Excel(name = "是否叶子节点,1:是 0:不是", width = 15) 68 @Excel(name = "是否叶子节点,1:是 0:不是", width = 15)
69 @ApiModelProperty(value = "是否叶子节点,1:是 0:不是") 69 @ApiModelProperty(value = "是否叶子节点,1:是 0:不是")
70 private boolean isLeaf = true; 70 private boolean isLeaf = true;
71
72 @Excel(name = "是否药剂,1:是 0:不是", width = 15)
73 @ApiModelProperty(value = "是否药剂,1:是 0:不是")
74 private boolean isMedicament = false;
71 /** 75 /**
72 * 创建人 76 * 创建人
73 */ 77 */
......
...@@ -29,6 +29,12 @@ public class SysBaseConfig { ...@@ -29,6 +29,12 @@ public class SysBaseConfig {
29 @TableId(type = IdType.ID_WORKER_STR) 29 @TableId(type = IdType.ID_WORKER_STR)
30 @ApiModelProperty(value = "主键") 30 @ApiModelProperty(value = "主键")
31 private java.lang.String id; 31 private java.lang.String id;
32
33 /**网站标题*/
34 @Excel(name = "网站地址", width = 15)
35 @ApiModelProperty(value = "网站地址")
36 private java.lang.String websiteUrl;
37
32 /**网站标题*/ 38 /**网站标题*/
33 @Excel(name = "网站标题", width = 15) 39 @Excel(name = "网站标题", width = 15)
34 @ApiModelProperty(value = "网站标题") 40 @ApiModelProperty(value = "网站标题")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!