change - 采购入库同步含税单价

master
yinq 5 days ago
parent e7b0a628cb
commit bf15098e8b

@ -150,8 +150,18 @@ public class MesPurchaseOrder extends BaseEntity {
*
*/
private String specificationParameter;
//单价
private BigDecimal price;
//含税单价
private BigDecimal fTaxPrice;
public BigDecimal getfTaxPrice() {
return fTaxPrice;
}
public void setfTaxPrice(BigDecimal fTaxPrice) {
this.fTaxPrice = fTaxPrice;
}
public String getSpecificationParameter() {
return specificationParameter;

@ -231,6 +231,7 @@ public class KingdeeErpService {
String FSBillId = (String) objectParams.get("FSBillId");//源单单据内码(上游单据:单据内码)
String FSId = (String) objectParams.get("FSId");//源单单据行内码(上游单据:单据行内码)
String FPOOrderNo = (String) objectParams.get("FPOOrderNo");//采购订单号
Double fTaxPrice = (Double) objectParams.get("fTaxPrice");//含税单价
supplierCode = StringUtils.isEmpty(supplierCode)?"VEN04520":supplierCode;
@ -250,6 +251,8 @@ public class KingdeeErpService {
FEntity.put("FMaterialId", FMaterialIdObject); //物料编码(必填项)
FEntity.put("FPriceUnitID", FPriceUnitIDObject); //计价单位(必填项)
FEntity.put("FRealQty", FRealQty); //实收数量
FEntity.put("FTaxPrice", fTaxPrice); //含税单价
FEntity.put("FEntryTaxRate", 13.000000); //税率
JSONObject FStockIdObject = new JSONObject();
FStockIdObject.put("FNumber", FStockId);
FEntity.put("FStockId", FStockIdObject); //仓库
@ -282,7 +285,6 @@ public class KingdeeErpService {
ArrayList<JSONObject> entityList = new ArrayList<>();
JSONObject data = new JSONObject();
entityList.add(FEntity);
model.put("FInStockEntry", entityList);
model.put("FID", KingdeeConfig.FID);
// model.put("FBusinessType", ""); //业务类型(必填项)
// model.put("FOwnerTypeIdHead", ""); //货主类型(必填项)
@ -297,6 +299,7 @@ public class KingdeeErpService {
JSONObject FSupplierId = new JSONObject();
FSupplierId.put("FNumber", supplierCode);
model.put("FSupplierId", FSupplierId); //供应商(必填项)
model.put("FInStockEntry", entityList);
data.put("Model", model);
String saveParams = data.toJSONString();
String resultJson = client.save(formId, saveParams);

@ -1074,7 +1074,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
JSONObject queryJson = new JSONObject();
String formId = "PUR_PurchaseOrder";
String fieldKeys = "FID,FBillNo,FApproveDate,FDocumentStatus,FPOOrderEntry_FEntryID,FRequireDeptId,FMaterialId,FMaterialId.FNumber,FMaterialId.FName," +
"FQty,FDeliveryDate,FCreateDate,FModifyDate,FUnitId,FStockUnitID,FPriceUnitID,FPrice,FAuxPropId,FAUXPROPID.FF100001,FSrcBillNo,FPurchaseOrgId,FPurchaseDeptId,F_TOND_Base,FSupplierId";
"FQty,FDeliveryDate,FCreateDate,FModifyDate,FUnitId,FStockUnitID,FPriceUnitID,FPrice,FAuxPropId,FAUXPROPID.FF100001,FSrcBillNo,FPurchaseOrgId,FPurchaseDeptId,F_TOND_Base,FSupplierId,FTaxPrice";
// String filterString = "";
String orderString = "";
int topRowCount = 0;
@ -1163,6 +1163,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
Long priceUnitId = resultObject.getLong("FPriceUnitID");
//单价
BigDecimal price = resultObject.getBigDecimal("FPrice");
//含税单价
BigDecimal fTaxPrice = resultObject.getBigDecimal("FTaxPrice");
//辅助属性
Long auxPropId = resultObject.getLong("FAuxPropId");
//规格参数
@ -1193,6 +1195,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesPurchaseOrder.setStockUnitId(stockUnitId);
mesPurchaseOrder.setPriceUnitId(priceUnitId);
mesPurchaseOrder.setPrice(price);
mesPurchaseOrder.setfTaxPrice(fTaxPrice);
mesPurchaseOrder.setAuxPropId(auxPropId);
mesPurchaseOrder.setSpecificationParameter(FF100001);
mesPurchaseOrder.setSrcBillNo(srcBillNo);

@ -37,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="purchaseOrgId" column="purchase_org_id" />
<result property="supplierId" column="supplier_id" />
<result property="specificationParameter" column="specification_parameter" />
<result property="fTaxPrice" column="f_tax_price" />
</resultMap>
<sql id="selectMesPurchaseOrderVo">
@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
material_id, material_code, material_name, order_amount, complete_amount,
approve_date, erp_modify_date, plan_delivery_date, begin_date, end_date, order_status,
complete_date, is_flag, remark, create_by, create_time, update_by, update_time ,unit_id,
stock_unit_id,price_unit_id,aux_prop_id,specification_parameter, src_bill_no,tond_base,purchase_org_id,supplier_id
stock_unit_id,price_unit_id,aux_prop_id,specification_parameter, src_bill_no,tond_base,purchase_org_id,supplier_id,f_tax_price
from mes_purchase_order
</sql>
@ -189,6 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tondBase != null">tond_base=#{tondBase},</if>
<if test="purchaseOrgId != null">purchase_org_id=#{purchaseOrgId},</if>
<if test="supplierId != null">supplier_id=#{supplierId},</if>
<if test="fTaxPrice != null">f_tax_price=#{fTaxPrice},</if>
</trim>
where purchase_order_id = #{purchaseOrderId}
</update>
@ -215,9 +217,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchMesBasePurchaseOrder">
INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, price,aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES
INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, price,aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time, update_time, f_tax_price) VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.price}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime})
(#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.price}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime},#{item.fTaxPrice})
</foreach>
</insert>
</mapper>

@ -67,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="projectNo" column="project_no" />
<result property="projectName" column="project_name"/>
<result property="actLandAmount" column="act_land_amount"/>
<result property="fTaxPrice" column="f_tax_price" />
</resultMap>
@ -102,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectMesPurchaseOrderVo">
select purchase_order_id, erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, begin_date, end_date, order_status, complete_date, is_flag, unit_id, stock_unit_id, price_unit_id, aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, remark, create_by, create_time, update_by, update_time from mes_purchase_order
select purchase_order_id, erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, begin_date, end_date, order_status, complete_date, is_flag, unit_id, stock_unit_id, price_unit_id, aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, remark, create_by, create_time, update_by, update_time,f_tax_price from mes_purchase_order
</sql>
<select id="selectMesPurchaseOrderList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">
@ -417,7 +418,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.order_amount, mpo.complete_amount, mpo.approve_date,
mpo.erp_modify_date, mpo.plan_delivery_date, mpo.begin_date, mpo.end_date, mpo.order_status,
mpo.complete_date, mpo.specification_parameter, mpo.src_bill_no, mpo.purchase_org_id, mpo.tond_base,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag,mpi.project_name,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag,mpi.project_name,mpo.f_tax_price,
IF((select count(*) from mes_order_bind mob where mob.purchase_order_id = mpo.purchase_order_id and mob.sale_order_id > 0) > 0, '1', '0') bindFlag
from mes_purchase_order mpo left join mes_base_material_info mbmi on mpo.material_id =mbmi.erp_id
left join mes_project_info mpi on mpo.tond_base=mpi.erp_id

@ -166,6 +166,19 @@ public class WmsRawInstock extends BaseEntity
*/
private BigDecimal actLandAmount;
/**
*
*/
private BigDecimal fTaxPrice;
public BigDecimal getfTaxPrice() {
return fTaxPrice;
}
public void setfTaxPrice(BigDecimal fTaxPrice) {
this.fTaxPrice = fTaxPrice;
}
public BigDecimal getActLandAmount() {
return actLandAmount;
}

@ -140,6 +140,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
data.put("FSBillId", instock.getFsBillId());
data.put("FSId", instock.getFsId());
data.put("FPOOrderNo", instock.getPoNo());//采购订单的FBillNo
data.put("fTaxPrice", instock.getfTaxPrice());
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER);

@ -399,7 +399,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setUpdateBy(userName);
wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock);
insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, baseBarcodeInfo.getBatchCode(), userName, currentDate);
insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, baseBarcodeInfo.getBatchCode(), userName, currentDate, wmsRawOutstock.getOutstockAmount());
updateRawStock(materialBarcode, outstockAmount, userName, currentDate);
@ -431,7 +431,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public void insertRawOutstockDetail(WmsRawOutstock wmsRawOutstock, String locationCode, String materialBarcode, String batchCode,
String userName, Date currentDate) {
String userName, Date currentDate, BigDecimal outstockAmount) {
WmsRawOutstockDetail wmsRawOutstockDetail = new WmsRawOutstockDetail();
wmsRawOutstockDetail.setRawOutstockId(wmsRawOutstock.getRawOutstockId());
wmsRawOutstockDetail.setTaskCode(wmsRawOutstock.getTaskCode());
@ -440,8 +440,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstockDetail.setMaterialId(wmsRawOutstock.getMaterialId());
wmsRawOutstockDetail.setMaterialBarcode(materialBarcode);
wmsRawOutstockDetail.setInstockBatch(batchCode);
wmsRawOutstockDetail.setPlanAmount(BigDecimal.ONE);
wmsRawOutstockDetail.setOutstockAmount(BigDecimal.ONE);
wmsRawOutstockDetail.setPlanAmount(outstockAmount);
wmsRawOutstockDetail.setOutstockAmount(outstockAmount);
wmsRawOutstockDetail.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawOutstockDetail.setOutstockPerson(userName);
wmsRawOutstockDetail.setOutstockTime(currentDate);
@ -1256,7 +1256,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstockMapper.insertWmsRawOutstock(wmsRawOutstock);
this.insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, batchCode,
userName, currentDate);
userName, currentDate, outstockAmount);
return directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate);

@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="billNo" column="bill_no" />
<result property="receiveBillId" column="receive_bill_id" />
<result property="actLandAmount" column="act_land_amount" />
<result property="fTaxPrice" column="f_tax_price" />
</resultMap>
<sql id="selectWmsRawInstockVo">
@ -235,7 +236,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wri.material_barcode,
mprb.bill_no,
mprb.erp_id fs_bill_id,
mprb.fentry_id fs_id
mprb.fentry_id fs_id,
mpo.f_tax_price
from wms_raw_instock wri
left join wms_base_warehouse wbw on wbw.warehouse_id = wri.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wri.material_id

Loading…
Cancel
Save