rev:采购订单同步

This commit is contained in:
zhangzhiqiang
2023-04-03 08:37:05 +08:00
parent 9523165dc5
commit 239ff311cf

View File

@@ -261,7 +261,6 @@ public class WmsToErpServiceImpl implements WmsToErpService {
item_import_date.setValue(DateUtil.now());
SpringContextHolder.getBean(ParamServiceImpl.class).update(item_import_date);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void getPurchaseInfo(Map map) {
@@ -288,11 +287,15 @@ public class WmsToErpServiceImpl implements WmsToErpService {
JSONObject jo2 = ja.getJSONObject(i);
String VBILLCODE = jo2.getString("vbillcode");
if (list.contains(VBILLCODE)){
log.warn("采购相同:{}",JSON.toJSONString(jo2));
String ITEM_ID = jo2.getString("item_id");
String CROWNO = jo2.getString("crowno");
String QTY = jo2.getString("qty");
String orderMd5 = VBILLCODE + ITEM_ID + CROWNO+QTY;
if (list.contains(orderMd5)){
log.warn("采购相同:{},md5:{}",JSON.toJSONString(jo2),orderMd5);
continue;
}
list.add(VBILLCODE);
list.add(orderMd5);
//判断该采购订单是否存在,存在的话判断状态是否为生成,生成删除再添加,其他状态不操作
String PURCHASE_ID_B = jo2.getString("purchase_id_b");
JSONObject purchase_jo = purchase_proc_wql.query("PURCHASE_ID_B = '" + PURCHASE_ID_B + "'").uniqueResult(0);
@@ -317,7 +320,6 @@ public class WmsToErpServiceImpl implements WmsToErpService {
String VEND_ID = jo2.getString("vend_id");
String CEMPLOYEEID = jo2.getString("cemployeeid");
String CROWNO = jo2.getString("crowno");
String CREATE_BY = jo2.getString("create_by");
String CREATE_DATE = jo2.getString("create_date");
if (StrUtil.isNotEmpty(CREATE_DATE)) {
@@ -328,9 +330,8 @@ public class WmsToErpServiceImpl implements WmsToErpService {
if (StrUtil.isNotEmpty(UPDATED_DATE)) {
UPDATED_DATE = DateUtil.parse(UPDATED_DATE, "yyyy-MM-dd HH:mm:ss").toString();
}
String ITEM_ID = jo2.getString("item_id");
String M_UNIT_ID = jo2.getString("m_unit_id");
String QTY = jo2.getString("qty");
String F_UNIT_ID = jo2.getString("f_unit_id");
String F_QTY = jo2.getString("f_qty");
String PRICE = jo2.getString("price");