Explorar o código

2022年12月14日18:42:32

纪新园 %!s(int64=2) %!d(string=hai) anos
pai
achega
b5331ade0f

+ 10 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/vo/FeeVO.java

@@ -74,7 +74,7 @@ public class FeeVO extends TFee {
     private BigDecimal copeWithAmount;
 
     //天数
-    private int fBillingDays;
+    private BigDecimal fBillingDays;
 
     //单价
     private BigDecimal price;
@@ -94,4 +94,13 @@ public class FeeVO extends TFee {
     private String fBilltypeC;
 
 
+    private String fBillTypeName;
+
+    private String name;
+
+    private String TfeesNameC;
+
+    private String TfeesNameD;
+
+
 }

+ 16 - 18
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -730,7 +730,7 @@ public class TFeeServiceImpl implements ITFeeService {
         }
         List<FeeVO> list = tFeeMapper.selectFinancialLedgerList(tWareHouseFees);
         for (int i = 0; i < list.size(); i++) {
-            if(tWareHouseFees.getSwitchSection() == 0){
+            if (tWareHouseFees.getSwitchSection() == 0) {
                 list.get(i).setReviewDate(list.get(i).getBstime());
             }
             FeeDTO feeDTO = new FeeDTO();
@@ -784,12 +784,12 @@ public class TFeeServiceImpl implements ITFeeService {
             BigDecimal amount = new BigDecimal("0.00");
             BigDecimal stlamount = new BigDecimal("0.00");
 //            if (tWareHouseFees.getSwitchSection() == 0) {
-                if (ObjectUtils.isNotNull(map.get("reviewDate"))) {
-                    List<String> list1 = new ArrayList<>();
-                    list1.add(map.get("reviewDate").toString());
-                    list1.add(map.get("reviewDate").toString());
-                    feeDTO.setFAuditList(list1);
-                }
+            if (ObjectUtils.isNotNull(map.get("reviewDate"))) {
+                List<String> list1 = new ArrayList<>();
+                list1.add(map.get("reviewDate").toString());
+                list1.add(map.get("reviewDate").toString());
+                feeDTO.setFAuditList(list1);
+            }
            /* } else {
                 if (ObjectUtils.isNotNull(map.get("f_bstime"))) {
                     List<String> list1 = new ArrayList<>();
@@ -2396,7 +2396,7 @@ public class TFeeServiceImpl implements ITFeeService {
     public AjaxResult financialLedgerDetailsTotal(FeeDTO feeDTO) {
         feeDTO.setFToCorpid(feeDTO.getFCorpId());
         feeDTO.setFCorpId(null);
-        if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())){
+        if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())) {
             feeDTO.setFAuditList(feeDTO.getFBstimeExamine());
             feeDTO.setFBstimeExamine(null);
         }
@@ -2434,23 +2434,21 @@ public class TFeeServiceImpl implements ITFeeService {
                     }
                     vo.setReceivableFQty(feeVOD.getFQty());
                     vo.setReceivablePrice(feeVOD.getPrice());
-                    /*WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOD.getfBilltype(), "storageType");
-                    vo.setfBilltype(storageType.getName());*/
-                    vo.setfBilltype(feeVOD.getFFeesName());
+                    vo.setfBilltype(feeVOD.getFBillTypeName());
                     vo.setFBillingDays(feeVOD.getFBillingDays());
+                    vo.setTfeesNameD(feeVOD.getName());
                 }
                 if (ObjectUtils.isNotNull(feeVOC)) {
                     if (ObjectUtils.isNotNull(feeVOC.getFAmount())) {
-                        C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);;
+                        C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                         vo.setCopeWithAmount(C);
                     } else {
                         vo.setCopeWithAmount(C);
                     }
-                   /* WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOC.getfBilltype(), "storageType");
-                    vo.setFBilltypeC(storageType.getName());*/
-                    vo.setfBilltype(feeVOC.getFFeesName());
+                    vo.setFBilltypeC(feeVOC.getFBillTypeName());
                     vo.setCopeWithFQty(feeVOC.getFQty());
                     vo.setCopeWithPrice(feeVOC.getPrice());
+                    vo.setTfeesNameC(feeVOC.getName());
                 }
                 vo.setNnfinished(D.subtract(C));
                 voList.add(vo);
@@ -2465,7 +2463,7 @@ public class TFeeServiceImpl implements ITFeeService {
         List<GeneralLedgerDetailTotalExcel> list = new ArrayList<>();
         feeDTO.setFToCorpid(feeDTO.getFCorpId());
         feeDTO.setFCorpId(null);
-        if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())){
+        if (ObjectUtils.isNotNull(feeDTO.getFBstimeExamine())) {
             feeDTO.setFAuditList(feeDTO.getFBstimeExamine());
             feeDTO.setFBstimeExamine(null);
         }
@@ -2505,11 +2503,11 @@ public class TFeeServiceImpl implements ITFeeService {
                     /*WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(feeVOD.getfBilltype(), "storageType");
                     generalLedgerDetailTotalExcel.setFBilltype(storageType.getName());*/
                     generalLedgerDetailTotalExcel.setFBilltype(feeVOD.getFFeesName());
-                    generalLedgerDetailTotalExcel.setFBillingDays(feeVOD.getFBillingDays());
+                    generalLedgerDetailTotalExcel.setFBillingDays(feeVOD.getFBillingDays().intValue());
                 }
                 if (ObjectUtils.isNotNull(feeVOC)) {
                     if (ObjectUtils.isNotNull(feeVOC.getFAmount())) {
-                        C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);;
+                        C = feeVOCList.stream().map(FeeVO::getFAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                         generalLedgerDetailTotalExcel.setCopeWithAmount(C);
                     } else {
                         generalLedgerDetailTotalExcel.setCopeWithAmount(C);

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

@@ -616,7 +616,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 earlySumDays = 0L;
                 days -= tempDays;
                 // 计算最终金额:数量 * 单价 * 天数
-                BigDecimal calculate = this.getCalculate(qty, tWarehouseAgreementitems.getfPrice(), tempDays).setScale(2,BigDecimal.ROUND_HALF_UP);
+                BigDecimal calculate = this.getCalculate(qty, tWarehouseAgreementitems.getfPrice(), tempDays);
                 money = money.add(calculate);
                 // 组装运费明细记录
                 String details = assemblyBillingDetails(StorageFeeRangeDTO.builder()
@@ -633,7 +633,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 // 下一个区间的开始时间调整
                 storageFeesDto.setStartTime(DateUtils.dateAdd(storageFeesDto.getStartTime(), tempDays.intValue()));
             } else {
-                BigDecimal calculate = this.getCalculate(qty, tWarehouseAgreementitems.getfPrice(), days).setScale(2,BigDecimal.ROUND_HALF_UP);
+                BigDecimal calculate = this.getCalculate(qty, tWarehouseAgreementitems.getfPrice(), days);
                 money = money.add(calculate);
                 // 计算费用明细
                 String details = assemblyBillingDetails(StorageFeeRangeDTO.builder()

+ 18 - 13
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/WarehouseBillsCcbServiceImpl.java

@@ -10,15 +10,13 @@ import com.ruoyi.basicData.mapper.TCorpsMapper;
 import com.ruoyi.basicData.mapper.TGoodsMapper;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
 import com.ruoyi.basicData.mapper.TWarehouseWebcamMapper;
-import com.ruoyi.basicData.service.ITWarehouseWebcamService;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.system.mapper.SysDictDataMapper;
-import com.ruoyi.warehouse.warehouse.domain.TMonitoringAlarms;
 import com.ruoyi.warehouse.warehouse.mapper.TMonitoringAlarmsMapper;
-import com.ruoyi.warehouse.warehouse.service.ITMonitoringAlarmsService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
 import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitemsElabel;
@@ -27,7 +25,6 @@ import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsElabelMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsMapper;
 import com.ruoyi.warehouseBusiness.service.IWarehouseBillsCcbService;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -71,6 +68,13 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult inAndOutStock(String billType, List<TWarehousebillsitems> items) {
+        if (items.size() < 1) {
+            return AjaxResult.error("数据不能为空!");
+        }
+        if (ObjectUtil.isNull(items.get(0).getfMblno())){
+            return AjaxResult.error("提单号不能为空!");
+        }
+        TWarehouseBills tWarehouseBills = billMapper.selectBYOriginalBillNo(items.get(0).getfMblno());
         for (TWarehousebillsitems item : items) {
             // 获取客户信息
             TCorps corp = corpMapper.getCorpByName(item.getCargoBelong());
@@ -169,6 +173,7 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
                 }
 
                 bill.setfWarehouseid(warehouse.getfId());*/
+                bill.setfWarehouseid(tWarehouseBills.getfWarehouseid());
                 bill.setfChargedate(bsDate);
                 bill.setfBusinessType("5");
                 bill.setIsPledge("1");
@@ -189,7 +194,7 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
             item.setfBusinessType(1L);
 
             if ("SJCK".equals(billType)) {
-               /* TWarehouse warehouse = warehouseMapper.getWarehouseByNo(item.getShelvesNo());
+                /*TWarehouse warehouse = warehouseMapper.getWarehouseByNo(item.getShelvesNo());
                 if (ObjectUtil.isNull(warehouse)) {
                     return AjaxResult.error("库区不存在!");
                 }
@@ -197,19 +202,19 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
                 item.setfWarehouseInformation(warehouse.getfWarehouseInformation());
 
                 TWhgenleg temp = new TWhgenleg();
-                temp.setfCorpid(bill.getfCorpid());
-                temp.setfMblno(item.getfMblno());
+                temp.setfCorpid(tWarehouseBills.getfCorpid());
+                temp.setfMblno(tWarehouseBills.getfMblno());
                 temp.setfWarehouseLocationid(item.getfWarehouselocid());
                 temp.setfTrademodeid(bill.getfTrademodeid());
-                temp.setfGoodsid(item.getfGoodsid());
+                temp.setfGoodsid(goods.getfId());
                 temp.setfLocation(1L);
                 TWhgenleg stock = stockMapper.selectTWhgenleg(temp);
                 if (ObjectUtil.isNull(stock)) {
                     return AjaxResult.error("未找到库存!");
                 }
-                item.setfSrcid(stock.getfId());
-                item.setfSrcBsdate(stock.getfBsdate());
-                item.setfChargedate(stock.getfChargedate());*/
+                item.setfSrcid(stock.getfId());*/
+                item.setfSrcBsdate(tWarehouseBills.getfBsdate());
+                item.setfChargedate(tWarehouseBills.getfChargedate());
             }
             billItemMapper.insertTWarehousebillsitems(item);
 
@@ -381,8 +386,8 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
      * @return
      */
     @Override
-    public List<TWarehouseWebcam> selectListAllDevices(int pageNo, int pageSize,Long deviceLocationCode) {
-        return tWarehouseWebcamMapper.selectTWarehouseWebcamByPage(pageNo,pageSize,deviceLocationCode);
+    public List<TWarehouseWebcam> selectListAllDevices(int pageNo, int pageSize, Long deviceLocationCode) {
+        return tWarehouseWebcamMapper.selectTWarehouseWebcamByPage(pageNo, pageSize, deviceLocationCode);
     }
 
     /**

+ 33 - 9
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -109,6 +109,10 @@
         <result property="fBstime" column="f_bstime"/>
         <result property="fAccamount" column="f_accamount"/>
         <result property="fInvamount" column="f_invamount"/>
+        <result property="price" column="f_unitprice"/>
+        <result property="fBillingDays" column="f_inventory_days"/>
+        <result property="fQty" column="f_qty"/>
+        <result property="name" column="f_name"/>
     </resultMap>
 
     <sql id="selectTFeeVo">
@@ -783,6 +787,8 @@
         w.f_inventory_days AS fInventoryDays,
         w.f_originalbilldate AS fOriginalbilldate,
         f.f_name AS fFeeName,
+        w.f_qty AS fQty,
+        w.f_unitprice AS fUnitprice,
         w.f_dc AS fSrcdc,
         CASE
         WHEN w.f_dc = 'D' THEN
@@ -815,7 +821,9 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
                 w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
             </if>
-
+            <if test="map.tWareHouseFees.fProductName != null and map.tWareHouseFees.fProductName != ''">
+                and w.f_product_name like concat('%', #{map.tWareHouseFees.fProductName}, '%')
+            </if>
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
                 and w.f_accamount_date IS NOT NULL
             </if>
@@ -1009,7 +1017,9 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
                 w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
             </if>
-
+            <if test="map.tWareHouseFees.fProductName != null and map.tWareHouseFees.fProductName != ''">
+                and w.f_product_name like concat('%', #{map.tWareHouseFees.fProductName}, '%')
+            </if>
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
                 and w.f_accamount_date IS NOT NULL
             </if>
@@ -1203,7 +1213,9 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
                 w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
             </if>
-
+            <if test="map.tWareHouseFees.fProductName != null and map.tWareHouseFees.fProductName != ''">
+                and w.f_product_name like concat('%', #{map.tWareHouseFees.fProductName}, '%')
+            </if>
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
                 and w.f_accamount_date IS NOT NULL
             </if>
@@ -1356,7 +1368,9 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
                 w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
             </if>
-
+            <if test="map.tWareHouseFees.fProductName != null and map.tWareHouseFees.fProductName != ''">
+                and w.f_product_name like concat('%', #{map.tWareHouseFees.fProductName}, '%')
+            </if>
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
                 and w.f_accamount_date IS NOT NULL
             </if>
@@ -2754,7 +2768,9 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
                 w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
             </if>
-
+            <if test="map.tWareHouseFees.fProductName != null and map.tWareHouseFees.fProductName != ''">
+                and w.f_product_name like concat('%', #{map.tWareHouseFees.fProductName}, '%')
+            </if>
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
                 and w.f_accamount_date IS NOT NULL
             </if>
@@ -2884,6 +2900,13 @@
     <select id="selectFinancialLedgerDetails" resultMap="feeVOResult">
         SELECT t.f_id AS f_srcpid, c.f_name AS f_fees_name, w.f_mblno AS f_mblno,
             w.f_product_name, w.f_marks, t.f_billtype,
+        CASE
+        WHEN t.f_billtype = 'SJRK' THEN '实际入库'
+        WHEN t.f_billtype = 'SJCK' THEN '实际出库'
+        WHEN t.f_billtype = 'JSCCF' THEN '仓储费'
+        WHEN t.f_billtype = 'KCZZ' THEN '库存总账'
+        END
+        AS fBillTypeName,
             w.f_review_date,w.f_accamount,w.f_invamount,
             IF ( w.f_feeid = #{feesId}, w.f_amount, 0.00 ) storage_fee,
             IF ( w.f_feeid != #{feesId}, w.f_amount, 0.00 ) other_fee,
@@ -2891,14 +2914,15 @@
             ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS nnfinished,
             w.f_bsdate AS fBstime,
             w.f_dc,
-            w.f_unitprice AS price,
-               w.f_qty AS fQty,
-               w.f_billing_days AS fBillingDays
+            w.f_unitprice,
+               w.f_qty,
+               w.f_inventory_days,
+               f.f_name
         FROM t_warehousebills t
             LEFT JOIN t_warehousebillsfees w ON w.f_pid = t.f_id
             LEFT JOIN sys_user u ON t.create_by = u.user_name
             LEFT JOIN sys_dept d ON t.f_bsdeptid = d.dept_id
-            LEFT JOIN t_corps c ON c.f_id = w.f_corpid
+            LEFT JOIN t_corps c ON c.f_id = t.f_corpid
             LEFT JOIN t_fees f ON w.f_feeid = f.f_id
         where
             t.del_flag = '0'

+ 5 - 5
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -956,19 +956,19 @@
         tf.f_review_date AS fReviewDate,
         te.f_name AS feeName,
         tf.f_dc AS fDc,
-        tf.f_amount AS fAmount,
+        sum(tf.f_amount) AS fAmount,
         tf.f_stlamount_no AS fStlamountNo,
         tw.f_shipper AS fShipper,
         tw.f_emblno AS fEmblno,
-        tf.f_stlamount AS fStlamount,
+        sum(tf.f_stlamount) AS fStlamount,
         tf.f_stlamount_date AS fStlamountDate,
-        tf.f_invamount AS fInvamount,
+        sum(tf.f_invamount) AS fInvamount,
         tf.f_invnos AS fInvnos,
-        tf.f_accamount AS fAccamount,
+        sum(tf.f_accamount) AS fAccamount,
         tf.f_accamount_date AS fAccamountDate,
         tf.f_statement_no AS fStatementNo,
         tf.f_feeUnitid AS fFeeUnitid,
-        tf.f_qty AS fQty,
+        sum(tf.f_qty) AS fQty,
         tf.f_unitprice AS fUnitprice,
         tf.f_billtype AS fBilltype,
         tf.f_product_name AS fProductName,