Bladeren bron

出运明细提交时忽略删除文件, 增加推送报错提示,行计算总价保留两位小数

huxy 11 maanden geleden
bovenliggende
commit
eec3927d51

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

@@ -972,7 +972,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 				  //查询未提交数据
 				  QueryWrapper<SyShippingDetailsItem> itemQueryWrapper = new QueryWrapper<>();
-				  itemQueryWrapper.in("group_id",idsList).eq("submit_status","0");
+				  itemQueryWrapper.in("group_id",idsList).eq("submit_status","0").eq("del_flag","0");
 				  List<SyShippingDetailsItem> list = syShippingDetailsItemService.list(itemQueryWrapper);
 
 				  for (SyShippingDetailsItem li : list) {

+ 25 - 24
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -37,6 +37,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import java.io.Serializable;
 import java.lang.reflect.Array;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -82,15 +83,15 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 				item1.setSize(size.getSize());//获取尺码
 				item1.setActualPackingQty(size.getQuantity());//获取该尺码计划装箱数量
 
-				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 //				item1.setBoxNumber(boxNumber);//获取箱数
 				//boxNumber=boxNumber.divide(item.getPiecesBox(),6,BigDecimal.ROUND_HALF_UP);
-				//item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
-				//item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
-				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
-				//BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());
-				//volume=volume.multiply(item1.getOuterBoxLength());
-				//volume=volume.multiply(item1.getOuterBoxWidth());
+				//item1.setTotalNetWeight(boxNumber.multip1ly(item1.getNetWeight()));//获取总净重		净重*箱数
+				//item1.setTotalGrossWeight(boxNumber.multip1ly(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
+				//item1.setTotalNetWeight(boxNumber.multip1ly(new BigDecimal(size.getProportion())));//获取净净重 不知
+				//BigDecimal volume=boxNumber.multip1ly(item1.getOuterBoxHeight());
+				//volume=volume.multip1ly(item1.getOuterBoxLength());
+				//volume=volume.multip1ly(item1.getOuterBoxWidth());
 				//item1.setTotalVolume(volume.divide(new BigDecimal(1000000)));//获取总体积	长*宽*高*箱数
 
 
@@ -169,7 +170,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 					 item1.setSize(size.getSize());//获取尺码信息
 					 BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码件数
 					 item1.setTotal(boxNumber);//该尺码件数
-					 item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+					 item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 					 item1.setId(size.getItemId());//从尺码表中获取到id
 					 if(size.getProportion()==0){
 						 item1.setTotal(null);//该尺码件数
@@ -233,9 +234,9 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 				}
 				SyPreAssembledPackingListItem item1=item;
 				item1.setSize(size.getSize());//获取尺码信息
-				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码件数
+				BigDecimal boxNumber=boxNumber1.multip1ly(new BigDecimal(size.getProportion()));//获取该尺码件数
 				item1.setTotal(boxNumber);//该尺码件数
-				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+				item1.setTotalPrice(boxNumber.multip1ly(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
 				item1.setId(size.getItemId());//从尺码表中获取到id
 				if(size.getProportion()==0){
 					item1.setTotal(null);//该尺码件数
@@ -244,12 +245,12 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 				//item1.setBoxNumber(boxNumber);//获取箱数
 				//boxNumber=boxNumber.divide(item.getPiecesBox(),6,BigDecimal.ROUND_HALF_UP);
 
-				//item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
-				//item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
-				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
-				//BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());//获取体积
-			//	volume=volume.multiply(item1.getOuterBoxLength());
-				//volume=volume.multiply(item1.getOuterBoxWidth());
+				//item1.setTotalNetWeight(boxNumber.multip1ly(item1.getNetWeight()));//获取总净重		净重*箱数
+				//item1.setTotalGrossWeight(boxNumber.multip1ly(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
+				//item1.setTotalNetWeight(boxNumber.multip1ly(new BigDecimal(size.getProportion())));//获取净净重 不知
+				//BigDecimal volume=boxNumber.multip1ly(item1.getOuterBoxHeight());//获取体积
+			//	volume=volume.multip1ly(item1.getOuterBoxLength());
+				//volume=volume.multip1ly(item1.getOuterBoxWidth());
 				//item1.setTotalVolume(volume.divide(new BigDecimal(1000000)));//获取总体积	长*宽*高*箱数
 
 				//item.setSyDeclarationElementsItemId(size.getItemId());//获取到发运明细子表id
@@ -351,15 +352,15 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 					//item1.setRemainingQuantity(boxNumber);//该尺码的剩余数量
 					item1.setSize(size.getSize());//获取尺码
 					item1.setActualPackingQty(size.getQuantity());//获取该尺码计划装箱数量 z
-					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 //				item1.setBoxNumber(boxNumber);//获取箱数
 					//boxNumber=boxNumber.divide(item.getPiecesBox(),6,BigDecimal.ROUND_HALF_UP);
-					//item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
-					//item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
-					//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
-					//BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());
-					//volume=volume.multiply(item1.getOuterBoxLength());
-					//volume=volume.multiply(item1.getOuterBoxWidth());
+					//item1.setTotalNetWeight(boxNumber.multip1ly(item1.getNetWeight()));//获取总净重		净重*箱数
+					//item1.setTotalGrossWeight(boxNumber.multip1ly(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
+					//item1.setTotalNetWeight(boxNumber.multip1ly(new BigDecimal(size.getProportion())));//获取净净重 不知
+					//BigDecimal volume=boxNumber.multip1ly(item1.getOuterBoxHeight());
+					//volume=volume.multip1ly(item1.getOuterBoxLength());
+					//volume=volume.multip1ly(item1.getOuterBoxWidth());
 					//item1.setTotalVolume(volume.divide(new BigDecimal(1000000)));//获取总体积	长*宽*高*箱数
 
 
@@ -861,7 +862,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 						item1.setInventoryName(syItem.getInventoryName());//存货名称
 						item1.setAcSetNo(syItem.getAccount());//获取账套号
 						item1.setHod(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(syItem.getPreDeliveryDate()));//预发货日期
-						item1.setTotalPrice(item1.getTotal().multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+						item1.setTotalPrice(item1.getTotal().multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 						item1.setOrderNumber(syItem.getOrderNumber());//获取订单号
 						//item1.setWithCode(syItem.getCodingRules());//配码规则	因为导出文件新加了配码字段所以注释
 						item1.setSpurOrSubOrder(syItem.getPurOrSubOrder());//获取采购委外订货号

+ 12 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -69,6 +69,7 @@ import java.io.FileWriter;
 import java.io.Serializable;
 import java.lang.reflect.Array;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -238,11 +239,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			}
 			if(entity.getMasterMetering()!=null&&entity.getMasterMetering().equals("KG")){//计算总价
 				if(entity.getNetWeight()!=null){
-					entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
+					entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 				}
 			}else{
 				if(entity.getActualDeclaredQuantity()!=null){
-					entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
+					entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()).setScale(2, RoundingMode.HALF_UP));//实际报关数量*单价
 				}
 			}
 			syShippingDetailsItemMapper.updateById(detailsItem);
@@ -828,13 +829,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}
 					if(s1.getMasterMetering().equals("KG")){//计算总价
 						if(s1.getNetWeight()==null){
-							s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()));//净重*单价
+							s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 						}else{
 							//throw new JeecgBootException("物料:"+s1.getInventoryName()+"请填写净重");
 						}
 					}else{
 						if(s1.getActualDeclaredQuantity()==null){
-							s1.setTotalPrice(s1.getActualDeclaredQuantity().multiply(s1.getPrice()));//实际报关数量*单价
+							s1.setTotalPrice(s1.getActualDeclaredQuantity().multiply(s1.getPrice()).setScale(2, RoundingMode.HALF_UP));//实际报关数量*单价
 						}
 					}
 
@@ -970,13 +971,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}
 					if(item.getMasterMetering().equals("KG")){//计算总价
 						if(item.getNetWeight()!=null){
-							item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价
+							item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 						}else{
 							//throw new JeecgBootException("单位为kg的物料请填写净重,用于计算金额");
 						}
 					}else{
 						if(item.getActualDeclaredQuantity()!=null){
-							item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//实际报关数量*单价
+							item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()).setScale(2, RoundingMode.HALF_UP));//实际报关数量*单价
 						}else{
 							//throw new JeecgBootException("单位不为kg的物料请填写实际报关数量,用于计算金额");
 						}
@@ -1074,13 +1075,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}*/
 					/*if(item.getMasterMetering().equals("KG")){//计算总价
 						if(item.getNetWeight()!=null){
-							item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价
+							item.setTotalPrice(item.getNetWeight().multip1ly(item.getPrice()));//净重*单价
 						}else{
 							//throw new JeecgBootException("单位为kg的物料请填写净重,用于计算金额");
 						}
 					}else{
 						if(item.getActualDeclaredQuantity()!=null){
-							item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//实际报关数量*单价
+							item.setTotalPrice(item.getActualDeclaredQuantity().multip1ly(item.getPrice()));//实际报关数量*单价
 						}else{
 							//throw new JeecgBootException("单位不为kg的物料请填写实际报关数量,用于计算金额");
 						}
@@ -2422,7 +2423,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							sy1.setSupplier(syShippingDetailsItem.getSupplier());
 							sy1.setSupplierCode(syShippingDetailsItem.getSupplierCode());
 							if(sy1.getPrice()!=null&&sy1.getActualDeclaredQuantity()!=null){
-								sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()));//实际报关数量*单价
+								sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()).setScale(2, RoundingMode.HALF_UP));//实际报关数量*单价
 							}
 							if((sy1.getInventoryCcode().substring(0,2).equals("03")&&!sy1.getInventoryCcode().equals("0399")) ||
 									(sy1.getInventoryCcode().substring(0,2).equals("02")&&!sy1.getInventoryCcode().equals("0299"))||
@@ -2467,11 +2468,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							}
 							if(sy1.getMasterMetering().equals("KG")){//计算总价
 								if(sy1.getNetWeight()!=null){
-									sy1.setTotalPrice(sy1.getNetWeight().multiply(sy1.getPrice()));//净重*单价
+									sy1.setTotalPrice(sy1.getNetWeight().multiply(sy1.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 								}
 							}else{
 								if(sy1.getActualDeclaredQuantity()!=null){
-									sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()));//实际报关数量*单价
+									sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()).setScale(2, RoundingMode.HALF_UP));//实际报关数量*单价
 								}
 							}
 							/*if(sy1.getActualDeclaredQuantity()!=null){

+ 8 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -45,6 +45,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import java.io.FileWriter;
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -101,7 +102,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码件数
 				item1.setTotal(boxNumber);//该尺码件数
 				item1.setActualPackingQty(boxNumber);
-				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 				item1.setId(size.getItemId());//从尺码表中获取到id
 				if(size.getProportion()==0){
 					item1.setTotal(null);//该尺码件数
@@ -212,7 +213,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					item1.setActualPackingQty(boxNumber);
 					item1.setPlanQuantity(size.getQuantity());//计划装箱数量
 					item1.setSize(size.getSize());//获取尺码
-					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 					item1.setSyPreAssembledPackingListItemId(size.getItemId());//获取到预装箱单子表id
 					item1.setSort(size.getNum());//获取序号
 					item1.setId(oConvertUtils.id());//获取到随机id
@@ -303,7 +304,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					item1.setActualPackingQty(boxNumber);
 					item1.setPlanQuantity(size.getQuantity());//计划装箱数量
 					item1.setSize(size.getSize());//获取尺码
-					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+					item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 					item1.setSyPreAssembledPackingListItemId(size.getItemId());//获取到预装箱单子表id
 					item1.setSort(size.getNum());//获取序号
 					item1.setId(oConvertUtils.id());//获取到随机id
@@ -449,7 +450,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				}catch (Exception e){
 					e.printStackTrace();
 				}
-				s1.setTotalPrice(s1.getTotal().multiply(s1.getUnitPrice()));//计算总价
+				s1.setTotalPrice(s1.getTotal().multiply(s1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//计算总价
 
 				s1.setSyOrderDataId(syPreAssembledPackingListItem.getSyOrderDataId());//订单数据子表id
 				s1.setSyOrderDataItemId(syPreAssembledPackingListItem.getSyOrderDataItemId());//订单数据子表id
@@ -863,7 +864,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 							item.setCreateTime(day);
 							item1.setInventoryName(syPreItem.getInventoryName());//存货名称
 							item1.setAcSetNo(syPreItem.getAcSetNo());//获取账套号
-							item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+							item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()).setScale(2, RoundingMode.HALF_UP));//获取总价		箱数*单价-->件数*单价
 							item1.setOrderNumber(syPreItem.getOrderNumber());//获取订单号
 							item1.setSalesman(syPreItem.getSalesman());//获取业务员
 							item1.setSalesDepartment(syPreItem.getSalesDepartment());//获取销售部门
@@ -1344,7 +1345,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("OM_MODetails", "MODetailsID='"+item.getOmpoIdItem()+"'","MODetailsID");
 					Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getOMMoDetails(item.getOmpoIdItem());//获取自由项		try
 					if (orderDataItem2==null){
-						return "推送失败:"+mapt.get("account")+"账套的"+mapt.get("ordertype")+"子表id"+orderDataItem.get("id")+"未获取到数据";
+						System.out.println("mapt\n"+mapt);
+						return "推送失败:"+mapt.get("account")+"账套的"+mapt.get("ordertype")+"子表id"+item.getOmpoIdItem()+"未获取到数据";
 					}
 					getcFree(mapItem,orderDataItem2);
 					getcFree(mapItem3,orderDataItem2);