Browse Source

成衣推送调整

huxy 1 year ago
parent
commit
41c3e28de7

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

@@ -32,6 +32,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.LoginUser;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.util.RedisUtil;
@@ -54,6 +55,7 @@ import org.jeecg.modules.splfi.service.ISyPackingListFabricService;
 import org.jeecg.modules.splt.vo.SyPackingListTailoringVo;
 import org.jeecg.modules.system.controller.CommonController;
 import org.jeecg.modules.system.entity.SysPermission;
+import org.jeecg.modules.system.service.impl.SysDictServiceImpl;
 import org.jeecg.modules.system.service.impl.SysPermissionServiceImpl;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -106,6 +108,9 @@ public class SyPackingListTailoringController implements Job {
 	private ISyPackingListTailoringItemService syPackingListTailoringItemService;
 	@Autowired
 	private RedisUtil redisUtil;//redisUtill
+    @Autowired
+ 	private SysDictServiceImpl sysDictService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -197,6 +202,31 @@ public class SyPackingListTailoringController implements Job {
 		 return result;
 	 }
 
+	 /**
+	  *
+	  *
+	  * @param account
+	  * @return
+	  */
+	 @AutoLog(value = "国内加工单成衣参考单价")
+	 @ApiOperation(value="国内加工单成衣参考单价", notes="国内加工单成衣参考单价")
+	 @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;
+			 }
+		 }
+		 result.setResult(dictModel1);
+		 result.setMessage("查询成功!");
+		 result.setSuccess(true);
+		 return result;
+	 }
+
 	 /**
 	  *
 	  *

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

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.hibernate.engine.jdbc.Size;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.config.InterfaceConnUtils;
@@ -33,6 +34,7 @@ import org.jeecg.modules.splt.mapper.SyPackingListTailoringMapper;
 import org.jeecg.modules.splt.service.ISyPackingListTailoringItemService;
 import org.jeecg.modules.splt.service.ISyPackingListTailoringService;
 import org.jeecg.modules.splt.vo.SyPackingListTailoringVo;
+import org.jeecg.modules.system.service.impl.SysDictServiceImpl;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -69,6 +71,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	private SyShippingOrderMapper syShippingOrderMapper;//托书主表
 	@Autowired
 	private SyShippingOrderItemMapper syShippingOrderItemMapper;//托书主表
+	@Autowired
+	private SysDictServiceImpl sysDictService;
 
 	void update(List<SyPackingListTailoringItem> items,String pid){
 		long start= System.currentTimeMillis();
@@ -2129,6 +2133,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						if(item.getAcSetNo().equals("102")&&account.equals("101")){
 							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));//改成使用报关单价
+						}
 						getcFree(jsonObject,map);
 						jsonObject.put("CDEFINE28",item.getSmallPo());//小po
 						break;
@@ -2332,6 +2348,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						if(item.getAcSetNo().equals("102")&&account.equals("102")){
 							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));//改成使用报关单价
+						}
 						break;
 					}
 				}
@@ -2601,12 +2629,22 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	public Map<String,List<String>> getSuppliers2(List<SyPackingListTailoring> listTailorings){
 		Map<String,List<String>> mapLists=new HashMap<>();
 		for (SyPackingListTailoring tailoring : listTailorings){
-			if(mapLists.containsKey(tailoring.getSupplierCode())){
-				mapLists.get(tailoring.getSupplierCode()).add(tailoring.getRdrecord32Code());
+			if (tailoring.getOmpoAccount().equals("103")){
+				if(mapLists.containsKey("103")){
+					mapLists.get("103").add(tailoring.getRdrecord32Code());
+				}else{
+					List<String> list=new ArrayList<>();
+					list.add(tailoring.getRdrecord32Code());
+					mapLists.put("103",list);
+				}
 			}else{
-				List<String> list=new ArrayList<>();
-				list.add(tailoring.getRdrecord32Code());
-				mapLists.put(tailoring.getSupplierCode(),list);
+				if(mapLists.containsKey(tailoring.getSupplierCode())){
+					mapLists.get(tailoring.getSupplierCode()).add(tailoring.getRdrecord32Code());
+				}else{
+					List<String> list=new ArrayList<>();
+					list.add(tailoring.getRdrecord32Code());
+					mapLists.put(tailoring.getSupplierCode(),list);
+				}
 			}
 		}
 		return mapLists;