|
@@ -26,8 +26,23 @@ public class ErpSyncServiceImpl implements ErpSyncService {
|
|
|
@JFinalTx
|
|
|
@Override
|
|
|
public void erpSync() {
|
|
|
- //skuType
|
|
|
- /*SqlPara sqlPara = Db.getSqlPara("erp.selectProType");
|
|
|
+
|
|
|
+ // 品号基础表 ERP_PRO_OB
|
|
|
+ SqlPara sqlParaOb = Db.getSqlPara("erp.selectProOb");
|
|
|
+ List<Record> recordObList = Db.find(sqlParaOb);
|
|
|
+ List<ErpProOb> erpProObList = RecordUtils.converModel(recordObList, ErpProOb.class);
|
|
|
+ if (erpProObList != null && erpProObList.size() > 0) {
|
|
|
+ for (ErpProOb erpProOb : erpProObList) {
|
|
|
+ Kv param = Kv.create();
|
|
|
+ param.put("ima01", erpProOb.getIma01());
|
|
|
+ SqlPara update = Db.getSqlPara("erp.updateProOb", param);
|
|
|
+ Db.update(update);
|
|
|
+ }
|
|
|
+ redisTemplate.opsForValue().set("erpProOb", JSON.toJSONString(erpProObList));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 产品类型基础表 ERP_PRO_TYPE
|
|
|
+ SqlPara sqlPara = Db.getSqlPara("erp.selectProType");
|
|
|
List<Record> recordList = Db.find(sqlPara);
|
|
|
if (recordList != null && recordList.size() > 0) {
|
|
|
List<ErpProType> list = new ArrayList<>();
|
|
@@ -45,19 +60,7 @@ public class ErpSyncServiceImpl implements ErpSyncService {
|
|
|
redisTemplate.opsForValue().set("erpProType", JSON.toJSONString(list));
|
|
|
}
|
|
|
|
|
|
- SqlPara sqlParaOb = Db.getSqlPara("erp.selectProOb");
|
|
|
- List<Record> recordObList = Db.find(sqlParaOb);
|
|
|
- List<ErpProOb> erpProObList = RecordUtils.converModel(recordObList, ErpProOb.class);
|
|
|
- if (erpProObList != null && erpProObList.size() > 0) {
|
|
|
- for (ErpProOb erpProOb : erpProObList) {
|
|
|
- Kv param = Kv.create();
|
|
|
- param.put("ima01", erpProOb.getIma01());
|
|
|
- SqlPara update = Db.getSqlPara("erp.updateProOb", param);
|
|
|
- Db.update(update);
|
|
|
- }
|
|
|
- redisTemplate.opsForValue().set("erpProOb", JSON.toJSONString(erpProObList));
|
|
|
- }
|
|
|
-
|
|
|
+ // 条码品号对照表 ERP_PRO_BARCODE
|
|
|
SqlPara sqlParaBarCode = Db.getSqlPara("erp.selectBarCode");
|
|
|
List<Record> recordBarCodeList = Db.find(sqlParaBarCode);
|
|
|
List<ErpProBarCode> erpBarCodeList = RecordUtils.converModel(recordBarCodeList, ErpProBarCode.class);
|
|
@@ -69,8 +72,9 @@ public class ErpSyncServiceImpl implements ErpSyncService {
|
|
|
Db.update(update);
|
|
|
}
|
|
|
redisTemplate.opsForValue().set("erpBarCode", JSON.toJSONString(erpBarCodeList));
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
+ // ERP需求单 ERP_ORDER_LIST
|
|
|
SqlPara sqlParaOrderList = Db.getSqlPara("erp.selectOrderList");
|
|
|
List<Record> recordOrderList = Db.find(sqlParaOrderList);
|
|
|
List<ErpOrderList> erpOrderLists = RecordUtils.converModel(recordOrderList, ErpOrderList.class);
|