caifc 3 år sedan
förälder
incheckning
ea34fb27b9

+ 3 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/domain/dto/AppAuditItemDTO.java

@@ -24,6 +24,9 @@ public class AppAuditItemDTO extends AuditItems {
     // 状态
     private String auditStatus;
 
+    // 业务类型
+    private String billType;
+
     // 业务类型区间
     private List<String> billTypeList;
 

+ 8 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -1144,8 +1144,14 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
      */
     @Override
     public List<AppAuditItemVO> selectOrderAuditItems(AppAuditItemDTO auditItems) {
-        // 赋值仓库类型
-        auditItems.setBillTypeList(WarehouseTypeEnum.getWarehousingType());
+        // 如果没有指定类型信息,则默认 赋值仓库类型
+        if (StringUtils.isEmpty(auditItems.getBillType())) {
+            auditItems.setBillTypeList(WarehouseTypeEnum.getWarehousingType());
+        } else {
+            List<String> strings = new ArrayList<>();
+            strings.add(auditItems.getBillType());
+            auditItems.setBillTypeList(strings);
+        }
         if (StringUtils.isNotEmpty(auditItems.getSendTimeInterval())) {
             String[] split = auditItems.getSendTimeInterval().split(",");
             List<String> list = Lists.newArrayList();

+ 3 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -590,7 +590,6 @@ public class TFeeServiceImpl implements ITFeeService {
 
     @Override
     public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees, String billsType) {
-        List<Map<String, Object>> maps = new ArrayList<Map<String, Object>>();
         Map<String, Object> map = new HashMap<>();
         map.put("tWareHouseFees", tWareHouseFees);
         List<Map<String, Object>> mapList = new ArrayList<>();
@@ -633,17 +632,17 @@ public class TFeeServiceImpl implements ITFeeService {
                     String dictLabel = sysDictDataList.stream().filter(li -> Objects.equals(li.getDictValue(), fBusinessType))
                             .map(SysDictData::getDictLabel).findFirst().orElseThrow(() -> new WarehouseException("缺少字典表信息"));
                     map.put("fBusinessType", dictLabel);
-                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.SJRK.getType())) {
+                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.SJRK.getType()) && Objects.nonNull(map.get("fBusinessType"))) {
                     String dictLabel = DictUtils.getDictLabel(ST_IN_TYPE, map.get("fBusinessType").toString());
                     if (StringUtils.isNotEmpty(dictLabel)) {
                         map.put("fBusinessType", dictLabel);
                     }
-                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.SJCK.getType())) {
+                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.SJCK.getType()) && Objects.nonNull(map.get("fBusinessType"))) {
                     String dictLabel = DictUtils.getDictLabel(ST_OUT_TYPE, map.get("fBusinessType").toString());
                     if (StringUtils.isNotEmpty(dictLabel)) {
                         map.put("fBusinessType", dictLabel);
                     }
-                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.HQZY.getType())) {
+                } else if (StringUtils.isNotEmpty(type) && type.equals(WarehouseTypeEnum.HQZY.getType()) && Objects.nonNull(map.get("fBusinessType"))) {
                     String dictLabel = DictUtils.getDictLabel(ST_TRANS_TYPE, map.get("fBusinessType").toString());
                     if (StringUtils.isNotEmpty(dictLabel)) {
                         map.put("fBusinessType", dictLabel);

+ 20 - 11
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -3635,7 +3635,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     return AjaxResult.error("库存明细第" + i + "行库存为空");
                 } else { // 非空修改库存总账
                     //校验计费日期是等于库存总帐计费日,如果不相等则报错
-                    checkWhgenleg(tWarehouseBills, tWhgenle);
+                    checkWhgenleg(wbItem, tWhgenle);
                     //  库存 <  出库件数
                     if (tWhgenle.getfQtyblc() < wbItem.getfQty()) {
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -3658,7 +3658,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     return AjaxResult.error("库存明细第" + i + "行库存为空");
                 } else { // 非空修改库存总账
                     //校验计费日期是等于库存总帐计费日,如果不相等则报错
-                    checkWhgenleg(tWarehouseBills, tWhgenle);
+                    checkWhgenleg(wbItem, tWhgenle);
                     if (tWhgenle.getfQtyblc() < wbItem.getfQty()) {  //  1、  库存 <  调拨件数  提示库存不足
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         return AjaxResult.error("库存明细第" + i + "行库存不足");
@@ -3688,7 +3688,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     return AjaxResult.error("库存明细第" + i + "行库存为空");
                 } else { // 非空修改库存总账
                     //校验计费日期是等于库存总帐计费日,如果不相等则报错
-                    checkWhgenleg(tWarehouseBills, tWhgenle);
+                    checkWhgenleg(wbItem, tWhgenle);
                     if (tWhgenle.getfQtyblc() < wbItem.getfQty()) {  //  1、  库存 <  调拨件数  提示库存不足
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         return AjaxResult.error("库存明细第" + i + "行库存不足");
@@ -3807,7 +3807,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      * @param wbItem
      * @param tWhgenle
      */
-    private void checkWhgenleg(TWarehouseBills wbItem, TWhgenleg tWhgenle) {
+    private void checkWhgenleg(TWarehousebillsitems wbItem, TWhgenleg tWhgenle) {
         // 如果仓储费计费日期超出 库存总帐的计费日期不相等则报异常
         if (wbItem.getfChargedate().before(tWhgenle.getfChargedate())) {
             throw new WarehouseException("仓储费计费日期与库存总帐计费日期不相符");
@@ -4051,7 +4051,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
             map.put("feeId", feeCalculationResultVO.getFeeId());
             map.put("itemFeeId", feeCalculationResultVO.getFeeId());
-            sumAmt = sumAmt.add(feeCalculationResultVO.getAmt()).setScale(2, RoundingMode.HALF_UP);
+            sumAmt = sumAmt.add(feeCalculationResultVO.getAmt());
             TWarehousebillsfees fees = new TWarehousebillsfees();
             fees.setfFeeid(feeCalculationResultVO.getFeeId());
             fees.setfDc("D");
@@ -4060,12 +4060,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             fees.setfMblno(mblno);
             fees.setRemark(feeCalculationResultVO.getRemark());
             fees.setfFeeunitid(2L);
-            fees.setfAmount(sumAmt);
+            fees.setfAmount(feeCalculationResultVO.getAmt());
             fees.setfBillstatus(2L);
             fees.setfCurrency("RMB");
             fees.setfBsdate(fBsdate);
             fees.setfBillingQty(feeCalculationResultVO.getQty());
-            fees.setfUnitprice(sumAmt);
+            fees.setfUnitprice(feeCalculationResultVO.getAmt());
             fees.setfBilltype(fBilltype);
             fees.setCreateTime(new Date());
             fees.setfBillingDays(fBillingDays);
@@ -4972,14 +4972,14 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     .map(TWarehousebillsfees::getSrcId).collect(toList());
             // 判断库存总账是否存在二次计算
             if (!generalLedgerIds.isEmpty() && tWhgenlegMapper.queryChangedByFchargedate(generalLedgerIds, chargedate) > 0) {
-                throw new WarehouseException("审批撤销失败,库存总账存在二计算");
+                throw new WarehouseException("审批撤销失败,库存总账存在二计算");
             }
             // 过滤货转库信息id集合查询是否存在变更的
             List<Long> forwardingIds = feesList.stream().filter(li -> Objects.nonNull(li.getSrcId()) && Objects.equals(WarehouseTypeEnum.HQZY.getType(), li.getfBilltype()))
                     .map(TWarehousebillsfees::getSrcId).collect(toList());
             // 判断货转是否存在二次计算
             if (!forwardingIds.isEmpty() && tWarehousebillsitemsMapper.queryChangedByFchargedate(forwardingIds, chargedate) > 0) {
-                throw new WarehouseException("审批撤销失败,货转明细存在二计算");
+                throw new WarehouseException("审批撤销失败,货转明细存在二计算");
             }
             for (TWarehousebillsfees wareItem : feesList) {
                 if (StringUtils.isNull(wareItem.getSrcId())) {
@@ -6953,10 +6953,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             infoVO.setStltypeName(dictLabel);
         }
         // 贸易方式
-        if (StringUtils.isNotNull(infoVO.getfNewTrademodeid())) {
+        if (StringUtils.isNotNull(infoVO.getfTrademodeid())) {
             String type = "data_trademodes";
             // 转换贸易方式
-            String dictLabel = DictUtils.getDictLabel(type, infoVO.getfNewTrademodeid().toString());
+            String dictLabel = DictUtils.getDictLabel(type, infoVO.getfTrademodeid().toString());
             if (StringUtils.isNotEmpty(dictLabel)) {
                 infoVO.setNewTrademodeName(dictLabel);
             }
@@ -6999,6 +6999,15 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 infoVO.setBusinessTypeName(dictLabel);
             }
         }
+        // 贸易方式
+        if (StringUtils.isNotNull(infoVO.getfTrademodeid())) {
+            String type = "data_trademodes";
+            // 转换贸易方式
+            String dictLabel = DictUtils.getDictLabel(type, infoVO.getfTrademodeid().toString());
+            if (StringUtils.isNotEmpty(dictLabel)) {
+                infoVO.setNewTrademodeName(dictLabel);
+            }
+        }
         // 仓库id集合
         List<Long> warehouseIds = new ArrayList<>();
         if (StringUtils.isNotNull(infoVO.getfInwarehouseid())) {

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsModifyServiceImpl.java

@@ -184,6 +184,7 @@ public class TWarehousebillsModifyServiceImpl implements ITWarehousebillsModifyS
         List<TWarehousebillsfeesModify> feesItemList = tWarehousebillsModify.getItems();
         feesItemList.forEach(li -> {
             li.setfPid(tWarehousebillsModify.getfId());
+            li.setfMblno(tWarehousebillsModify.getfMblno());
             li.setfSrcTypeId(Integer.parseInt(FeesTypeEnum.FEE_CHANGES.getType()));
             if (Objects.isNull(li.getfId())) {
                 li.setCreateTime(new Date());
@@ -235,6 +236,7 @@ public class TWarehousebillsModifyServiceImpl implements ITWarehousebillsModifyS
         List<TWarehousebillsfeesModify> feesItemList = tWarehousebillsModify.getItems();
         feesItemList.forEach(li -> {
             li.setfPid(tWarehousebillsModify.getfId());
+            li.setfMblno(tWarehousebillsModify.getfMblno());
             li.setfSrcTypeId(Integer.parseInt(FeesTypeEnum.FEE_CHANGES.getType()));
             li.setfStatus(Long.parseLong(tWarehousebillsModify.getfStatus()));
             if (Objects.isNull(li.getfId())) {