Просмотр исходного кода

配件档案增加【库位号】和服务商自动推送服务申请单机制更新

hu 5 месяцев назад
Родитель
Сommit
cc83705aa1

+ 92 - 60
src/custom/restcontroller/sale/serviceorder/serviceorder.java

@@ -160,38 +160,54 @@ public class serviceorder extends Controller {
                     RowsMap cityRowsMap = serviceagents.toRowsMap("city");
                     RowsMap provinceRowsMap = serviceagents.toRowsMap("province");
                     if (countyRowsMap.containsKey(rows.get(0).getString("county"))) {
-                        UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                        updateSQL.setUniqueid(sa_serviceorderid);
-                        updateSQL.setSiteid(siteid);
-                        updateSQL.setValue("status", "待受理");
-                        updateSQL.setValue("sys_enterpriseid_service", countyRowsMap.get(rows.get(0).getString("county")).get(0).getLong("sys_enterpriseid"));
-                        updateSQL.setDateValue("allocationdate");
-                        updateSQL.setValue("allocationby", username);
-                        sqlList.add(updateSQL.getSQL());
-                        sqlList.add(
-                                DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        for(Row row :countyRowsMap.get(rows.get(0).getString("county"))){
+                            if(row.getString("province").equals(rows.get(0).getString("province"))
+                            && row.getString("city").equals(rows.get(0).getString("city"))){
+                                UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                                updateSQL.setUniqueid(sa_serviceorderid);
+                                updateSQL.setSiteid(siteid);
+                                updateSQL.setValue("status", "待受理");
+                                updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                                updateSQL.setDateValue("allocationdate");
+                                updateSQL.setValue("allocationby", username);
+                                sqlList.add(updateSQL.getSQL());
+                                sqlList.add(
+                                        DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                            }
+                        }
                     } else if (cityRowsMap.containsKey(rows.get(0).getString("city"))) {
-                        UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                        updateSQL.setUniqueid(sa_serviceorderid);
-                        updateSQL.setSiteid(siteid);
-                        updateSQL.setValue("status", "待受理");
-                        updateSQL.setValue("sys_enterpriseid_service", cityRowsMap.get(rows.get(0).getString("city")).get(0).getLong("sys_enterpriseid"));
-                        updateSQL.setDateValue("allocationdate");
-                        updateSQL.setValue("allocationby", username);
-                        sqlList.add(updateSQL.getSQL());
-                        sqlList.add(
-                                DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        for(Row row :cityRowsMap.get(rows.get(0).getString("city"))){
+                            if(row.getString("province").equals(rows.get(0).getString("province"))
+                                    && StringUtils.isBlank(row.getString("county"))){
+                                UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                                updateSQL.setUniqueid(sa_serviceorderid);
+                                updateSQL.setSiteid(siteid);
+                                updateSQL.setValue("status", "待受理");
+                                updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                                updateSQL.setDateValue("allocationdate");
+                                updateSQL.setValue("allocationby", username);
+                                sqlList.add(updateSQL.getSQL());
+                                sqlList.add(
+                                        DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                            }
+                        }
+
                     } else if (provinceRowsMap.containsKey(rows.get(0).getString("province"))) {
-                        UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                        updateSQL.setUniqueid(sa_serviceorderid);
-                        updateSQL.setSiteid(siteid);
-                        updateSQL.setValue("status", "待受理");
-                        updateSQL.setValue("sys_enterpriseid_service", provinceRowsMap.get(rows.get(0).getString("province")).get(0).getLong("sys_enterpriseid"));
-                        updateSQL.setDateValue("allocationdate");
-                        updateSQL.setValue("allocationby", username);
-                        sqlList.add(updateSQL.getSQL());
-                        sqlList.add(
-                                DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        for(Row row :provinceRowsMap.get(rows.get(0).getString("province"))){
+                            if(StringUtils.isBlank(row.getString("city"))
+                                    && StringUtils.isBlank(row.getString("county"))){
+                                UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                                updateSQL.setUniqueid(sa_serviceorderid);
+                                updateSQL.setSiteid(siteid);
+                                updateSQL.setValue("status", "待受理");
+                                updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                                updateSQL.setDateValue("allocationdate");
+                                updateSQL.setValue("allocationby", username);
+                                sqlList.add(updateSQL.getSQL());
+                                sqlList.add(
+                                        DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                            }
+                        }
                     }
                 }
             }else {
@@ -200,38 +216,54 @@ public class serviceorder extends Controller {
                 RowsMap cityRowsMap = serviceagents.toRowsMap("city");
                 RowsMap provinceRowsMap = serviceagents.toRowsMap("province");
                 if (countyRowsMap.containsKey(rows.get(0).getString("county"))) {
-                    UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                    updateSQL.setUniqueid(sa_serviceorderid);
-                    updateSQL.setSiteid(siteid);
-                    updateSQL.setValue("status", "待受理");
-                    updateSQL.setValue("sys_enterpriseid_service", countyRowsMap.get(rows.get(0).getString("county")).get(0).getLong("sys_enterpriseid"));
-                    updateSQL.setDateValue("allocationdate");
-                    updateSQL.setValue("allocationby", username);
-                    sqlList.add(updateSQL.getSQL());
-                    sqlList.add(
-                            DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                    for(Row row :countyRowsMap.get(rows.get(0).getString("county"))){
+                        if(row.getString("province").equals(rows.get(0).getString("province"))
+                                && row.getString("city").equals(rows.get(0).getString("city"))){
+                            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                            updateSQL.setUniqueid(sa_serviceorderid);
+                            updateSQL.setSiteid(siteid);
+                            updateSQL.setValue("status", "待受理");
+                            updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                            updateSQL.setDateValue("allocationdate");
+                            updateSQL.setValue("allocationby", username);
+                            sqlList.add(updateSQL.getSQL());
+                            sqlList.add(
+                                    DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        }
+                    }
                 } else if (cityRowsMap.containsKey(rows.get(0).getString("city"))) {
-                    UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                    updateSQL.setUniqueid(sa_serviceorderid);
-                    updateSQL.setSiteid(siteid);
-                    updateSQL.setValue("status", "待受理");
-                    updateSQL.setValue("sys_enterpriseid_service", cityRowsMap.get(rows.get(0).getString("city")).get(0).getLong("sys_enterpriseid"));
-                    updateSQL.setDateValue("allocationdate");
-                    updateSQL.setValue("allocationby", username);
-                    sqlList.add(updateSQL.getSQL());
-                    sqlList.add(
-                            DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                    for(Row row :cityRowsMap.get(rows.get(0).getString("city"))){
+                        if(row.getString("province").equals(rows.get(0).getString("province"))
+                                && StringUtils.isBlank(row.getString("county"))){
+                            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                            updateSQL.setUniqueid(sa_serviceorderid);
+                            updateSQL.setSiteid(siteid);
+                            updateSQL.setValue("status", "待受理");
+                            updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                            updateSQL.setDateValue("allocationdate");
+                            updateSQL.setValue("allocationby", username);
+                            sqlList.add(updateSQL.getSQL());
+                            sqlList.add(
+                                    DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        }
+                    }
+
                 } else if (provinceRowsMap.containsKey(rows.get(0).getString("province"))) {
-                    UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
-                    updateSQL.setUniqueid(sa_serviceorderid);
-                    updateSQL.setSiteid(siteid);
-                    updateSQL.setValue("status", "待受理");
-                    updateSQL.setValue("sys_enterpriseid_service", provinceRowsMap.get(rows.get(0).getString("province")).get(0).getLong("sys_enterpriseid"));
-                    updateSQL.setDateValue("allocationdate");
-                    updateSQL.setValue("allocationby", username);
-                    sqlList.add(updateSQL.getSQL());
-                    sqlList.add(
-                            DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                    for(Row row :provinceRowsMap.get(rows.get(0).getString("province"))){
+                        if(StringUtils.isBlank(row.getString("city"))
+                                && StringUtils.isBlank(row.getString("county"))){
+                            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                            updateSQL.setUniqueid(sa_serviceorderid);
+                            updateSQL.setSiteid(siteid);
+                            updateSQL.setValue("status", "待受理");
+                            updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
+                            updateSQL.setDateValue("allocationdate");
+                            updateSQL.setValue("allocationby", username);
+                            sqlList.add(updateSQL.getSQL());
+                            sqlList.add(
+                                    DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
+                        }
+                    }
                 }
             }
             Rows workersRows = dbConnect.runSqlQuery(

+ 4 - 0
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -244,6 +244,8 @@ public class Item extends Controller {
         sqlFactory.addParameter("outplace", content.getStringValue("outplace"));
         sqlFactory.addParameter("repairattribute", content.getStringValue("repairattribute"));
         sqlFactory.addParameter("shapesize", content.getStringValue("shapesize"));
+        sqlFactory.addParameter("kw", content.getStringValue("kw"));
+
 
         String topclassnum="";
         if (content.containsKey("itemclassids")) {
@@ -516,6 +518,7 @@ public class Item extends Controller {
         sqlFactory.addParameter("repairattribute", item.getString("repairattribute"));
         sqlFactory.addParameter("shapesize", item.getString("shapesize"));
         sqlFactory.addParameter("topclassnum", item.getString("topclassnum"));
+        sqlFactory.addParameter("kw", item.getString("kw"));
 
         sqlList.add(sqlFactory.getSQL());
         // 货品档案扩展属性字段表
@@ -1779,6 +1782,7 @@ public class Item extends Controller {
                     sqlFactory.addParameter("iswuliao", 0);
                     // 是否服务物料
                     sqlFactory.addParameter("isservice", row.getString("isservice").equals("是") ? 1 : 0);
+                    sqlFactory.addParameter("kw", row.getString("kw"));
 
                     sqlList.add(sqlFactory.getSQL());
                     // 货品档案扩展属性字段表

+ 1 - 0
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案列表.sql

@@ -64,6 +64,7 @@ SELECT t1.itemid,
        t1.outplace,
        t1.shapesize,
        t1.topclassnum,
+       t1.kw,
        t6.auxunitid,
        t6.unitgroupname,
        t7.unitname axunitname,

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案新增.sql

@@ -6,7 +6,7 @@ insert into plm_item (siteid, itemid, createby, createdate, changeuserid, change
                       sa_customschemeid, cheek, delistingstatus, financeclasstype, stockno, volume, marketingcategory,
                       pricingmetod,cheekschemeid,colorschemeid,materialschemeid,cost,grossprofit,grossprofitmargin,saleprice,
                       rate,grade,custamount,safeqty,icaddqty,icminqty,iswriteoff,isnegative,ispartorderautocheck,islimitemparts,itemname_print,
-                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace,repairattribute,shapesize,topclassnum,aftersalesitemno)
+                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace,repairattribute,shapesize,topclassnum,aftersalesitemno,kw)
 values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURRENT_TIME, $itemno$, $unitid$,
         $isauxunit$, $unitgroupid$, $itemname$, $isonsale$, '新建', $model$, $spec$, $orderminqty$, $orderaddqty$,
         $orderminqty_auxunit$, $orderaddqty_auxunit$, $remarks$, $barcode$, $skucontrol$, $batchcontrol$, $grossweight$,
@@ -15,4 +15,4 @@ values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURR
         $iswoodproducts$, $sa_customschemeid$, $cheek$, $delistingstatus$, $financeclasstype$, $stockno$, $volume$,
         $marketingcategory$, $pricingmetod$,$cheekschemeid$,$colorschemeid$,$materialschemeid$,$cost$,$grossprofit$,$grossprofitmargin$,$saleprice$,
         $rate$,$grade$,$custamount$,$safeqty$,$icaddqty$,$icminqty$,$iswriteoff$,$isnegative$,$ispartorderautocheck$,$islimitemparts$,$itemname_print$,
-        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$,$repairattribute$,$shapesize$,$topclassnum$,$aftersalesitemno$)
+        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$,$repairattribute$,$shapesize$,$topclassnum$,$aftersalesitemno$,$kw$)

+ 2 - 1
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案更新.sql

@@ -74,7 +74,8 @@ SET changeuserid=$userid$,
     repairattribute=$repairattribute$,
     shapesize=$shapesize$,
     topclassnum=$topclassnum$,
-    aftersalesitemno=$aftersalesitemno$
+    aftersalesitemno=$aftersalesitemno$,
+    kw=$kw$
 WHERE itemid = $itemid$
   and siteid = $siteid$