|
|
@@ -54,14 +54,17 @@ public class GetBasicDataFromU8 extends ServiceController {
|
|
|
* 商品档案
|
|
|
*/
|
|
|
public void getItem() throws YosException {
|
|
|
- RowsMap unitMap = SQLFactory.createQuerySQL(dbConnect, "plm_unit", "unitid,unitname").setWhere("siteid", "MD").query().toRowsMap("unitname");
|
|
|
Rows cInvCodeRows = YUNl_DB.runSqlQuery("select " + "cInvCode," +//--存货编码
|
|
|
"cInvName," +//存货名称
|
|
|
"cInvStd," +//规格型号
|
|
|
"cComUnitName," +//主计量单位名称
|
|
|
"isnull(bSerial,0)as bSerial " +//是否序列号管理
|
|
|
"from Inventory where status=0 and accid in('666','888')");
|
|
|
+ if (cInvCodeRows.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
logger.info("监测到有【{}】个u8商品档案待同步", cInvCodeRows.size());
|
|
|
+ RowsMap unitMap = SQLFactory.createQuerySQL(dbConnect, "plm_unit", "unitid,unitname").setWhere("siteid", "MD").query().toRowsMap("unitname");
|
|
|
|
|
|
ArrayList<String> itemnoList = SQLFactory.createQuerySQL(dbConnect, "plm_item", "itemno").setWhere("siteid", "MD").setWhere("itemno", cInvCodeRows.toArrayList("cInvCode")).query().toArrayList("itemno");
|
|
|
for (Row cInvCodeRow : cInvCodeRows) {
|
|
|
@@ -111,6 +114,9 @@ public class GetBasicDataFromU8 extends ServiceController {
|
|
|
*/
|
|
|
public void getMcode() throws YosException {
|
|
|
Rows codeRows = YUNl_DB.runSqlQuery("SELECT cInvCode,cInvSN FROM ST_SNState where status=0 and accid in('666','888')");
|
|
|
+ if (codeRows.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
logger.info("监测到有【{}】个u8序列号待同步", codeRows.size());
|
|
|
Rows itemrows = SQLFactory.createQuerySQL(dbConnect, "plm_item", "itemid", "itemno").setWhere("siteid", "MD").setWhere("itemno", codeRows.toArrayList("cInvCode")).query();
|
|
|
|