Sfoglia il codice sorgente

客户信息系统

liujiankang 7 anni fa
parent
commit
4ba4e27a75

+ 9 - 9
watero-rst-core/src/main/java/com.iamberry.rst.core/customer/CustomerBasicInfo.java

@@ -21,8 +21,8 @@ public class CustomerBasicInfo implements Serializable{
     private Data createDate;//创建时间
     private Data updateDate;//修改时间
     private Integer idCreateBy;//创建人Id
-    private Integer idUpdateBy;//修改人Id
     private String customerRemarks;//备注信息
+    private String adminName;//管理员姓名
 
     public Integer getCustomerId() {
         return customerId;
@@ -120,14 +120,6 @@ public class CustomerBasicInfo implements Serializable{
         this.idCreateBy = idCreateBy;
     }
 
-    public Integer getIdUpdateBy() {
-        return idUpdateBy;
-    }
-
-    public void setIdUpdateBy(Integer idUpdateBy) {
-        this.idUpdateBy = idUpdateBy;
-    }
-
     public String getCustomerRemarks() {
         return customerRemarks;
     }
@@ -135,4 +127,12 @@ public class CustomerBasicInfo implements Serializable{
     public void setCustomerRemarks(String customerRemarks) {
         this.customerRemarks = customerRemarks;
     }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
 }

+ 10 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java

@@ -1,7 +1,17 @@
 package com.iamberry.rst.faces.customer;
 
+import com.iamberry.rst.core.cm.ComplaintMaintenanceInfo;
+import com.iamberry.rst.core.cm.CustomerInfo;
+import com.iamberry.rst.core.customer.CustomerBasicInfo;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+
 /**
  * Created by Administrator on 2018/4/20.
  */
 public interface CustomerBasicService {
+    /**
+     *  查询客户基本信息列表
+     */
+    PagedResult<CustomerBasicInfo> listCustomerBasic(PageRequest<CustomerBasicInfo> pageRequest);
 }

+ 20 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -1,11 +1,31 @@
 package com.iamberry.rst.service.customer;
 
 import com.alibaba.dubbo.config.annotation.Service;
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.cm.ComplaintMaintenanceInfo;
+import com.iamberry.rst.core.customer.CustomerBasicInfo;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsMachine;
 import com.iamberry.rst.faces.customer.CustomerBasicService;
+import com.iamberry.rst.service.customer.mapper.CustomerBasicMapper;
+import com.iamberry.rst.util.PageUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
 
 /**
  * Created by Administrator on 2018/4/20.
  */
 @Service
 public class CustomerBasicServiceImpl implements CustomerBasicService{
+    @Autowired
+    private CustomerBasicMapper customerBasicMapper;
+
+    @Override
+    public PagedResult<CustomerBasicInfo> listCustomerBasic(PageRequest<CustomerBasicInfo> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<CustomerBasicInfo> customerBasicList = customerBasicMapper.listCustomerBasic(pageRequest.getData());
+        return PageUtil.getPage(customerBasicList);
+    }
 }

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.java

@@ -1,7 +1,13 @@
 package com.iamberry.rst.service.customer.mapper;
 
+import com.iamberry.rst.core.customer.CustomerBasicInfo;
+
+import java.util.List;
+
 /**
  * Created by Administrator on 2018/4/20.
  */
 public interface CustomerBasicMapper {
+    /*查询客户基本信息列表*/
+    List<CustomerBasicInfo> listCustomerBasic(CustomerBasicInfo customerBasicInfo);
 }

+ 48 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml

@@ -1,6 +1,53 @@
 <?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.iamberry.rst.service.customer.mapper.CustomerBasicMapper" >
-
+  <select id="listCustomerBasic" resultType="CustomerBasicInfo" parameterType="CustomerBasicInfo">
+      SELECT
+      bi.customer_id customerId,
+      bi.customer_name customerName,
+      bi.customer_industry customerIndustry,
+      bi.customer_type customerType,
+      bi.cooperative_state cooperativeState,
+      bi.customer_province_code customerProvinceCode,
+      bi.customer_city_code customerCityCode,
+      bi.customer_address customerAddress,
+      bi.customer_status customerStatus,
+      bi.create_date createDate,
+      bi.update_date updateDate,
+      bi.id_create_by idCreateBy,
+      bi.customer_remarks customerRemarks,
+      sa.admin_name adminName
+      from tb_rst_customer_basic_info bi
+      LEFT JOIN tb_rst_sys_admin sa on bi.id_create_by = sa.admin_id
+      <where>
+        <if test="customerName != null and customerName!='' ">
+          customer_name like CONCAT('%',#{customerName},'%')
+        </if>
+        <if test="customerIndustry != null and customerIndustry!='' ">
+          AND customer_industry = #{customerIndustry}
+        </if>
+        <if test="customerType != null and customerType!='' ">
+          AND customer_type = #{customerType}
+        </if>
+        <if test="cooperativeState != null and cooperativeState!='' ">
+          AND cooperative_state = #{cooperativeState}
+        </if>
+        <if test="customerProvinceCode != null and customerProvinceCode!='' ">
+          AND customer_province_code = #{customerProvinceCode}
+        </if>
+        <if test="customerCityCode != null and customerCityCode!='' ">
+          AND customer_city_code = #{customerCityCode}
+        </if>
+        <if test="customerAddress != null and customerAddress!='' ">
+          AND customer_address = #{customerAddress}
+        </if>
+        <if test="customerStatus != null and customerStatus!='' ">
+          AND customer_status = #{customerStatus}
+        </if>
+        <if test="idCreateBy != null and idCreateBy!='' ">
+          AND id_create_by = #{idCreateBy}
+        </if>
+      </where>
+  </select>
 
 </mapper>

+ 56 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicController.java

@@ -0,0 +1,56 @@
+package com.iamberry.rst.controllers.customer;
+
+import com.iamberry.rst.core.cm.ComplaintDetectInfo;
+import com.iamberry.rst.core.customer.CustomerBasicInfo;
+import com.iamberry.rst.core.order.ProductType;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.faces.customer.CustomerBasicService;
+import com.iamberry.rst.utils.AdminUtils;
+import com.iamberry.rst.utils.StitchAttrUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * Created by Administrator on 2018/4/20.
+ */
+@Controller
+@RequestMapping("/admin/CustomerBasic")
+public class CustomerBasicController {
+    @Autowired
+    private CustomerBasicService customerBasicService;
+    /**
+     * 查询客户基本信息列表
+     *
+     * @return
+     * @author LJK
+     * @date 时间
+     */
+    @RequiresPermissions("CustomerBasic:select_all:CustomerBasic")
+    @RequestMapping("/listCustomerBasic")
+    public ModelAndView listCustomerBasic(HttpServletRequest request, CustomerBasicInfo customerBasicInfo,
+                                       @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                                       @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
+                                       @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
+        ModelAndView mv = new ModelAndView("customer/customer_basic_list");
+        //获取登录员工id
+        Integer adminId = AdminUtils.getLoginAdminId();
+        // 封装请求数据
+        PageRequest<CustomerBasicInfo> pageRequest = new PageRequest<>(customerBasicInfo, pageNO, pageSize, totalNum == 0);
+        // 查询订单列表
+        PagedResult<CustomerBasicInfo> result = customerBasicService.listCustomerBasic(pageRequest);
+        if (totalNum != 0) {
+            result.setTotal(totalNum);
+        }
+        StitchAttrUtil.setModelAndView(customerBasicInfo, mv, "/admin/CustomerBasic/listCustomerBasic", result);
+        return mv;
+    }
+}