ソースを参照

二线出岛放行业务bug修复

wenjinbiao 2 ヶ月 前
コミット
6c8eb06196

+ 47 - 13
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinehzdtz/service/impl/QySecondlineHzdTzServiceImpl.java

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import vip.xiaonuo.auth.core.pojo.SaBaseClientLoginUser;
 import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
+import vip.xiaonuo.biz.modular.dict.service.BizDictService;
 import vip.xiaonuo.biz.modular.qyoutwarehouse.entity.QyOutWarehouse;
 import vip.xiaonuo.biz.modular.qyoutwarehouse.service.QyOutWarehouseService;
 import vip.xiaonuo.biz.modular.qyrecardbody.entity.QyRecardBody;
@@ -95,6 +96,8 @@ public class QySecondlineHzdTzServiceImpl extends ServiceImpl<QySecondlineHzdTzM
     private QyRecordService qyRecordService;
     @Autowired
     private QyOutWarehouseService qyOutWarehouseService;
+    @Autowired
+    private BizDictService bizDictService;
     @Override
     public Page<QySecondlineHzdTz> page(QySecondlineHzdTzPageParam qySecondlineHzdTzPageParam) {
         QueryWrapper<QySecondlineHzdTz> queryWrapper = new QueryWrapper<QySecondlineHzdTz>().checkSqlInjection();
@@ -264,12 +267,24 @@ public class QySecondlineHzdTzServiceImpl extends ServiceImpl<QySecondlineHzdTzM
         qyOutWarehouse.setCompanyName(qySecondlineWarehouse.getCompanyName());
         //默认出库
         qyOutWarehouse.setOutWarehouseType("1");
-        //TODO 字典
-        qyOutWarehouse.setAccountType(qySecondlineWarehouse.getAccountType());
-        //TODO 字典
-        qyOutWarehouse.setRegulaMethod(qySecondlineHzdTz.getRegulaMethod());
-        //TODO 字典
-        qyOutWarehouse.setBz(product.getCurrency());
+        if(ObjectUtil.isNotEmpty(qySecondlineWarehouse.getAccountType())){
+            //TODO 字典  账册类型
+            String accountType = bizDictService.getNameByType("tzlx", qySecondlineWarehouse.getAccountType());
+            qyOutWarehouse.setAccountType(accountType);
+        }
+
+        //TODO 字典 运输方式
+        if(ObjectUtil.isNotEmpty(qySecondlineHzdTz.getRegulaMethod())){
+            String regulaMethod = bizDictService.getNameByType("jgfs", qySecondlineHzdTz.getRegulaMethod());
+            qyOutWarehouse.setRegulaMethod(regulaMethod);
+        }
+
+        //TODO 字典 币制
+        if(ObjectUtil.isNotEmpty(product.getCurrency())){
+            String bz = bizDictService.getNameByType("hbdm", product.getCurrency());
+            qyOutWarehouse.setBz(bz);
+        }
+
 
         qyOutWarehouse.setQdgDq(CollectionUtil.get(CollectionUtil.toList("中国","英国","美国"),  new Random().nextInt(3)));
 
@@ -284,10 +299,14 @@ public class QySecondlineHzdTzServiceImpl extends ServiceImpl<QySecondlineHzdTzM
 
         qyOutWarehouse.setBgbz((CollectionUtil.get(CollectionUtil.toList("飞机","火车","轮船"),  new Random().nextInt(3))));
         //TODO 运输方式 字典
-        qyOutWarehouse.setYsfs(qySecondlineHzdTz.getYsfs());
+        if(ObjectUtil.isNotEmpty(qySecondlineHzdTz.getYsfs())){
+            String ysfs = bizDictService.getNameByType("trans_type", qySecondlineHzdTz.getYsfs());
+            qyOutWarehouse.setYsfs(ysfs);
+        }
+
         qyOutWarehouse.setQgldbj(String.valueOf(new Random().nextInt(1000000)));
         qyOutWarehouse.setBssp((CollectionUtil.get(CollectionUtil.toList("是","否","其它"),  new Random().nextInt(3))));
-        qyOutWarehouse.setYxbgdh(BusinessIdGenerator.generateNumBerUUID(18).substring(8));
+        qyOutWarehouse.setYxbgdh(qySecondlineHzdTz.getDybgCode());
         qyOutWarehouse.setShqymc((CollectionUtil.get(CollectionUtil.toList("哈尔滨怡康药业有限公司","海南第二附属医院","海南金鼎酒业有限公司"),  new Random().nextInt(3))));
         qyOutWarehouse.setWlbh(product.getProductCode());
         qyOutWarehouse.setWlmc(product.getProductName());
@@ -300,18 +319,33 @@ public class QySecondlineHzdTzServiceImpl extends ServiceImpl<QySecondlineHzdTzM
         qyOutWarehouse.setFjcpbz((CollectionUtil.get(CollectionUtil.toList("成品标志1","成品标志2","成品标志3"),  new Random().nextInt(3))));
         //TODO 字典
         qyOutWarehouse.setGgxh(product.getSpecModel());
+
+
         qyOutWarehouse.setBrandType((CollectionUtil.get(CollectionUtil.toList("华为","苹果","三星"),  new Random().nextInt(3))));
         qyOutWarehouse.setYcgdq((CollectionUtil.get(CollectionUtil.toList("英国","美国","澳大利亚"),  new Random().nextInt(3))));
         qyOutWarehouse.setZzmdg((CollectionUtil.get(CollectionUtil.toList("泰国","法国","巴西"),  new Random().nextInt(3))));
         //出库数量 == 申报数量
         qyOutWarehouse.setCkNum(product.getSbNum());
-        //TODO 字典
-        qyOutWarehouse.setMeasurementUnit(product.getDeclareUnit());
+        //TODO 字典 计量单位
+        if(ObjectUtil.isNotEmpty(product.getDeclareUnit())){
+            String jldw = bizDictService.getNameByType("measurement unit", qySecondlineHzdTz.getYsfs());
+            qyOutWarehouse.setMeasurementUnit(jldw);
+        }
+
         qyOutWarehouse.setUnitPrice(product.getCompanySbPrice());
-        qyOutWarehouse.setFyfdNum(String.valueOf(product.getLegalQuantity()));
-        qyOutWarehouse.setDefdNum(String.valueOf(product.getSecondLegalQuantity()));
+        if(product.getLegalQuantity() != null){
+            qyOutWarehouse.setFyfdNum(String.valueOf(product.getLegalQuantity()));
+        }
+        if(product.getSecondLegalQuantity() != null){
+            qyOutWarehouse.setDefdNum(String.valueOf(product.getSecondLegalQuantity()));
+        }
+
         //TODO 字典
-        qyOutWarehouse.setZmfs(product.getZmMethod());
+        if(ObjectUtil.isNotEmpty(product.getZmMethod())){
+            String zm = bizDictService.getNameByType("zm_type", product.getZmMethod());
+            qyOutWarehouse.setZmfs(zm);
+        }
+
         qyOutWarehouse.setHcdm("INRD05017291");
         qyOutWarehouse.setCwdm("1A01-04-03");
         qyOutWarehouse.setHwlyType("检验证书");