Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

# Conflicts:
#	applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
zhoudw 7 years ago
parent
commit
7c058641ec

+ 64 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomerDTO.java

@@ -0,0 +1,64 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by zdw
+ * 2018-10-23 17:21.
+ */
+@Data
+public class CustomerDTO extends CommonBaseEntity implements Serializable {
+    private String cu_code;
+
+    private String cu_name;
+
+    private String cu_uu;
+
+    private String cu_type;
+
+    private Date cu_begindate;
+
+    private Double cu_beginaramount;
+
+    private Double cu_beginprerecamount;
+
+    private Double cu_promisedays;
+
+    private Double cu_taxrate;
+
+    private Integer cu_sellerid;
+
+    private String cu_sellercode;
+
+    private String cu_sellername;
+
+    private Double cu_credit;
+
+    private String cu_status;
+
+    private String cu_statuscode;
+
+    private Integer cu_recordmanid;
+
+    private String cu_recordman;
+
+    private Date cu_recorddate;
+
+    private String cu_text1;
+
+    private String cu_text2;
+
+    private String cu_text3;
+
+    private String cu_text4;
+
+    private String cu_text5;
+
+    private Double cu_leftamount;
+
+    private Double cu_recamount;
+}

+ 19 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomerFormDTO.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.document.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created by zdw
+ * 2018-10-23 17:26.
+ */
+@Data
+public class CustomerFormDTO implements Serializable {
+
+    private CustomerDTO main;
+    private List<CustomercontactDTO> items1;
+    private List<CustomeraddressDTO> items2;
+
+}

+ 33 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomeraddressDTO.java

@@ -0,0 +1,33 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CustomeraddressDTO extends CommonBaseEntity implements Serializable {
+
+    private Long ca_cuid;
+
+    private Integer ca_detno;
+
+    private String ca_person;
+
+    private Integer ca_phone;
+
+    private Integer ca_default;
+
+    private String ca_text1;
+
+    private String ca_text2;
+
+    private String ca_text3;
+
+    private String ca_text4;
+
+    private String ca_text5;
+
+    private String ca_address;
+
+}

+ 33 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java

@@ -0,0 +1,33 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CustomercontactDTO extends CommonBaseEntity implements Serializable {
+
+    private Long cc_cuid;
+
+    private Integer cc_detno;
+
+    private String cc_name;
+
+    private Integer cc_tel;
+
+    private String cc_qq;
+
+    private String cc_email;
+
+    private String cc_text1;
+
+    private String cc_text2;
+
+    private String cc_text3;
+
+    private String cc_text4;
+
+    private String cc_text5;
+
+}

+ 1 - 1
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/CustomerList.java

@@ -85,7 +85,7 @@ public class CustomerList extends CommonBaseEntity{
     private String ca_text5;
 
     private String ca_address;
-//    Customercontact
+//    CustomercontactDTO
 
     private Long cc_cuid;
 

+ 45 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -2,14 +2,14 @@ package com.usoftchina.saas.document.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.document.dto.CustomerFormDTO;
 import com.usoftchina.saas.document.entities.CustomerList;
 import com.usoftchina.saas.document.service.CustomerService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * Created by zdw
@@ -24,7 +24,7 @@ public class CustomerController {
     private CustomerService customerService;
 
     /**
-     * 采购订单列表
+     * 客户资料列表
      *
      * @param page
      * @param req
@@ -36,6 +36,47 @@ public class CustomerController {
         return Result.success(listData);
     }
 
+    /**
+     * 获取客户资料表单
+     *
+     * @return
+     */
+    @GetMapping("/read/{id}")
+    public Result<CustomerFormDTO> getFormData(@PathVariable("id") Long id) {
+        CustomerFormDTO data = customerService.getFormData(id);
+        return Result.success(data);
+    }
+
+    /**
+     * 客户资料表单保存
+     *
+     * @param
+     * @return
+     */
+    @PostMapping("/save")
+    public Result<DocBaseDTO> saveFormData(@RequestBody CustomerFormDTO data) {
+        DocBaseDTO save = customerService.saveFormData(data);
+        return Result.success(save);
+    }
+
+    /**
+     * 客户资料删除
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id) {
+        customerService.delete(id);
+        return Result.success();
+    }
+
+
+
+
+
+
+
 
 
 

+ 8 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java

@@ -2,7 +2,9 @@ package com.usoftchina.saas.document.service;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.document.dto.CustomerFormDTO;
 import com.usoftchina.saas.document.entities.Customer;
 import com.usoftchina.saas.document.entities.CustomerList;
 import com.usoftchina.saas.document.mapper.CustomerMapper;
@@ -14,4 +16,10 @@ import com.usoftchina.saas.page.PageRequest;
  */
 public interface CustomerService extends CommonBaseService<CustomerMapper, Customer> {
     PageInfo<CustomerList> getListData(PageRequest page, ListReqDTO req);
+
+    CustomerFormDTO getFormData(Long id);
+
+    DocBaseDTO saveFormData(CustomerFormDTO data);
+
+    void delete(Long id);
 }

+ 45 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -3,14 +3,20 @@ package com.usoftchina.saas.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.dto.CustomerDTO;
+import com.usoftchina.saas.document.dto.CustomerFormDTO;
 import com.usoftchina.saas.document.entities.Customer;
 import com.usoftchina.saas.document.entities.CustomerList;
 import com.usoftchina.saas.document.mapper.CustomerListMapper;
 import com.usoftchina.saas.document.mapper.CustomerMapper;
+import com.usoftchina.saas.document.mapper.CustomeraddressMapper;
+import com.usoftchina.saas.document.mapper.CustomercontactMapper;
 import com.usoftchina.saas.document.service.CustomerService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -27,6 +33,15 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     @Autowired
     private CustomerListMapper customerListMapper;
 
+    @Autowired
+    private CustomercontactMapper customercontactMapper;
+
+    @Autowired
+    private CustomeraddressMapper customeraddressMapper;
+
+
+
+
     @Override
     public PageInfo<CustomerList> getListData(PageRequest page, ListReqDTO req) {
         //设置默认分页
@@ -43,6 +58,34 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return pageInfo;
     }
 
+    @Override
+    public CustomerFormDTO getFormData(Long id) {
+        if (null == id || "0".equals(id)) {
+            return null;
+        }
+        CustomerFormDTO purchaseFormDTO = new CustomerFormDTO();
+        //查询主表信息
+        Customer customer = getMapper().selectByPrimaryKey(id);
+        //将Customer实体对象转化成传输对象
+        CustomerDTO main = BeanMapper.map(customer, CustomerDTO.class);
+        //查询从表
+//        List<PurchaseDetail> purchaseDetails = purchasedetailMapper.selectByFK(id);
+//        List<PurchaseDetailDTO> items = BeanMapper.mapList(purchaseDetails, PurchaseDetailDTO.class);
+//        purchaseFormDTO.setMain(main);
+//        purchaseFormDTO.setItems(items);
+        return purchaseFormDTO;
+    }
+
+    @Override
+    public DocBaseDTO saveFormData(CustomerFormDTO data) {
+        return null;
+    }
+
+    @Override
+    public void delete(Long id) {
+
+    }
+
     private List<CustomerList> getListByMode(ListReqDTO req) {
         List<CustomerList> list = null;
         Long companyId = BaseContextHolder.getCompanyId();
@@ -51,9 +94,9 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             con = "1=1";
         }
         if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
-            list = customerListMapper.selectPurchaseBycondition(con, companyId);
+            list = customerListMapper.selectCustomerListByCondition(con, companyId);
         } else {
-            list = customerListMapper.selectPurchaseListByCondition(con, companyId);
+            list = customerListMapper.selectCustomerBycondition(con, companyId);
         }
         return list;
     }

+ 29 - 82
applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml

@@ -2,104 +2,51 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.usoftchina.saas.document.mapper.CustomerListMapper">
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.CustomerList">
-    <id column="pi_id" jdbcType="INTEGER" property="id" />
-    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
-    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
-    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
-    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
-    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
-    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
-    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
-    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
-    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
-    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
-    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
-    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
-    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
-    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
-    <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
-    <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
-    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="pi_recorddate" />
-    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
-    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
-    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
-    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
-    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
-    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
-    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
-    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
-    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
-    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
-    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
-    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
-    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
-    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
-    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
-    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
-    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
-    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
-    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
-    <result column="pd_inqty" jdbcType="INTEGER" property="pd_inqty" />
-    <result column="pd_outqty" jdbcType="INTEGER" property="pd_outqty" />
-    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
-    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
-    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
-    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
-    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
-    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
-    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
-    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
-    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
-    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
-    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
-    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
-    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
-    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
-    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
-    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
-    <result column="companyid" jdbcType="INTEGER" property="companyId" />
-    <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
-    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
-    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
-    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
-    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
-    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
-    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
-    <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
-    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <id column="cc_id" jdbcType="INTEGER" property="id" />
+    <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
+    <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
+    <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
+    <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
+    <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
+    <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
+    <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
+    <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
+    <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
+    <result column="ca_phone" jdbcType="INTEGER" property="ca_phone" />
+    <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
+    <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
+    <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
+    <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
+    <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
+    <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
+    <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
 
   </resultMap>
 
 
-  <select id="selectCustomerListByCondition" parameterType="string" resultMap="BaseResultMap">
-    select  *  from purchase left join purchasedetail on pu_id=pd_puid
+  <select id="selectCustomerListByCondition"  resultMap="BaseResultMap">
+    select  *  from customer left join customeraddress on cu_id=ca_cuid left join customercontact on cu_id = cc_cuid
     <where>
       <if test="con != null">
         ${con}
       </if>
       <if test="companyId != null">
-        and   companyId = #{companyId}
+        and   companyid = #{companyId}
       </if>
-    </where>  order by pu_id,pd_detno
+    </where>  order by cu_id
   </select>
 
-  <select id="selectCustomerBycondition" parameterType="string" resultMap="BaseResultMap">
-    select  *  from prodinout
+  <select id="selectCustomerBycondition"  resultMap="BaseResultMap">
+    select  *  from customer
     <where>
-      <if test="begin != null">
-        pu_date &gt;= ${begin}
-      </if>
-      <if test="end!= null">
-        AND  pu_date &lt;= ${end}
-      </if>
-      <if test="status != null">
-        AND pu_status=${status}
+      <if test="con != null">
+        ${con}
       </if>
-      <if test="keyword != null">
-        AND ${keyword}
+      <if test="companyId != null">
+        and  companyid = #{companyId}
       </if>
     </where>
+    order by cu_id
   </select>
 
 

+ 0 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseListMapper.java

@@ -1,7 +1,5 @@
 package com.usoftchina.saas.purchase.mapper;
 
-import com.usoftchina.saas.commons.dto.ListReqDTO;
-import com.usoftchina.saas.purchase.dto.PurchaseReqDTO;
 import com.usoftchina.saas.purchase.po.PurchaseList;
 import org.apache.ibatis.annotations.Param;