57ef9988 康伟

kangwei:药剂结算对接,

         供应商详细页面
1 个父辈 0614bc3c
package com.skua.modules.alarmtmp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -11,8 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
......
......@@ -7,21 +7,22 @@
</delete>
<!-- 结算单详情:供应商-->
<select id="queryListBySupplier" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO">
select d.depart_name, pc.project_name, pc.contract_name, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
select d.depart_name, sm.supp_name supplierName,pc.project_name, pc.contract_name,pc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
from erp_settlement_item si
left join sys_depart d on d.id = si.depart_id
left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code )
left join erp_material_acceptance_form mf on mf.id = si.id
left join erp_material_acceptance_form mf on mf.id = si.material_in_id
left join erp_purchase_contract pc on si.purchase_contract_id = pc.id
left join ajh_supplier_manage sm on sm.id = pm.supplier_id
where si.settlement_id = #{settlementId}
</select>
<!-- 结算单详情:水厂-->
<select id="queryListByWaterDepart" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO">
select d.depart_name, dc.contract_name ,dc.project_name, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
select d.depart_name, dc.contract_name ,dc.project_name,dc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
from erp_settlement_item si
left join sys_depart d on d.id = si.depart_id
left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code )
left join erp_material_acceptance_form mf on mf.id = si.id
left join erp_material_acceptance_form mf on mf.id = si.material_in_id
left join erp_distribut_contract dc on si.distribut_contract_id = dc.id
where si.settlement_id = #{settlementId}
</select>
......
......@@ -41,6 +41,10 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
private ErpSettlementItemMapper settlementItemMapper;
@Autowired
private ICommonSqlService commonSqlService;
@Autowired
private SupplierManageMapper supplierManageMapper;
@Autowired
private SysDepartMapper departMapper ;
/**
* 新增结算单
* @param erpSettlementVO
......@@ -77,16 +81,23 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
//根据编号查询结算单
public ErpSettlementVO queryById(String id){
ErpSettlementVO erpSettlementVO = new ErpSettlementVO();
ErpSettlement erpSettlement = this.baseMapper.selectById(id);
List<ErpSettlementItemVO> settlementItemList = null;
if("0".equals( erpSettlement.getSettlementType())){ //供应商
if(StringUtils.isNotEmpty( erpSettlement.getSupplierId())){
erpSettlementVO.setSupplierName(supplierManageMapper.selectById( erpSettlement.getSupplierId()).getSuppName() );
}
settlementItemList = settlementItemMapper.queryListBySupplier(id);
}
if("1".equals( erpSettlement.getSettlementType())){ //水厂
if(StringUtils.isNotEmpty( erpSettlement.getDepartId())){
erpSettlementVO.setDepartName( departMapper.selectById(erpSettlement.getDepartId()).getDepartName());
}
settlementItemList = settlementItemMapper.queryListByWaterDepart(id);
}
ErpSettlementVO erpSettlementVO = new ErpSettlementVO();
if(erpSettlement != null ){
//BeanUtils.copyProperties(有值的对象, 要被赋值的对象);
......@@ -96,6 +107,7 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
String jtDepartName = commonSqlService.queryForString("select depart_name from sys_depart order by parent_id asc limit 1");
Map<String, SparepartSettlementVO> sparepartSettlementMap = new HashedMap();
SparepartSettlementVO sparepartSettlementVO = null;
List<SparepartSettlementVO> sparepartSettlementVOList = new ArrayList<>();
if(settlementItemList != null ){
for( ErpSettlementItemVO settlementItemVO : settlementItemList){
sparepartSettlementVO = sparepartSettlementMap.get(settlementItemVO.getSparepartId());
......@@ -103,10 +115,13 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
//String projectName,String departName, String contractCode, String sparepartName, String specification, String goodOrigin, String goodBrand
sparepartSettlementVO = new SparepartSettlementVO(settlementItemVO.getProjectName(),settlementItemVO.getDepartName(),settlementItemVO.getContractCode(),
settlementItemVO.getSparepartName(),settlementItemVO.getSpecification(),settlementItemVO.getGoodCode() ,settlementItemVO.getGoodBrand() );
sparepartSettlementVO.setJtDepartName(jtDepartName);
sparepartSettlementVO.setSupplierName( settlementItemVO.getSupplierName() ) ;
sparepartSettlementVO.setContractName(settlementItemVO.getContractName() );
sparepartSettlementMap.put( settlementItemVO.getSparepartId() ,sparepartSettlementVO );
}
sparepartSettlementVO.setJtDepartName(jtDepartName);
sparepartSettlementVO.addErpSettlementItem( settlementItemVO );
sparepartSettlementVOList.add(sparepartSettlementVO );
}
}
//送货单以及物资验收单
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!