Ver código fonte

采购模块

yingp 7 anos atrás
pai
commit
11999be699
24 arquivos alterados com 1191 adições e 50 exclusões
  1. 15 0
      applications/common-dto/pom.xml
  2. 48 0
      applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocBaseDTO.java
  3. 38 0
      applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocSavedDTO.java
  4. 67 0
      applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/ProductBaseDTO.java
  5. 1 0
      applications/pom.xml
  6. 6 0
      applications/purchase/purchase-dto/pom.xml
  7. 159 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java
  8. 39 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseFormDTO.java
  9. 208 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseItemDTO.java
  10. 185 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java
  11. 65 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseReqDTO.java
  12. 5 2
      applications/purchase/purchase-server/pom.xml
  13. 73 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  14. 21 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseItemMapper.java
  15. 5 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Purchase.java
  16. 48 36
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseItem.java
  17. 44 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseItemMapper.xml
  18. 4 4
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  19. 36 0
      applications/ui/pom.xml
  20. 19 0
      applications/ui/src/main/java/com/usoftchina/saas/ui/UiApplication.java
  21. 56 0
      framework/core/src/main/java/com/usoftchina/saas/base/dto/CommonBaseDTO.java
  22. 34 0
      framework/core/src/main/java/com/usoftchina/saas/page/PageRequest.java
  23. 5 0
      pom.xml
  24. 10 0
      script/mysql/init/ui.sql

+ 15 - 0
applications/common-dto/pom.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>applications</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>common-dto</artifactId>
+    <description>common data transfer object</description>
+
+</project>

+ 48 - 0
applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocBaseDTO.java

@@ -0,0 +1,48 @@
+package com.usoftchina.saas.common.dto;
+
+import java.io.Serializable;
+
+/**
+ * 单据基础属性
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class DocBaseDTO implements Serializable{
+    private Long id;
+    private String code;
+    private String name;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return "DocBaseDTO{" +
+                "id=" + id +
+                ", code='" + code + '\'' +
+                ", name='" + name + '\'' +
+                '}';
+    }
+}

+ 38 - 0
applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/DocSavedDTO.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.common.dto;
+
+import java.io.Serializable;
+
+/**
+ * 单据保存后数据
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class DocSavedDTO implements Serializable{
+    private Long id;
+    private String code;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return "DocSavedDTO{" +
+                "id=" + id +
+                ", code='" + code + '\'' +
+                '}';
+    }
+}

+ 67 - 0
applications/common-dto/src/main/java/com/usoftchina/saas/common/dto/ProductBaseDTO.java

@@ -0,0 +1,67 @@
+package com.usoftchina.saas.common.dto;
+
+import java.io.Serializable;
+
+/**
+ * 物料基本属性
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class ProductBaseDTO implements Serializable {
+    private Long id;
+    /**
+     * 料号
+     */
+    private String code;
+    /**
+     * 描述
+     */
+    private String description;
+    /**
+     * 单位
+     */
+    private String unit;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    @Override
+    public String toString() {
+        return "ProductBaseDTO{" +
+                "id=" + id +
+                ", code='" + code + '\'' +
+                ", description='" + description + '\'' +
+                ", unit='" + unit + '\'' +
+                '}';
+    }
+}

+ 1 - 0
applications/pom.xml

@@ -20,6 +20,7 @@
         <module>money</module>
         <module>document</module>
         <module>ui</module>
+        <module>common-dto</module>
     </modules>
 
 

+ 6 - 0
applications/purchase/purchase-dto/pom.xml

@@ -12,4 +12,10 @@
     <artifactId>purchase-dto</artifactId>
     <description>purchase data transfer object</description>
 
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>common-dto</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 159 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java

@@ -0,0 +1,159 @@
+package com.usoftchina.saas.purchase.dto;
+
+import com.usoftchina.saas.common.dto.DocBaseDTO;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PurchaseDTO implements Serializable{
+    private Long id;
+    /**
+     * 编号
+     */
+    private String code;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 供应商
+     */
+    private DocBaseDTO contact;
+    /**
+     * 交货日期
+     */
+    private Date deliveryDate;
+    /**
+     * 单据日期
+     */
+    private Date docDate;
+    /**
+     * 自定义字段1
+     */
+    private String userDefined1;
+    /**
+     * 自定义字段2
+     */
+    private String userDefined2;
+    /**
+     * 自定义字段3
+     */
+    private String userDefined3;
+    /**
+     * 自定义字段4
+     */
+    private String userDefined4;
+    /**
+     * 自定义字段5
+     */
+    private String userDefined5;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public DocBaseDTO getContact() {
+        return contact;
+    }
+
+    public void setContact(DocBaseDTO contact) {
+        this.contact = contact;
+    }
+
+    public Date getDeliveryDate() {
+        return deliveryDate;
+    }
+
+    public void setDeliveryDate(Date deliveryDate) {
+        this.deliveryDate = deliveryDate;
+    }
+
+    public Date getDocDate() {
+        return docDate;
+    }
+
+    public void setDocDate(Date docDate) {
+        this.docDate = docDate;
+    }
+
+    public String getUserDefined1() {
+        return userDefined1;
+    }
+
+    public void setUserDefined1(String userDefined1) {
+        this.userDefined1 = userDefined1;
+    }
+
+    public String getUserDefined2() {
+        return userDefined2;
+    }
+
+    public void setUserDefined2(String userDefined2) {
+        this.userDefined2 = userDefined2;
+    }
+
+    public String getUserDefined3() {
+        return userDefined3;
+    }
+
+    public void setUserDefined3(String userDefined3) {
+        this.userDefined3 = userDefined3;
+    }
+
+    public String getUserDefined4() {
+        return userDefined4;
+    }
+
+    public void setUserDefined4(String userDefined4) {
+        this.userDefined4 = userDefined4;
+    }
+
+    public String getUserDefined5() {
+        return userDefined5;
+    }
+
+    public void setUserDefined5(String userDefined5) {
+        this.userDefined5 = userDefined5;
+    }
+
+    @Override
+    public String toString() {
+        return "PurchaseDTO{" +
+                "id=" + id +
+                ", code='" + code + '\'' +
+                ", status='" + status + '\'' +
+                ", contact=" + contact +
+                ", deliveryDate=" + deliveryDate +
+                ", docDate=" + docDate +
+                ", userDefined1='" + userDefined1 + '\'' +
+                ", userDefined2='" + userDefined2 + '\'' +
+                ", userDefined3='" + userDefined3 + '\'' +
+                ", userDefined4='" + userDefined4 + '\'' +
+                ", userDefined5='" + userDefined5 + '\'' +
+                '}';
+    }
+}

+ 39 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseFormDTO.java

@@ -0,0 +1,39 @@
+package com.usoftchina.saas.purchase.dto;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 采购订单表单数据
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PurchaseFormDTO implements Serializable{
+    private PurchaseDTO main;
+    private List<PurchaseItemDTO> items;
+
+    public PurchaseDTO getMain() {
+        return main;
+    }
+
+    public void setMain(PurchaseDTO main) {
+        this.main = main;
+    }
+
+    public List<PurchaseItemDTO> getItems() {
+        return items;
+    }
+
+    public void setItems(List<PurchaseItemDTO> items) {
+        this.items = items;
+    }
+
+    @Override
+    public String toString() {
+        return "PurchaseFormDTO{" +
+                "main=" + main +
+                ", items=" + items +
+                '}';
+    }
+}

+ 208 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseItemDTO.java

@@ -0,0 +1,208 @@
+package com.usoftchina.saas.purchase.dto;
+
+import com.usoftchina.saas.common.dto.DocBaseDTO;
+import com.usoftchina.saas.common.dto.ProductBaseDTO;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PurchaseItemDTO implements Serializable{
+    private Long id;
+    private Long mainId;
+    /**
+     * 商品
+     */
+    private ProductBaseDTO product;
+    /**
+     * 仓库
+     */
+    private DocBaseDTO warehouse;
+    /**
+     * 数量
+     */
+    private Double qty;
+    /**
+     * 单价
+     */
+    private Double price;
+    /**
+     * 含税单价
+     */
+    private Double taxPrice;
+    /**
+     * 税率
+     */
+    private Float taxRate;
+    /**
+     * 税额
+     */
+    private Double taxAmount;
+    /**
+     * 折扣率
+     */
+    private Float disRate;
+    /**
+     * 折扣额
+     */
+    private Double disAmount;
+    /**
+     * 金额
+     */
+    private Double amount;
+    /**
+     * 价税合计
+     */
+    private Double totalTaxAmount;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 关联订单
+     */
+    private DocBaseDTO srcOrder;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getMainId() {
+        return mainId;
+    }
+
+    public void setMainId(Long mainId) {
+        this.mainId = mainId;
+    }
+
+    public ProductBaseDTO getProduct() {
+        return product;
+    }
+
+    public void setProduct(ProductBaseDTO product) {
+        this.product = product;
+    }
+
+    public DocBaseDTO getWarehouse() {
+        return warehouse;
+    }
+
+    public void setWarehouse(DocBaseDTO warehouse) {
+        this.warehouse = warehouse;
+    }
+
+    public Double getQty() {
+        return qty;
+    }
+
+    public void setQty(Double qty) {
+        this.qty = qty;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Double getTaxPrice() {
+        return taxPrice;
+    }
+
+    public void setTaxPrice(Double taxPrice) {
+        this.taxPrice = taxPrice;
+    }
+
+    public Float getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(Float taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public Double getTaxAmount() {
+        return taxAmount;
+    }
+
+    public void setTaxAmount(Double taxAmount) {
+        this.taxAmount = taxAmount;
+    }
+
+    public Float getDisRate() {
+        return disRate;
+    }
+
+    public void setDisRate(Float disRate) {
+        this.disRate = disRate;
+    }
+
+    public Double getDisAmount() {
+        return disAmount;
+    }
+
+    public void setDisAmount(Double disAmount) {
+        this.disAmount = disAmount;
+    }
+
+    public Double getAmount() {
+        return amount;
+    }
+
+    public void setAmount(Double amount) {
+        this.amount = amount;
+    }
+
+    public Double getTotalTaxAmount() {
+        return totalTaxAmount;
+    }
+
+    public void setTotalTaxAmount(Double totalTaxAmount) {
+        this.totalTaxAmount = totalTaxAmount;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public DocBaseDTO getSrcOrder() {
+        return srcOrder;
+    }
+
+    public void setSrcOrder(DocBaseDTO srcOrder) {
+        this.srcOrder = srcOrder;
+    }
+
+    @Override
+    public String toString() {
+        return "PurchaseItemDTO{" +
+                "id=" + id +
+                ", mainId=" + mainId +
+                ", product=" + product +
+                ", warehouse=" + warehouse +
+                ", qty=" + qty +
+                ", price=" + price +
+                ", taxPrice=" + taxPrice +
+                ", taxRate=" + taxRate +
+                ", taxAmount=" + taxAmount +
+                ", disRate=" + disRate +
+                ", disAmount=" + disAmount +
+                ", amount=" + amount +
+                ", totalTaxAmount=" + totalTaxAmount +
+                ", remark='" + remark + '\'' +
+                ", srcOrder=" + srcOrder +
+                '}';
+    }
+}

+ 185 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java

@@ -0,0 +1,185 @@
+package com.usoftchina.saas.purchase.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 采购订单列表数据
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PurchaseListDTO implements Serializable {
+    private Long id;
+    /**
+     * 编号
+     */
+    private String code;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 供应商
+     */
+    private String contactName;
+    /**
+     * 交货日期
+     */
+    private Date deliveryDate;
+    /**
+     * 单据日期
+     */
+    private Date docDate;
+    /**
+     * 打印状态
+     */
+    private String printStatus;
+    /**
+     * 打印次数
+     */
+    private Integer printTimes;
+    /**
+     * 自定义字段1
+     */
+    private String userDefined1;
+    /**
+     * 自定义字段2
+     */
+    private String userDefined2;
+    /**
+     * 自定义字段3
+     */
+    private String userDefined3;
+    /**
+     * 自定义字段4
+     */
+    private String userDefined4;
+    /**
+     * 自定义字段5
+     */
+    private String userDefined5;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getContactName() {
+        return contactName;
+    }
+
+    public void setContactName(String contactName) {
+        this.contactName = contactName;
+    }
+
+    public Date getDeliveryDate() {
+        return deliveryDate;
+    }
+
+    public void setDeliveryDate(Date deliveryDate) {
+        this.deliveryDate = deliveryDate;
+    }
+
+    public Date getDocDate() {
+        return docDate;
+    }
+
+    public void setDocDate(Date docDate) {
+        this.docDate = docDate;
+    }
+
+    public String getPrintStatus() {
+        return printStatus;
+    }
+
+    public void setPrintStatus(String printStatus) {
+        this.printStatus = printStatus;
+    }
+
+    public Integer getPrintTimes() {
+        return printTimes;
+    }
+
+    public void setPrintTimes(Integer printTimes) {
+        this.printTimes = printTimes;
+    }
+
+    public String getUserDefined1() {
+        return userDefined1;
+    }
+
+    public void setUserDefined1(String userDefined1) {
+        this.userDefined1 = userDefined1;
+    }
+
+    public String getUserDefined2() {
+        return userDefined2;
+    }
+
+    public void setUserDefined2(String userDefined2) {
+        this.userDefined2 = userDefined2;
+    }
+
+    public String getUserDefined3() {
+        return userDefined3;
+    }
+
+    public void setUserDefined3(String userDefined3) {
+        this.userDefined3 = userDefined3;
+    }
+
+    public String getUserDefined4() {
+        return userDefined4;
+    }
+
+    public void setUserDefined4(String userDefined4) {
+        this.userDefined4 = userDefined4;
+    }
+
+    public String getUserDefined5() {
+        return userDefined5;
+    }
+
+    public void setUserDefined5(String userDefined5) {
+        this.userDefined5 = userDefined5;
+    }
+
+    @Override
+    public String toString() {
+        return "PurchaseListDTO{" +
+                "id=" + id +
+                ", code='" + code + '\'' +
+                ", status='" + status + '\'' +
+                ", contactName='" + contactName + '\'' +
+                ", deliveryDate=" + deliveryDate +
+                ", docDate=" + docDate +
+                ", printStatus='" + printStatus + '\'' +
+                ", printTimes=" + printTimes +
+                ", userDefined1='" + userDefined1 + '\'' +
+                ", userDefined2='" + userDefined2 + '\'' +
+                ", userDefined3='" + userDefined3 + '\'' +
+                ", userDefined4='" + userDefined4 + '\'' +
+                ", userDefined5='" + userDefined5 + '\'' +
+                '}';
+    }
+}

+ 65 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseReqDTO.java

@@ -0,0 +1,65 @@
+package com.usoftchina.saas.purchase.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 采购查询条件
+ *
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PurchaseReqDTO implements Serializable{
+    /**
+     * 开始日期
+     */
+    private Date begin;
+    /**
+     * 截止日期
+     */
+    private Date end;
+    private String status;
+    private String keyword;
+
+    public Date getBegin() {
+        return begin;
+    }
+
+    public void setBegin(Date begin) {
+        this.begin = begin;
+    }
+
+    public Date getEnd() {
+        return end;
+    }
+
+    public void setEnd(Date end) {
+        this.end = end;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    @Override
+    public String toString() {
+        return "PurchaseReqDTO{" +
+                "begin=" + begin +
+                ", end=" + end +
+                ", status='" + status + '\'' +
+                ", keyword='" + keyword + '\'' +
+                '}';
+    }
+}

+ 5 - 2
applications/purchase/purchase-server/pom.xml

@@ -51,7 +51,10 @@
             <groupId>org.springframework.amqp</groupId>
             <artifactId>spring-rabbit</artifactId>
         </dependency>
-    </dependencies>
-
 
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 73 - 3
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -1,20 +1,90 @@
 package com.usoftchina.saas.purchase.controller;
 
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.common.dto.DocSavedDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
+import com.usoftchina.saas.purchase.dto.PurchaseListDTO;
+import com.usoftchina.saas.purchase.dto.PurchaseReqDTO;
 import com.usoftchina.saas.purchase.service.PurchaseService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author yingp
  * @date 2018/10/9
  */
 @RestController
-@RequestMapping("/api/purchase")
+@RequestMapping("/api/purchase/purchase")
 public class PurchaseController {
 
     @Autowired
     private PurchaseService purchaseService;
 
+    /**
+     * 采购订单列表
+     *
+     * @param page
+     * @param req
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<PageInfo<PurchaseListDTO>> getListData(PageRequest page, PurchaseReqDTO req) {
+        return Result.success();
+    }
 
+    /**
+     * 采购订单表单
+     *
+     * @return
+     */
+    @GetMapping("/form")
+    public Result<PurchaseFormDTO> getFormData(@RequestParam int id) {
+        return Result.success();
+    }
+
+    /**
+     * 采购订单表单保存
+     *
+     * @param formData
+     * @return
+     */
+    @PostMapping("/form")
+    public Result<DocSavedDTO> saveFormData(@RequestBody PurchaseFormDTO formData) {
+        return Result.success();
+    }
+
+    /**
+     * 采购订单删除
+     *
+     * @param id
+     * @return
+     */
+    @DeleteMapping
+    public Result delete(@RequestParam int id) {
+        return Result.success();
+    }
+
+    /**
+     * 采购订单明细删除
+     *
+     * @param id
+     * @return
+     */
+    @DeleteMapping("/item")
+    public Result deleteItem(@RequestParam int id) {
+        return Result.success();
+    }
+
+    /**
+     * 采购订单审批
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/audit")
+    public Result audit(@RequestParam int id) {
+        return Result.success();
+    }
 }

+ 21 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseItemMapper.java

@@ -0,0 +1,21 @@
+package com.usoftchina.saas.purchase.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.purchase.po.PurchaseItem;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+public interface PurchaseItemMapper extends CommonBaseMapper<PurchaseItem> {
+    /**
+     * 按采购ID查询
+     *
+     * @param mainId
+     * @return
+     */
+    List<PurchaseItem> selectByMainId(@Param("mainId") long mainId);
+}

+ 5 - 5
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Purchase.java

@@ -23,7 +23,7 @@ public class Purchase extends CommonBaseEntity implements Serializable{
     /**
      * 供应商
      */
-    private long vendorId;
+    private long contactId;
     /**
      * 交货日期
      */
@@ -69,12 +69,12 @@ public class Purchase extends CommonBaseEntity implements Serializable{
         this.status = status;
     }
 
-    public long getVendorId() {
-        return vendorId;
+    public long getContactId() {
+        return contactId;
     }
 
-    public void setVendorId(long vendorId) {
-        this.vendorId = vendorId;
+    public void setContactId(long contactId) {
+        this.contactId = contactId;
     }
 
     public Date getDeliveryDate() {

+ 48 - 36
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseItem.java

@@ -11,51 +11,55 @@ import java.io.Serializable;
  * @date 2018/10/9
  */
 public class PurchaseItem extends CommonBaseEntity implements Serializable {
-    private long mainId;
+    private Long mainId;
+    /**
+     * 序号
+     */
+    private Integer orderNum;
     /**
      * 商品
      */
-    private long productId;
+    private Long productId;
     /**
      * 仓库
      */
-    private long warehouseId;
+    private Long warehouseId;
     /**
      * 数量
      */
-    private double qty;
+    private Double qty;
     /**
      * 单价
      */
-    private double price;
+    private Double price;
     /**
      * 含税单价
      */
-    private double taxPrice;
+    private Double taxPrice;
     /**
      * 税率
      */
-    private float taxRate;
+    private Float taxRate;
     /**
      * 税额
      */
-    private double taxAmount;
+    private Double taxAmount;
     /**
      * 折扣率
      */
-    private float disRate;
+    private Float disRate;
     /**
      * 折扣额
      */
-    private double disAmount;
+    private Double disAmount;
     /**
      * 金额
      */
-    private double amount;
+    private Double amount;
     /**
      * 价税合计
      */
-    private double totalTaxAmount;
+    private Double totalTaxAmount;
     /**
      * 备注
      */
@@ -65,99 +69,107 @@ public class PurchaseItem extends CommonBaseEntity implements Serializable {
      */
     private Long srcOrderId;
 
-    public long getMainId() {
+    public Long getMainId() {
         return mainId;
     }
 
-    public void setMainId(long mainId) {
+    public void setMainId(Long mainId) {
         this.mainId = mainId;
     }
 
-    public long getProductId() {
+    public Integer getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(Integer orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public Long getProductId() {
         return productId;
     }
 
-    public void setProductId(long productId) {
+    public void setProductId(Long productId) {
         this.productId = productId;
     }
 
-    public long getWarehouseId() {
+    public Long getWarehouseId() {
         return warehouseId;
     }
 
-    public void setWarehouseId(long warehouseId) {
+    public void setWarehouseId(Long warehouseId) {
         this.warehouseId = warehouseId;
     }
 
-    public double getQty() {
+    public Double getQty() {
         return qty;
     }
 
-    public void setQty(double qty) {
+    public void setQty(Double qty) {
         this.qty = qty;
     }
 
-    public double getPrice() {
+    public Double getPrice() {
         return price;
     }
 
-    public void setPrice(double price) {
+    public void setPrice(Double price) {
         this.price = price;
     }
 
-    public double getTaxPrice() {
+    public Double getTaxPrice() {
         return taxPrice;
     }
 
-    public void setTaxPrice(double taxPrice) {
+    public void setTaxPrice(Double taxPrice) {
         this.taxPrice = taxPrice;
     }
 
-    public float getTaxRate() {
+    public Float getTaxRate() {
         return taxRate;
     }
 
-    public void setTaxRate(float taxRate) {
+    public void setTaxRate(Float taxRate) {
         this.taxRate = taxRate;
     }
 
-    public double getTaxAmount() {
+    public Double getTaxAmount() {
         return taxAmount;
     }
 
-    public void setTaxAmount(double taxAmount) {
+    public void setTaxAmount(Double taxAmount) {
         this.taxAmount = taxAmount;
     }
 
-    public float getDisRate() {
+    public Float getDisRate() {
         return disRate;
     }
 
-    public void setDisRate(float disRate) {
+    public void setDisRate(Float disRate) {
         this.disRate = disRate;
     }
 
-    public double getDisAmount() {
+    public Double getDisAmount() {
         return disAmount;
     }
 
-    public void setDisAmount(double disAmount) {
+    public void setDisAmount(Double disAmount) {
         this.disAmount = disAmount;
     }
 
-    public double getAmount() {
+    public Double getAmount() {
         return amount;
     }
 
-    public void setAmount(double amount) {
+    public void setAmount(Double amount) {
         this.amount = amount;
     }
 
-    public double getTotalTaxAmount() {
+    public Double getTotalTaxAmount() {
         return totalTaxAmount;
     }
 
-    public void setTotalTaxAmount(double totalTaxAmount) {
+    public void setTotalTaxAmount(Double totalTaxAmount) {
         this.totalTaxAmount = totalTaxAmount;
     }
 

+ 44 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseItemMapper.xml

@@ -0,0 +1,44 @@
+<?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.usoftchina.saas.purchase.mapper.PurchaseItemMapper">
+    <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.PurchaseItem">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <result column="main_id" jdbcType="BIGINT" property="mainId"/>
+        <result column="order_num" jdbcType="INT" property="orderNum"/>
+        <result column="product_id" jdbcType="BIGINT" property="productId"/>
+        <result column="warehouse_id" jdbcType="BIGINT" property="warehouseId"/>
+        <result column="qty" jdbcType="DOUBLE" property="qty"/>
+        <result column="price" jdbcType="DOUBLE" property="price"/>
+        <result column="tax_price" jdbcType="DOUBLE" property="taxPrice"/>
+        <result column="tax_rate" jdbcType="FLOAT" property="taxRate"/>
+        <result column="tax_amount" jdbcType="DOUBLE" property="taxAmount"/>
+        <result column="dis_rate" jdbcType="FLOAT" property="disRate"/>
+        <result column="dis_amount" jdbcType="DOUBLE" property="disAmount"/>
+        <result column="amount" jdbcType="DOUBLE" property="amount"/>
+        <result column="total_tax_amount" jdbcType="DOUBLE" property="totalTaxAmount"/>
+        <result column="remark" jdbcType="VARCHAR" property="remark"/>
+        <result column="src_order_id" jdbcType="BIGINT" property="srcOrderId"/>
+        <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="baseColumns">
+        id,company_id,main_id,order_num,product_id,warehouse_id,qty,price,tax_price,tax_rate,tax_amount,dis_rate,dis_amount,amount,
+        total_tax_amount,remark,src_order_id,creator_id,create_time,updater_id,update_time
+    </sql>
+    <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem">
+        insert into purchase_item(company_id,main_id,order_num,product_id,warehouse_id,qty,price,tax_price,tax_rate,tax_amount,dis_rate,dis_amount,amount,
+        total_tax_amount,remark,src_order_id,creator_id,create_time,updater_id,update_time)
+        values (#{companyId,jdbcType=BIGINT}, #{mainId,jdbcType=BIGINT}, #{orderNum,jdbcType=INT}, #{productId,jdbcType=BIGINT},
+        #{warehouseId,jdbcType=BIGINT}, #{qty,jdbcType=DOUBLE}, #{price,jdbcType=DOUBLE},
+        #{tax_price,jdbcType=DOUBLE}, #{tax_rate,jdbcType=FLOAT}, #{tax_amount,jdbcType=DOUBLE},
+        #{dis_rate,jdbcType=FLOAT}, #{dis_amount,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE},
+        #{total_tax_amount,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{src_order_id,jdbcType=BIGINT}
+        #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})
+    </insert>
+    <select id="selectByMainId" parameterType="java.lang.String" resultMap="BaseResultMap">
+        select <include refid="baseColumns"/> from purchase_item where main_id=#{mainId}
+    </select>
+</mapper>

+ 4 - 4
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -6,7 +6,7 @@
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
         <result column="code" jdbcType="VARCHAR" property="code"/>
         <result column="status" jdbcType="VARCHAR" property="status"/>
-        <result column="vendor_id" jdbcType="BIGINT" property="vendorId"/>
+        <result column="contact_id" jdbcType="BIGINT" property="contactId"/>
         <result column="delivery_date" jdbcType="TIMESTAMP" property="deliveryDate"/>
         <result column="doc_date" jdbcType="TIMESTAMP" property="docDate"/>
         <result column="user_defined1" jdbcType="VARCHAR" property="userDefined1"/>
@@ -20,14 +20,14 @@
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
     </resultMap>
     <sql id="baseColumns">
-        id,company_id,code,status,vendor_id,delivery_date,doc_date,user_defined1,user_defined2,user_defined3,
+        id,company_id,code,status,contact_id,delivery_date,doc_date,user_defined1,user_defined2,user_defined3,
         user_defined4,user_defined5,creator_id,create_time,updater_id,update_time
     </sql>
     <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.Purchase">
-        insert into purchase(company_id, code, status, vendor_id, delivery_date, doc_date, user_defined1, user_defined2,
+        insert into purchase(company_id, code, status, contact_id, delivery_date, doc_date, user_defined1, user_defined2,
         user_defined3, user_defined4, user_defined5, creator_id, create_time, updater_id, update_time)
         values (#{companyId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
-        #{vendorId,jdbcType=BIGINT}, #{deliveryDate,jdbcType=TIMESTAMP}, #{docDate,jdbcType=TIMESTAMP},
+        #{contactId,jdbcType=BIGINT}, #{deliveryDate,jdbcType=TIMESTAMP}, #{docDate,jdbcType=TIMESTAMP},
         #{userDefined1,jdbcType=VARCHAR}, #{userDefined2,jdbcType=VARCHAR}, #{userDefined3,jdbcType=VARCHAR},
         #{userDefined4,jdbcType=VARCHAR}, #{userDefined5,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
         #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})

+ 36 - 0
applications/ui/pom.xml

@@ -12,5 +12,41 @@
     <artifactId>ui</artifactId>
     <description>ui config server</description>
 
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- db -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- sleuth -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.amqp</groupId>
+            <artifactId>spring-rabbit</artifactId>
+        </dependency>
+    </dependencies>
 
 </project>

+ 19 - 0
applications/ui/src/main/java/com/usoftchina/saas/ui/UiApplication.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.ui;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+@SpringBootApplication
+@EnableEurekaClient
+@EnableTransactionManagement
+public class UiApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(UiApplication.class, args);
+    }
+}

+ 56 - 0
framework/core/src/main/java/com/usoftchina/saas/base/dto/CommonBaseDTO.java

@@ -0,0 +1,56 @@
+package com.usoftchina.saas.base.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+public abstract class CommonBaseDTO implements Serializable{
+    protected Long id;
+    protected Date createTime;
+    protected String creatorName;
+    protected Date updateTime;
+    protected String updaterName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreatorName() {
+        return creatorName;
+    }
+
+    public void setCreatorName(String creatorName) {
+        this.creatorName = creatorName;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdaterName() {
+        return updaterName;
+    }
+
+    public void setUpdaterName(String updaterName) {
+        this.updaterName = updaterName;
+    }
+}

+ 34 - 0
framework/core/src/main/java/com/usoftchina/saas/page/PageRequest.java

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.page;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/10/9
+ */
+public class PageRequest implements Serializable{
+    /**
+     * 页码
+     */
+    private int number;
+    /**
+     * 每页条数
+     */
+    private int size;
+
+    public int getNumber() {
+        return number;
+    }
+
+    public void setNumber(int number) {
+        this.number = number;
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public void setSize(int size) {
+        this.size = size;
+    }
+}

+ 5 - 0
pom.xml

@@ -227,6 +227,11 @@
                 <artifactId>auth-client</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.usoftchina.saas</groupId>
+                <artifactId>common-dto</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>com.usoftchina.saas</groupId>
                 <artifactId>purchase-api</artifactId>

+ 10 - 0
script/mysql/init/ui.sql

@@ -0,0 +1,10 @@
+CREATE DATABASE `saas_ui` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+use `saas_ui`;
+
+create table `ui_form`(
+id int unsigned primary key not null auto_increment,
+name varchar(100) not null,
+field_name varchar(100) not null,
+field_desc varchar(100) not null,
+field_order int not null
+);