Parcourir la source

已采购页面详情优化,待采购页面“采购”窗口增加字段,物流数据加流程id

yzc il y a 2 ans
Parent
commit
2a88201ce8
27 fichiers modifiés avec 424 ajouts et 12 suppressions
  1. 55 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/entity/other/OtherFee.java
  2. 10 1
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/entity/purchase/Purchase.java
  3. 13 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/apply/ApplyPurchaseVo.java
  4. 3 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/logistics/DataInfoPageVo.java
  5. 11 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/logistics/LogisticsInfoEx.java
  6. 17 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/other/OtherFeeEx.java
  7. 17 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/other/OtherFeeVo.java
  8. 4 0
      hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/purchase/PurchaseVo.java
  9. 56 0
      hx-service/victoriatourist/src/main/java/com/fjhx/controller/other/OtherFeeController.java
  10. 2 1
      hx-service/victoriatourist/src/main/java/com/fjhx/controller/purchase/PurchaseFlowController.java
  11. 7 0
      hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/StockTransferController.java
  12. 5 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/logistics/LogisticsInfoMapper.java
  13. 16 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/logistics/LogisticsInfoMapper.xml
  14. 16 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/other/OtherFeeMapper.java
  15. 5 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/other/OtherFeeMapper.xml
  16. 2 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/stock/StockTransferMapper.java
  17. 11 0
      hx-service/victoriatourist/src/main/java/com/fjhx/mapper/stock/StockTransferMapper.xml
  18. 1 1
      hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/ApplyPurchaseService.java
  19. 46 3
      hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java
  20. 16 1
      hx-service/victoriatourist/src/main/java/com/fjhx/service/logistics/impl/LogisticsInfoServiceImpl.java
  21. 28 0
      hx-service/victoriatourist/src/main/java/com/fjhx/service/other/OtherFeeService.java
  22. 48 0
      hx-service/victoriatourist/src/main/java/com/fjhx/service/other/impl/OtherFeeServiceImpl.java
  23. 2 1
      hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/PurchaseFlowService.java
  24. 23 3
      hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/impl/PurchaseFlowServiceImpl.java
  25. 2 1
      hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/impl/PurchaseServiceImpl.java
  26. 3 0
      hx-service/victoriatourist/src/main/java/com/fjhx/service/stock/StockTransferService.java
  27. 5 0
      hx-service/victoriatourist/src/main/java/com/fjhx/service/stock/impl/StockTransferServiceImpl.java

+ 55 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/entity/other/OtherFee.java

@@ -0,0 +1,55 @@
+package com.fjhx.entity.other;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.fjhx.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 其他费用
+ * </p>
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OtherFee extends BaseEntity {
+
+
+    /**
+     * 业务id
+     */
+    private Long businessId;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 金额
+     */
+    private BigDecimal price;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 逻辑删除 0未删除 1已删除
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer delFlag;
+
+
+}

+ 10 - 1
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/entity/purchase/Purchase.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.fjhx.base.BaseEntity;
 import com.fjhx.entity.apply.ApplyPurchase;
+import com.fjhx.entity.other.OtherFee;
+import com.fjhx.params.apply.ApplyPurchaseVo;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -95,7 +97,7 @@ public class Purchase extends BaseEntity {
      * 物品集合
      */
     @TableField(exist = false)
-    private List<ApplyPurchase> goodsList;
+    private List<ApplyPurchaseVo> goodsList;
 
     /**
      * 供应商名称
@@ -108,4 +110,11 @@ public class Purchase extends BaseEntity {
     /**下一节点审批人名称*/
     private String processInstanceUserName;
 
+    /**是否是合同*/
+    private Integer isAgreement;
+    /**付款方式*/
+    private Integer paymentMethod;
+    /**总金额*/
+    private Integer totalPrice;
+
 }

+ 13 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/apply/ApplyPurchaseVo.java

@@ -1,9 +1,14 @@
 package com.fjhx.params.apply;
 
 import com.fjhx.entity.apply.ApplyPurchase;
+import com.fjhx.entity.logistics.LogisticsDetails;
+import com.fjhx.params.logistics.LogisticsInfoEx;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+import java.util.List;
+
 /**
  * 申购单
  *
@@ -14,4 +19,12 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = true)
 public class ApplyPurchaseVo extends ApplyPurchase {
 
+    /**发货数量列表*/
+    List<LogisticsInfoEx> quantityList;
+
+    /**发货总数量*/
+    BigDecimal shipmentTotalQuantity;
+    /**到货总数量*/
+    BigDecimal arrivalTotalQuantity;
+
 }

+ 3 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/logistics/DataInfoPageVo.java

@@ -74,4 +74,7 @@ public class DataInfoPageVo {
     /**是否是快递100*/
     private Integer isKd100;
 
+    /**流程id*/
+    private Long flowId;
+
 }

+ 11 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/logistics/LogisticsInfoEx.java

@@ -4,6 +4,8 @@ import com.fjhx.entity.logistics.LogisticsInfo;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+
 /**
  * 物流信息
  *
@@ -17,4 +19,13 @@ public class LogisticsInfoEx extends LogisticsInfo {
     /**仓库名称*/
     private String warehouseName;
 
+    /**发货数量*/
+    private BigDecimal shipmentQuantity;
+
+    /**入库数量*/
+    private BigDecimal receiptQuantity;
+
+    /**申购id*/
+    private Long applyPurchaseId;
+
 }

+ 17 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/other/OtherFeeEx.java

@@ -0,0 +1,17 @@
+package com.fjhx.params.other;
+
+import com.fjhx.entity.other.OtherFee;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 其他费用
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OtherFeeEx extends OtherFee {
+
+}

+ 17 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/other/OtherFeeVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.params.other;
+
+import com.fjhx.entity.other.OtherFee;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 其他费用
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OtherFeeVo extends OtherFee {
+
+}

+ 4 - 0
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/params/purchase/PurchaseVo.java

@@ -2,6 +2,7 @@ package com.fjhx.params.purchase;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fjhx.entity.apply.ApplyPurchase;
+import com.fjhx.entity.other.OtherFee;
 import com.fjhx.entity.purchase.Purchase;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -17,4 +18,7 @@ import java.util.List;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class PurchaseVo extends Purchase {
+
+    /**其他费用*/
+    List<OtherFee> otherFeeList;
 }

+ 56 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/controller/other/OtherFeeController.java

@@ -0,0 +1,56 @@
+package com.fjhx.controller.other;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springblade.core.tool.api.R;
+import com.fjhx.entity.other.OtherFee;
+import com.fjhx.params.other.OtherFeeVo;
+import com.fjhx.service.other.OtherFeeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 其他费用 前端控制器
+ * </p>
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+@RestController
+@RequestMapping("/otherFee")
+public class OtherFeeController {
+
+    @Autowired
+    private OtherFeeService otherFeeService;
+
+    @PostMapping("/page")
+    public R page(@RequestBody Map<String, Object> condition){
+        Page<OtherFee> result = otherFeeService.getPage(condition);
+        return R.success(result);
+    }
+
+    @PostMapping("/add")
+    public R add(@RequestBody OtherFeeVo otherFeeVo){
+        otherFeeService.add(otherFeeVo);
+        return R.success();
+    }
+
+    @PostMapping("/edit")
+    public R edit(@RequestBody OtherFeeVo otherFeeVo){
+        otherFeeService.edit(otherFeeVo);
+        return R.success();
+    }
+
+    @PostMapping("/delete")
+    public R delete(@RequestBody OtherFeeVo otherFeeVo){
+        otherFeeService.delete(otherFeeVo);
+        return R.success();
+    }
+
+}
+

+ 2 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/controller/purchase/PurchaseFlowController.java

@@ -1,6 +1,7 @@
 package com.fjhx.controller.purchase;
 
 import com.fjhx.entity.purchase.Purchase;
+import com.fjhx.params.purchase.PurchaseVo;
 import com.fjhx.service.purchase.PurchaseFlowService;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,7 +32,7 @@ public class PurchaseFlowController {
      * @return
      */
     @PostMapping(value = "/start")
-    public R start(@RequestBody Purchase entity) {
+    public R start(@RequestBody PurchaseVo entity) {
         purchaseFlowService.start(entity);
         return R.success();
     }

+ 7 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/StockTransferController.java

@@ -56,5 +56,12 @@ public class StockTransferController {
         return R.success();
     }
 
+    /**调仓明细*/
+    @PostMapping("/detailed")
+    public R detailed(@RequestBody StockTransfer stockTransfer) {
+        StockTransfer detailed = stockTransferService.detailed(stockTransfer);
+        return R.success(detailed);
+    }
+
 }
 

+ 5 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/logistics/LogisticsInfoMapper.java

@@ -1,5 +1,6 @@
 package com.fjhx.mapper.logistics;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.entity.logistics.LogisticsInfo;
@@ -9,6 +10,8 @@ import com.fjhx.params.logistics.LogisticsInfoEx;
 import com.fjhx.utils.wrapperUtil.IWrapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 物流信息 Mapper 接口
@@ -33,4 +36,6 @@ public interface LogisticsInfoMapper extends BaseMapper<LogisticsInfo> {
     Page<JdBackPageVo> jdBackPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<Object> wrapper);
 
     Page<LogisticsInfoEx> issuePage(@Param("page") Page<Object> page, @Param("ew") IWrapper<Object> wrapper);
+
+    List<LogisticsInfoEx> getLogisticsQuantity(@Param("ew") QueryWrapper<Object> queryWrapper);
 }

+ 16 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/logistics/LogisticsInfoMapper.xml

@@ -95,5 +95,21 @@
                 JOIN logistics_company ON logistics_info.logistics_company_code = logistics_company.`code`
             ${ew.customSqlSegment}
     </select>
+    <select id="getLogisticsQuantity" resultType="com.fjhx.params.logistics.LogisticsInfoEx">
+        SELECT
+            lf.business_id,
+            lf.CODE,
+            lf.create_time,
+            lf.update_time,
+            lf.logistics_status,
+            ld.shipment_quantity,
+            ld.receipt_quantity,
+            ap.id applyPurchaseId
+        FROM
+            logistics_info lf
+                JOIN logistics_details ld ON ld.logistics_info_id = lf.id
+                JOIN apply_purchase ap on ld.apply_purchase_id = ap.id
+            ${ew.customSqlSegment}
+    </select>
 
 </mapper>

+ 16 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/other/OtherFeeMapper.java

@@ -0,0 +1,16 @@
+package com.fjhx.mapper.other;
+
+import com.fjhx.entity.other.OtherFee;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 其他费用 Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+public interface OtherFeeMapper extends BaseMapper<OtherFee> {
+
+}

+ 5 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/other/OtherFeeMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.mapper.other.OtherFeeMapper">
+
+</mapper>

+ 2 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/stock/StockTransferMapper.java

@@ -3,6 +3,7 @@ package com.fjhx.mapper.stock;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.entity.stock.StockTransfer;
+import com.fjhx.params.stock.StockTransferEx;
 import com.fjhx.utils.wrapperUtil.IWrapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,4 +21,5 @@ public interface StockTransferMapper extends BaseMapper<StockTransfer> {
 
     Page<Map<String, Object>> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<Object> wrapper);
 
+    StockTransferEx detailed(Long id);
 }

+ 11 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/stock/StockTransferMapper.xml

@@ -23,5 +23,16 @@
                  left join warehouse ow on ow.id = st.out_warehouse_id
             ${ew.customSqlSegment}
     </select>
+    <select id="detailed" resultType="com.fjhx.params.stock.StockTransferEx">
+        SELECT
+            st.*,
+            w.`name` inWarehouseName,
+            w1.`name` outWarehouseName
+        FROM
+            `stock_transfer` st
+                JOIN warehouse w ON st.in_warehouse_id = w.id
+                JOIN warehouse w1 ON st.out_warehouse_id = w1.id
+        where st.id = #{id}
+    </select>
 
 </mapper>

+ 1 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/ApplyPurchaseService.java

@@ -40,5 +40,5 @@ public interface ApplyPurchaseService extends BaseService<ApplyPurchase> {
      * @param purchaseId 采购ID
      * @return
      */
-    List<ApplyPurchase> getByPurchaseId(Long purchaseId);
+    List<ApplyPurchaseVo> getByPurchaseId(Long purchaseId);
 }

+ 46 - 3
hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java

@@ -1,17 +1,25 @@
 package com.fjhx.service.apply.impl;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.constants.StockJournalTypeConstant;
 import com.fjhx.entity.apply.ApplyPurchase;
+import com.fjhx.entity.logistics.LogisticsDetails;
+import com.fjhx.entity.logistics.LogisticsInfo;
 import com.fjhx.entity.product.ProductInfo;
 import com.fjhx.entity.stock.Stock;
 import com.fjhx.entity.stock.StockJournal;
 import com.fjhx.entity.warehouse.Warehouse;
 import com.fjhx.enums.apply.ApplyPurchaseStatusEnum;
 import com.fjhx.mapper.apply.ApplyPurchaseMapper;
+import com.fjhx.mapper.logistics.LogisticsInfoMapper;
 import com.fjhx.params.apply.ApplyPurchaseVo;
+import com.fjhx.params.logistics.LogisticsInfoEx;
 import com.fjhx.service.apply.ApplyPurchaseService;
+import com.fjhx.service.logistics.LogisticsDetailsService;
+import com.fjhx.service.logistics.LogisticsInfoService;
 import com.fjhx.service.product.ProductInfoService;
 import com.fjhx.service.stock.StockJournalService;
 import com.fjhx.service.stock.StockService;
@@ -21,8 +29,10 @@ import com.fjhx.utils.wrapperUtil.IWrapper;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.redis.lock.RedisLockClient;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -56,6 +66,12 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
     @Autowired
     private StockJournalService stockJournalService;
 
+    @Autowired
+    LogisticsDetailsService logisticsDetailsService;
+
+    @Autowired
+    LogisticsInfoMapper logisticsInfoMapper;
+
     private final String REDIS_LOCK_CACHE_KEY = "seq:lock:" + AuthUtil.getTenantId() + ":apply_purchase:";
 
     @Override
@@ -234,9 +250,13 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
      * @return
      */
     @Override
-    public List<ApplyPurchase> getByPurchaseId(Long purchaseId) {
+    public List<ApplyPurchaseVo> getByPurchaseId(Long purchaseId) {
+
+        List<ApplyPurchase> purchases0 = lambdaQuery().eq(ApplyPurchase::getPurchaseId, purchaseId).list();
+        //去重
+        purchases0 = purchases0.stream().distinct().collect(Collectors.toList());
+        List<ApplyPurchaseVo> purchases = BeanUtil.copy(purchases0, ApplyPurchaseVo.class);
 
-        List<ApplyPurchase> purchases = lambdaQuery().eq(ApplyPurchase::getPurchaseId, purchaseId).list();
         if (Func.isNotEmpty(purchases)) {
             //物品ID集合
             List<Long> goodsIds = purchases.stream().map(ApplyPurchase::getGoodsId).distinct().collect(Collectors.toList());
@@ -252,7 +272,15 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
             //物品出库信息map
             Map<Long, BigDecimal> outStockMap = getOutStockMap(goodsIds);
 
-            for (ApplyPurchase record : purchases) {
+            //获取物流明细
+            List<Long> purchaseIds = purchases.stream().map(ApplyPurchase::getPurchaseId).collect(Collectors.toList());
+            QueryWrapper<Object> wrapper = new QueryWrapper<>();
+            wrapper.in("ld.purchase_id", purchaseIds);
+            List<LogisticsInfoEx> logisticsInfoExes = logisticsInfoMapper.getLogisticsQuantity(wrapper);
+            Map<Long, List<LogisticsInfoEx>> map1 = logisticsInfoExes.stream()
+                    .collect(Collectors.groupingBy(LogisticsInfoEx::getApplyPurchaseId));
+
+            for (ApplyPurchaseVo record : purchases) {
                 if (Func.isNotEmpty(productInfoMap) && Func.isNotEmpty(productInfoMap.get(record.getGoodsId()))) {
                     ProductInfo info = productInfoMap.get(record.getGoodsId());
                     record.setGoodsType(info.getType());
@@ -263,6 +291,21 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
                 if (Func.isNotEmpty(outStockMap) && Func.isNotEmpty(outStockMap.get(record.getGoodsId()))) {
                     record.setOutStockQuantity(outStockMap.get(record.getGoodsId()));
                 }
+                //赋值发货,到货数量
+                List<LogisticsInfoEx> shipmentQuantityList = map1.get(record.getId());
+                if(ObjectUtil.isNotEmpty(shipmentQuantityList)) {
+                    BigDecimal shipmentTotalQuantity = shipmentQuantityList.stream().map(LogisticsInfoEx::getShipmentQuantity)
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                    BigDecimal receiptQuantity = shipmentQuantityList.stream().map(LogisticsInfoEx::getReceiptQuantity)
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                    record.setQuantityList(shipmentQuantityList);
+                    record.setShipmentTotalQuantity(shipmentTotalQuantity);
+                    record.setArrivalTotalQuantity(receiptQuantity);
+                }else{
+                    record.setQuantityList(new ArrayList<>());
+                    record.setShipmentTotalQuantity(BigDecimal.ZERO);
+                    record.setReceiptQuantity(BigDecimal.ZERO);
+                }
             }
         }
         return purchases;

+ 16 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/logistics/impl/LogisticsInfoServiceImpl.java

@@ -57,6 +57,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * <p>
@@ -441,7 +442,21 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
                 wrapper.ne("sc.logistics_status", "15");
             }
         }
-        return baseMapper.dataInfoPage(dto.getPage(), wrapper);
+        Page<DataInfoPageVo> dataInfoPageVoPage = baseMapper.dataInfoPage(dto.getPage(), wrapper);
+        List<DataInfoPageVo> records = dataInfoPageVoPage.getRecords();
+        //过滤出采购数据赋值流程id
+        List<DataInfoPageVo> collect = records.stream().filter(item -> 1 == item.getBusinessType()).collect(Collectors.toList());
+        List<Long> ids = collect.stream().map(DataInfoPageVo::getBusinessId).collect(Collectors.toList());
+        List<Purchase> purchases = purchaseService.listByIds(ids);
+        Map<Long, Purchase> collect1 = purchases.stream().collect(Collectors.groupingBy(Purchase::getId,
+                Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))));
+        for (DataInfoPageVo dataInfoPageVo:collect){
+            Purchase purchase = collect1.get(dataInfoPageVo.getBusinessId());
+            if(ObjectUtil.isNotEmpty(purchase)) {
+                dataInfoPageVo.setFlowId(purchase.getFlowId());
+            }
+        }
+        return dataInfoPageVoPage;
     }
 
     @Override

+ 28 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/service/other/OtherFeeService.java

@@ -0,0 +1,28 @@
+package com.fjhx.service.other;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.entity.other.OtherFee;
+import com.fjhx.params.other.OtherFeeVo;
+import com.fjhx.base.BaseService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 其他费用 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+public interface OtherFeeService extends BaseService<OtherFee> {
+
+    Page<OtherFee> getPage(Map<String, Object> condition);
+
+    void add(OtherFeeVo otherFeeVo);
+
+    void edit(OtherFeeVo otherFeeVo);
+
+    void delete(OtherFeeVo otherFeeVo);
+
+}

+ 48 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/service/other/impl/OtherFeeServiceImpl.java

@@ -0,0 +1,48 @@
+package com.fjhx.service.other.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.entity.other.OtherFee;
+import com.fjhx.params.other.OtherFeeVo;
+import com.fjhx.mapper.other.OtherFeeMapper;
+import com.fjhx.service.other.OtherFeeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.utils.wrapperUtil.IWrapper;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 其他费用 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2023-03-24
+ */
+@Service
+public class OtherFeeServiceImpl extends ServiceImpl<OtherFeeMapper, OtherFee> implements OtherFeeService {
+
+    @Override
+    public Page<OtherFee> getPage(Map<String, Object> condition) {
+
+        IWrapper<OtherFee> wrapper = IWrapper.getWrapper(condition);
+
+        return page(condition, wrapper);
+    }
+
+    @Override
+    public void add(OtherFeeVo otherFeeVo) {
+        save(otherFeeVo);
+    }
+
+    @Override
+    public void edit(OtherFeeVo otherFeeVo) {
+        updateById(otherFeeVo);
+    }
+
+    @Override
+    public void delete(OtherFeeVo otherFeeVo) {
+        removeById(otherFeeVo.getId());
+    }
+
+}

+ 2 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/PurchaseFlowService.java

@@ -1,6 +1,7 @@
 package com.fjhx.service.purchase;
 
 import com.fjhx.entity.purchase.Purchase;
+import com.fjhx.params.purchase.PurchaseVo;
 
 /**
  * <p>
@@ -18,7 +19,7 @@ public interface PurchaseFlowService {
      * @param entity
      * @return
      */
-    void start(Purchase entity);
+    void start(PurchaseVo entity);
 
     /**
      * 审批

+ 23 - 3
hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/impl/PurchaseFlowServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.fjhx.entity.apply.ApplyPurchase;
 import com.fjhx.entity.example.ExampleInfo;
+import com.fjhx.entity.other.OtherFee;
 import com.fjhx.entity.purchase.Purchase;
 import com.fjhx.enums.ProcessNodeHandleObjectTypeEnum;
 import com.fjhx.enums.apply.ApplyPurchaseStatusEnum;
@@ -11,7 +12,10 @@ import com.fjhx.enums.flow.FlowCodeEnum;
 import com.fjhx.enums.purchase.PurchaseStatusEnum;
 import com.fjhx.feign.IFlowClient;
 import com.fjhx.params.ExampleResult;
+import com.fjhx.params.apply.ApplyPurchaseVo;
+import com.fjhx.params.purchase.PurchaseVo;
 import com.fjhx.service.apply.ApplyPurchaseService;
+import com.fjhx.service.other.OtherFeeService;
 import com.fjhx.service.purchase.PurchaseFlowService;
 import com.fjhx.service.purchase.PurchaseService;
 import com.fjhx.uitl.code.CodeEnum;
@@ -22,7 +26,9 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.redis.lock.RedisLockClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.system.user.entity.User;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -55,6 +61,9 @@ public class PurchaseFlowServiceImpl implements PurchaseFlowService {
     @Autowired
     private IFlowClient iFlowClient;
 
+    @Autowired
+    private OtherFeeService otherFeeService;
+
     private final String REDIS_LOCK_CACHE_KEY = "seq:lock:" + AuthUtil.getTenantId() + ":purchase:";
 
     /**
@@ -133,8 +142,8 @@ public class PurchaseFlowServiceImpl implements PurchaseFlowService {
      */
     @Transactional(rollbackFor = {Exception.class})
     @Override
-    public void start(Purchase purchase) {
-        List<ApplyPurchase> goodsList = purchase.getGoodsList();
+    public void start(PurchaseVo purchase) {
+        List<ApplyPurchaseVo> goodsList = purchase.getGoodsList();
         Assert.notEmpty(goodsList, "采购物品不能为空");
 
         Long supplierId = purchase.getSupplierId();
@@ -173,6 +182,8 @@ public class PurchaseFlowServiceImpl implements PurchaseFlowService {
             }
             purchase.setPrice(price);
 
+            List<ApplyPurchase> copy = BeanUtil.copy(goodsList, ApplyPurchase.class);
+            applyPurchaseService.saveOrUpdateBatch(copy);
 
             // 流程标题
             String title = AuthUtil.getUserName() + " 在" + LocalDate.now() + "日发起了 采购审批流程(单号:" + purchase.getCode() + ")";
@@ -203,7 +214,16 @@ public class PurchaseFlowServiceImpl implements PurchaseFlowService {
             }
 
             purchaseService.saveOrUpdate(purchase);
-            applyPurchaseService.saveOrUpdateBatch(goodsList);
+
+            //其他费用
+            List<OtherFee> otherFeeList = purchase.getOtherFeeList();
+            if(ObjectUtil.isNotEmpty(otherFeeList)) {
+                for (OtherFee otherFee : otherFeeList) {
+                    //赋值采购id
+                    otherFee.setBusinessId(purchase.getId());
+                }
+                otherFeeService.saveBatch(otherFeeList);
+            }
 
             return true;
         })) {

+ 2 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/purchase/impl/PurchaseServiceImpl.java

@@ -11,6 +11,7 @@ import com.fjhx.entity.supplier.Supplier;
 import com.fjhx.enums.apply.ApplyPurchaseStatusEnum;
 import com.fjhx.enums.purchase.PurchaseStatusEnum;
 import com.fjhx.mapper.purchase.PurchaseMapper;
+import com.fjhx.params.apply.ApplyPurchaseVo;
 import com.fjhx.service.apply.ApplyPurchaseService;
 import com.fjhx.service.logistics.LogisticsInfoService;
 import com.fjhx.service.purchase.PurchaseService;
@@ -130,7 +131,7 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase> i
         }
 
         //获取物品详情
-        List<ApplyPurchase> applyPurchases = applyPurchaseService.getByPurchaseId(id);
+        List<ApplyPurchaseVo> applyPurchases = applyPurchaseService.getByPurchaseId(id);
         purchase.setGoodsList(applyPurchases);
         return purchase;
     }

+ 3 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/service/stock/StockTransferService.java

@@ -30,4 +30,7 @@ public interface StockTransferService extends BaseService<StockTransfer> {
      */
     void receive(StockTransfer stockTransfer);
 
+    /**调仓明细*/
+    StockTransfer detailed(StockTransfer stockTransfer);
+
 }

+ 5 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/service/stock/impl/StockTransferServiceImpl.java

@@ -159,4 +159,9 @@ public class StockTransferServiceImpl extends ServiceImpl<StockTransferMapper, S
         stockService.changeQuantity(stockChangeDto);
     }
 
+    @Override
+    public StockTransfer detailed(StockTransfer stockTransfer){
+        return baseMapper.detailed(stockTransfer.getId());
+    }
+
 }