Browse Source

成衣参考单价

huxy 1 năm trước cách đây
mục cha
commit
f1ff62f903

+ 5 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.splt.controller;
 
 import java.io.*;
 import java.lang.reflect.Array;
+import java.math.BigDecimal;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -213,14 +214,7 @@ public class SyPackingListTailoringController implements Job {
 	 @GetMapping(value = "/getAccountPrice")
 	 public Result<DictModel> getAccountPrice(String account) {
 		 Result<DictModel> result=new Result<>();
-		 List<DictModel> dictModels=sysDictService.queryDictItemsByCode("accountPrice");
-		 DictModel dictModel1=new DictModel();
-		 for (DictModel dictModel : dictModels){
-			 if (dictModel.getText().equals(account)){
-			 	dictModel1=dictModel;
-			 	break;
-			 }
-		 }
+		 DictModel dictModel1=sysDictService.queryDictItemsByCode("accountPrice").get(0);
 		 result.setResult(dictModel1);
 		 result.setMessage("查询成功!");
 		 result.setSuccess(true);
@@ -2046,9 +2040,11 @@ public class SyPackingListTailoringController implements Job {
 					}
 				}
 				List<SyPackingListTailoringItem> tailoringItemList=syPackingListTailoringService.getList(tailoring.getId());
-				if(tailoring.getIsTc()!=null){
+				 DictModel dictModel1=sysDictService.queryDictItemsByCode("accountPrice").get(0);
+				 if(tailoring.getIsTc()!=null){
 					for (SyPackingListTailoringItem tailoringItem : tailoringItemList){
 						tailoringItem.setIsTc(tailoring.getIsTc());
+						tailoringItem.setAccountPrice(new BigDecimal(dictModel1.getValue()));
 					}
 				}
 				SyOrderData syOrderData=syOrderDataMapper.selectById(tailoringItemList.get(0).getSyOrderDataId());//最终客户

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoringItem.java

@@ -350,6 +350,11 @@ public class SyPackingListTailoringItem implements Serializable {
 	@ApiModelProperty(value = "包数")
 	private BigDecimal packs;
 
+	@Excel(name = "国内加工单成衣参考单价", width = 15)
+	@ApiModelProperty(value = "国内加工单成衣参考单价")
+	@TableField(exist = false)
+	private BigDecimal accountPrice;
+
 	public SyPackingListTailoringItem(){
 
 	}

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/ISyPackingListTailoringService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem;
 import org.jeecg.modules.splfi.entity.SyPackingListFabric;
 import org.jeecg.modules.splt.entity.SyPackingListTailoringItem;

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

@@ -2134,16 +2134,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 							jsonObject.put("IORITAXCOST",item.getCustomsDeclarationUnitPrice());//改成使用报关单价
 						}
 						if(item.getOmpoAccount().equals("103")&&account.equals("102")){
-							List<DictModel> dictModels=sysDictService.queryDictItemsByCode("accountPrice");
-							DictModel dictModel1=new DictModel();
-							for (DictModel dictModel : dictModels){
-								if (dictModel.getText().equals(account)){
-									dictModel1=dictModel;
-									break;
-								}
-							}
-							BigDecimal number=new BigDecimal(dictModel1.getValue());
-							jsonObject.put("IORITAXCOST",item.getCustomsDeclarationUnitPrice().multiply(number));//改成使用报关单价
+							jsonObject.put("IORITAXCOST",item.getCustomsDeclarationUnitPrice().multiply(item.getAccountPrice()));//改成使用报关单价
 						}
 						getcFree(jsonObject,map);
 						jsonObject.put("CDEFINE28",item.getSmallPo());//小po
@@ -2349,16 +2340,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 							jsonObject.put("ITAXUNITPRICE",item.getCustomsDeclarationUnitPrice());//改成使用报关单价
 						}
 						if(item.getOmpoAccount().equals("103")&&account.equals("103")){
-							List<DictModel> dictModels=sysDictService.queryDictItemsByCode("accountPrice");
-							DictModel dictModel1=new DictModel();
-							for (DictModel dictModel : dictModels){
-								if (dictModel.getText().equals(account)){
-									dictModel1=dictModel;
-									break;
-								}
-							}
-							BigDecimal number=new BigDecimal(dictModel1.getValue());
-							jsonObject.put("IORITAXCOST",item.getCustomsDeclarationUnitPrice().multiply(number));//改成使用报关单价
+							jsonObject.put("ITAXUNITPRICE",item.getCustomsDeclarationUnitPrice().multiply(item.getAccountPrice()));//改成使用报关单价*成衣参考单价
 						}
 						break;
 					}