Przeglądaj źródła

托书调整、订单调整

huxy 1 miesiąc temu
rodzic
commit
3d4083cd17

+ 23 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/controller/SySOAndOMController.java

@@ -182,7 +182,7 @@ public class SySOAndOMController extends JeecgController<SySOAndOM, ISySOAndOMSe
                     syOrderDataItem.setGarmentFactory(syOrderData.getGarmentFactory());
                 }
                 if (syOrderDataItem.getOmpoIdItem() != null && sy.getAccount() != null) {
-                    List<String> rsup = queryRSupplier(syOrderDataItem.getOmpoIdItem(), sy.getAccount());
+                    List<String> rsup = queryRSupplier(syOrderDataItem.getOmpoIdItem(), sy.getAccount(),syOrderDataItem.getSupplier());
                     if (rsup.size() > 0) {
                         syOrderDataItem.setRSupplierCode(rsup.get(0));
                         syOrderDataItem.setRSupplier(rsup.get(1));
@@ -230,7 +230,7 @@ public class SySOAndOMController extends JeecgController<SySOAndOM, ISySOAndOMSe
                 syOrderDataItem.setGarmentFactory(syOrderData.getGarmentFactory());
             }
             if (syOrderDataItem.getOmpoIdItem() != null && sy.getAccount() != null) {
-                List<String> rsup = queryRSupplier(syOrderDataItem.getOmpoIdItem(), sy.getAccount());
+                List<String> rsup = queryRSupplier(syOrderDataItem.getOmpoIdItem(), sy.getAccount(),syOrderDataItem.getSupplier());
                 if (rsup.size() > 0) {
                     syOrderDataItem.setRSupplierCode(rsup.get(0));
                     syOrderDataItem.setRSupplier(rsup.get(1));
@@ -317,7 +317,7 @@ public class SySOAndOMController extends JeecgController<SySOAndOM, ISySOAndOMSe
     /*
      * 查询染厂供应商编码 供应商名称
      * */
-    public List<String>  queryRSupplier(String id,String zhangtao){
+    public List<String>  queryRSupplier(String id,String zhangtao,String supplier){
         /*
         查询账套用于判断
          */
@@ -336,6 +336,26 @@ public class SySOAndOMController extends JeecgController<SySOAndOM, ISySOAndOMSe
             index++;
         }
 
+        List<Map<String, Object>> supplierList = new ArrayList<>();
+        String supplierSql="select cvccode from Vendor where cVenAbbName='"+supplier+"'";
+        String cvccode="";
+        if(zhangtao.equals(account[0])){
+            supplierList= senYuDataSourceOne.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[1])){
+            supplierList= senYuDataSourceTwo.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[2])){
+            supplierList= senYuDataSourceThree.queryForList(supplierSql);
+        }
+        List<JSONObject> supplierObjects = JsonChangeUtils.toJSONObject(supplierList);
+        if(supplierObjects.size()>0){
+            for (JSONObject json:supplierObjects) {
+                cvccode= (String) json.get("cvccode");
+            }
+        }
+        if (!cvccode.equals("0105")){
+            return new ArrayList<>();
+        }
+
         String sql = "select om.cVenCode as cVenCode,v.cVenAbbName as cVenName From OM_MODetails  o " +
                 "join ( " +
                 " select ommos.isosid,ommom.cInvCode from  " +

+ 24 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/impl/SyOrderDataServiceImpl.java

@@ -292,8 +292,8 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
                         if(sy2.getOmpoIdItem()==null || sy2.getOmpoIdItem().equals("")){
                             continue;
                         }
-                        if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null){
-                            List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount());
+                        if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null && sy2.getSupplier()!=null){
+                            List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount(),sy2.getSupplier());
                             if(rsup.size()>0){
                                 sy2.setRSupplierCode(rsup.get(0));
                                 sy2.setRSupplier(rsup.get(1));
@@ -335,8 +335,8 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
                             if(sy2.getOmpoIdItem()==null || sy2.getOmpoIdItem().equals("")){
                                 continue;
                             }
-                            if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null){
-                                List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount());
+                            if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null && sy2.getSupplier()!=null){
+                                List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount(),sy2.getSupplier());
                                 if(rsup.size()>0){
                                     sy2.setRSupplierCode(rsup.get(0));
                                     sy2.setRSupplier(rsup.get(1));
@@ -547,7 +547,7 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
     /*
      * 查询染厂供应商编码 供应商名称
      * */
-    public List<String>  queryRSupplier(String id,String zhangtao){
+    public List<String>  queryRSupplier(String id,String zhangtao,String supplier){
         /*
         查询账套用于判断
          */
@@ -566,6 +566,25 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
             index++;
         }
 
+        List<Map<String, Object>> supplierList = new ArrayList<>();
+        String supplierSql="select cvccode from Vendor where cVenAbbName='"+supplier+"'";
+        String cvccode="";
+        if(zhangtao.equals(account[0])){
+            supplierList= senYuDataSourceOne.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[1])){
+            supplierList= senYuDataSourceTwo.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[2])){
+            supplierList= senYuDataSourceThree.queryForList(supplierSql);
+        }
+        List<JSONObject> supplierObjects = JsonChangeUtils.toJSONObject(supplierList);
+        if(supplierObjects.size()>0){
+            for (JSONObject json:supplierObjects) {
+                cvccode= (String) json.get("cvccode");
+            }
+        }
+        if (!cvccode.equals("0105")){
+            return new ArrayList<>();
+        }
         String sql = "select om.cVenCode as cVenCode,v.cVenAbbName as cVenName From OM_MODetails  o " +
                 "join ( " +
                 " select ommos.isosid,ommom.cInvCode from  " +

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java

@@ -33,6 +33,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.documents.letterDeposit.entity.SyLetterDeposit;
 import org.jeecg.modules.documents.letterDeposit.entity.SyRmb;
 import org.jeecg.modules.documents.letterDeposit.entity.SyUsd;
 import org.jeecg.modules.documents.letterDeposit.mapper.SyLetterDepositMapper;
@@ -266,6 +267,16 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 			return result;
 		}
 
+		QueryWrapper<SyShippingOrder> queryWrapper2 = new QueryWrapper();
+		queryWrapper2.eq("shipping_order_number",syShippingOrder.getShippingOrderNumber()).eq("del_flag",0).ne("id",syShippingOrder.getId());
+		List<SyShippingOrder> list2 = syShippingOrderService.list(queryWrapper2);
+
+		if(list2.size()>0){
+			result.setSuccess(false);
+			result.setMessage("托书号已存在,请重新维护!");
+			return result;
+		}
+
 		//判断是否已提交
 //		SyShippingOrder pojo = syShippingOrderService.getById(syShippingOrder.getId());
 //		if(pojo.getTheDocumentsState().equals("1")){

+ 23 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/AddOrderJob.java

@@ -297,7 +297,7 @@ public class AddOrderJob implements Job,ApplicationContextAware {
                             continue;
                         }
                         if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null){
-                            List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount());
+                            List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount(),sy2.getSupplier());
                             if(rsup.size()>0){
                                 sy2.setRSupplierCode(rsup.get(0));
                                 sy2.setRSupplier(rsup.get(1));
@@ -339,7 +339,7 @@ public class AddOrderJob implements Job,ApplicationContextAware {
                                 continue;
                             }
                             if(sy2.getOmpoIdItem()!=null && sy.getAccount()!=null){
-                                List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount());
+                                List<String> rsup = queryRSupplier(sy2.getOmpoIdItem(),sy.getAccount(),sy2.getSupplier());
                                 if(rsup.size()>0){
                                     sy2.setRSupplierCode(rsup.get(0));
                                     sy2.setRSupplier(rsup.get(1));
@@ -556,7 +556,7 @@ public class AddOrderJob implements Job,ApplicationContextAware {
     /*
      * 查询染厂供应商编码 供应商名称
      * */
-    public List<String>  queryRSupplier(String id,String zhangtao){
+    public List<String>  queryRSupplier(String id,String zhangtao,String supplier){
         /*
         查询账套用于判断
          */
@@ -575,6 +575,26 @@ public class AddOrderJob implements Job,ApplicationContextAware {
             index++;
         }
 
+        List<Map<String, Object>> supplierList = new ArrayList<>();
+        String supplierSql="select cvccode from Vendor where cVenAbbName='"+supplier+"'";
+        String cvccode="";
+        if(zhangtao.equals(account[0])){
+            supplierList= senYuDataSourceOne.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[1])){
+            supplierList= senYuDataSourceTwo.queryForList(supplierSql);
+        }else if(zhangtao.equals(account[2])){
+            supplierList= senYuDataSourceThree.queryForList(supplierSql);
+        }
+        List<JSONObject> supplierObjects = JsonChangeUtils.toJSONObject(supplierList);
+        if(supplierObjects.size()>0){
+            for (JSONObject json:supplierObjects) {
+                cvccode= (String) json.get("cvccode");
+            }
+        }
+        if (!cvccode.equals("0105")){
+            return new ArrayList<>();
+        }
+
         String sql = "select om.cVenCode as cVenCode,v.cVenAbbName as cVenName From OM_MODetails  o " +
                 "join ( " +
                 " select ommos.isosid,ommom.cInvCode from  " +