kangwei: 扩展:统购合同选中水务公司,分销合同使用水厂,根据货号查询水厂以及水厂所属水务公司的物料信息
正在显示
5 个修改的文件
包含
21 行增加
和
9 行删除
... | @@ -26,6 +26,9 @@ import com.skua.modules.erp.service.IPurchaseMaterialService; | ... | @@ -26,6 +26,9 @@ import com.skua.modules.erp.service.IPurchaseMaterialService; |
26 | import com.skua.modules.erp.vo.DistributContractVO; | 26 | import com.skua.modules.erp.vo.DistributContractVO; |
27 | import com.skua.modules.erp.vo.MaterialSearchVO; | 27 | import com.skua.modules.erp.vo.MaterialSearchVO; |
28 | import com.skua.modules.guest.util.DateUtil; | 28 | import com.skua.modules.guest.util.DateUtil; |
29 | import com.skua.modules.system.entity.SysDepart; | ||
30 | import com.skua.modules.system.service.ISysDepartService; | ||
31 | import com.skua.tool.util.JSUtils; | ||
29 | import lombok.extern.slf4j.Slf4j; | 32 | import lombok.extern.slf4j.Slf4j; |
30 | import org.apache.commons.lang3.StringUtils; | 33 | import org.apache.commons.lang3.StringUtils; |
31 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 34 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
... | @@ -54,6 +57,9 @@ public class DistributContractController { | ... | @@ -54,6 +57,9 @@ public class DistributContractController { |
54 | @Autowired | 57 | @Autowired |
55 | private IDistributContractTempService distributContractTempService; | 58 | private IDistributContractTempService distributContractTempService; |
56 | 59 | ||
60 | @Autowired | ||
61 | private ISysDepartService departService; | ||
62 | |||
57 | @AutoLog(value = "erp分销合同-分页列表查询") | 63 | @AutoLog(value = "erp分销合同-分页列表查询") |
58 | @ApiOperation(value="erp分销合同-分页列表查询", notes="erp分销合同-分页列表查询") | 64 | @ApiOperation(value="erp分销合同-分页列表查询", notes="erp分销合同-分页列表查询") |
59 | @GetMapping(value = "/list") | 65 | @GetMapping(value = "/list") |
... | @@ -256,7 +262,13 @@ public class DistributContractController { | ... | @@ -256,7 +262,13 @@ public class DistributContractController { |
256 | @GetMapping(value = "/queryMaterialByGoodCode") | 262 | @GetMapping(value = "/queryMaterialByGoodCode") |
257 | public Result<PurchaseMaterial> queryMaterialByGoodCode(MaterialSearchVO materialSearchVO) { | 263 | public Result<PurchaseMaterial> queryMaterialByGoodCode(MaterialSearchVO materialSearchVO) { |
258 | Result<PurchaseMaterial> result = new Result<PurchaseMaterial>(); | 264 | Result<PurchaseMaterial> result = new Result<PurchaseMaterial>(); |
259 | List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.queryMaterialByGoodCode(materialSearchVO.getGoodCode(),materialSearchVO.getDepartId()); | 265 | SysDepart sysDepart = departService.getById(materialSearchVO.getDepartId()); |
266 | |||
267 | String departIds = materialSearchVO.getDepartId(); | ||
268 | if(sysDepart != null ){ | ||
269 | departIds +=","+sysDepart.getParentId(); | ||
270 | } | ||
271 | List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.queryMaterialByGoodCode(materialSearchVO.getGoodCode(), JSUtils.quoteEach(departIds,",")); | ||
260 | 272 | ||
261 | if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){ | 273 | if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){ |
262 | result.setSuccess(true); | 274 | result.setSuccess(true); | ... | ... |
... | @@ -45,10 +45,10 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> { | ... | @@ -45,10 +45,10 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> { |
45 | /*** | 45 | /*** |
46 | * 根据货号查询采购合同物料清单 | 46 | * 根据货号查询采购合同物料清单 |
47 | * @param goodCode | 47 | * @param goodCode |
48 | * @param departId | 48 | * @param departIds |
49 | * @return | 49 | * @return |
50 | */ | 50 | */ |
51 | List<PurchaseMaterial> queryMaterialByGoodCode( @Param("goodCode")String goodCode, @Param("departId")String departId); | 51 | List<PurchaseMaterial> queryMaterialByGoodCode( @Param("goodCode")String goodCode, @Param("departIds")String departId); |
52 | 52 | ||
53 | 53 | ||
54 | /*** | 54 | /*** | ... | ... |
... | @@ -40,7 +40,7 @@ | ... | @@ -40,7 +40,7 @@ |
40 | from ( | 40 | from ( |
41 | select m.* from erp_purchase_material m , erp_purchase_contract c | 41 | select m.* from erp_purchase_material m , erp_purchase_contract c |
42 | where m.contract_id = c.id and c.status = 3 and c.use_flag = '0' and c.start_time <= now() and c.end_time >= now() | 42 | where m.contract_id = c.id and c.status = 3 and c.use_flag = '0' and c.start_time <= now() and c.end_time >= now() |
43 | and m.good_code = #{goodCode} and m.depart_id = #{departId} | 43 | and m.good_code = #{goodCode} and m.depart_id in(${departIds}) |
44 | ) pm | 44 | ) pm |
45 | left join equipment_sparepart_type st on st.id = pm.sparepart_type | 45 | left join equipment_sparepart_type st on st.id = pm.sparepart_type |
46 | left join ajh_supplier_manage sm on sm.id = pm.supplier_id | 46 | left join ajh_supplier_manage sm on sm.id = pm.supplier_id | ... | ... |
... | @@ -28,10 +28,10 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> { | ... | @@ -28,10 +28,10 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> { |
28 | /*** | 28 | /*** |
29 | * 根据货号查询采购合同物料清单 | 29 | * 根据货号查询采购合同物料清单 |
30 | * @param goodCode | 30 | * @param goodCode |
31 | * @param departId | 31 | * @param departIds |
32 | * @return | 32 | * @return |
33 | */ | 33 | */ |
34 | List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId); | 34 | List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departIds); |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * 药剂入库查询结果:采购物料清单+分销单价+分销总价 | 37 | * 药剂入库查询结果:采购物料清单+分销单价+分销总价 | ... | ... |
... | @@ -32,11 +32,11 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap | ... | @@ -32,11 +32,11 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap |
32 | /*** | 32 | /*** |
33 | * 根据货号查询采购合同物料清单 | 33 | * 根据货号查询采购合同物料清单 |
34 | * @param goodCode | 34 | * @param goodCode |
35 | * @param departId | 35 | * @param departIds |
36 | * @return | 36 | * @return |
37 | */ | 37 | */ |
38 | public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId){ | 38 | public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departIds){ |
39 | return this.baseMapper.queryMaterialByGoodCode(goodCode,departId); | 39 | return this.baseMapper.queryMaterialByGoodCode(goodCode,departIds); |
40 | } | 40 | } |
41 | /** | 41 | /** |
42 | * 药剂入库查询结果:采购物料清单+分销单价+分销总价 | 42 | * 药剂入库查询结果:采购物料清单+分销单价+分销总价 | ... | ... |
-
请 注册 或 登录 后发表评论