831cef07 康伟

kangwei : 采购计划统计接口

1 个父辈 6c8e9266
正在显示 18 个修改的文件 包含 192 行增加16 行删除
...@@ -12,6 +12,7 @@ import com.skua.modules.erp.entity.ApproveRecord; ...@@ -12,6 +12,7 @@ import com.skua.modules.erp.entity.ApproveRecord;
12 import com.skua.modules.erp.entity.PurchaseMaterial; 12 import com.skua.modules.erp.entity.PurchaseMaterial;
13 import com.skua.modules.erp.service.IDistributMaterialService; 13 import com.skua.modules.erp.service.IDistributMaterialService;
14 import com.skua.modules.erp.service.IPurchaseMaterialService; 14 import com.skua.modules.erp.service.IPurchaseMaterialService;
15 import com.skua.modules.erp.vo.MaterialSearchVO;
15 import com.skua.modules.supplies.entity.EquipmentSparepartSupplies; 16 import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
16 import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; 17 import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService;
17 import com.skua.modules.system.entity.SysUser; 18 import com.skua.modules.system.entity.SysUser;
...@@ -36,16 +37,17 @@ public class ErpCommonController { ...@@ -36,16 +37,17 @@ public class ErpCommonController {
36 @Autowired 37 @Autowired
37 private IDistributMaterialService distributMaterialService; 38 private IDistributMaterialService distributMaterialService;
38 39
39 @AutoLog(value = "ERP-物料列表") 40 @AutoLog(value = "ERP-采购计划--物料列表")
40 @ApiOperation(value = "ERP-物料列表", notes = "ERP-物料列表") 41 @ApiOperation(value = "ERP-采购计划--物料列表", notes = "ERP-采购计划--物料列表")
41 @RequestMapping(value = "/sparepartList", method = RequestMethod.GET) 42 @RequestMapping(value = "/sparepartList", method = RequestMethod.GET)
42 public Result<IPage<EquipmentSparepartSupplies>> sparepartList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, 43 public Result<IPage<EquipmentSparepartSupplies>> sparepartList(MaterialSearchVO materialSearchVO,
44 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
43 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { 45 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
44 Result<IPage<EquipmentSparepartSupplies>> result = new Result<IPage<EquipmentSparepartSupplies>>(); 46 Result<IPage<EquipmentSparepartSupplies>> result = new Result<IPage<EquipmentSparepartSupplies>>();
45 Page<EquipmentSparepartSupplies> page = new Page<EquipmentSparepartSupplies>(pageNo, pageSize); 47 Page<EquipmentSparepartSupplies> page = new Page<EquipmentSparepartSupplies>(pageNo, pageSize);
46 String depId = BaseContextHandler.getRealDepartId();//临时参数 48 String depId = BaseContextHandler.getRealDepartId();//临时参数
47 // String username = req.getParameter("username"); 49 // String username = req.getParameter("username");
48 IPage<EquipmentSparepartSupplies> pageList = sparepartSuppliesService.queryPageByOut(page, depId); 50 IPage<EquipmentSparepartSupplies> pageList = sparepartSuppliesService.queryPageByOut(page, depId , materialSearchVO.getSparepartName() ,materialSearchVO.getSparepartType(),materialSearchVO.getSparepartCode());
49 result.setSuccess(true); 51 result.setSuccess(true);
50 result.setResult(pageList); 52 result.setResult(pageList);
51 return result; 53 return result;
......
...@@ -158,4 +158,19 @@ public class PurchaseContractController { ...@@ -158,4 +158,19 @@ public class PurchaseContractController {
158 } 158 }
159 return result; 159 return result;
160 } 160 }
161 @AutoLog(value = "erp采购合同-同步入库")
162 @ApiOperation(value="erp采购合同-同步入库", notes="erp采购合同-同步入库")
163 @PutMapping(value = "/syncEquipmentIn")
164 public Result<String> syncEquipmentIn(@RequestParam(name="id",required=true) String id ) {
165 Result<String> result = new Result<String>();
166 try {
167 PurchaseContractVO purchaseContractVO = purchaseContractService.queryById( id) ;
168 //调用接口,同步到入库单
169 purchaseContractService.syncEquipmentIn(purchaseContractVO);
170 } catch (Exception e) {
171 log.error("同步入库失败",e.getMessage());
172 result.setSuccess(true);
173 }
174 return result;
175 }
161 } 176 }
......
...@@ -46,6 +46,7 @@ public class ERPPurchaseContract { ...@@ -46,6 +46,7 @@ public class ERPPurchaseContract {
46 /**采购类型:招标采购/询价采购*/ 46 /**采购类型:招标采购/询价采购*/
47 @Excel(name = "采购类型:招标采购/询价采购", width = 15) 47 @Excel(name = "采购类型:招标采购/询价采购", width = 15)
48 @ApiModelProperty(value = "采购类型:招标采购/询价采购") 48 @ApiModelProperty(value = "采购类型:招标采购/询价采购")
49 @Dict(dicCode = "purchase_type")
49 private java.lang.String purchaseType; 50 private java.lang.String purchaseType;
50 /**合同编号*/ 51 /**合同编号*/
51 @Excel(name = "合同编号", width = 15) 52 @Excel(name = "合同编号", width = 15)
...@@ -90,6 +91,9 @@ public class ERPPurchaseContract { ...@@ -90,6 +91,9 @@ public class ERPPurchaseContract {
90 @ApiModelProperty(value = "申请时间") 91 @ApiModelProperty(value = "申请时间")
91 private String applyTime; 92 private String applyTime;
92 93
94 @Excel(name = "备注", width = 15)
95 @ApiModelProperty(value = "备注")
96 private String remark;
93 97
94 /**创建人id*/ 98 /**创建人id*/
95 @Excel(name = "创建人id", width = 15) 99 @Excel(name = "创建人id", width = 15)
...@@ -123,4 +127,7 @@ public class ERPPurchaseContract { ...@@ -123,4 +127,7 @@ public class ERPPurchaseContract {
123 @Excel(name = "删除标识,0:有效,1:删除", width = 15) 127 @Excel(name = "删除标识,0:有效,1:删除", width = 15)
124 @ApiModelProperty(value = "删除标识,0:有效,1:删除") 128 @ApiModelProperty(value = "删除标识,0:有效,1:删除")
125 private java.lang.Integer delFlag; 129 private java.lang.Integer delFlag;
130
131 @ApiModelProperty(value = "删除标识,0:有效,1:删除")
132 private String equipmentInId;
126 } 133 }
......
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
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
5
6 <!-- 统计查询--> 4 <!-- 统计查询-->
7 <select id="statisticsPage" resultType="com.skua.modules.erp.entity.PurchasePlanItem"> 5 <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 ( 6 select ss.id, ss.sparepart_name,ss.sparepart_type, st.item_text as 'sparepart_type_name' ,ss.sparepart_code, 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' 7 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 8 from erp_purchase_plan_item pi ,erp_purchase_plan pp
11 where 9 where
...@@ -30,6 +28,7 @@ ...@@ -30,6 +28,7 @@
30 group by pi.sparepart_id 28 group by pi.sparepart_id
31 )aaa 29 )aaa
32 left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id 30 left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
31 left join equipment_sparepart_type st on st.id = aaa.sparepart_type
33 32
34 </select> 33 </select>
35 34
......
...@@ -55,6 +55,11 @@ public interface IEROPurchaseContractService extends IService<ERPPurchaseContrac ...@@ -55,6 +55,11 @@ public interface IEROPurchaseContractService extends IService<ERPPurchaseContrac
55 */ 55 */
56 public void auditPurchaseContract(PurchaseContractVO purchaseContractVO); 56 public void auditPurchaseContract(PurchaseContractVO purchaseContractVO);
57 57
58 58 /***
59 * 同步入库操作
60 * @param purchaseContractVO
61 * @return
62 */
63 public int syncEquipmentIn(PurchaseContractVO purchaseContractVO)throws Exception;
59 64
60 } 65 }
......
1 package com.skua.modules.erp.service.impl; 1 package com.skua.modules.erp.service.impl;
2 2
3 import com.skua.core.context.BaseContextHandler; 3 import com.skua.core.context.BaseContextHandler;
4 import com.skua.core.util.DateUtils;
5 import com.skua.modules.equipment.dto.EquipmentInDTO;
6 import com.skua.modules.equipment.entity.EquipmentIn;
7 import com.skua.modules.equipment.entity.EquipmentInChild;
8 import com.skua.modules.equipment.service.IEquipmentInService;
9 import com.skua.modules.equipment.vo.EquipmentInExcel;
4 import com.skua.modules.erp.entity.*; 10 import com.skua.modules.erp.entity.*;
5 import com.skua.modules.erp.mapper.ApproveRecordMapper; 11 import com.skua.modules.erp.mapper.ApproveRecordMapper;
6 import com.skua.modules.erp.mapper.ERPPurchaseContractMapper; 12 import com.skua.modules.erp.mapper.ERPPurchaseContractMapper;
7 import com.skua.modules.erp.mapper.PurchaseMaterialMapper; 13 import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
8 import com.skua.modules.erp.service.IEROPurchaseContractService; 14 import com.skua.modules.erp.service.IEROPurchaseContractService;
9 import com.skua.modules.erp.vo.PurchaseContractVO; 15 import com.skua.modules.erp.vo.PurchaseContractVO;
16 import com.skua.modules.guest.util.DateUtil;
10 import org.springframework.beans.BeanUtils; 17 import org.springframework.beans.BeanUtils;
18 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 20 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
13 import org.springframework.transaction.annotation.Transactional; 21 import org.springframework.transaction.annotation.Transactional;
14 22
15 import javax.annotation.Resource; 23 import javax.annotation.Resource;
24 import java.math.BigDecimal;
25 import java.util.ArrayList;
26 import java.util.Date;
16 import java.util.List; 27 import java.util.List;
28 import java.util.UUID;
17 29
18 /** 30 /**
19 * 采购合同 31 * 采购合同
...@@ -27,6 +39,9 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr ...@@ -27,6 +39,9 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
27 @Resource 39 @Resource
28 private ApproveRecordMapper recordMapper; 40 private ApproveRecordMapper recordMapper;
29 41
42 @Autowired
43 private IEquipmentInService equipmentInService;
44
30 /*** 45 /***
31 * 新增purchaseContractVO 46 * 新增purchaseContractVO
32 * @param purchaseContractVO 47 * @param purchaseContractVO
...@@ -131,7 +146,56 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr ...@@ -131,7 +146,56 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
131 recordMapper.insert( record ) ; 146 recordMapper.insert( record ) ;
132 // 审核通过,生成入库单据、物料单 147 // 审核通过,生成入库单据、物料单
133 if(inStock ){ 148 if(inStock ){
149 try {
150 syncEquipmentIn(purchaseContractVO);
151 } catch (Exception e) {
152 e.printStackTrace();
134 153
135 } 154 }
136 } 155 }
156 }
157
158
159 /***
160 * 同步入库
161 * @param purchaseContractVO
162 * @return
163 */
164 public int syncEquipmentIn(PurchaseContractVO purchaseContractVO) throws Exception{
165 EquipmentInDTO equipmentInDTO = new EquipmentInDTO();
166 // EquipmentIn equipmentIn = new EquipmentIn();
167 //入库类型
168 equipmentInDTO.setDepartId( purchaseContractVO.getDepartId() );//所属厂站
169 equipmentInDTO.setSuppliesWarehouseId( purchaseContractVO.getInWarehouseId() ) ;//入库仓库
170 equipmentInDTO.setInDate(DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
171 equipmentInDTO.setUseBy( BaseContextHandler.getUserId() ) ;//经办人
172 equipmentInDTO.setChooseTime( DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss") );//经办时间
173 equipmentInDTO.setRemark( purchaseContractVO.getRemark() );//备注
174
175 List<EquipmentInChild> equipmentInChildrenList = new ArrayList<>();
176 EquipmentInChild equipmentInChild = new EquipmentInChild();//
177 if(purchaseContractVO.getMaterialList() != null ){
178 for( PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
179 equipmentInChild = new EquipmentInChild();//
180 equipmentInChild.setSparepartId( purchaseMaterial.getSparepartId());//物料编号
181 equipmentInChild.setInNum( new BigDecimal(purchaseMaterial.getPurchaseNum())); //物料类别
182 equipmentInChild.setBatchNum(purchaseMaterial.getGoodCode() ) ;//批次号
183
184 equipmentInChildrenList.add( equipmentInChild ) ;
185 }
186 }
187 equipmentInDTO.setEquipmentInChildList( equipmentInChildrenList );
188 //调用接口入库
189 equipmentInService.saveEquipmentIn(equipmentInDTO ) ;
190
191
192 /* ERPPurchaseContract erpPurchaseContract = this.baseMapper.selectById(purchaseContractVO.getId());
193 if(erpPurchaseContract == null ){
194 throw new Exception("采购合同记录不存在");
195 }*/
196 purchaseContractVO.setEquipmentInId( equipmentInDTO.getId() ) ;//记录入库单号
197 this.baseMapper.updateById(purchaseContractVO ) ;
198 return 1;
199 }
200
137 } 201 }
......
1 package com.skua.modules.erp.vo;
2
3 import com.skua.core.aspect.annotation.Dict;
4 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty;
6 import lombok.Data;
7 import lombok.EqualsAndHashCode;
8 import lombok.experimental.Accessors;
9
10 @Data
11 @EqualsAndHashCode(callSuper = false)
12 @Accessors(chain = true)
13 @ApiModel(value="Material物料查询对象", description="Material物料查询对象")
14 public class MaterialSearchVO {
15 @ApiModelProperty(value = "物料编号")
16 private String sparepartCode;
17
18 @ApiModelProperty(value = "物料名称")
19 private String sparepartName;
20
21 @ApiModelProperty(value = "物料类型")
22 private String sparepartType;
23
24 @ApiModelProperty(value = "所属厂站")
25 private String departId;
26 }
...@@ -79,6 +79,20 @@ public class DangerLevelManageController { ...@@ -79,6 +79,20 @@ public class DangerLevelManageController {
79 return result; 79 return result;
80 } 80 }
81 81
82
83 @AutoLog(value = "风险分级管控清单-列表查询")
84 @ApiOperation(value="风险分级管控清单-列表查询", notes="风险分级管控清单-分页列表查询")
85 @GetMapping(value = "/dangerList")
86 public Result<List<DangerLevelManage>> queryByDangerList( @RequestParam(name="departId")String departId ) {
87 Result<List<DangerLevelManage>> result = new Result<List<DangerLevelManage>>();
88 QueryWrapper<DangerLevelManage> queryWrapper = new QueryWrapper();//QueryGenerator.initQueryWrapper(dangerLevelManage, req.getParameterMap());
89 queryWrapper.eq("depart_id" ,departId);
90 List<DangerLevelManage> pageList = dangerLevelManageService.list(queryWrapper);
91 result.setSuccess(true);
92 result.setResult(pageList);
93 return result;
94 }
95
82 /** 96 /**
83 * 添加 97 * 添加
84 * @param dangerLevelManage 98 * @param dangerLevelManage
......
...@@ -58,8 +58,9 @@ public class APPDangerInspectionRecordController { ...@@ -58,8 +58,9 @@ public class APPDangerInspectionRecordController {
58 Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>(); 58 Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>();
59 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<DangerInspectionRecord>();// QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap()); 59 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<DangerInspectionRecord>();// QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap());
60 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize); 60 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize);
61 if(dangerInspectionRecord.getDangerId() != null ){
61 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId()); 62 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
62 63 }
63 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){ 64 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
64 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ; 65 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
65 } 66 }
......
...@@ -242,8 +242,6 @@ public class EquipmentInController { ...@@ -242,8 +242,6 @@ public class EquipmentInController {
242 @ApiOperation(value = "入库-添加", notes = "入库-添加") 242 @ApiOperation(value = "入库-添加", notes = "入库-添加")
243 @PostMapping(value = "/add") 243 @PostMapping(value = "/add")
244 public Result<Object> add(@RequestBody EquipmentInDTO equipmentInDTO) throws Exception { 244 public Result<Object> add(@RequestBody EquipmentInDTO equipmentInDTO) throws Exception {
245
246
247 List<SuppliesWarehouse> suppliesWarehouseList = suppliesWarehouseService.list(); 245 List<SuppliesWarehouse> suppliesWarehouseList = suppliesWarehouseService.list();
248 Map<String, String> warehouseDictMap = suppliesWarehouseList.stream().collect(Collectors.toMap(SuppliesWarehouse::getId, SuppliesWarehouse::getDepartId)); 246 Map<String, String> warehouseDictMap = suppliesWarehouseList.stream().collect(Collectors.toMap(SuppliesWarehouse::getId, SuppliesWarehouse::getDepartId));
249 Result<Object> result = new Result<>(); 247 Result<Object> result = new Result<>();
......
...@@ -147,4 +147,20 @@ public class EquipmentIn { ...@@ -147,4 +147,20 @@ public class EquipmentIn {
147 @ApiModelProperty(value = "采购部门") 147 @ApiModelProperty(value = "采购部门")
148 @Dict(dicCode="departCode") 148 @Dict(dicCode="departCode")
149 private String purchaseDepart; 149 private String purchaseDepart;
150
151 public EquipmentIn( ) {
152 }
153
154 public EquipmentIn(String departId, String inOrder, String purchaseCode, String purchaseId, String inType, String inDate, String suppliesWarehouseId, Integer isConfirm, String chooseTime, String purchaseDepart) {
155 this.departId = departId;
156 this.inOrder = inOrder;
157 this.purchaseCode = purchaseCode;
158 this.purchaseId = purchaseId;
159 this.inType = inType;
160 this.inDate = inDate;
161 this.suppliesWarehouseId = suppliesWarehouseId;
162 this.isConfirm = isConfirm;
163 this.chooseTime = chooseTime;
164 this.purchaseDepart = purchaseDepart;
165 }
150 } 166 }
......
...@@ -2,6 +2,7 @@ package com.skua.modules.equipment.service; ...@@ -2,6 +2,7 @@ package com.skua.modules.equipment.service;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 import com.baomidou.mybatisplus.core.toolkit.Constants; 4 import com.baomidou.mybatisplus.core.toolkit.Constants;
5 import com.skua.modules.equipment.dto.EquipmentInDTO;
5 import com.skua.modules.equipment.entity.EquipmentIn; 6 import com.skua.modules.equipment.entity.EquipmentIn;
6 import com.baomidou.mybatisplus.extension.service.IService; 7 import com.baomidou.mybatisplus.extension.service.IService;
7 import com.skua.modules.equipment.vo.EquipmentInExcel; 8 import com.skua.modules.equipment.vo.EquipmentInExcel;
...@@ -17,4 +18,9 @@ public interface IEquipmentInService extends IService<EquipmentIn> { ...@@ -17,4 +18,9 @@ public interface IEquipmentInService extends IService<EquipmentIn> {
17 18
18 List<EquipmentInExcel> queryExport(@Param(Constants.WRAPPER) QueryWrapper<EquipmentIn> queryWrapper); 19 List<EquipmentInExcel> queryExport(@Param(Constants.WRAPPER) QueryWrapper<EquipmentIn> queryWrapper);
19 20
21 /***
22 * 入库新增
23 * @param equipmentInDTO
24 */
25 public int saveEquipmentIn(EquipmentInDTO equipmentInDTO) throws Exception;
20 } 26 }
......
...@@ -257,4 +257,15 @@ public class EquipmentSparepartSupplies { ...@@ -257,4 +257,15 @@ public class EquipmentSparepartSupplies {
257 @TableField(exist=false) 257 @TableField(exist=false)
258 @ApiModelProperty(value = "计划采购数量") 258 @ApiModelProperty(value = "计划采购数量")
259 private String purchaseNum; 259 private String purchaseNum;
260
261
262 @TableField(exist=false)
263 @ApiModelProperty(value = "计划采购数量")
264 private String sparepartId;
265
266 public String getSparepartId() {
267 return id;
268 }
269
270
260 } 271 }
......
...@@ -18,5 +18,7 @@ public interface EquipmentSparepartSuppliesMapper extends BaseMapper<EquipmentSp ...@@ -18,5 +18,7 @@ public interface EquipmentSparepartSuppliesMapper extends BaseMapper<EquipmentSp
18 * @param depId 18 * @param depId
19 * @return 19 * @return
20 */ 20 */
21 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String depId); 21 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page,
22 @Param("depId") String depId ,@Param("sparepartName")String sparepartName,
23 @Param("sparepartType")String sparepartType ,@Param("sparepartCode")String sparepartCode);
22 } 24 }
......
...@@ -6,12 +6,22 @@ ...@@ -6,12 +6,22 @@
6 <select id="queryPageByOut" resultType="com.skua.modules.supplies.entity.EquipmentSparepartSupplies"> 6 <select id="queryPageByOut" resultType="com.skua.modules.supplies.entity.EquipmentSparepartSupplies">
7 select st.item_text 'sparepart_type_name' , aaa.out_num, ss.* from equipment_sparepart_supplies ss 7 select st.item_text 'sparepart_type_name' , aaa.out_num, ss.* from equipment_sparepart_supplies ss
8 left join equipment_sparepart_type st on ss.sparepart_type = st.id 8 left join equipment_sparepart_type st on ss.sparepart_type = st.id
9
10 left join ( 9 left join (
11 select sum(out_num) out_num ,sparepart_id from equipment_out_child 10 select sum(out_num) out_num ,sparepart_id from equipment_out_child
12 where 11 where
13 YEAR(create_time) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR) 12 YEAR(create_time) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR)
14 group by sparepart_id 13 group by sparepart_id
15 ) aaa on aaa.sparepart_id = ss.id 14 ) aaa on aaa.sparepart_id = ss.id
15 <where>
16 <if test="sparepartName != null and sparepartName !=''">
17 and ss.sparepart_name like CONCAT('%', #{sparepartName},'%')
18 </if>
19 <if test="sparepartCode != null and sparepartCode !=''">
20 and ss.sparepart_code like CONCAT('%', #{sparepartCode},'%')
21 </if>
22 <if test="sparepartType != null and sparepartType !=''">
23 and ss.sparepart_type = #{sparepartType}
24 </if>
25 </where>
16 </select> 26 </select>
17 </mapper> 27 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -15,5 +15,5 @@ public interface IEquipmentSparepartSuppliesService extends IService<EquipmentSp ...@@ -15,5 +15,5 @@ public interface IEquipmentSparepartSuppliesService extends IService<EquipmentSp
15 * @param depId 15 * @param depId
16 * @return 16 * @return
17 */ 17 */
18 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String depId); 18 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String depId ,String sparepartName,String sparepartType ,String sparepartCode);
19 } 19 }
......
...@@ -20,7 +20,7 @@ public class EquipmentSparepartSuppliesServiceImpl extends ServiceImpl<Equipment ...@@ -20,7 +20,7 @@ public class EquipmentSparepartSuppliesServiceImpl extends ServiceImpl<Equipment
20 * @param depId 20 * @param depId
21 * @return 21 * @return
22 */ 22 */
23 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String depId){ 23 public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String depId ,String sparepartName,String sparepartType ,String sparepartCode){
24 return baseMapper.queryPageByOut(page,depId); 24 return baseMapper.queryPageByOut(page,depId ,sparepartName,sparepartType,sparepartCode);
25 } 25 }
26 } 26 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!