zengtx před 3 roky
rodič
revize
2a66dea9d6

+ 24 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -118,6 +118,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		if(oConvertUtils.isNotEmpty(syShippingDetails.getDocumentNo())){
 			queryWrapper.eq("t.documentNo",syShippingDetails.getDocumentNo());
 		}
+		if(oConvertUtils.isNotEmpty(syShippingDetails.getOrderNumber())){
+			queryWrapper.eq("t.orderNumber",syShippingDetails.getOrderNumber());
+		}
 		if(oConvertUtils.isNotEmpty(startTime)){
 		    queryWrapper.ge("t.documentDate",startTime);
 			queryWrapper.le("t.documentDate",endTime);
@@ -267,11 +270,11 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			return result;
 		}
 		//判断是否已提交
-		if(shippingDetails.getState().equals("1")){
-			result.setMessage("该单据已提交,不允许删除!");
-			result.setSuccess(false);
-			return result;
-		}
+//		if(shippingDetails.getState().equals("1")){
+//			result.setMessage("该单据已提交,不允许删除!");
+//			result.setSuccess(false);
+//			return result;
+//		}
 		String idsSplit[] = itemIds.split(",");
 		for(String str:idsSplit){
 			strList.add(str);
@@ -480,6 +483,22 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 				idsList.add(arr);
 			}
 		  }
+
+		  //查询是否已提交
+		  QueryWrapper<SyShippingDetailsItem> itemQueryWrapper = new QueryWrapper<>();
+		  itemQueryWrapper.in("id",idsList);
+		  List<SyShippingDetailsItem> list = syShippingDetailsItemService.list(itemQueryWrapper);
+		  if(list.size()!=0){
+
+		  	for (SyShippingDetailsItem li:list){
+		  		if(li.getSubmitStatus() == 1){
+					result.setSuccess(false);
+					result.setMessage("部分单据已提交,请勿重复提交!");
+					return result;
+				}
+			}
+		  }
+
 		  int i = syShippingDetailsService.batchSubmission(idsList,syShippingDetails.getType());
 		  if(i>0){
 			  if(syShippingDetails.getType().equals("1")){

+ 27 - 30
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java

@@ -176,6 +176,7 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 //  @MultiTransactional(value = {DbTxConstants.DB1_TX, DbTxConstants.DB2_TX})
   public Result saveBath(@RequestBody JSONArray json){
   	Result result=new Result();
+  	boolean boo = false;
 
 	  try {
 		  if(json!=null&&json.size()>0){
@@ -185,20 +186,22 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
               List<Map<String,Object>> mapListTwo=new ArrayList<>();
               //账套3
               List<Map<String,Object>> mapListThree=new ArrayList<>();
-              String cAccId = "";
               for(int i=0;i<json.size();i++){
                   //获取对象
                   JSONObject jsonObject=json.getJSONObject(i);
                   //获取账套
-                  cAccId=jsonObject.get("cAccId").toString();
+                  String cAccId=jsonObject.get("cAccId").toString();
                   //转map
                   Map<String,Object> map=updateMap(jsonObject);
                   if(cAccId.equals("901")){
                       mapListOne.add(map);
+					  boo = true;
                   }else if(cAccId.equals("902")){
                       mapListTwo.add(map);
+					  boo = true;
                   }else if(cAccId.equals("903")){
                       mapListThree.add(map);
+					  boo = true;
                   }
               }
               if(mapListOne.size()>0){
@@ -207,9 +210,6 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
                   purchaseWarehousingService.savaOne(mapListOne,caccId);
               }
               if(mapListTwo.size()>0){
@@ -218,23 +218,22 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
                   purchaseWarehousingService.savaTwo(mapListTwo,caccId);
               }
               if(mapListThree.size()>0){
 				  //获取账套
 				  String caccId=sysDictService.queryDictTextByKey("cAccID", "3");
+
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
                   purchaseWarehousingService.savaThree(mapListThree,caccId);
               }
-              result.success("操作成功");
+              if(boo == false){
+				  result.success("检查账套号是否正确!");
+			  }else {
+				  result.success("操作成功");
+			  }
           }else{
 		  	result.error500("为获取到正确的json");
 		  }
@@ -262,6 +261,7 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
   @PostMapping(value = "/saveMaterialIssueDoc")
   public Result saveMaterialIssueDoc(@RequestBody JSONArray json){
 	  Result result=new Result();
+      boolean boo = false;
 
 	  try {
 		  if(json!=null&&json.size()>0){
@@ -271,21 +271,22 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 			  List<Map<String,Object>> mapListTwo=new ArrayList<>();
 			  //账套3
 			  List<Map<String,Object>> mapListThree=new ArrayList<>();
-
-			  String cAccId = "";
 			  for(int i=0;i<json.size();i++){
 				  //获取对象
 				  JSONObject jsonObject=json.getJSONObject(i);
 				  //获取账套
-				  cAccId=jsonObject.get("cAccId").toString();
+				  String cAccId=jsonObject.get("cAccId").toString();
 				  //转map
 				  Map<String,Object> map=updateMap(jsonObject);
 				  if(cAccId.equals("901")){
 					  mapListOne.add(map);
+					  boo = true;
 				  }else if(cAccId.equals("902")){
 					  mapListTwo.add(map);
+					  boo = true;
 				  }else if(cAccId.equals("903")){
 					  mapListThree.add(map);
+					  boo = true;
 				  }
 			  }
 			  //查询字典配置-获取U8错误信息验证配置
@@ -307,9 +308,6 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
 				  message=message+purchaseWarehousingService.saveMaterialIssueDocOne(mapListOne,caccId,isMaterialIssueDoc);
 			  }
 			  if(mapListTwo.size()>0){
@@ -318,9 +316,6 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
 				  message=message+purchaseWarehousingService.saveMaterialIssueDocTwo(mapListTwo,caccId,isMaterialIssueDoc);
 			  }
 			  if(mapListThree.size()>0){
@@ -329,18 +324,20 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
 				  if(StringUtils.isNotBlank(caccId)){
 					  result.error500("未获取到账套");
 				  }
-				  if(!cAccId.equals(caccId)){
-					  result.error500("账套号错误!");
-				  }
 				  message=message+purchaseWarehousingService.saveMaterialIssueDocThree(mapListThree,caccId,isMaterialIssueDoc);
 			  }
-			  result.setSuccess(true);
-			  if(StringUtils.isNotBlank(message)){
-				  result.setMessage("错误信息:"+message);
-			  }else{
-				  result.setMessage("操作成功");
-			  }
+			  if(boo == false){
+				  result.success("检查账套号是否正确!");
+			  }else {
 
+				  result.setSuccess(true);
+
+				  if(StringUtils.isNotBlank(message)){
+					  result.setMessage("错误信息:"+message);
+				  }else{
+					  result.setMessage("操作成功");
+				  }
+			  }
 		  }else{
 			  result.error500("未获取到正确的json");
 		  }