Browse Source

【怡海能达商城对接】【物料编号获取规则调整】

chenw 6 years ago
parent
commit
aa372344bc
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/main/java/com/uas/erp/schedular/mall/task/OrderTask.java

+ 6 - 1
src/main/java/com/uas/erp/schedular/mall/task/OrderTask.java

@@ -432,7 +432,12 @@ public class OrderTask extends AbstractTask {
                         + "values(productVendor_seq.nextval, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?)";
                 jdbcTemplate.execute(insertProductVendorSql, productMap.get("prodId"), vendor.getVe_id(), vendor.getVe_code(), product.getMaterialCode(), product.getSpec(), product.getUnit(), vendor.getVe_name(), productMap.get("prodCode"), product.getMpq());
             }else if (count == 0) {
-                String code = "YS" + product.getMaterialCode();
+                String code = "";
+                if (StringUtils.isEmpty(product.getMaterialCode())) {
+                    code = "YS" + jdbcTemplate.generateCode("product$yhnd", 2);
+                }else {
+                    code = "YS" + product.getMaterialCode();
+                }
                 int id = jdbcTemplate.getInt("SELECT PRODUCT_SEQ.NEXTVAL FROM DUAL");
                 //生成物料资料
                 String insertProductSql = "INSERT INTO PRODUCT(PR_ID,PR_CODE,PR_DETAIL,PR_SPEC,PR_UNIT,PR_ORISPECCODE,PR_BRAND,pr_taxcode,pr_manutype,pr_dhzc,PR_SUPPLYTYPE,PR_ZXBZS,PR_ZXDHL,PR_ACCEPTMETHOD,"