Преглед на файлове

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

lph преди 1 година
родител
ревизия
c39a86e426

+ 129 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/CustomerController.java

@@ -0,0 +1,129 @@
+package com.zkqy.business.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.business.domain.Customer;
+import com.zkqy.business.service.ICustomerService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 客户Controller
+ *
+ * @author zkqy
+ * @date 2024-05-14
+ */
+@RestController
+@RequestMapping("/system/customer")
+@Api(value = "/system/customer", description = "客户-接口")
+public class CustomerController extends BaseController
+{
+    @Autowired
+    private ICustomerService customerService;
+
+    /**
+     * 查询客户列表
+     */
+//@PreAuthorize("@ss.hasPermi('system:customer:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询客户列表")
+    public TableDataInfo list(Customer customer)
+    {
+        startPage();
+        List<Customer> list = customerService.selectCustomerList(customer);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出客户列表
+     */
+    @PreAuthorize("@ss.hasPermi('huaxian:xsglkhgl:EXPORT')")
+    @Log(title = "客户", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出客户列表")
+    public void export(HttpServletResponse response, Customer customer)
+    {
+        List<Customer> list = customerService.selectCustomerList(customer);
+        ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
+        util.exportExcel(response, list, "客户数据");
+    }
+
+    /**
+     * 获取客户详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:customer:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取客户详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(customerService.selectCustomerById(id));
+    }
+
+    /**
+     * 新增客户
+     */
+    @PreAuthorize("@ss.hasPermi('huaxian:xsglkhgl:INSERT')")
+    @Log(title = "客户", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增客户")
+    public AjaxResult add(@RequestBody Customer customer)
+    {
+        return toAjax(customerService.insertCustomer(customer));
+    }
+
+    /**
+     * 修改客户
+     */
+    @PreAuthorize("@ss.hasPermi('huaxian:xsglkhgl:UPDATE')")
+    @Log(title = "客户", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改客户")
+    public AjaxResult edit(@RequestBody Customer customer)
+    {
+        return toAjax(customerService.updateCustomer(customer));
+    }
+
+    /**
+     * 删除客户
+     */
+    @PreAuthorize("@ss.hasPermi('huaxian:xsglkhgl:DELETE')")
+    @Log(title = "客户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除客户")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(customerService.deleteCustomerByIds(ids));
+    }
+
+    /**
+     * 客户列表--权限过滤
+     */
+    @GetMapping("/customerList")
+    @ApiOperation(value = "查询客户列表")
+    public TableDataInfo customerList(Customer customer)
+    {
+        startPage();
+        List<Customer> list = customerService.customerList(customer);
+        return getDataTable(list);
+    }
+
+    /**
+     * 客户编号校验
+     */
+    @GetMapping("/checkCustomerNo")
+    public AjaxResult checkCustomerNo(@RequestParam(required = false) Long id, @RequestParam String customerNo){
+        return AjaxResult.success(customerService.checkCustomerNo(id,customerNo));
+    }
+
+
+
+}

+ 285 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/Customer.java

@@ -0,0 +1,285 @@
+package com.zkqy.business.domain;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 客户对象 customer
+ * 
+ * @author zkqy
+ * @date 2024-05-14
+ */
+public class Customer extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 客户编号 */
+    @Excel(name = "客户编号")
+    private String customNo;
+
+    /** 客户名称 */
+    @Excel(name = "客户名称")
+    private String customName;
+
+    /** 手机号码(+86/其他国外) */
+    @Excel(name = "手机号码(+86/其他国外)")
+    private String customPhoneNumber;
+
+    /** 座机号码 */
+    @Excel(name = "座机号码")
+    private String customLandine;
+
+    /** 邮件地址 */
+    @Excel(name = "邮件地址")
+    private String customMail;
+
+    /** 客户类型(国内/国外/内加工) */
+    @Excel(name = "客户类型", readConverterExp = "国=内/国外/内加工")
+    private String customType;
+
+    /** 客户等级(一级/二级/三级) */
+    @Excel(name = "客户等级", readConverterExp = "一=级/二级/三级")
+    private String customGrade;
+
+    /** 地址信息 */
+    @Excel(name = "地址信息")
+    private String customAddress;
+
+    /** 客户国别 */
+    @Excel(name = "客户国别")
+    private String customCountryType;
+
+    /** 客户地区 */
+    @Excel(name = "客户地区")
+    private String customDistrict;
+
+    /** 销售员 */
+    @Excel(name = "销售员")
+    private String salesman;
+
+    /** 联系人 */
+    @Excel(name = "联系人")
+    private String contactPerson;
+
+    /** 创建者id */
+    private Long createById;
+
+    /** 更新者id */
+    private Long updateById;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 任务编码 */
+    private String taskProcessKey;
+
+    /** 任务节点编码 */
+    private String taskNodeKey;
+
+    private String queryParam;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setCustomNo(String customNo) 
+    {
+        this.customNo = customNo;
+    }
+
+    public String getCustomNo() 
+    {
+        return customNo;
+    }
+    public void setCustomName(String customName) 
+    {
+        this.customName = customName;
+    }
+
+    public String getCustomName() 
+    {
+        return customName;
+    }
+    public void setCustomPhoneNumber(String customPhoneNumber) 
+    {
+        this.customPhoneNumber = customPhoneNumber;
+    }
+
+    public String getCustomPhoneNumber() 
+    {
+        return customPhoneNumber;
+    }
+    public void setCustomLandine(String customLandine) 
+    {
+        this.customLandine = customLandine;
+    }
+
+    public String getCustomLandine() 
+    {
+        return customLandine;
+    }
+    public void setCustomMail(String customMail) 
+    {
+        this.customMail = customMail;
+    }
+
+    public String getCustomMail() 
+    {
+        return customMail;
+    }
+    public void setCustomType(String customType) 
+    {
+        this.customType = customType;
+    }
+
+    public String getCustomType() 
+    {
+        return customType;
+    }
+    public void setCustomGrade(String customGrade) 
+    {
+        this.customGrade = customGrade;
+    }
+
+    public String getCustomGrade() 
+    {
+        return customGrade;
+    }
+    public void setCustomAddress(String customAddress) 
+    {
+        this.customAddress = customAddress;
+    }
+
+    public String getCustomAddress() 
+    {
+        return customAddress;
+    }
+    public void setCustomCountryType(String customCountryType) 
+    {
+        this.customCountryType = customCountryType;
+    }
+
+    public String getCustomCountryType() 
+    {
+        return customCountryType;
+    }
+    public void setCustomDistrict(String customDistrict) 
+    {
+        this.customDistrict = customDistrict;
+    }
+
+    public String getCustomDistrict() 
+    {
+        return customDistrict;
+    }
+    public void setSalesman(String salesman) 
+    {
+        this.salesman = salesman;
+    }
+
+    public String getSalesman() 
+    {
+        return salesman;
+    }
+    public void setContactPerson(String contactPerson) 
+    {
+        this.contactPerson = contactPerson;
+    }
+
+    public String getContactPerson() 
+    {
+        return contactPerson;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setTaskProcessKey(String taskProcessKey) 
+    {
+        this.taskProcessKey = taskProcessKey;
+    }
+
+    public String getTaskProcessKey() 
+    {
+        return taskProcessKey;
+    }
+    public void setTaskNodeKey(String taskNodeKey) 
+    {
+        this.taskNodeKey = taskNodeKey;
+    }
+
+    public String getTaskNodeKey() 
+    {
+        return taskNodeKey;
+    }
+
+    public String getQueryParam() {
+        return queryParam;
+    }
+
+    public void setQueryParam(String queryParam) {
+        this.queryParam = queryParam;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("customNo", getCustomNo())
+            .append("customName", getCustomName())
+            .append("customPhoneNumber", getCustomPhoneNumber())
+            .append("customLandine", getCustomLandine())
+            .append("customMail", getCustomMail())
+            .append("customType", getCustomType())
+            .append("customGrade", getCustomGrade())
+            .append("customAddress", getCustomAddress())
+            .append("customCountryType", getCustomCountryType())
+            .append("customDistrict", getCustomDistrict())
+            .append("salesman", getSalesman())
+            .append("contactPerson", getContactPerson())
+            .append("remark", getRemark())
+            .append("createById", getCreateById())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateById", getUpdateById())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("delFlag", getDelFlag())
+            .append("taskProcessKey", getTaskProcessKey())
+            .append("taskNodeKey", getTaskNodeKey())
+            .toString();
+    }
+}

+ 75 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/CustomerMapper.java

@@ -0,0 +1,75 @@
+package com.zkqy.business.mapper;
+
+import java.util.List;
+import com.zkqy.business.domain.Customer;
+
+/**
+ * 客户Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-05-14
+ */
+public interface CustomerMapper 
+{
+    /**
+     * 查询客户
+     * 
+     * @param id 客户主键
+     * @return 客户
+     */
+    public Customer selectCustomerById(Long id);
+
+    /**
+     * 查询客户列表
+     * 
+     * @param customer 客户
+     * @return 客户集合
+     */
+    public List<Customer> selectCustomerList(Customer customer);
+
+    /**
+     * 新增客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    public int insertCustomer(Customer customer);
+
+    /**
+     * 修改客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    public int updateCustomer(Customer customer);
+
+    /**
+     * 删除客户
+     * 
+     * @param id 客户主键
+     * @return 结果
+     */
+    public int deleteCustomerById(Long id);
+
+    /**
+     * 批量删除客户
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCustomerByIds(Long[] ids);
+
+    /**
+     * 客户列表--权限过滤
+     */
+    List<Customer> customerList(Customer customer);
+
+    /**
+     * 查询客户
+     *
+     * @param customerNo 客户编号
+     * @return 客户
+     */
+    Customer selectCustomerByCustomerNo(String customerNo);
+
+}

+ 72 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/ICustomerService.java

@@ -0,0 +1,72 @@
+package com.zkqy.business.service;
+
+import java.util.List;
+import com.zkqy.business.domain.Customer;
+
+/**
+ * 客户Service接口
+ * 
+ * @author zkqy
+ * @date 2024-05-14
+ */
+public interface ICustomerService 
+{
+    /**
+     * 查询客户
+     * 
+     * @param id 客户主键
+     * @return 客户
+     */
+    public Customer selectCustomerById(Long id);
+
+    /**
+     * 查询客户列表
+     * 
+     * @param customer 客户
+     * @return 客户集合
+     */
+    public List<Customer> selectCustomerList(Customer customer);
+
+    /**
+     * 新增客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    public int insertCustomer(Customer customer);
+
+    /**
+     * 修改客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    public int updateCustomer(Customer customer);
+
+    /**
+     * 批量删除客户
+     * 
+     * @param ids 需要删除的客户主键集合
+     * @return 结果
+     */
+    public int deleteCustomerByIds(Long[] ids);
+
+    /**
+     * 删除客户信息
+     * 
+     * @param id 客户主键
+     * @return 结果
+     */
+    public int deleteCustomerById(Long id);
+
+    /**
+     * 客户列表--权限过滤
+     */
+    List<Customer> customerList(Customer customer);
+
+    /**
+     * 客户编号校验
+     */
+    boolean checkCustomerNo(Long id,String customerNo);
+
+}

+ 149 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/CustomerServiceImpl.java

@@ -0,0 +1,149 @@
+package com.zkqy.business.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.zkqy.common.core.domain.entity.SysRole;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.business.mapper.CustomerMapper;
+import com.zkqy.business.domain.Customer;
+import com.zkqy.business.service.ICustomerService;
+
+/**
+ * 客户Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2024-05-14
+ */
+@Service
+public class CustomerServiceImpl implements ICustomerService 
+{
+    @Autowired
+    private CustomerMapper customerMapper;
+
+    /**
+     * 查询客户
+     * 
+     * @param id 客户主键
+     * @return 客户
+     */
+    @Override
+    public Customer selectCustomerById(Long id)
+    {
+        return customerMapper.selectCustomerById(id);
+    }
+
+    /**
+     * 查询客户列表
+     * 
+     * @param customer 客户
+     * @return 客户
+     */
+    @Override
+    public List<Customer> selectCustomerList(Customer customer)
+    {
+        return customerMapper.selectCustomerList(customer);
+    }
+
+    /**
+     * 新增客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    @Override
+    public int insertCustomer(Customer customer)
+    {
+        customer.setCreateTime(DateUtils.getNowDate());
+        customer.setCreateById(SecurityUtils.getUserId());
+        customer.setCreateBy(SecurityUtils.getUsername());
+        return customerMapper.insertCustomer(customer);
+    }
+
+    /**
+     * 修改客户
+     * 
+     * @param customer 客户
+     * @return 结果
+     */
+    @Override
+    public int updateCustomer(Customer customer)
+    {
+        customer.setUpdateTime(DateUtils.getNowDate());
+        customer.setUpdateById(SecurityUtils.getUserId());
+        customer.setUpdateBy(SecurityUtils.getUsername());
+        return customerMapper.updateCustomer(customer);
+    }
+
+    /**
+     * 批量删除客户
+     * 
+     * @param ids 需要删除的客户主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomerByIds(Long[] ids)
+    {
+        return customerMapper.deleteCustomerByIds(ids);
+    }
+
+    /**
+     * 删除客户信息
+     * 
+     * @param id 客户主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomerById(Long id)
+    {
+        return customerMapper.deleteCustomerById(id);
+    }
+
+    @Override
+    public List<Customer> customerList(Customer customer) {
+        List<Customer> customerList = new ArrayList<>();
+        // 查看当前用户角色
+        List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
+        //查看当前用户角色是否存在销售员角色
+        boolean containsSalesman = roles.stream().anyMatch(role -> "salesman".equals(role.getRoleKey()));
+
+        //查看当前用户是否是租户管理员,是返回全部销售单数据
+        if(SecurityUtils.isLoginUserTenantAdmin()){
+            customerList = customerMapper.customerList(customer);
+        }else if(containsSalesman){
+            customer.setCreateById(SecurityUtils.getUserId());
+            customerList = customerMapper.customerList(customer);
+        }else {
+            customerList = customerMapper.customerList(customer);
+        }
+        return customerList;
+    }
+
+    @Override
+    public boolean checkCustomerNo(Long id, String customerNo) {
+        //判断新增还是修改
+        if(id != null){
+            Customer customer = customerMapper.selectCustomerById(id);
+            if(customer.getCustomNo().equals(customerNo)){
+                return true;
+            }else {
+                Customer customer1 = customerMapper.selectCustomerByCustomerNo(customerNo);
+                if(customer1 != null){
+                    return false;
+                }else {
+                    return true;
+                }
+            }
+        }else {
+            Customer customer1 = customerMapper.selectCustomerByCustomerNo(customerNo);
+            if(customer1 != null){
+                return false;
+            }else {
+                return true;
+            }
+        }
+    }
+}

+ 163 - 0
zkqy-custom-business/src/main/resources/mapper/business/CustomerMapper.xml

@@ -0,0 +1,163 @@
+<?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.zkqy.business.mapper.CustomerMapper">
+    
+    <resultMap type="com.zkqy.business.domain.Customer" id="CustomerResult">
+        <result property="id"    column="id"    />
+        <result property="customNo"    column="custom_no"    />
+        <result property="customName"    column="custom_name"    />
+        <result property="customPhoneNumber"    column="custom_phone_number"    />
+        <result property="customLandine"    column="custom_landine"    />
+        <result property="customMail"    column="custom_mail"    />
+        <result property="customType"    column="custom_type"    />
+        <result property="customGrade"    column="custom_grade"    />
+        <result property="customAddress"    column="custom_address"    />
+        <result property="customCountryType"    column="custom_country_type"    />
+        <result property="customDistrict"    column="custom_district"    />
+        <result property="salesman"    column="salesman"    />
+        <result property="contactPerson"    column="contact_person"    />
+        <result property="remark"    column="remark"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="taskProcessKey"    column="task_process_key"    />
+        <result property="taskNodeKey"    column="task_node_key"    />
+    </resultMap>
+
+    <sql id="selectCustomerVo">
+        select id, custom_no, custom_name, custom_phone_number, custom_landine, custom_mail, custom_type, custom_grade, custom_address, custom_country_type, custom_district, salesman, contact_person, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from {DBNAME}.customer
+    </sql>
+
+    <select id="selectCustomerList" parameterType="com.zkqy.business.domain.Customer" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        where del_flag = '0'
+            <if test="customNo != null  and customNo != ''"> and custom_no = #{customNo}</if>
+            <if test="customName != null  and customName != ''"> and custom_name like concat('%', #{customName}, '%')</if>
+            <if test="customPhoneNumber != null  and customPhoneNumber != ''"> and custom_phone_number = #{customPhoneNumber}</if>
+            <if test="customLandine != null  and customLandine != ''"> and custom_landine = #{customLandine}</if>
+            <if test="customMail != null  and customMail != ''"> and custom_mail = #{customMail}</if>
+            <if test="customType != null  and customType != ''"> and custom_type = #{customType}</if>
+            <if test="customGrade != null  and customGrade != ''"> and custom_grade = #{customGrade}</if>
+            <if test="customAddress != null  and customAddress != ''"> and custom_address = #{customAddress}</if>
+            <if test="customCountryType != null  and customCountryType != ''"> and custom_country_type = #{customCountryType}</if>
+            <if test="customDistrict != null  and customDistrict != ''"> and custom_district = #{customDistrict}</if>
+            <if test="salesman != null  and salesman != ''"> and salesman = #{salesman}</if>
+            <if test="contactPerson != null  and contactPerson != ''"> and contact_person = #{contactPerson}</if>
+    </select>
+    
+    <select id="selectCustomerById" parameterType="Long" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCustomer" parameterType="com.zkqy.business.domain.Customer" useGeneratedKeys="true" keyProperty="id">
+        insert into {DBNAME}.customer
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="customNo != null">custom_no,</if>
+            <if test="customName != null">custom_name,</if>
+            <if test="customPhoneNumber != null">custom_phone_number,</if>
+            <if test="customLandine != null">custom_landine,</if>
+            <if test="customMail != null">custom_mail,</if>
+            <if test="customType != null">custom_type,</if>
+            <if test="customGrade != null">custom_grade,</if>
+            <if test="customAddress != null">custom_address,</if>
+            <if test="customCountryType != null">custom_country_type,</if>
+            <if test="customDistrict != null">custom_district,</if>
+            <if test="salesman != null">salesman,</if>
+            <if test="contactPerson != null">contact_person,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="taskProcessKey != null">task_process_key,</if>
+            <if test="taskNodeKey != null">task_node_key,</if>
+            del_flag
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="customNo != null">#{customNo},</if>
+            <if test="customName != null">#{customName},</if>
+            <if test="customPhoneNumber != null">#{customPhoneNumber},</if>
+            <if test="customLandine != null">#{customLandine},</if>
+            <if test="customMail != null">#{customMail},</if>
+            <if test="customType != null">#{customType},</if>
+            <if test="customGrade != null">#{customGrade},</if>
+            <if test="customAddress != null">#{customAddress},</if>
+            <if test="customCountryType != null">#{customCountryType},</if>
+            <if test="customDistrict != null">#{customDistrict},</if>
+            <if test="salesman != null">#{salesman},</if>
+            <if test="contactPerson != null">#{contactPerson},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="taskProcessKey != null">#{taskProcessKey},</if>
+            <if test="taskNodeKey != null">#{taskNodeKey},</if>
+            '0'
+         </trim>
+    </insert>
+
+    <update id="updateCustomer" parameterType="com.zkqy.business.domain.Customer">
+        update {DBNAME}.customer
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="customNo != null">custom_no = #{customNo},</if>
+            <if test="customName != null">custom_name = #{customName},</if>
+            <if test="customPhoneNumber != null">custom_phone_number = #{customPhoneNumber},</if>
+            <if test="customLandine != null">custom_landine = #{customLandine},</if>
+            <if test="customMail != null">custom_mail = #{customMail},</if>
+            <if test="customType != null">custom_type = #{customType},</if>
+            <if test="customGrade != null">custom_grade = #{customGrade},</if>
+            <if test="customAddress != null">custom_address = #{customAddress},</if>
+            <if test="customCountryType != null">custom_country_type = #{customCountryType},</if>
+            <if test="customDistrict != null">custom_district = #{customDistrict},</if>
+            <if test="salesman != null">salesman = #{salesman},</if>
+            <if test="contactPerson != null">contact_person = #{contactPerson},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
+            <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCustomerById" parameterType="Long">
+        update {DBNAME}.customer set del_flag = '2' where id = #{id}
+    </delete>
+
+    <delete id="deleteCustomerByIds" parameterType="String">
+        update {DBNAME}.customer set del_flag = '2' where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="customerList" parameterType="com.zkqy.business.domain.Customer" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        WHERE
+            del_flag = '0'
+        <if test="queryParam != null and queryParam != ''">
+            AND CONCAT(
+            IFNULL(custom_no, '' ),
+            IFNULL(custom_name, '' ),
+            IFNULL(custom_phone_number, '' ),
+            IFNULL(salesman, '' ),
+            IFNULL(contact_person, '' )) LIKE concat('%', #{queryParam}, '%')
+        </if>
+        <if test="createById != null "> and create_by_id = #{createById}</if>
+        ORDER BY
+            id DESC
+    </select>
+
+    <select id="selectCustomerByCustomerNo" parameterType="string" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        where custom_no = #{customerNo} and del_flag = '0'
+    </select>
+
+</mapper>

+ 1 - 0
zkqy-custom-business/src/main/resources/mapper/business/ProductCodeListMapper.xml

@@ -261,6 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND p.del_flag = '0'
           AND sc.del_flag = '0'
             and ml.del_flag = '0'
+            and sp.status = '6'
     </select>
 
     <select id="selectMaxCodeList" resultType="string">