home преди 2 години
родител
ревизия
b7eb502c7e

+ 56 - 0
hx-common/library-supply/src/main/java/com/fjhx/controller/PaymentController.java

@@ -0,0 +1,56 @@
+package com.fjhx.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springblade.core.tool.api.R;
+import com.fjhx.entity.Payment;
+import com.fjhx.params.payment.PaymentVo;
+import com.fjhx.service.PaymentService;
+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 2022-08-26
+ */
+@RestController
+@RequestMapping("/payment")
+public class PaymentController {
+
+    @Autowired
+    private PaymentService paymentService;
+
+    @PostMapping("/page")
+    public R page(@RequestBody Map<String, String> condition){
+        Page<Payment> result = paymentService.getPage(condition);
+        return R.success(result);
+    }
+
+    @PostMapping("/add")
+    public R add(@RequestBody PaymentVo paymentVo){
+        paymentService.add(paymentVo);
+        return R.success();
+    }
+
+    @PostMapping("/edit")
+    public R edit(@RequestBody PaymentVo paymentVo){
+        paymentService.edit(paymentVo);
+        return R.success();
+    }
+
+    @PostMapping("/delete")
+    public R delete(@RequestBody PaymentVo paymentVo){
+        paymentService.delete(paymentVo);
+        return R.success();
+    }
+
+}
+

+ 56 - 0
hx-common/library-supply/src/main/java/com/fjhx/controller/PaymentDetailsController.java

@@ -0,0 +1,56 @@
+package com.fjhx.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springblade.core.tool.api.R;
+import com.fjhx.entity.PaymentDetails;
+import com.fjhx.params.payment.PaymentDetailsVo;
+import com.fjhx.service.PaymentDetailsService;
+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 2022-08-26
+ */
+@RestController
+@RequestMapping("/paymentDetails")
+public class PaymentDetailsController {
+
+    @Autowired
+    private PaymentDetailsService paymentDetailsService;
+
+    @PostMapping("/page")
+    public R page(@RequestBody Map<String, String> condition){
+        Page<PaymentDetails> result = paymentDetailsService.getPage(condition);
+        return R.success(result);
+    }
+
+    @PostMapping("/add")
+    public R add(@RequestBody PaymentDetailsVo paymentDetailsVo){
+        paymentDetailsService.add(paymentDetailsVo);
+        return R.success();
+    }
+
+    @PostMapping("/edit")
+    public R edit(@RequestBody PaymentDetailsVo paymentDetailsVo){
+        paymentDetailsService.edit(paymentDetailsVo);
+        return R.success();
+    }
+
+    @PostMapping("/delete")
+    public R delete(@RequestBody PaymentDetailsVo paymentDetailsVo){
+        paymentDetailsService.delete(paymentDetailsVo);
+        return R.success();
+    }
+
+}
+

+ 5 - 0
hx-common/library-supply/src/main/java/com/fjhx/entity/Order.java

@@ -45,6 +45,11 @@ public class Order extends BaseEntity {
     private BigDecimal arrivalPrice;
 
     /**
+     * 支付金额
+     */
+    private BigDecimal payPrice;
+
+    /**
      * 状态 1待审批 2不通过 3审批通过 4完成
      */
     private Integer status;

+ 35 - 0
hx-common/library-supply/src/main/java/com/fjhx/entity/Payment.java

@@ -0,0 +1,35 @@
+package com.fjhx.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fjhx.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Payment extends BaseEntity {
+
+
+    /**
+     * 供应商id
+     */
+    private Long supplierId;
+
+    /**
+     * 支付总金额
+     */
+    private BigDecimal price;
+
+
+}

+ 40 - 0
hx-common/library-supply/src/main/java/com/fjhx/entity/PaymentDetails.java

@@ -0,0 +1,40 @@
+package com.fjhx.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fjhx.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PaymentDetails extends BaseEntity {
+
+
+    /**
+     * 付款id
+     */
+    private Long paymentId;
+
+    /**
+     * 订单id
+     */
+    private Long orderId;
+
+    /**
+     * 支付金额
+     */
+    private BigDecimal price;
+
+
+}

+ 16 - 0
hx-common/library-supply/src/main/java/com/fjhx/mapper/PaymentDetailsMapper.java

@@ -0,0 +1,16 @@
+package com.fjhx.mapper;
+
+import com.fjhx.entity.PaymentDetails;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+public interface PaymentDetailsMapper extends BaseMapper<PaymentDetails> {
+
+}

+ 5 - 0
hx-common/library-supply/src/main/java/com/fjhx/mapper/PaymentDetailsMapper.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.PaymentDetailsMapper">
+
+</mapper>

+ 16 - 0
hx-common/library-supply/src/main/java/com/fjhx/mapper/PaymentMapper.java

@@ -0,0 +1,16 @@
+package com.fjhx.mapper;
+
+import com.fjhx.entity.Payment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+public interface PaymentMapper extends BaseMapper<Payment> {
+
+}

+ 5 - 0
hx-common/library-supply/src/main/java/com/fjhx/mapper/PaymentMapper.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.PaymentMapper">
+
+</mapper>

+ 16 - 0
hx-common/library-supply/src/main/java/com/fjhx/service/PaymentDetailsService.java

@@ -0,0 +1,16 @@
+package com.fjhx.service;
+
+import com.fjhx.base.BaseService;
+import com.fjhx.entity.PaymentDetails;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+public interface PaymentDetailsService extends BaseService<PaymentDetails> {
+
+}

+ 16 - 0
hx-common/library-supply/src/main/java/com/fjhx/service/PaymentService.java

@@ -0,0 +1,16 @@
+package com.fjhx.service;
+
+import com.fjhx.base.BaseService;
+import com.fjhx.entity.Payment;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+public interface PaymentService extends BaseService<Payment> {
+
+}

+ 2 - 0
hx-common/library-supply/src/main/java/com/fjhx/service/impl/OrderServiceImpl.java

@@ -117,6 +117,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
             Order orderTemp = new Order();
             orderTemp.setPrice(price);
+            orderTemp.setArrivalPrice(BigDecimal.ZERO);
+            orderTemp.setPayPrice(BigDecimal.ZERO);
             orderTemp.setSupplierId(supplierId);
             orderTemp.setAccountPeriod(accountPeriod);
             orderTemp.setCode(code);

+ 20 - 0
hx-common/library-supply/src/main/java/com/fjhx/service/impl/PaymentDetailsServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fjhx.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.entity.PaymentDetails;
+import com.fjhx.mapper.PaymentDetailsMapper;
+import com.fjhx.service.PaymentDetailsService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+@Service
+public class PaymentDetailsServiceImpl extends ServiceImpl<PaymentDetailsMapper, PaymentDetails> implements PaymentDetailsService {
+
+}

+ 20 - 0
hx-common/library-supply/src/main/java/com/fjhx/service/impl/PaymentServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fjhx.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.entity.Payment;
+import com.fjhx.mapper.PaymentMapper;
+import com.fjhx.service.PaymentService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-08-26
+ */
+@Service
+public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, Payment> implements PaymentService {
+
+}