yzc пре 2 година
родитељ
комит
244f2369d5
31 измењених фајлова са 413 додато и 99 уклоњено
  1. 1 1
      hx-common/src/main/java/com/fjhx/common/utils/Assert.java
  2. 0 1
      hx-purchase/src/main/java/com/fjhx/purchase/a-json/PurchasePayRecordApi.json
  3. 3 2
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchaseController.java
  4. 1 16
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordController.java
  5. 45 0
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordDetailController.java
  6. 3 2
      hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeController.java
  7. 3 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchaseDto.java
  8. 17 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailDto.java
  9. 22 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailSelectDto.java
  10. 9 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDto.java
  11. 1 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordSelectDto.java
  12. 5 5
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecord.java
  13. 48 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecordDetail.java
  14. 22 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordDetailVo.java
  15. 1 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordVo.java
  16. 6 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseVo.java
  17. 26 0
      hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordDetailMapper.java
  18. 1 10
      hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordMapper.java
  19. 29 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordDetailService.java
  20. 1 9
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordService.java
  21. 3 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchaseService.java
  22. 56 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordDetailServiceImpl.java
  23. 2 12
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordServiceImpl.java
  24. 74 14
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java
  25. 3 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeService.java
  26. 10 4
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeServiceImpl.java
  27. 18 0
      hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordDetailMapper.xml
  28. 0 13
      hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordMapper.xml
  29. 1 1
      hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/logistics/impl/LogisticsInfosServiceImpl.java
  30. 1 1
      hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/order/impl/OrderInfoServiceImpl.java
  31. 1 2
      hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/stock/impl/StockTransferServiceImpl.java

+ 1 - 1
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/utils/Assert.java → hx-common/src/main/java/com/fjhx/common/utils/Assert.java

@@ -1,4 +1,4 @@
-package com.fjhx.victoriatourist.utils;
+package com.fjhx.common.utils;
 
 
 import cn.hutool.core.util.ObjectUtil;

+ 0 - 1
hx-purchase/src/main/java/com/fjhx/purchase/a-json/PurchasePayRecordApi.json

@@ -1 +0,0 @@
-{"openapi":"3.0.1","tags":[{"name":"采购付款记录"}],"paths":{"/purchasePayRecord/page":{"post":{"summary":"分页","tags":["采购付款记录"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["pageNum","pageSize"],"title":null,"properties":{"pageNum":{"type":"integer","required":null,"title":"页数","properties":null,"items":null},"pageSize":{"type":"integer","required":null,"title":"每页大小","properties":null,"items":null}},"items":null}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["code","success","msg","data"],"title":null,"properties":{"code":{"type":"Integer","required":null,"title":null,"properties":null,"items":null},"success":{"type":"boolean","required":null,"title":null,"properties":null,"items":null},"msg":{"type":"string","required":null,"title":null,"properties":null,"items":null},"data":{"type":"object","required":["rows","total"],"title":null,"properties":{"records":{"type":"array","required":null,"title":"分页数据","properties":null,"items":{"type":"object","required":null,"title":null,"properties":{"id":{"type":"integer","required":null,"title":"采购付款记录id","properties":null,"items":null},"purchaseId":{"type":"integer","required":null,"title":"采购id","properties":null,"items":null},"amount":{"type":"number","required":null,"title":"付款金额","properties":null,"items":null},"createTime":{"type":"string","required":null,"title":"创建时间","properties":null,"items":null},"updateTime":{"type":"string","required":null,"title":"修改时间","properties":null,"items":null}},"items":null}},"total":{"type":"integer","required":null,"title":"总条数","properties":null,"items":null}},"items":null}},"items":null}}}}}}}}}

+ 3 - 2
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchaseController.java

@@ -2,6 +2,7 @@ package com.fjhx.purchase.controller.purchase;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -99,8 +100,8 @@ public class PurchaseController {
      * 采购付款
      */
     @PostMapping("/payByWdly")
-    public void payByWdly(@RequestBody PurchaseDto purchaseDto) {
-        purchaseService.payByWdly(purchaseDto);
+    public void payByWdly(@RequestBody PurchasePayRecordDto purchasePayRecordDto) {
+        purchaseService.payByWdly(purchasePayRecordDto);
     }
 
 }

+ 1 - 16
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordController.java

@@ -1,11 +1,6 @@
 package com.fjhx.purchase.controller.purchase;
 
 import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordVo;
-import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordSelectDto;
-import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 
 /**
@@ -14,21 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired;
  * </p>
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @RestController
 @RequestMapping("/purchasePayRecord")
 public class PurchasePayRecordController {
 
-    @Autowired
-    private PurchasePayRecordService purchasePayRecordService;
-
-    /**
-     * 采购付款记录分页
-     */
-    @PostMapping("/page")
-    public Page<PurchasePayRecordVo> page(@RequestBody PurchasePayRecordSelectDto dto) {
-        return purchasePayRecordService.getPage(dto);
-    }
 
 }

+ 45 - 0
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordDetailController.java

@@ -0,0 +1,45 @@
+package com.fjhx.purchase.controller.purchase;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+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;
+
+
+/**
+ * <p>
+ * 采购付款记录 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@RestController
+@RequestMapping("/purchasePayRecord")
+public class PurchasePayRecordDetailController {
+
+    @Autowired
+    private PurchasePayRecordDetailService purchasePayRecordDetailService;
+
+    /**
+     * 采购付款记录分页
+     */
+    @PostMapping("/page")
+    public Page<PurchasePayRecordDetailVo> page(@RequestBody PurchasePayRecordDetailSelectDto dto) {
+        return purchasePayRecordDetailService.getPage(dto);
+    }
+
+    /**
+     * 采购付款记录清空
+     */
+    @PostMapping("/empty")
+    public void empty(@RequestBody PurchasePayRecordDetailSelectDto dto) {
+        purchasePayRecordDetailService.empty(dto);
+    }
+
+}

+ 3 - 2
hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeController.java

@@ -3,6 +3,7 @@ package com.fjhx.purchase.controller.subscribe;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import org.springframework.web.bind.annotation.*;
@@ -82,8 +83,8 @@ public class SubscribeController {
     }
 
     @PostMapping("/getDepts")
-    public List<SysDept> getDepts(@RequestBody SubscribeDetailDto subscribeDetailDto) {
-        return subscribeService.getDepts(subscribeDetailDto);
+    public List<SysDept> getDepts(@RequestBody SubscribeDetailSelectDto subscribeDetailSelectDto) {
+        return subscribeService.getDepts(subscribeDetailSelectDto);
     }
 
 }

+ 3 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchaseDto.java

@@ -1,10 +1,13 @@
 package com.fjhx.purchase.entity.purchase.dto;
 
 import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
 import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 采购新增编辑入参实体
@@ -47,5 +50,4 @@ public class PurchaseDto extends Purchase {
      */
     private String paidCurrency;
 
-
 }

+ 17 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录新增编辑入参实体
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailDto extends PurchasePayRecordDetail {
+
+}

+ 22 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailSelectDto.java

@@ -0,0 +1,22 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailSelectDto extends BaseSelectDto {
+
+    /**
+     * 采购id
+     */
+    private Long purchaseId;
+
+}

+ 9 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDto.java

@@ -1,17 +1,25 @@
 package com.fjhx.purchase.entity.purchase.dto;
 
 import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * 采购付款记录新增编辑入参实体
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @Getter
 @Setter
 public class PurchasePayRecordDto extends PurchasePayRecord {
 
+    /**
+     * 付款记录列表
+     */
+    private List<PurchasePayRecordDetail> purchasePayRecordList;
 }

+ 1 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordSelectDto.java

@@ -8,7 +8,7 @@ import lombok.Setter;
  * 采购付款记录列表查询入参实体
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @Getter
 @Setter

+ 5 - 5
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecord.java

@@ -13,7 +13,7 @@ import lombok.Setter;
  * </p>
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @Getter
 @Setter
@@ -21,13 +21,13 @@ import lombok.Setter;
 public class PurchasePayRecord extends BasePo {
 
     /**
-     * 采购id
+     * 付款金额
      */
-    private Long purchaseId;
+    private BigDecimal amount;
 
     /**
-     * 付款金额
+     * 付款时间
      */
-    private BigDecimal amount;
+    private Date payDate;
 
 }

+ 48 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecordDetail.java

@@ -0,0 +1,48 @@
+package com.fjhx.purchase.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * <p>
+ * 采购付款记录
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+@TableName("purchase_pay_record_detail")
+public class PurchasePayRecordDetail extends BasePo {
+
+    /**
+     * 采购id
+     */
+    @NotEmpty(message = "采购id不能为空")
+    private Long purchaseId;
+
+    /**
+     * 付款金额
+     */
+    @NotEmpty(message = "付款金额不能为空")
+    private BigDecimal amount;
+
+    /**
+     * 付款时间
+     */
+    private Date payDate;
+
+    /**
+     * 付款id 预留字段
+     */
+    private Long purchasePayRecordId;
+
+}

+ 22 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordDetailVo.java

@@ -0,0 +1,22 @@
+package com.fjhx.purchase.entity.purchase.vo;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询返回值实体
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailVo extends PurchasePayRecordDetail {
+
+    /**
+     * 付款人名称
+     */
+    private String payUserName;
+
+}

+ 1 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordVo.java

@@ -8,7 +8,7 @@ import lombok.Setter;
  * 采购付款记录列表查询返回值实体
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @Getter
 @Setter

+ 6 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseVo.java

@@ -4,6 +4,7 @@ import com.fjhx.purchase.entity.purchase.po.Purchase;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -32,4 +33,9 @@ public class PurchaseVo extends Purchase {
      * 申购编号
      */
     private String subscribeCode;
+
+    /**
+     * 已付款金额
+     */
+    private BigDecimal paidAmount;
 }

+ 26 - 0
hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordDetailMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.purchase.mapper.purchase;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 采购付款记录 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+public interface PurchasePayRecordDetailMapper extends BaseMapper<PurchasePayRecordDetail> {
+
+    /**
+     * 采购付款记录分页
+     */
+    Page<PurchasePayRecordDetailVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<PurchasePayRecordDetail> wrapper);
+
+}

+ 1 - 10
hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordMapper.java

@@ -2,10 +2,6 @@ package com.fjhx.purchase.mapper.purchase;
 
 import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordVo;
-import com.ruoyi.common.utils.wrapper.IWrapper;
-import org.apache.ibatis.annotations.Param;
 
 
 /**
@@ -14,13 +10,8 @@ import org.apache.ibatis.annotations.Param;
  * </p>
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 public interface PurchasePayRecordMapper extends BaseMapper<PurchasePayRecord> {
 
-    /**
-     * 采购付款记录分页
-     */
-    Page<PurchasePayRecordVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<PurchasePayRecord> wrapper);
-
 }

+ 29 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordDetailService.java

@@ -0,0 +1,29 @@
+package com.fjhx.purchase.service.purchase;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+public interface PurchasePayRecordDetailService extends BaseService<PurchasePayRecordDetail> {
+
+    /**
+     * 采购付款记录分页
+     */
+    Page<PurchasePayRecordDetailVo> getPage(PurchasePayRecordDetailSelectDto dto);
+
+    /**
+     * 清空付款记录
+     */
+    void empty(PurchasePayRecordDetailSelectDto dto);
+}

+ 1 - 9
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordService.java

@@ -2,9 +2,6 @@ package com.fjhx.purchase.service.purchase;
 
 import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
 import com.ruoyi.common.core.service.BaseService;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordVo;
-import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordSelectDto;
 
 
 /**
@@ -13,13 +10,8 @@ import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordSelectDto;
  * </p>
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 public interface PurchasePayRecordService extends BaseService<PurchasePayRecord> {
 
-    /**
-     * 采购付款记录分页
-     */
-    Page<PurchasePayRecordVo> getPage(PurchasePayRecordSelectDto dto);
-
 }

+ 3 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchaseService.java

@@ -2,10 +2,12 @@ package com.fjhx.purchase.service.purchase;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseDto;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseSelectDto;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
 import com.ruoyi.common.core.service.BaseService;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -66,5 +68,5 @@ public interface PurchaseService extends BaseService<Purchase> {
     /**
      * 采购付款
      */
-    void payByWdly(PurchaseDto purchaseDto);
+    void payByWdly(PurchasePayRecordDto purchaseDto);
 }

+ 56 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordDetailServiceImpl.java

@@ -0,0 +1,56 @@
+package com.fjhx.purchase.service.purchase.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.utils.Assert;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.fjhx.purchase.mapper.purchase.PurchasePayRecordDetailMapper;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.system.utils.UserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Service
+public class PurchasePayRecordDetailServiceImpl extends ServiceImpl<PurchasePayRecordDetailMapper, PurchasePayRecordDetail> implements PurchasePayRecordDetailService {
+
+    @Autowired
+    private PurchaseService purchaseService;
+
+    @Override
+    public Page<PurchasePayRecordDetailVo> getPage(PurchasePayRecordDetailSelectDto dto) {
+        IWrapper<PurchasePayRecordDetail> wrapper = getWrapper();
+        wrapper.eq(PurchasePayRecordDetail::getPurchaseId, dto.getPurchaseId());
+        wrapper.orderByDesc("ppr", PurchasePayRecordDetail::getId);
+        Page<PurchasePayRecordDetailVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        UserUtil.assignmentNickName(page.getRecords(), PurchasePayRecordDetailVo::getCreateUser, PurchasePayRecordDetailVo::setPayUserName);
+        return page;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void empty(PurchasePayRecordDetailSelectDto dto) {
+        Assert.notEmpty(dto.getPurchaseId(), "采购id不能为空");
+        //修改付款状态未未付款
+        Purchase purchase = purchaseService.getById(dto.getPurchaseId());
+        purchase.setPayStatus(0);
+        purchaseService.updateById(purchase);
+        //清空付款记录
+        this.remove(q -> q.eq(PurchasePayRecordDetail::getPurchaseId, dto.getPurchaseId()));
+    }
+
+}

+ 2 - 12
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordServiceImpl.java

@@ -5,10 +5,6 @@ import com.fjhx.purchase.mapper.purchase.PurchasePayRecordMapper;
 import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordVo;
-import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordSelectDto;
-import com.ruoyi.common.utils.wrapper.IWrapper;
 
 
 /**
@@ -17,17 +13,11 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
  * </p>
  *
  * @author 
- * @since 2023-05-23
+ * @since 2023-05-24
  */
 @Service
 public class PurchasePayRecordServiceImpl extends ServiceImpl<PurchasePayRecordMapper, PurchasePayRecord> implements PurchasePayRecordService {
 
-    @Override
-    public Page<PurchasePayRecordVo> getPage(PurchasePayRecordSelectDto dto) {
-        IWrapper<PurchasePayRecord> wrapper = getWrapper();
-        wrapper.orderByDesc("ppr", PurchasePayRecord::getId);
-        Page<PurchasePayRecordVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
-        return page;
-    }
+
 
 }

+ 74 - 14
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -16,6 +17,7 @@ import com.fjhx.common.entity.documentary.bo.DocumentaryData;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.service.product.ProductInfoService;
@@ -23,11 +25,13 @@ import com.fjhx.purchase.entity.invoice.vo.InvoiceDetailsVo;
 import com.fjhx.purchase.entity.pay.vo.PayDetailVo;
 import com.fjhx.purchase.entity.purchase.bo.PurchaseDocumentaryBo;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseDto;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseSelectDto;
 import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
 import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseDocumentaryVo;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
@@ -38,7 +42,7 @@ import com.fjhx.purchase.service.arrival.ArrivalService;
 import com.fjhx.purchase.service.invoice.InvoiceDetailsService;
 import com.fjhx.purchase.service.pay.PayDetailService;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
-import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
 import com.fjhx.purchase.service.purchase.PurchaseService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeService;
@@ -54,6 +58,7 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -110,7 +115,7 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
     @Autowired
     private CodingRuleService codingRuleService;
     @Autowired
-    private PurchasePayRecordService purchasePayRecordService;
+    private PurchasePayRecordDetailService purchasePayRecordDetailService;
 
     /**
      * 列表
@@ -198,6 +203,10 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 
         Page<PurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<PurchaseVo> list = page.getRecords();
+        if (ObjectUtils.isEmpty(list)) {
+            return page;
+        }
+
         if (CollectionUtils.isNotEmpty(list)) {
             List<Long> supplyIds = list.stream().map(PurchaseVo::getSupplyId).collect(Collectors.toList());
             List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
@@ -257,6 +266,20 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 //                }
 //            }
         }
+        //赋值已付款金额
+        List<Long> purchaseIds = list.stream().map(PurchaseVo::getId).collect(Collectors.toList());
+        Map<Long, List<PurchasePayRecordDetail>> PayRecordMap = purchasePayRecordDetailService.mapKGroup(PurchasePayRecordDetail::getPurchaseId,
+                q -> q.in(PurchasePayRecordDetail::getPurchaseId, purchaseIds));
+        for (PurchaseVo purchaseVo : list) {
+            List<PurchasePayRecordDetail> purchasePayRecords = PayRecordMap.get(purchaseVo.getId());
+            if (ObjectUtils.isEmpty(purchasePayRecords)) {
+                purchaseVo.setPaidAmount(BigDecimal.ZERO);
+            }
+            //求和已付款
+            BigDecimal paidAmount = purchasePayRecords.stream().map(PurchasePayRecordDetail::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+            purchaseVo.setPaidAmount(paidAmount);
+        }
+
         return page;
     }
 
@@ -441,7 +464,8 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
     }
 
     @Override
-    public Page<? extends DocumentaryData> getDocumentaryPage(JSONObject selectData, BaseSelectDto dto, List<Long> excludeBusinessId) {
+    public Page<? extends DocumentaryData> getDocumentaryPage(JSONObject selectData, BaseSelectDto
+            dto, List<Long> excludeBusinessId) {
         PurchaseDocumentaryBo bo = selectData.toJavaObject(PurchaseDocumentaryBo.class);
 
         IWrapper<Purchase> wrapper = IWrapper.getWrapper();
@@ -471,18 +495,54 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
      * 维多利亚 采购付款
      */
     @Override
-    public void payByWdly(PurchaseDto purchaseDto) {
-        Purchase purchase = getById(purchaseDto.getId());
-        String victoriatouristJson = purchase.getVictoriatouristJson();
-        JSONObject json = ObjectUtil.isEmpty(victoriatouristJson) ? new JSONObject() : JSONObject.parseObject(victoriatouristJson);
-        BigDecimal paidAmount = ObjectUtil.isEmpty(json.getBigDecimal("paidAmount")) ? BigDecimal.ZERO : json.getBigDecimal("paidAmount");
-        //计算已付款金额
-        BigDecimal add = paidAmount.add(purchaseDto.getPaidAmount());
-        json.put("paidAmount", add);
-        purchase.setVictoriatouristJson(json.toJSONString());
+    @Transactional(rollbackFor = Exception.class)
+    public void payByWdly(PurchasePayRecordDto purchaseDto) {
         //创建付款记录
+        long payId = IdWorker.getId();
+        List<PurchasePayRecordDetail> purchasePayRecordList = purchaseDto.getPurchasePayRecordList();
+        Assert.notEmpty(purchasePayRecordList, "付款列表为空");
+        List<Long> purchaseIds = purchasePayRecordList.stream().map(PurchasePayRecordDetail::getPurchaseId).collect(Collectors.toList());
+        ;
+
+        Map<Long, Purchase> purchaseMap = this.mapKEntity(Purchase::getId, q -> q.in(Purchase::getId, purchaseIds));
+        Map<Long, List<PurchasePayRecordDetail>> PayRecordMap = purchasePayRecordDetailService.mapKGroup(PurchasePayRecordDetail::getPurchaseId,
+                q -> q.in(PurchasePayRecordDetail::getPurchaseId, purchaseIds));
+
         PurchasePayRecord purchasePayRecord = new PurchasePayRecord();
-        purchasePayRecord.setPurchaseId(purchase.getId());
-        purchasePayRecord.setAmount(purchaseDto.getPaidAmount());
+
+
+        for (PurchasePayRecordDetail payRecord : purchasePayRecordList) {
+            //检查付款金额+已付款金额是否大于采购金额
+            Purchase purchase = purchaseMap.get(payRecord.getPurchaseId());
+            List<PurchasePayRecordDetail> oldPurchasePayRecords = PayRecordMap.get(payRecord.getPurchaseId());
+
+            //求和已付款
+            BigDecimal paidAmount = oldPurchasePayRecords.stream().map(PurchasePayRecordDetail::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal add = paidAmount.add(payRecord.getAmount());
+
+            if (purchase.getAmount().compareTo(add) < 0) {
+                throw new ServiceException("付款金额不能大于采购金额");
+            }
+            if (purchase.getAmount().compareTo(add) > 0) {
+                //部分付款
+                purchase.setPayStatus(10);
+            } else {
+                //完全付款
+                purchase.setPayStatus(20);
+            }
+
+            //赋值已付款金额
+            String victoriatouristJson = purchase.getVictoriatouristJson();
+            JSONObject json = ObjectUtil.isEmpty(victoriatouristJson) ? new JSONObject() : JSONObject.parseObject(victoriatouristJson);
+            json.put("paidAmount", add);
+            purchase.setVictoriatouristJson(json.toJSONString());
+
+            this.updateById(purchase);
+
+            //获取付款记录并赋值付款时间
+            payRecord.setPayDate(purchaseDto.getPayDate());
+            payRecord.setPurchasePayRecordId(payId);
+        }
+        purchasePayRecordDetailService.saveBatch(purchasePayRecordList);
     }
 }

+ 3 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeService.java

@@ -1,6 +1,7 @@
 package com.fjhx.purchase.service.subscribe;
 
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.service.BaseService;
@@ -55,5 +56,6 @@ public interface SubscribeService extends BaseService<Subscribe> {
      * 获取待采购所有产品的部门列表
      * @return
      */
-    List<SysDept> getDepts(SubscribeDetailDto subscribeDetailDto);
+    List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto);
+
 }

+ 10 - 4
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeServiceImpl.java

@@ -16,7 +16,7 @@ import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.item.entity.product.po.ProductInfo;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.service.product.ProductInfoService;
-import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
@@ -25,7 +25,6 @@ import com.fjhx.purchase.entity.subscribe.vo.SubscribeVo;
 import com.fjhx.purchase.mapper.subscribe.SubscribeMapper;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeService;
-import com.fjhx.purchase.util.code.CodeEnum;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.service.warehouse.WarehouseService;
 import com.obs.services.internal.ServiceException;
@@ -168,9 +167,16 @@ public class SubscribeServiceImpl extends ServiceImpl<SubscribeMapper, Subscribe
     }
 
     @Override
-    public List<SysDept> getDepts(SubscribeDetailDto subscribeDetailDto) {
+    public List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto) {
         List<Long> deptIds = new ArrayList<>();
-        List<SubscribeDetail> list = subscribeDetailService.list(q->q.eq(ObjectUtils.isNotEmpty(subscribeDetailDto.getStatus()),SubscribeDetail::getStatus,subscribeDetailDto.getStatus()));
+        List<SubscribeDetail> list;
+        String status = subscribeDetailDto.getStatus();
+        if(ObjectUtils.isEmpty(status)){
+            list = subscribeDetailService.list();
+        }else {
+            String[] split = status.split(",");
+            list = subscribeDetailService.list(q -> q.in(SubscribeDetail::getStatus, split));
+        }
         if(ObjectUtils.isEmpty(list)){
             return new ArrayList<>();
         }

+ 18 - 0
hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordDetailMapper.xml

@@ -0,0 +1,18 @@
+<?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.purchase.mapper.purchase.PurchasePayRecordDetailMapper">
+    <select id="getPage" resultType="com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo">
+        select
+            ppr.id,
+            ppr.purchase_id,
+            ppr.amount,
+            ppr.pay_date,
+            ppr.create_user,
+            ppr.create_time,
+            ppr.update_user,
+            ppr.update_time
+        from purchase_pay_record ppr
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 0 - 13
hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordMapper.xml

@@ -1,17 +1,4 @@
 <?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.purchase.mapper.purchase.PurchasePayRecordMapper">
-    <select id="getPage" resultType="com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordVo">
-        select
-            ppr.id,
-            ppr.purchase_id,
-            ppr.amount,
-            ppr.create_user,
-            ppr.create_time,
-            ppr.update_user,
-            ppr.update_time
-        from purchase_pay_record ppr
-            ${ew.customSqlSegment}
-    </select>
-
 </mapper>

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

@@ -28,7 +28,7 @@ import com.fjhx.victoriatourist.service.jd.JdBackDetailsService;
 import com.fjhx.victoriatourist.service.jd.JdBackService;
 import com.fjhx.victoriatourist.service.logistics.LogisticsDetailsService;
 import com.fjhx.victoriatourist.service.logistics.LogisticsInfosService;
-import com.fjhx.victoriatourist.utils.Assert;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.victoriatourist.utils.LogisticsConstant;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/order/impl/OrderInfoServiceImpl.java

@@ -23,7 +23,7 @@ import com.fjhx.victoriatourist.service.logistics.LogisticsDetailsService;
 import com.fjhx.victoriatourist.service.logistics.LogisticsInfosService;
 import com.fjhx.victoriatourist.service.order.OrderDetailsService;
 import com.fjhx.victoriatourist.service.order.OrderInfoService;
-import com.fjhx.victoriatourist.utils.Assert;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.victoriatourist.utils.CodeEnum;
 import com.fjhx.wms.entity.stock.dto.StockWaitDetailsDto;
 import com.fjhx.wms.entity.stock.emums.StockWaitType;

+ 1 - 2
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/stock/impl/StockTransferServiceImpl.java

@@ -18,7 +18,7 @@ import com.fjhx.victoriatourist.mapper.stock.StockTransferMapper;
 import com.fjhx.victoriatourist.service.abnormal.AbnormalInfoService;
 import com.fjhx.victoriatourist.service.stock.StockTransferDetailsService;
 import com.fjhx.victoriatourist.service.stock.StockTransferService;
-import com.fjhx.victoriatourist.utils.Assert;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.victoriatourist.utils.CodeEnum;
 import com.fjhx.wms.entity.stock.emums.JournalType;
 import com.fjhx.wms.entity.stock.po.Stock;
@@ -33,7 +33,6 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.system.utils.UserUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.*;