客户信息功能开发

客户信息功能开发
master
siontion 10 months ago
parent 8d49a8f7ea
commit 1fd8e20e7a

2
.gitignore vendored

@ -51,3 +51,5 @@ rebel.xml
application-my.yaml
/mes-ui-app/unpackage/
mes-module-heli/mes-module-heli-biz/src/test/java/com/chanko/yunxi/mes/module/heli/service/client/ClientServiceImplTest.java
mes-module-heli/mes-module-heli-biz/src/test/java/com/chanko/yunxi/mes/module/heli/service/client/ClientServiceImplTest.java

@ -18,5 +18,6 @@ public interface ErrorCodeConstants {
ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1_001_001, "物料不存在");
ErrorCode COMPOSITION_NOT_EXISTS = new ErrorCode(1_001_002, "材质不存在");
ErrorCode CLIENT_NOT_EXISTS = new ErrorCode(1_001_003, "客户信息不存在");
ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode( 1_001_004, "客户新表信息不存在");
}

@ -0,0 +1,95 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.customer;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.module.heli.service.customer.CustomerService;
@Tag(name = "管理后台 - 客户新表")
@RestController
@RequestMapping("/heli/customer")
@Validated
public class CustomerController {
@Resource
private CustomerService customerService;
@PostMapping("/create")
@Operation(summary = "创建客户新表")
@PreAuthorize("@ss.hasPermission('heli:customer:create')")
public CommonResult<Long> createCustomer(@Valid @RequestBody CustomerSaveReqVO createReqVO) {
return success(customerService.createCustomer(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新客户新表")
@PreAuthorize("@ss.hasPermission('heli:customer:update')")
public CommonResult<Boolean> updateCustomer(@Valid @RequestBody CustomerSaveReqVO updateReqVO) {
customerService.updateCustomer(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除客户新表")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('heli:customer:delete')")
public CommonResult<Boolean> deleteCustomer(@RequestParam("id") Long id) {
customerService.deleteCustomer(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得客户新表")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('heli:customer:query')")
public CommonResult<CustomerRespVO> getCustomer(@RequestParam("id") Long id) {
CustomerDO customer = customerService.getCustomer(id);
return success(BeanUtils.toBean(customer, CustomerRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得客户新表分页")
@PreAuthorize("@ss.hasPermission('heli:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getCustomerPage(@Valid CustomerPageReqVO pageReqVO) {
PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, CustomerRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出客户新表 Excel")
@PreAuthorize("@ss.hasPermission('heli:customer:export')")
@OperateLog(type = EXPORT)
public void exportCustomerExcel(@Valid CustomerPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<CustomerDO> list = customerService.getCustomerPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "客户新表.xls", "数据", CustomerRespVO.class,
BeanUtils.toBean(list, CustomerRespVO.class));
}
}

@ -0,0 +1,122 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 客户新表分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CustomerPageReqVO extends PageParam {
@Schema(description = "主键id", example = "12756")
private Long id;
@Schema(description = "客户编码")
private String code;
@Schema(description = "客户简称")
private String brief;
@Schema(description = "客户全称", example = "赵六")
private String name;
@Schema(description = "所属行业")
private String industry;
@Schema(description = "客户级别.字典")
private Integer level;
@Schema(description = "业务员,对应用户ID", example = "5426")
private Long userId;
@Schema(description = "备注", example = "你猜")
private String description;
@Schema(description = "联系人姓名1姓名", example = "赵六")
private String contact1Name;
@Schema(description = "联系人姓名1岗位")
private String contact1Post;
@Schema(description = "联系人姓名1方法")
private String contact1Method;
@Schema(description = "联系人姓名1邮箱")
private String contact1Email;
@Schema(description = "联系人姓名1地址")
private String contact1Addr;
@Schema(description = "联系人姓名2姓名", example = "赵六")
private String contact2Name;
@Schema(description = "联系人姓名2岗位")
private String contact2Post;
@Schema(description = "联系人姓名2方法")
private String contact2Method;
@Schema(description = "联系人姓名2邮箱")
private String contact2Email;
@Schema(description = "联系人姓名2地址")
private String contact2Addr;
@Schema(description = "联系人姓名3姓名", example = "赵六")
private String contact3Name;
@Schema(description = "联系人姓名3岗位")
private String contact3Post;
@Schema(description = "联系人姓名3方法")
private String contact3Method;
@Schema(description = "联系人姓名3邮箱")
private String contact3Email;
@Schema(description = "联系人姓名3地址")
private String contact3Addr;
@Schema(description = "状态,1 表示正常2 表示禁用", example = "1")
private Integer status;
@Schema(description = "记录的创建人,对应员工表中的 Id")
private String creator;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "记录的修改人,对应员工表中的 Id")
private String updater;
@Schema(description = "更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] updateTime;
@Schema(description = "客户logo")
private String logo;
@Schema(description = "付款方式", example = "1")
private String payType;
@Schema(description = "账户名称", example = "芋艿")
private String accountName;
@Schema(description = "银行账号")
private String bankNo;
@Schema(description = "开户行")
private String bankAddress;
@Schema(description = "公司税号")
private String taxNo;
}

@ -0,0 +1,155 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
@Schema(description = "管理后台 - 客户新表 Response VO")
@Data
@ExcelIgnoreUnannotated
public class CustomerRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12756")
@ExcelProperty("主键id")
private Long id;
@Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客户编码")
private String code;
@Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客户简称")
private String brief;
@Schema(description = "客户全称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty("客户全称")
private String name;
@Schema(description = "所属行业")
@ExcelProperty("所属行业")
private String industry;
@Schema(description = "客户级别.字典", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客户级别.字典")
private Integer level;
@Schema(description = "业务员,对应用户ID", example = "5426")
@ExcelProperty("业务员,对应用户ID")
private Long userId;
@Schema(description = "备注", example = "你猜")
@ExcelProperty("备注")
private String description;
@Schema(description = "联系人姓名1姓名", example = "赵六")
@ExcelProperty("联系人姓名1姓名")
private String contact1Name;
@Schema(description = "联系人姓名1岗位")
@ExcelProperty("联系人姓名1岗位")
private String contact1Post;
@Schema(description = "联系人姓名1方法")
@ExcelProperty("联系人姓名1方法")
private String contact1Method;
@Schema(description = "联系人姓名1邮箱")
@ExcelProperty("联系人姓名1邮箱")
private String contact1Email;
@Schema(description = "联系人姓名1地址")
@ExcelProperty("联系人姓名1地址")
private String contact1Addr;
@Schema(description = "联系人姓名2姓名", example = "赵六")
@ExcelProperty("联系人姓名2姓名")
private String contact2Name;
@Schema(description = "联系人姓名2岗位")
@ExcelProperty("联系人姓名2岗位")
private String contact2Post;
@Schema(description = "联系人姓名2方法")
@ExcelProperty("联系人姓名2方法")
private String contact2Method;
@Schema(description = "联系人姓名2邮箱")
@ExcelProperty("联系人姓名2邮箱")
private String contact2Email;
@Schema(description = "联系人姓名2地址")
@ExcelProperty("联系人姓名2地址")
private String contact2Addr;
@Schema(description = "联系人姓名3姓名", example = "赵六")
@ExcelProperty("联系人姓名3姓名")
private String contact3Name;
@Schema(description = "联系人姓名3岗位")
@ExcelProperty("联系人姓名3岗位")
private String contact3Post;
@Schema(description = "联系人姓名3方法")
@ExcelProperty("联系人姓名3方法")
private String contact3Method;
@Schema(description = "联系人姓名3邮箱")
@ExcelProperty("联系人姓名3邮箱")
private String contact3Email;
@Schema(description = "联系人姓名3地址")
@ExcelProperty("联系人姓名3地址")
private String contact3Addr;
@Schema(description = "状态,1 表示正常2 表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "状态,1 表示正常2 表示禁用", converter = DictConvert.class)
@DictFormat("heli_system_common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private Integer status;
@Schema(description = "创建人")
@ExcelProperty("创建人")
private String creator;
@Schema(description = "修改人")
@ExcelProperty("修改人")
private String updater;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
@Schema(description = "客户logo")
@ExcelProperty("客户logo")
private String logo;
@Schema(description = "付款方式", example = "1")
@ExcelProperty("付款方式")
private String payType;
@Schema(description = "账户名称", example = "芋艿")
@ExcelProperty("账户名称")
private String accountName;
@Schema(description = "银行账号")
@ExcelProperty("银行账号")
private String bankNo;
@Schema(description = "开户行")
@ExcelProperty("开户行")
private String bankAddress;
@Schema(description = "公司税号")
@ExcelProperty("公司税号")
private String taxNo;
}

@ -0,0 +1,108 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 客户新表新增/修改 Request VO")
@Data
public class CustomerSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12756")
private Long id;
@Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "客户编码不能为空")
private String code;
@Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "客户简称不能为空")
private String brief;
@Schema(description = "客户全称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "客户全称不能为空")
private String name;
@Schema(description = "所属行业")
private String industry;
@Schema(description = "客户级别.字典", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "客户级别.字典不能为空")
private Integer level;
@Schema(description = "业务员,对应用户ID", example = "5426")
private Long userId;
@Schema(description = "备注", example = "你猜")
private String description;
@Schema(description = "联系人姓名1姓名", example = "赵六")
private String contact1Name;
@Schema(description = "联系人姓名1岗位")
private String contact1Post;
@Schema(description = "联系人姓名1方法")
private String contact1Method;
@Schema(description = "联系人姓名1邮箱")
private String contact1Email;
@Schema(description = "联系人姓名1地址")
private String contact1Addr;
@Schema(description = "联系人姓名2姓名", example = "赵六")
private String contact2Name;
@Schema(description = "联系人姓名2岗位")
private String contact2Post;
@Schema(description = "联系人姓名2方法")
private String contact2Method;
@Schema(description = "联系人姓名2邮箱")
private String contact2Email;
@Schema(description = "联系人姓名2地址")
private String contact2Addr;
@Schema(description = "联系人姓名3姓名", example = "赵六")
private String contact3Name;
@Schema(description = "联系人姓名3岗位")
private String contact3Post;
@Schema(description = "联系人姓名3方法")
private String contact3Method;
@Schema(description = "联系人姓名3邮箱")
private String contact3Email;
@Schema(description = "联系人姓名3地址")
private String contact3Addr;
@Schema(description = "状态,1 表示正常2 表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态,1 表示正常2 表示禁用不能为空")
private Integer status;
@Schema(description = "客户logo")
private String logo;
@Schema(description = "付款方式", example = "1")
private String payType;
@Schema(description = "账户名称", example = "芋艿")
private String accountName;
@Schema(description = "银行账号")
private String bankNo;
@Schema(description = "开户行")
private String bankAddress;
@Schema(description = "公司税号")
private String taxNo;
}

@ -0,0 +1,151 @@
package com.chanko.yunxi.mes.module.heli.dal.dataobject.customer;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("base_customer")
@KeySequence("base_customer_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CustomerDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String code;
/**
*
*/
private String brief;
/**
*
*/
private String name;
/**
*
*/
private String industry;
/**
* .
*
* {@link TODO heli_customer_level }
*/
private Integer level;
/**
* ID,ID
*/
private String userId;
/**
*
*/
private String description;
/**
* 1
*/
private String contact1Name;
/**
* 1
*/
private String contact1Post;
/**
* 1
*/
private String contact1Method;
/**
* 1
*/
private String contact1Email;
/**
* 1
*/
private String contact1Addr;
/**
* 2
*/
private String contact2Name;
/**
* 2
*/
private String contact2Post;
/**
* 2
*/
private String contact2Method;
/**
* 2
*/
private String contact2Email;
/**
* 2
*/
private String contact2Addr;
/**
* 3
*/
private String contact3Name;
/**
* 3
*/
private String contact3Post;
/**
* 3
*/
private String contact3Method;
/**
* 3
*/
private String contact3Email;
/**
* 3
*/
private String contact3Addr;
/**
* ,1 2
*
* {@link TODO heli_common_status }
*/
private Integer status;
/**
* logo
*/
private String logo;
/**
*
*/
private String payType;
/**
*
*/
private String accountName;
/**
*
*/
private String bankNo;
/**
*
*/
private String bankAddress;
/**
*
*/
private String taxNo;
}

@ -0,0 +1,28 @@
package com.chanko.yunxi.mes.module.heli.dal.mysql.customer;
import java.util.*;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import org.apache.ibatis.annotations.Mapper;
import com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface CustomerMapper extends BaseMapperX<CustomerDO> {
default PageResult<CustomerDO> selectPage(CustomerPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<CustomerDO>()
.likeIfPresent(CustomerDO::getCode, reqVO.getCode())
.likeIfPresent(CustomerDO::getBrief, reqVO.getBrief())
.eqIfPresent(CustomerDO::getStatus, reqVO.getStatus())
.orderByDesc(CustomerDO::getId));
}
}

@ -0,0 +1,55 @@
package com.chanko.yunxi.mes.module.heli.service.customer;
import java.util.*;
import javax.validation.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
/**
* Service
*
* @author
*/
public interface CustomerService {
/**
*
*
* @param createReqVO
* @return
*/
Long createCustomer(@Valid CustomerSaveReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateCustomer(@Valid CustomerSaveReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteCustomer(Long id);
/**
*
*
* @param id
* @return
*/
CustomerDO getCustomer(Long id);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO);
}

@ -0,0 +1,74 @@
package com.chanko.yunxi.mes.module.heli.service.customer;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.customer.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.module.heli.dal.mysql.customer.CustomerMapper;
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class CustomerServiceImpl implements CustomerService {
@Resource
private CustomerMapper customerMapper;
@Override
public Long createCustomer(CustomerSaveReqVO createReqVO) {
// 插入
CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
customerMapper.insert(customer);
// 返回
return customer.getId();
}
@Override
public void updateCustomer(CustomerSaveReqVO updateReqVO) {
// 校验存在
validateCustomerExists(updateReqVO.getId());
// 更新
CustomerDO updateObj = BeanUtils.toBean(updateReqVO, CustomerDO.class);
customerMapper.updateById(updateObj);
}
@Override
public void deleteCustomer(Long id) {
// 校验存在
validateCustomerExists(id);
// 删除
customerMapper.deleteById(id);
}
private void validateCustomerExists(Long id) {
if (customerMapper.selectById(id) == null) {
throw exception(CUSTOMER_NOT_EXISTS);
}
}
@Override
public CustomerDO getCustomer(Long id) {
return customerMapper.selectById(id);
}
@Override
public PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO) {
return customerMapper.selectPage(pageReqVO);
}
}

@ -0,0 +1,12 @@
<?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.chanko.yunxi.mes.module.heli.dal.mysql.customer.CustomerMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,64 @@
import request from '@/config/axios'
export interface CustomerVO {
id: number
code: string
brief: string
name: string
industry: string
level: number
userId: string
description: string
contact1Name: string
contact1Post: string
contact1Method: string
contact1Email: string
contact1Addr: string
contact2Name: string
contact2Post: string
contact2Method: string
contact2Email: string
contact2Addr: string
contact3Name: string
contact3Post: string
contact3Method: string
contact3Email: string
contact3Addr: string
status: number
logo: string
payType: string
accountName: string
bankNo: string
bankAddress: string
taxNo: string
}
// 查询客户新表分页
export const getCustomerPage = async (params) => {
return await request.get({ url: `/heli/customer/page`, params })
}
// 查询客户新表详情
export const getCustomer = async (id: number) => {
return await request.get({ url: `/heli/customer/get?id=` + id })
}
// 新增客户新表
export const createCustomer = async (data: CustomerVO) => {
return await request.post({ url: `/heli/customer/create`, data })
}
// 修改客户新表
export const updateCustomer = async (data: CustomerVO) => {
return await request.put({ url: `/heli/customer/update`, data })
}
// 删除客户新表
export const deleteCustomer = async (id: number) => {
return await request.delete({ url: `/heli/customer/delete?id=` + id })
}
// 导出客户新表 Excel
export const exportCustomer = async (params) => {
return await request.download({ url: `/heli/customer/export-excel`, params })
}

@ -206,5 +206,6 @@ export enum DICT_TYPE {
CRM_PRODUCT_STATUS = 'crm_product_status',
CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别
HELI_COMMON_STATUS = 'heli_common_status'
HELI_COMMON_STATUS = 'heli_common_status',// 业务实体启用禁用状态
HELI_CUSTOMER_LEVEL = 'heli_customer_level' //合立客户级别
}

@ -23,7 +23,7 @@
<el-input v-model="formData.address" placeholder="请输入客户地址" />
</el-form-item>
<el-form-item label="描述信息" prop="description">
<Editor v-model="formData.description" height="150px" />
<el-input v-model="formData.description" height="150px" type="textarea" placeholder="请输入描述信息"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">

@ -0,0 +1,436 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="1500">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
<el-card class="xy-card-info">
<template #header>
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">基础信息</span>
</template>
<template #default>
<el-row>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item label="公司LOGO" prop="logo">
<UploadImg v-model="formData.logo" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item prop="code" label="客户编码" required>
<el-input v-model="formData.code" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item prop="name" label="客户全称" required>
<el-input v-model="formData.name" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item prop="level" label="客户级别">
<el-select v-model="formData.level" clearable class="!w-400px">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CUSTOMER_LEVEL)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="description">
<el-input type="textarea" v-model="formData.description" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item prop="brief" label="客户简称" required>
<el-input v-model="formData.brief" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item prop="industry" label="所属行业">
<el-input v-model="formData.industry" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="业务员" prop="userId">
<!-- <el-input v-model="formData.userId" placeholder="请输入联系人" /> -->
<el-select v-model="formData.userId" clearable class="!w-400px" filterable>
<el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
</el-card>
<el-card class="xy-card-info">
<template #header>
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">联系方式</span>
</template>
<template #default>
<el-row>
<el-col :span="5">
<el-row>
<el-col :span="20">
<el-form-item label="联系人姓名1" prop="contact1Name">
<el-input v-model="formData.contact1Name" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="联系人姓名2" prop="contact2Name">
<el-input v-model="formData.contact2Name" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="联系人姓名3" prop="contact3Name">
<el-input v-model="formData.contact3Name" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="20">
<el-form-item label="岗位" prop="contact1Post">
<el-input v-model="formData.contact1Post" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="岗位" prop="contact2Post">
<el-input v-model="formData.contact2Post" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="岗位" prop="contact3Post">
<el-input v-model="formData.contact3Post" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="20">
<el-form-item label="联系方法" prop="contact1Method">
<el-input v-model="formData.contact1Method" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="联系方法" prop="contact2Method">
<el-input v-model="formData.contact2Method" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="联系方法" prop="contact3Method">
<el-input v-model="formData.contact3Method" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="20">
<el-form-item label="邮箱" prop="contact1Email">
<el-input v-model="formData.contact1Email" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="邮箱" prop="contact2Email">
<el-input v-model="formData.contact2Email" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="邮箱" prop="contact3Email">
<el-input v-model="formData.contact3Email" />
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="客户地址1" prop="contact1Addr">
<el-input v-model="formData.contact1Addr" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="客户地址2" prop="contact2Addr">
<el-input v-model="formData.contact2Addr" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="客户地址3" prop="contact3Addr">
<el-input v-model="formData.contact3Addr" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" class="ml-2" />
</el-form-item>
</el-col>
</el-row>
</template>
</el-card>
<el-card class="xy-card-info">
<template #header>
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">财务信息</span>
</template>
<template #default>
<el-row>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item label="付款方式" prop="payType">
<el-input v-model="formData.payType" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="开户行" prop="bankAddress">
<el-input v-model="formData.bankAddress" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item label="账户名称" prop="accountName">
<el-input v-model="formData.accountName" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="公司税号" prop="taxNo">
<el-input v-model="formData.taxNo" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item label="银行账号" prop="bankNo">
<el-input v-model="formData.bankNo" />
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
</el-card>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import * as CustomerApi from '@/api/heli/customer'
import * as UserApi from '@/api/system/user'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
code: undefined,
brief: undefined,
name: undefined,
industry: undefined,
level: undefined,
userId: undefined,
description: undefined,
contact1Name: undefined,
contact1Post: undefined,
contact1Method: undefined,
contact1Email: undefined,
contact1Addr: undefined,
contact2Name: undefined,
contact2Post: undefined,
contact2Method: undefined,
contact2Email: undefined,
contact2Addr: undefined,
contact3Name: undefined,
contact3Post: undefined,
contact3Method: undefined,
contact3Email: undefined,
contact3Addr: undefined,
status: undefined,
logo: undefined,
logo: undefined,
payType: undefined,
accountName: undefined,
bankNo: undefined,
bankAddress: undefined,
taxNo: undefined,
})
const formRules = reactive({
code: [{ required: true, message: '客户编码不能为空', trigger: 'blur' }],
brief: [{ required: true, message: '客户简称不能为空', trigger: 'blur' }],
name: [{ required: true, message: '客户全称不能为空', trigger: 'blur' }],
// status: [{ required: true, message: ',1 2 ', trigger: 'blur' }],
})
const formRef = ref() // Ref
const userList = ref<UserApi.UserVO[]>([]) //
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
userList.value = await UserApi.getSimpleUserList()
userList.value.forEach(element => {
element.value = element.id
element.label = element.nickname
});
dialogVisible.value = true
dialogTitle.value = type === "create" ? "新增客户信息" : "编辑客户信息"//t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await CustomerApi.getCustomer(id)
formData.value.status = formData.value.status === 1 ?ref(true):ref(false)
} finally {
formLoading.value = false
}
} else {
formData.value.status = ref(true)
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as CustomerApi.CustomerVO
data.status = data.status == true ?1 :2
if (formType.value === 'create') {
await CustomerApi.createCustomer(data)
message.success(t('common.createSuccess'))
} else {
await CustomerApi.updateCustomer(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
code: undefined,
brief: undefined,
name: undefined,
industry: undefined,
level: undefined,
userId: undefined,
description: undefined,
contact1Name: undefined,
contact1Post: undefined,
contact1Method: undefined,
contact1Email: undefined,
contact1Addr: undefined,
contact2Name: undefined,
contact2Post: undefined,
contact2Method: undefined,
contact2Email: undefined,
contact2Addr: undefined,
contact3Name: undefined,
contact3Post: undefined,
contact3Method: undefined,
contact3Email: undefined,
contact3Addr: undefined,
status: undefined,
logo: undefined,
}
formRef.value?.resetFields()
}
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="客户编码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入客户编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户简称" prop="brief">
<el-input
v-model="queryParams.brief"
placeholder="请输入客户简称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_COMMON_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['heli:customer:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="客户编码" align="center" prop="code" />
<el-table-column label="客户简称" align="center" prop="brief" />
<el-table-column label="客户全称" align="center" prop="name" />
<el-table-column label="所属行业" align="center" prop="industry" />
<el-table-column label="客户级别" align="center" prop="level">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_CUSTOMER_LEVEL" :value="scope.row.level" />
</template>
</el-table-column>
<el-table-column label="业务员" align="center" prop="userId" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_COMMON_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="creator" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="修改人" align="center" prop="updater" />
<el-table-column
label="更新时间"
align="center"
prop="updateTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<CustomerForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as CustomerApi from '@/api/heli/customer'
import CustomerForm from './CustomerForm.vue'
defineOptions({ name: 'Customer' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: undefined,
brief: undefined,
status: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CustomerApi.getCustomerPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CustomerApi.deleteCustomer(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerApi.exportCustomer(queryParams)
download.excel(data, '客户新表.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

@ -1,3 +1,47 @@
DROP TABLE IF EXISTS `base_customer`;
CREATE TABLE `base_customer` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户编码',
`brief` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户简称',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户全称',
`industry` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '所属行业',
`level` tinyint(1) NOT NULL COMMENT '客户级别.字典',
`user_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人ID,对应用户ID',
`desc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
`contact1_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名1姓名',
`contact1_post` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名1岗位',
`contact1_method` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名1方法',
`contact1_email` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名1邮箱',
`contact1_addr1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名1地址',
`contact2_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名2姓名',
`contact2_post` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名2岗位',
`contact2_method` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名2方法',
`contact2_email` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名2邮箱',
`contact1_addr2` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名2地址',
`contact3_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名3姓名',
`contact3_post` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名3岗位',
`contact3_method` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名3方法',
`contact3_email` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名3邮箱',
`contact1_addr3` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人姓名3地址',
`status` tinyint(1) NOT NULL COMMENT '状态,1 表示正常2 表示禁用',
`deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1.是,0.否',
`creator` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '记录的创建人,对应员工表中的 Id',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '记录的修改人,对应员工表中的 Id',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客户新表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `base_client`;
CREATE TABLE `base_client` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一',
@ -214,7 +258,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
DROP TABLE IF EXISTS `wms_wh`;
CREATE TABLE `wms_wh` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wh_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '仓库编号,唯一',
`wh_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '仓库名称,唯一',
`contact` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '联系人',
@ -235,7 +279,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_rg`;
CREATE TABLE `wms_rg` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`rg_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '库区编号,唯一',
`rg_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '库区名称,唯一',
`wh_id` bigint(19) NOT NULL COMMENT '仓库 Id对应 wms_wh 表中的Id',
@ -256,7 +300,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_pn`;
CREATE TABLE `wms_pn` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`pn_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '库位编号,唯一',
`pn_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '库位名称,唯一',
`rg_id` bigint(19) NOT NULL COMMENT '库区 Id对应 wms_rg 表中的Id',
@ -279,7 +323,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_check_m_plan`;
CREATE TABLE `wms_check_m_plan` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`plan_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '编号,唯一',
`plan_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称,唯一',
`part_scope` char(1) NOT NULL DEFAULT 'N' COMMENT '只能填写 Y 或者 NY 表示包含零库存物料N 则反之,默认值是 N',
@ -305,7 +349,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_check_d_plan`;
CREATE TABLE `wms_check_d_plan` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`plan_id` bigint(19) NOT NULL COMMENT '盘点计划 Id对应wms_check_m_plan 表中的 Id',
`wh_id` bigint(19) NOT NULL COMMENT '仓库 Id对应 wms_wh 表中的Id 列',
`d_plan_status` tinyint NOT NULL COMMENT '状态,1 表示正常2 表示禁用',
@ -325,7 +369,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_check_op`;
CREATE TABLE `wms_check_op` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`plan_id` bigint(19) NOT NULL COMMENT '盘点计划 Id对应wms_check_m_plan 表中的 Id',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id对应 sys_part 表中的 Id',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品批号',
@ -351,7 +395,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_temp_recv`;
CREATE TABLE `wms_temp_recv` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品批号',
`recv_qty` bigint NOT NULL COMMENT '接收的数量',
@ -376,7 +420,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_storage`;
CREATE TABLE `wms_storage` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品批号',
`wh_id` bigint(19) NOT NULL COMMENT '仓库 Id对应 wms_wh 表中的Id',
@ -401,7 +445,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_storage_log`;
CREATE TABLE `wms_storage_log` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品批号',
`wh_id` bigint(19) NOT NULL COMMENT '仓库 Id对应 wms_wh 表中的Id',
@ -426,7 +470,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `wms_deliver_part`;
CREATE TABLE `wms_deliver_part` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`so_id` bigint(19) NOT NULL COMMENT '销售订单 Id对应 int_m_so中 Id',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品批号',
@ -450,7 +494,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_plan`;
CREATE TABLE `pro_plan` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`plan_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '生产计划编号',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`plan_qty` int(11) NOT NULL COMMENT '计划数量',
@ -484,7 +528,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_wo`;
CREATE TABLE `pro_wo` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '生产工单编号',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 表中的 Id 列',
`plan_qty` int(11) NOT NULL COMMENT '计划数量',
@ -520,7 +564,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_wo_sn`;
CREATE TABLE `pro_wo_sn` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`seq` int(11) NOT NULL COMMENT '条码顺序号,每张工单的条码顺序号从 1 开始编号,最大值等于工单的计划数量',
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品条码',
@ -540,7 +584,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_issue_part`;
CREATE TABLE `pro_issue_part` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`line_id` bigint(19) NOT NULL COMMENT '生产线 Id,对应 sys_line 中的 Id',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 sys_part 中的Id 列',
@ -565,7 +609,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_put_in_storage`;
CREATE TABLE `pro_put_in_storage` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`line_id` bigint(19) NOT NULL COMMENT '生产线 Id,对应 sys_line 中的 Id,生产入库的时候必须填写,委外入库的时候填写null',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 sys_part 中的Id 列',
@ -590,7 +634,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_piece_status`;
CREATE TABLE `pro_piece_status` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`route_id` bigint(19) NOT NULL COMMENT '工艺路线 Id,对应 sys_m_route中的Id',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 sys_part 中的Id 列',
@ -615,7 +659,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_piece_status_log`;
CREATE TABLE `pro_piece_status_log` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`route_id` bigint(19) NOT NULL COMMENT '工艺路线 Id,对应 sys_m_route中的Id',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 sys_part 中的Id 列',
@ -641,7 +685,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_piece_count`;
CREATE TABLE `pro_piece_count` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`part_id` bigint(19) NOT NULL COMMENT '物料 Id,对应 sys_part 中的Id 列',
`line_id` bigint(19) NOT NULL COMMENT '生产线 Id,对应 sys_line 中的 Id',
@ -673,7 +717,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_temp_kpsn`;
CREATE TABLE `pro_temp_kpsn` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品条码',
`kp_ barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '原材料条码',
`tn_id` bigint(19) NOT NULL COMMENT '工位 Id,对应 sys_tn 中的 Id',
@ -693,7 +737,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_assy_kpsn`;
CREATE TABLE `pro_assy_kpsn` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品条码',
`kp_ barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原材料条码',
`tn_id` bigint(19) NOT NULL COMMENT '工位 Id,对应 sys_tn 中的 Id',
@ -712,7 +756,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_report_work`;
CREATE TABLE `pro_report_work` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '工单 Id,对应 pro_wo 表中的Id 列',
`lot_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '物料批号',
`work_date` date NOT NULL COMMENT '生产日期(日期部分)',
@ -737,7 +781,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_pack_m_data`;
CREATE TABLE `pro_pack_m_data` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`carton_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '箱号',
`carton_close_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '箱子是否关闭,Y 表示关闭,N 表示未关闭,默认是 N',
`deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1.是,0.否',
@ -755,7 +799,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `pro_pack_d_data`;
CREATE TABLE `pro_pack_d_data` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`wo_id` bigint(19) NOT NULL COMMENT '生产工单 Id',
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品条码',
`carton_no` tinyint(19) NOT NULL COMMENT '箱号',
@ -775,7 +819,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `qms_sys_check_item`;
CREATE TABLE `qms_sys_check_item` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`check_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检验项编号',
`check_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '检验项名称,唯一',
`check_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型,只能填写功能或者外观',
@ -801,7 +845,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `qms_sys_m_check`;
CREATE TABLE `qms_sys_m_check` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`part_id` bigint(19) NOT NULL COMMENT '成品 Id,对应 sys_part 中的id 列',
`check_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型,只能填写功能或者外观',
`check_status` tinyint(1) NOT NULL COMMENT '状态,1 表示正常,2 表示作废',
@ -820,7 +864,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `qms_sys_d_check`;
CREATE TABLE `qms_sys_d_check` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`check_id` bigint(19) NOT NULL COMMENT '对应 qms_sys_m_check 中的id 列',
`ps_id` bigint(19) NOT NULL COMMENT '工序 Id,对应 sys_ps 中的 id',
`check_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检验项编号观',
@ -848,7 +892,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `qms_m_check`;
CREATE TABLE `qms_m_check` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品条码',
`ps_id` bigint(19) NOT NULL COMMENT '工序 Id,对应 sys_ps 中的 id',
`check_result` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '检验结果,Y 表示合格,N 表示不合格',
@ -868,7 +912,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `qms_d_check`;
CREATE TABLE `qms_d_check` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`check_result_id` bigint(19) NOT NULL COMMENT '对应 qms_m_check 中的 id 列',
`check_id` bigint(19) NOT NULL COMMENT '对应 qms_sys_m_check 中的id 列',
`ps_id` bigint(19) NOT NULL COMMENT '工序 Id,对应 sys_ps 中的 id',
@ -898,7 +942,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `eqt_type`;
CREATE TABLE `eqt_type` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`type_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备类型编号,唯一',
`type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备类型名称,唯一',
`eqt_status` tinyint(1) NOT NULL COMMENT '状态,1 表示正常2 表示报废3 表示设备暂时不可用',
@ -920,7 +964,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `eqt_type_mtn_item`;
CREATE TABLE `eqt_type_mtn_item` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`eqt_type` bigint(20) NOT NULL COMMENT '设备类型 Id对应表eqt_type 的 Id 列',
`mtn_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备保养项目编号,唯一',
`mtn_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备保养项目名称,唯一',
@ -941,7 +985,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `eqt_base`;
CREATE TABLE `eqt_base` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`eqt_type` bigint(20) NOT NULL COMMENT '设备类型 Id对应表eqt_type 的 Id 列',
`eqt_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备编号,唯一',
`eqt_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
@ -964,7 +1008,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `int_m_po`;
CREATE TABLE `int_m_po` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`po_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '采购单号,唯一',
`po_status` tinyint(1) NULL DEFAULT 1 COMMENT '状态,1 表示正常2 表示作废',
`deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1.是,0.否',
@ -982,7 +1026,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `int_d_po`;
CREATE TABLE `int_d_po` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`po_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '采购单号,唯一',
`po_item` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '采购单项次',
`part_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '物料编码',
@ -1002,7 +1046,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `int_m_so`;
CREATE TABLE `int_m_so` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`so_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '销售订单号,唯一',
`so_status` tinyint NULL DEFAULT null COMMENT '状态,1 表示正常2 表示作废',
`customer_id` bigint NULL DEFAULT null COMMENT '客户 Id对应 sys_customer',
@ -1021,7 +1065,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
DROP TABLE IF EXISTS `int_d_so`;
CREATE TABLE `int_d_so` (
`id` bigint(19) NOT NULL COMMENT '主键id',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`so_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '销售订单号',
`so_item` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '销售订单项次',
`part_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品编码',

Loading…
Cancel
Save