da332013 康伟

kangwei: 扩展:统购合同选中水务公司,分销合同使用水厂,根据货号查询水厂以及水厂所属水务公司的物料信息

1 个父辈 3a09e4eb
......@@ -26,6 +26,9 @@ import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.DistributContractVO;
import com.skua.modules.erp.vo.MaterialSearchVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.service.ISysDepartService;
import com.skua.tool.util.JSUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -54,6 +57,9 @@ public class DistributContractController {
@Autowired
private IDistributContractTempService distributContractTempService;
@Autowired
private ISysDepartService departService;
@AutoLog(value = "erp分销合同-分页列表查询")
@ApiOperation(value="erp分销合同-分页列表查询", notes="erp分销合同-分页列表查询")
@GetMapping(value = "/list")
......@@ -256,7 +262,13 @@ public class DistributContractController {
@GetMapping(value = "/queryMaterialByGoodCode")
public Result<PurchaseMaterial> queryMaterialByGoodCode(MaterialSearchVO materialSearchVO) {
Result<PurchaseMaterial> result = new Result<PurchaseMaterial>();
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.queryMaterialByGoodCode(materialSearchVO.getGoodCode(),materialSearchVO.getDepartId());
SysDepart sysDepart = departService.getById(materialSearchVO.getDepartId());
String departIds = materialSearchVO.getDepartId();
if(sysDepart != null ){
departIds +=","+sysDepart.getParentId();
}
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.queryMaterialByGoodCode(materialSearchVO.getGoodCode(), JSUtils.quoteEach(departIds,","));
if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){
result.setSuccess(true);
......
......@@ -45,10 +45,10 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @param departIds
* @return
*/
List<PurchaseMaterial> queryMaterialByGoodCode( @Param("goodCode")String goodCode, @Param("departId")String departId);
List<PurchaseMaterial> queryMaterialByGoodCode( @Param("goodCode")String goodCode, @Param("departIds")String departId);
/***
......
......@@ -40,7 +40,7 @@
from (
select m.* from erp_purchase_material m , erp_purchase_contract c
where m.contract_id = c.id and c.status = 3 and c.use_flag = '0' and c.start_time &lt;= now() and c.end_time &gt;= now()
and m.good_code = #{goodCode} and m.depart_id = #{departId}
and m.good_code = #{goodCode} and m.depart_id in(${departIds})
) pm
left join equipment_sparepart_type st on st.id = pm.sparepart_type
left join ajh_supplier_manage sm on sm.id = pm.supplier_id
......
......@@ -28,10 +28,10 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> {
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @param departIds
* @return
*/
List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId);
List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departIds);
/**
* 药剂入库查询结果:采购物料清单+分销单价+分销总价
......
......@@ -32,11 +32,11 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departId
* @param departIds
* @return
*/
public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId){
return this.baseMapper.queryMaterialByGoodCode(goodCode,departId);
public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departIds){
return this.baseMapper.queryMaterialByGoodCode(goodCode,departIds);
}
/**
* 药剂入库查询结果:采购物料清单+分销单价+分销总价
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!