diff --git a/pom.xml b/pom.xml index 0fab0160..493f617d 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,8 @@ yudao-module-pay zsw-farm zsw-bxg + zsw-erp + zsw-spi ${project.artifactId} diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index fd03b261..bb90f0f3 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -48,7 +48,7 @@ 1.18.20 1.4.1.Final - 5.6.1 + 5.8.0.M1 2.2.7 2.2 1.0.5 diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index b249b9e9..c20c98d6 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -28,6 +28,11 @@ zsw-bxg ${revision} + + cn.iocoder.boot + zsw-erp + ${revision} + cn.iocoder.boot diff --git a/zsw-erp/pom.xml b/zsw-erp/pom.xml new file mode 100644 index 00000000..ff640d8c --- /dev/null +++ b/zsw-erp/pom.xml @@ -0,0 +1,103 @@ + + + + yudao + cn.iocoder.boot + ${revision} + + 4.0.0 + + jar + zsw-erp + ${project.artifactId} + + + UTF-8 + UTF-8 + 1.8 + 3.0.5 + + + + + + com.zsw + pos-spi + 1.0-SNAPSHOT + + + + + com.qiniu + qiniu-java-sdk + 7.9.2 + + + + cn.iocoder.boot + yudao-module-system-impl + 1.6.2-snapshot + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-weixin + ${revision} + + + cn.iocoder.boot + yudao-common + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-pay + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-mybatis + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-web + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-redis + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-security + ${revision} + + + cn.iocoder.boot + yudao-spring-boot-starter-extension + ${revision} + + + org.springframework.boot + spring-boot-starter-websocket + 2.5.10 + + + + org.apache.dubbo + dubbo-spring-boot-starter + ${dubbo.version} + + + log4j + log4j + + + + + + + diff --git a/zsw-erp/src/main/java/com/zsw/erp/ErpService.java b/zsw-erp/src/main/java/com/zsw/erp/ErpService.java new file mode 100644 index 00000000..19c4cf77 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/ErpService.java @@ -0,0 +1,20 @@ +package com.zsw.erp; + +import com.zsw.erp.datasource.entities.Depot; +import com.zsw.erp.datasource.entities.Unit; +import com.zsw.erp.dto.material.MaterialDto; + +import java.util.List; + +public interface ErpService { + + // 获取原物料 + List findMaterial(MaterialDto dto); + + // 获取仓库列表 + List findDepot(); + + // 获取物料单位 + List findUnit(); + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/annotation/Query.java b/zsw-erp/src/main/java/com/zsw/erp/annotation/Query.java new file mode 100644 index 00000000..6f90580d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/annotation/Query.java @@ -0,0 +1,52 @@ +package com.zsw.erp.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Query { + + // 基本对象的属性名 + String propName() default ""; + // 查询方式 + Type type() default Type.EQUAL; + /** + * 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username") + */ + String blurry() default ""; + + enum Type { + // jie 2019/6/4 相等 + EQUAL + // Dong ZhaoYang 2017/8/7 大于等于 + , GREATER_THAN + //大于 + , GREATER_THAN_NQ + // Dong ZhaoYang 2017/8/7 小于等于 + , LESS_THAN + // Dong ZhaoYang 2017/8/7 中模糊查询 + , INNER_LIKE + // Dong ZhaoYang 2017/8/7 左模糊查询 + , LEFT_LIKE + // Dong ZhaoYang 2017/8/7 右模糊查询 + , RIGHT_LIKE + // Dong ZhaoYang 2017/8/7 小于 + , LESS_THAN_NQ + // jie 2019/6/4 包含 + , IN + // 不等于 + ,NOT_EQUAL + // between + ,BETWEEN + // 不为空 + ,NOT_NULL + // 查询时间 + ,UNIX_TIMESTAMP + } + +} + diff --git a/zsw-erp/src/main/java/com/zsw/erp/config/ArrayListTypeHandler.java b/zsw-erp/src/main/java/com/zsw/erp/config/ArrayListTypeHandler.java new file mode 100644 index 00000000..60ba9d36 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/config/ArrayListTypeHandler.java @@ -0,0 +1,23 @@ +package com.zsw.erp.config; + +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; +import com.zsw.erp.datasource.entities.BtnDto; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; + +@Slf4j +public class ArrayListTypeHandler extends AbstractJsonTypeHandler> { + + + @Override + protected List parse(String json) { + return JSONUtil.toList(json, BtnDto.class); + } + + @Override + protected String toJson(List obj) { + return JSONUtil.toJsonStr(obj); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/config/QiniuConfigProperty.java b/zsw-erp/src/main/java/com/zsw/erp/config/QiniuConfigProperty.java new file mode 100644 index 00000000..5cf8b82a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/config/QiniuConfigProperty.java @@ -0,0 +1,20 @@ +package com.zsw.erp.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "qiniu") +@Data +public class QiniuConfigProperty { + + private String zone; + + private String access; + + private String secret; + + private String bucket; + + private String pre; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/constants/BusinessConstants.java b/zsw-erp/src/main/java/com/zsw/erp/constants/BusinessConstants.java new file mode 100644 index 00000000..c3ff63ab --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/constants/BusinessConstants.java @@ -0,0 +1,191 @@ +package com.zsw.erp.constants; + +/** + * @ClassName:BusinessConstants + * @Description 业务字典类 + * @Author qiankunpingtai + * @Date 2019-3-6 17:58 + * @Version 1.0 + **/ +public class BusinessConstants { + + /** + * 默认的日期格式 + */ + public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + /** + * 一天的初始时间 + */ + public static final String DAY_FIRST_TIME = " 00:00:00"; + /** + * 一天的结束时间 + */ + public static final String DAY_LAST_TIME = " 23:59:59"; + /** + * 默认的分页起始页页码 + */ + public static final Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1; + /** + * 无数据时列表返回的默认数据条数 + */ + public static final Long DEFAULT_LIST_NULL_NUMBER = 0L; + /** + * 默认的分页条数 + */ + public static final Integer DEFAULT_PAGINATION_PAGE_SIZE = 10; + /** + * 单据主表出入库类型 type 入库 出库 其它 + * depothead + * */ + public static final String DEPOTHEAD_TYPE_IN = "入库"; + public static final String DEPOTHEAD_TYPE_OUT = "出库"; + public static final String DEPOTHEAD_TYPE_OTHER = "其它"; + /** + * 付款类型 payType //现付/预付款 + * */ + public static final String PAY_TYPE_PREPAID = "预付款"; + public static final String PAY_TYPE_BY_CASH = "现付"; + /** + * 删除标记 deleteFlag '0'未删除 '1'已删除 + * */ + public static final String DELETE_FLAG_DELETED = "1"; + public static final String DELETE_FLAG_EXISTS = "0"; + /** + * 是否卖出 isSell '0'未卖出 '1'已卖出 + * */ + public static final String IS_SELL_SELLED = "1"; + public static final String IS_SELL_HOLD = "0"; + /** + * 商品是否开启序列号标识enableSerialNumber '0'未启用 '1'启用 + * */ + public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1"; + public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0"; + /** + * 单据状态 billsStatus '0'未审核 '1'审核 '2'完成采购|销售 '3'部分采购|销售 + * */ + public static final String BILLS_STATUS_UN_AUDIT = "0"; + public static final String BILLS_STATUS_AUDIT = "1"; + public static final String BILLS_STATUS_SKIPED = "2"; + public static final String BILLS_STATUS_SKIPING = "3"; + /** + * 出入库分类 + *采购、采购退货、其它、零售、销售、调拨、盘点复盘等 + * */ + public static final String SUB_TYPE_PURCHASE_ORDER = "采购订单"; + public static final String SUB_TYPE_PURCHASE = "采购"; + public static final String SUB_TYPE_PURCHASE_RETURN = "采购退货"; + public static final String SUB_TYPE_OTHER = "其它"; + public static final String SUB_TYPE_RETAIL = "零售"; + public static final String SUB_TYPE_SALES_ORDER = "销售订单"; + public static final String SUB_TYPE_SALES = "销售"; + public static final String SUB_TYPE_SALES_RETURN = "销售退货"; + public static final String SUB_TYPE_TRANSFER = "调拨"; + public static final String SUB_TYPE_REPLAY = "盘点复盘"; + /** + * 批量插入sql时最大的数据条数 + * */ + public static final int BATCH_INSERT_MAX_NUMBER = 500; + /** + * sequence名称 + * */ + //sequence返回字符串的最小长度 + public static final Long SEQ_TO_STRING_MIN_LENGTH = 10000000000L; + //sequence长度小于基准长度时前追加基础值 + public static final String SEQ_TO_STRING_LESS_INSERT = "0"; + //单据编号 + public static final String DEPOT_NUMBER_SEQ = "depot_number_seq"; + /** + * 商品类别根目录id + * */ + /** + * create by: qiankunpingtai + * create time: 2019/3/14 11:41 + * description: + * 为了使用户可以自己建初始目录,设定根目录的父级目录id为-1 + * + */ + public static final Long MATERIAL_CATEGORY_ROOT_PARENT_ID = -1L; + /** + * 商品类别状态 + * 0系统默认,1启用,2删除 + * */ + public static final String MATERIAL_CATEGORY_STATUS_DEFAULT = "0"; + public static final String MATERIAL_CATEGORY_STATUS_ENABLE = "1"; + public static final String MATERIAL_CATEGORY_STATUS_DELETE = "2"; + /** + * 机构状态 + * 1未营业、2正常营业、3暂停营业、4终止营业,5已除名 + * */ + public static final String ORGANIZATION_STCD_NOT_OPEN = "1"; + public static final String ORGANIZATION_STCD_OPEN = "2"; + public static final String ORGANIZATION_STCD_BUSINESS_SUSPENDED = "3"; + public static final String ORGANIZATION_STCD_BUSINESS_TERMINATED = "4"; + public static final String ORGANIZATION_STCD_REMOVED = "5"; + /** + * 根机构父级编号 + * 根机父级构编号默认为-1 + * */ + public static final String ORGANIZATION_ROOT_PARENT_NO = "-1"; + /** + * 新增用户默认密码 + * */ + public static final String USER_DEFAULT_PASSWORD = "123456"; + /** + * 用户是否系统自带 + * 0、非系统自带,1系统自带 + * */ + public static final byte USER_NOT_SYSTEM = 0; + public static final byte USER_IS_SYSTEM = 1; + /** + * 用户是否为管理者 + * 0、管理者,1员工 + * */ + public static final byte USER_IS_MANAGER = 0; + public static final byte USER_NOT_MANAGER = 1; + /** + * 用户状态 + * 0:正常,1:删除,2封禁 + * */ + public static final byte USER_STATUS_NORMAL = 0; + public static final byte USER_STATUS_DELETE = 1; + public static final byte USER_STATUS_BANNED = 2; + /** + * 日志操作 + * 新增、修改、删除、登录、导入 + * */ + public static final String LOG_OPERATION_TYPE_ADD = "新增"; + public static final String LOG_OPERATION_TYPE_BATCH_ADD = "批量新增"; + public static final String LOG_OPERATION_TYPE_EDIT = "修改"; + public static final String LOG_OPERATION_TYPE_DELETE = "删除"; + public static final String LOG_OPERATION_TYPE_LOGIN = "登录"; + public static final String LOG_OPERATION_TYPE_IMPORT = "导入"; + + /** + * 数据数量单位 + * 条 + * */ + public static final String LOG_DATA_UNIT = "条"; + + /** + * 删除类型 + * 1正常删除 + * 2强制删除 + * */ + public static final String DELETE_TYPE_NORMAL = "1"; + public static final String DELETE_TYPE_FORCE = "2"; + + /** + * 默认管理员账号 + */ + public static final String DEFAULT_MANAGER = "admin"; + + public static final String ROLE_TYPE_PRIVATE = "个人数据"; + + public static final String ROLE_TYPE_THIS_ORG = "本机构数据"; + + /** + * redis相关 + * */ + //session的生命周期,秒 + public static final Long MAX_SESSION_IN_SECONDS=60*60*24L*30; +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/constants/ExceptionConstants.java b/zsw-erp/src/main/java/com/zsw/erp/constants/ExceptionConstants.java new file mode 100644 index 00000000..764dd533 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/constants/ExceptionConstants.java @@ -0,0 +1,467 @@ +package com.zsw.erp.constants; + +import com.alibaba.fastjson.JSONObject; + +public class ExceptionConstants { + /** + * code 格式 type+五位数字,例如3500000 + * ResourceInfo(value = "inOutItem", type = 35) + * + * */ + + public static final String GLOBAL_RETURNS_CODE = "code"; + public static final String GLOBAL_RETURNS_MESSAGE = "msg"; + public static final String GLOBAL_RETURNS_DATA = "data"; + + /** + * 正常返回/操作成功 + **/ + public static final int SERVICE_SUCCESS_CODE = 200; + public static final String SERVICE_SUCCESS_MSG = "操作成功"; + /** + * 数据查询异常 + */ + public static final int DATA_READ_FAIL_CODE = 300; + public static final String DATA_READ_FAIL_MSG = "数据查询异常"; + /** + * 数据写入异常 + */ + public static final int DATA_WRITE_FAIL_CODE = 301; + public static final String DATA_WRITE_FAIL_MSG = "数据写入异常"; + + /** + * 系统运行时未知错误 + **/ + public static final int SERVICE_SYSTEM_ERROR_CODE = 500; + public static final String SERVICE_SYSTEM_ERROR_MSG = "未知异常"; + + /** + * 删除操作被拒绝,请联系管理员 + **/ + public static final int DELETE_REFUSED_CODE = 600; + public static final String DELETE_REFUSED_MSG = "删除操作被拒绝,请联系管理员"; + /** + * 检测到存在依赖数据,是否强制删除? + **/ + public static final int DELETE_FORCE_CONFIRM_CODE = 601; + public static final String DELETE_FORCE_CONFIRM_MSG = "检测到存在依赖数据,不能删除!"; + /** + * 用户信息 + * type = 5 + * */ + //添加用户信息失败 + public static final int USER_ADD_FAILED_CODE = 500000; + public static final String USER_ADD_FAILED_MSG = "添加用户信息失败"; + //删除用户信息失败 + public static final int USER_DELETE_FAILED_CODE = 500001; + public static final String USER_DELETE_FAILED_MSG = "删除用户信息失败"; + //修改用户信息失败 + public static final int USER_EDIT_FAILED_CODE = 500002; + public static final String USER_EDIT_FAILED_MSG = "修改用户信息失败"; + //用户名已存在 + public static final int USER_USER_NAME_ALREADY_EXISTS_CODE = 500003; + public static final String USER_USER_NAME_ALREADY_EXISTS_MSG = "用户名在本系统已存在"; + //登录名已存在 + public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003; + public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名在本系统已存在"; + //用户录入数量超出限制 + public static final int USER_OVER_LIMIT_FAILED_CODE = 500004; + public static final String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系管理员"; + //此用户名限制使用 + public static final int USER_NAME_LIMIT_USE_CODE = 500005; + public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用"; + //演示用户不允许删除 + public static final int USER_LIMIT_DELETE_CODE = 500006; + public static final String USER_LIMIT_DELETE_MSG = "抱歉,演示模式下的演示用户不允许删除"; + //演示用户不允许修改 + public static final int USER_LIMIT_UPDATE_CODE = 500007; + public static final String USER_LIMIT_UPDATE_MSG = "抱歉,演示模式下的演示用户不允许修改"; + //租户不能被删除 + public static final int USER_LIMIT_TENANT_DELETE_CODE = 500008; + public static final String USER_LIMIT_TENANT_DELETE_MSG = "抱歉,租户不能被删除"; + + /** + * 角色信息 + * type = 10 + * */ + //添加角色信息失败 + public static final int ROLE_ADD_FAILED_CODE = 1000000; + public static final String ROLE_ADD_FAILED_MSG = "添加角色信息失败"; + //删除角色信息失败 + public static final int ROLE_DELETE_FAILED_CODE = 1000001; + public static final String ROLE_DELETE_FAILED_MSG = "删除角色信息失败"; + //修改角色信息失败 + public static final int ROLE_EDIT_FAILED_CODE = 1000002; + public static final String ROLE_EDIT_FAILED_MSG = "修改角色信息失败"; + /** + * 应用信息 + * type = 15 + * */ + //添加角色信息失败 + public static final int APP_ADD_FAILED_CODE = 1500000; + public static final String APP_ADD_FAILED_MSG = "添加应用信息失败"; + //删除角色信息失败 + public static final int APP_DELETE_FAILED_CODE = 1500001; + public static final String APP_DELETE_FAILED_MSG = "删除应用信息失败"; + //修改角色信息失败 + public static final int APP_EDIT_FAILED_CODE = 1500002; + public static final String APP_EDIT_FAILED_MSG = "修改应用信息失败"; + /** + * 仓库信息 + * type = 20 + * */ + //添加仓库信息失败 + public static final int DEPOT_ADD_FAILED_CODE = 2000000; + public static final String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败"; + //删除仓库信息失败 + public static final int DEPOT_DELETE_FAILED_CODE = 2000001; + public static final String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败"; + //修改仓库信息失败 + public static final int DEPOT_EDIT_FAILED_CODE = 2000002; + public static final String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败"; + + /** + * 功能模块信息 + * type = 30 + * */ + //添加角色信息失败 + public static final int FUNCTIONS_ADD_FAILED_CODE = 3000000; + public static final String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败"; + //删除角色信息失败 + public static final int FUNCTIONS_DELETE_FAILED_CODE = 3000001; + public static final String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败"; + //修改角色信息失败 + public static final int FUNCTIONS_EDIT_FAILED_CODE = 3000002; + public static final String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败"; + /** + * 收支项目信息 + * type = 35 + * */ + //添加收支项目信息失败 + public static final int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000; + public static final String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败"; + //删除收支项目信息失败 + public static final int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001; + public static final String IN_OUT_ITEM_DELETE_FAILED_MSG = "删除收支项目信息失败"; + //修改收支项目信息失败 + public static final int IN_OUT_ITEM_EDIT_FAILED_CODE = 3500002; + public static final String IN_OUT_ITEM_EDIT_FAILED_MSG = "修改收支项目信息失败"; + /** + * 多单位信息 + * type = 40 + * */ + //添加多单位信息失败 + public static final int UNIT_ADD_FAILED_CODE = 4000000; + public static final String UNIT_ADD_FAILED_MSG = "添加多单位信息失败"; + //删除多单位信息失败 + public static final int UNIT_DELETE_FAILED_CODE = 4000001; + public static final String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败"; + //修改多单位信息失败 + public static final int UNIT_EDIT_FAILED_CODE = 4000002; + public static final String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败"; + /** + * 经手人信息 + * type = 45 + * */ + //添加经手人信息失败 + public static final int PERSON_ADD_FAILED_CODE = 4500000; + public static final String PERSON_ADD_FAILED_MSG = "添加经手人信息失败"; + //删除经手人信息失败 + public static final int PERSON_DELETE_FAILED_CODE = 4500001; + public static final String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败"; + //修改经手人信息失败 + public static final int PERSON_EDIT_FAILED_CODE = 4500002; + public static final String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败"; + /** + * 用户角色模块关系信息 + * type = 50 + * */ + //添加用户角色模块关系信息失败 + public static final int USER_BUSINESS_ADD_FAILED_CODE = 5000000; + public static final String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败"; + //删除用户角色模块关系信息失败 + public static final int USER_BUSINESS_DELETE_FAILED_CODE = 5000001; + public static final String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败"; + //修改用户角色模块关系信息失败 + public static final int USER_BUSINESS_EDIT_FAILED_CODE = 5000002; + public static final String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败"; + /** + * 系统参数信息 + * type = 55 + * */ + //添加系统参数信息失败 + public static final int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000; + public static final String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败"; + //删除系统参数信息失败 + public static final int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001; + public static final String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败"; + //修改系统参数信息失败 + public static final int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002; + public static final String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败"; + /** + * 商品扩展信息 + * type = 60 + * */ + //添加商品扩展信息失败 + public static final int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000; + public static final String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败"; + //删除商品扩展信息失败 + public static final int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001; + public static final String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败"; + //修改商品扩展信息失败 + public static final int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002; + public static final String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败"; + /** + * 账户信息 + * type = 65 + * */ + //添加账户信息失败 + public static final int ACCOUNT_ADD_FAILED_CODE = 6500000; + public static final String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败"; + //删除账户信息失败 + public static final int ACCOUNT_DELETE_FAILED_CODE = 6500001; + public static final String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败"; + //修改账户信息失败 + public static final int ACCOUNT_EDIT_FAILED_CODE = 6500002; + public static final String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败"; + /** + * 供应商信息 + * type = 70 + * */ + //添加供应商信息失败 + public static final int SUPPLIER_ADD_FAILED_CODE = 7000000; + public static final String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败"; + //删除供应商信息失败 + public static final int SUPPLIER_DELETE_FAILED_CODE = 7000001; + public static final String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败"; + //修改供应商信息失败 + public static final int SUPPLIER_EDIT_FAILED_CODE = 7000002; + public static final String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败"; + /** + * 商品类别信息 + * type = 75 + * */ + //添加商品类别信息失败 + public static final int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000; + public static final String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败"; + //删除商品类别信息失败 + public static final int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001; + public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; + //修改商品类别信息失败 + public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; + public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败"; + //商品类别编号已存在 + public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003; + public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在"; + //根类别不支持修改 + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004; + public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根类别不支持修改"; + //根类别不支持删除 + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005; + public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根类别不支持删除"; + //该类别存在下级不允许删除 + public static final int MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE = 7500006; + public static final String MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG = "该类别存在下级不允许删除"; + /** + * 商品信息 + * type = 80 + * */ + //添加商品信息信息失败 + public static final int MATERIAL_ADD_FAILED_CODE = 7500000; + public static final String MATERIAL_ADD_FAILED_MSG = "添加商品信息失败"; + //删除商品信息失败 + public static final int MATERIAL_DELETE_FAILED_CODE = 7500001; + public static final String MATERIAL_DELETE_FAILED_MSG = "删除商品信息失败"; + //修改商品信息失败 + public static final int MATERIAL_EDIT_FAILED_CODE = 7500002; + public static final String MATERIAL_EDIT_FAILED_MSG = "修改商品信息失败"; + //商品信息不存在 + public static final int MATERIAL_NOT_EXISTS_CODE = 8000000; + public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在"; + //商品信息不唯一 + public static final int MATERIAL_NOT_ONLY_CODE = 8000001; + public static final String MATERIAL_NOT_ONLY_MSG = "商品信息不唯一"; + //该商品未开启序列号 + public static final int MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE = 8000002; + public static final String MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG = "该商品未开启序列号功能"; + //该商品已绑定序列号数量小于等于商品现有库存 + public static final int MATERIAL_SERIAL_NUMBERE_NOT_MORE_THAN_STORAGE_CODE = 8000003; + public static final String MATERIAL_SERIAL_NUMBERE_NOT_MORE_THAN_STORAGE_MSG = "该商品已绑定序列号数量大于等于商品现有库存"; + //商品库存不足 + public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004; + public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; + //商品条码重复 + public static final int MATERIAL_BARCODE_EXISTS_CODE = 8000005; + public static final String MATERIAL_BARCODE_EXISTS_MSG = "商品条码:%s重复"; + //商品-单位匹配不上 + public static final int MATERIAL_UNIT_MATE_CODE = 8000006; + public static final String MATERIAL_UNIT_MATE_MSG = "抱歉,商品条码:%s的单位匹配不上,请完善计量单位信息!"; + /** + * 单据信息 + * type = 85 + * */ + //添加单据信息失败 + public static final int DEPOT_HEAD_ADD_FAILED_CODE = 8500000; + public static final String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败"; + //删除单据信息失败 + public static final int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001; + public static final String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败"; + //修改单据信息失败 + public static final int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002; + public static final String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败"; + //单据录入-仓库不能为空 + public static final int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004; + public static final String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空"; + //单据录入-调入仓库不能为空 + public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空"; + //单据录入-明细不能为空 + public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006; + public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + //单据录入-账户不能为空 + public static final int DEPOT_HEAD_ACCOUNT_FAILED_CODE = 8500007; + public static final String DEPOT_HEAD_ACCOUNT_FAILED_MSG = "结算账户不能为空"; + //单据录入-请修改多账户的结算金额 + public static final int DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE = 8500008; + public static final String DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG = "请修改多账户的结算金额"; + //单据录入-退货单不能欠款 + public static final int DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE = 8500009; + public static final String DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG = "退货单不能欠款"; + //单据录入-调入仓库与原仓库不能重复 + public static final int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复"; + //单据删除-只有未审核的单据才能删除 + public static final int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011; + public static final String DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; + //单据审核-只有未审核的单据才能审核 + public static final int DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE = 8500012; + public static final String DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG = "抱歉,只有未审核的单据才能审核"; + //单据反审核-只有已审核的单据才能反审核 + public static final int DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE = 8500013; + public static final String DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG = "抱歉,只有已审核的单据才能反审核"; + //单据录入-商品条码XXX的数量需要修改下 + public static final int DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE = 85000014; + public static final String DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG = "商品条码%s的数量需要修改"; + /** + * 单据明细信息 + * type = 90 + * */ + //添加单据明细信息失败 + public static final int DEPOT_ITEM_ADD_FAILED_CODE = 9000000; + public static final String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败"; + //删除单据明细信息失败 + public static final int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001; + public static final String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败"; + //修改单据明细信息失败 + public static final int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002; + public static final String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败"; + /** + * 财务信息 + * type = 95 + * */ + //添加财务信息失败 + public static final int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000; + public static final String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败"; + //删除财务信息失败 + public static final int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001; + public static final String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败"; + //修改财务信息失败 + public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002; + public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败"; + //单据录入-明细不能为空 + public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003; + public static final String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + //单据删除-只有未审核的单据才能删除 + public static final int ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 9500004; + public static final String ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; + /** + * 财务明细信息 + * type = 100 + * */ + //添加财务明细信息失败 + public static final int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000; + public static final String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败"; + //删除财务明细信息失败 + public static final int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001; + public static final String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败"; + //修改财务明细信息失败 + public static final int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002; + public static final String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败"; + /** + * 序列号 + * type = 105 + * */ + /**序列号已存在*/ + public static final int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000; + public static final String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号已存在"; + /**序列号不能为为空*/ + public static final int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500001; + public static final String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空"; + /**商品%s下序列号不充足,请补充后重试*/ + public static final int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002; + public static final String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足,请补充后重试"; + /**删序列号信息失败*/ + public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003; + public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败"; + /** + * 机构信息 + * type = 110 + * */ + //添加机构信息失败 + public static final int ORGANIZATION_ADD_FAILED_CODE = 11000000; + public static final String ORGANIZATION_ADD_FAILED_MSG = "添加机构信息失败"; + //删除机构信息失败 + public static final int ORGANIZATION_DELETE_FAILED_CODE = 11000001; + public static final String ORGANIZATION_DELETE_FAILED_MSG = "删除机构信息失败"; + //修改机构信息失败 + public static final int ORGANIZATION_EDIT_FAILED_CODE = 11000002; + public static final String ORGANIZATION_EDIT_FAILED_MSG = "修改机构信息失败"; + //机构编号已存在 + public static final int ORGANIZATION_NO_ALREADY_EXISTS_CODE = 11000003; + public static final String ORGANIZATION_NO_ALREADY_EXISTS_MSG = "机构编号已存在"; + //根机构不允许删除 + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE = 11000004; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG = "根机构不允许删除"; + //根机构不允许修改 + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改"; + //该机构存在下级不允许删除 + public static final int ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE = 11000006; + public static final String ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG = "该机构存在下级不允许删除"; + /** + * 机构用户关联关系 + * type = 115 + * */ + //添加机构用户关联关系失败 + public static final int ORGA_USER_REL_ADD_FAILED_CODE = 11500000; + public static final String ORGA_USER_REL_ADD_FAILED_MSG = "添加机构用户关联关系失败"; + //删除机构用户关联关系失败 + public static final int ORGA_USER_REL_DELETE_FAILED_CODE = 11500001; + public static final String ORGA_USER_REL_DELETE_FAILED_MSG = "删除机构用户关联关系失败"; + //修改机构用户关联关系失败 + public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002; + public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败"; + + //演示用户禁止操作 + public static final int SYSTEM_CONFIG_TEST_USER_CODE = -1; + public static final String SYSTEM_CONFIG_TEST_USER_MSG = "演示用户禁止操作"; + + + /** + * 标准正常返回/操作成功返回 + * @return + */ + public static JSONObject standardSuccess () { + JSONObject success = new JSONObject(); + success.put(GLOBAL_RETURNS_CODE, SERVICE_SUCCESS_CODE); + success.put(GLOBAL_RETURNS_MESSAGE, SERVICE_SUCCESS_MSG); + return success; + } + + public static JSONObject standardErrorUserOver () { + JSONObject success = new JSONObject(); + success.put(GLOBAL_RETURNS_CODE, USER_OVER_LIMIT_FAILED_CODE); + success.put(GLOBAL_RETURNS_MESSAGE, USER_OVER_LIMIT_FAILED_MSG); + return success; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java new file mode 100644 index 00000000..48429a67 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountController.java @@ -0,0 +1,152 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.Account; +import com.zsw.erp.datasource.vo.AccountVo4InOutList; +import com.zsw.erp.service.account.AccountService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/account") +@Api(tags = {"账户管理"}) +public class AccountController { + private Logger logger = LoggerFactory.getLogger(AccountController.class); + + @Resource + private AccountService accountService; + + /** + * 查找结算账户信息-下拉框 + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找结算账户信息-下拉框") + public String findBySelect(HttpServletRequest request) throws Exception { + String res = null; + try { + List dataList = accountService.findBySelect(); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Account account : dataList) { + JSONObject item = new JSONObject(); + item.put("Id", account.getId()); + //结算账户名称 + item.put("AccountName", account.getName()); + dataArray.add(item); + } + } + res = dataArray.toJSONString(); + } catch(Exception e){ + e.printStackTrace(); + res = "获取数据失败"; + } + return res; + } + + /** + * 获取所有结算账户 + * @param request + * @return + */ + @GetMapping(value = "/getAccount") + @ApiOperation(value = "获取所有结算账户") + public R getAccount(HttpServletRequest request) throws Exception { + + Map map = new HashMap(); + List accountList = accountService.getAccount(); + map.put("accountList", accountList); + return R.success(map); + } + + /** + * 账户流水信息 + * @param currentPage + * @param pageSize + * @param accountId + * @param initialAmount + * @param request + * @return + */ + @GetMapping(value = "/findAccountInOutList") + @ApiOperation(value = "账户流水信息") + public R findAccountInOutList(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("accountId") Long accountId, + @RequestParam("initialAmount") BigDecimal initialAmount, + HttpServletRequest request) throws Exception{ + + Map map = new HashMap(); + List dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize); + int total = accountService.findAccountInOutListCount(accountId); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (AccountVo4InOutList aEx : dataList) { + String timeStr = aEx.getOperTime().toString(); + BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date").add(accountService.getAccountSumByHead(accountId, timeStr, "date")) + .add(accountService.getAccountSumByDetail(accountId, timeStr, "date")).add(accountService.getManyAccountSum(accountId, timeStr, "date")).add(initialAmount); + aEx.setBalance(balance); + aEx.setAccountId(accountId); + dataArray.add(aEx); + } + } + map.put("rows", dataArray); + return R.success(map); + } + + /** + * 更新默认账户 + * @param object + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/updateIsDefault") + @ApiOperation(value = "更新默认账户") + public String updateIsDefault(@RequestBody JSONObject object, + HttpServletRequest request) throws Exception{ + Long accountId = object.getLong("id"); + Map objectMap = new HashMap<>(); + int res = accountService.updateIsDefault(accountId); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 结算账户的统计 + * @param request + * @return + */ + @GetMapping(value = "/getStatistics") + @ApiOperation(value = "结算账户的统计") + public R getStatistics(@RequestParam("name") String name, + @RequestParam("serialNo") String serialNo, + HttpServletRequest request) throws Exception { + + Map map = accountService.getStatistics(name, serialNo); + return R.success(map); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/AccountHeadController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountHeadController.java new file mode 100644 index 00000000..f36cecfa --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountHeadController.java @@ -0,0 +1,110 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.AccountHeadVo4Body; +import com.zsw.erp.datasource.entities.AccountHeadVo4ListEx; +import com.zsw.erp.service.accountHead.AccountHeadService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/accountHead") +@Api(tags = {"财务管理"}) +public class AccountHeadController { + private Logger logger = LoggerFactory.getLogger(AccountHeadController.class); + + @Resource + private AccountHeadService accountHeadService; + + /** + * 批量设置状态-审核或者反审核 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-审核或者反审核") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception{ + Map objectMap = new HashMap<>(); + String status = jsonObject.getString("status"); + String ids = jsonObject.getString("ids"); + int res = accountHeadService.batchSetStatus(status, ids); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 新增财务主表及财务子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/addAccountHeadAndDetail") + @ApiOperation(value = "新增财务主表及财务子表信息") + public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + accountHeadService.addAccountHeadAndDetail(beanJson,rows, request); + return result; + } + + /** + * 更新财务主表及财务子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PutMapping(value = "/updateAccountHeadAndDetail") + @ApiOperation(value = "更新财务主表及财务子表信息") + public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + accountHeadService.updateAccountHeadAndDetail(beanJson,rows,request); + return result; + } + + /** + * 根据编号查询单据信息 + * @param billNo + * @param request + * @return + */ + @GetMapping(value = "/getDetailByNumber") + @ApiOperation(value = "根据编号查询单据信息") + public R getDetailByNumber(@RequestParam("billNo") String billNo, + HttpServletRequest request)throws Exception { + + AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx(); + List list = accountHeadService.getDetailByNumber(billNo); + if(list.size() == 1) { + ahl = list.get(0); + return R.success(ahl); + }else { + return R.fail("错误"); + } + + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/AccountItemController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountItemController.java new file mode 100644 index 00000000..cf467869 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/AccountItemController.java @@ -0,0 +1,65 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.vo.AccountItemVo4List; +import com.zsw.erp.service.accountItem.AccountItemService; +import com.zsw.base.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +@RestController +@RequestMapping(value = "/accountItem") +@Api(tags = {"财务明细"}) +public class AccountItemController { + private Logger logger = LoggerFactory.getLogger(AccountItemController.class); + + @Resource + private AccountItemService accountItemService; + + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "明细列表") + public R getDetailList(@RequestParam("headerId") Long headerId, + HttpServletRequest request)throws Exception { + + List dataList = new ArrayList<>(); + if(headerId != 0) { + dataList = accountItemService.getDetailList(headerId); + } + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (AccountItemVo4List ai : dataList) { + JSONObject item = new JSONObject(); + item.put("accountId", ai.getAccountId()); + item.put("accountName", ai.getAccountName()); + item.put("inOutItemId", ai.getInOutItemId()); + item.put("inOutItemName", ai.getInOutItemName()); + item.put("billNumber", ai.getBillNumber()); + item.put("needDebt", ai.getNeedDebt()); + item.put("finishDebt", ai.getFinishDebt()); + BigDecimal eachAmount = ai.getEachAmount(); + item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount); + item.put("remark", ai.getRemark()); + dataArray.add(item); + } + } + outer.put("rows", dataArray); + return R.success(outer); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java new file mode 100644 index 00000000..e3c57532 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/BomController.java @@ -0,0 +1,89 @@ +package com.zsw.erp.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.zsw.base.R; +import com.zsw.erp.datasource.dto.BomDto; +import com.zsw.erp.service.zyh.BomService; +import com.zsw.erp.utils.DozerUtils; +import com.zsw.pos.product.dto.AdminStoreProductDTO; +import com.zsw.pos.product.entity.Product; +import com.zsw.pos.product.entity.ProductSku; +import com.zsw.pos.product.service.ProductService; +import com.zsw.pos.product.service.ProductSkuService; +import com.zsw.pos.product.vo.ProductPageVO; +import com.zsw.pos.store.StoreService; +import com.zsw.pos.store.entity.Store; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@Api(tags = "BOM物料清单") +@RequestMapping("/bom") +@Slf4j +public class BomController { + + @Resource + private DozerUtils dozerUtils; + + @DubboReference + private ProductService productService; + + @DubboReference + private ProductSkuService productSkuService; + + @DubboReference + private StoreService storeService; + + @Resource + private BomService bomService; + + @PostMapping("/insert") + @ApiOperation("新增BOM") + public R insert(@RequestBody BomDto bomDto){ + return R.success(bomService.save(bomDto)); + } + + @PostMapping("/edit") + @ApiOperation("修改BOM") + public R edit(@RequestBody BomDto bomDto){ + return R.success(bomService.updateById(bomDto)); + } + + @GetMapping("/list") + @ApiOperation("列举全部BOM") + public R> list(){ + List rs = dozerUtils.convertList(bomService.list(), BomDto.class); + return R.success(rs); + } + + @PostMapping("/listProduct") + @ApiOperation("获取商品") + public R listProduct(AdminStoreProductDTO dto){ + return productService.findAdminStoreProductList(dto); + } + + @GetMapping("/listProcutSkuByPid") + @ApiOperation("获取SKU") + public R> listProcutSkuByPid(@RequestParam List ids){ + List sku = productSkuService.getProductSkuByMaterial(ids); + return R.success(sku); + } + + @GetMapping("/listStore") + @ApiOperation("获取全部店铺列表") + public R> listStore(){ + List storeList = storeService.list(); + return R.success(storeList); + } + + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java new file mode 100644 index 00000000..3926e356 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotController.java @@ -0,0 +1,170 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.Depot; +import com.zsw.erp.datasource.entities.DepotEx; +import com.zsw.erp.datasource.entities.MaterialInitialStock; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/depot") +@Api(tags = {"仓库管理"}) +public class DepotController { + private Logger logger = LoggerFactory.getLogger(DepotController.class); + + @Resource + private DepotService depotService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private MaterialService materialService; + + /** + * 仓库列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "仓库列表") + public R getAllList(HttpServletRequest request) throws Exception{ + List depotList = depotService.getAllList(); + return R.success(depotList); + } + + /** + * 用户对应仓库显示 + * @param type + * @param keyId + * @param request + * @return + */ + @GetMapping(value = "/findUserDepot") + @ApiOperation(value = "用户对应仓库显示") + public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, + HttpServletRequest request) throws Exception{ + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = depotService.findUserDepot(); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.put("id", 0); + outer.put("key", 0); + outer.put("value", 0); + outer.put("title", "仓库列表"); + outer.put("attributes", "仓库列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("key", depot.getId()); + item.put("value", depot.getId()); + item.put("title", depot.getName()); + item.put("attributes", depot.getName()); + Boolean flag = ubValue.contains(depot.getId()); + if (flag) { + item.put("checked", true); + } + dataArray.add(item); + } + } + outer.put("children", dataArray); + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 获取当前用户拥有权限的仓库列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findDepotByCurrentUser") + @ApiOperation(value = "获取当前用户拥有权限的仓库列表") + public R findDepotByCurrentUser(HttpServletRequest request) throws Exception{ + JSONArray arr = depotService.findDepotByCurrentUser(); + return R.success(arr); + } + + /** + * 更新默认仓库 + * @param object + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/updateIsDefault") + @ApiOperation(value = "更新默认仓库") + public String updateIsDefault(@RequestBody JSONObject object, + HttpServletRequest request) throws Exception{ + Long depotId = object.getLong("id"); + Map objectMap = new HashMap<>(); + int res = depotService.updateIsDefault(depotId); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 仓库列表-带库存 + * @param mId + * @param request + * @return + */ + @GetMapping(value = "/getAllListWithStock") + @ApiOperation(value = "仓库列表-带库存") + public R getAllList(@RequestParam("mId") Long mId, + HttpServletRequest request) { + + List list = depotService.getAllList(); + List depotList = new ArrayList(); + for(Depot depot: list) { + DepotEx de = new DepotEx(); + if(mId!=0) { + BigDecimal initStock = materialService.getInitStock(mId, depot.getId()).getNumber(); + BigDecimal currentStock = materialService.getCurrentStock(mId, depot.getId()); + de.setInitStock(initStock); + de.setCurrentStock(currentStock); + MaterialInitialStock materialInitialStock = materialService.getSafeStock(mId, depot.getId()); + de.setLowSafeStock(materialInitialStock.getLowSafeStock()); + de.setHighSafeStock(materialInitialStock.getHighSafeStock()); + } else { + de.setInitStock(BigDecimal.ZERO); + de.setCurrentStock(BigDecimal.ZERO); + } + de.setId(depot.getId()); + de.setName(depot.getName()); + depotList.add(de); + } + return R.success(depotList); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java new file mode 100644 index 00000000..3a590f11 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotHeadController.java @@ -0,0 +1,495 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.base.R; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.dto.DepotItemDto; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.vo.DepotHeadVo4InDetail; +import com.zsw.erp.datasource.vo.DepotHeadVo4InOutMCount; +import com.zsw.erp.datasource.vo.DepotHeadVo4List; +import com.zsw.erp.datasource.vo.DepotHeadVo4StatementAccount; +import com.zsw.erp.service.account.AccountService; +import com.zsw.erp.service.accountHead.AccountHeadService; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.depotHead.DepotHeadService; +import com.zsw.erp.service.depotItem.DepotItemService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.supplier.SupplierService; +import com.zsw.erp.utils.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; +import static com.zsw.erp.utils.Tools.getNow3; + + +@RestController +@RequestMapping(value = "/depotHead") +@Api(tags = {"单据管理"}) +public class DepotHeadController { + private Logger logger = LoggerFactory.getLogger(DepotHeadController.class); + + @Resource + private DepotHeadService depotHeadService; + + @Resource + private AccountHeadService accountHeadService; + + @Resource + private AccountService accountService; + + @Resource + private SupplierService supplierService; + + @Resource + private DepotService depotService; + + @Resource + private RedisService redisService; + + @Resource + private DepotItemService depotItemService; + + /** + * 批量设置状态-审核或者反审核 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-审核或者反审核") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception{ + Map objectMap = new HashMap<>(); + String status = jsonObject.getString("status"); + String ids = jsonObject.getString("ids"); + int res = depotHeadService.batchSetStatus(status, ids); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 入库出库明细接口 + * @param currentPage + * @param pageSize + * @param oId + * @param number + * @param materialParam + * @param depotId + * @param beginTime + * @param endTime + * @param type + * @param request + * @return + */ + @GetMapping(value = "/findInDetail") + @ApiOperation(value = "入库出库明细接口") + public R findInDetail(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "organId", required = false) Integer oId, + @RequestParam("number") String number, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam("type") String type, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + List resList = new ArrayList(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadService.findByAll(beginTime, endTime, type, materialParam, depotList, oId, number, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findByAllCount(beginTime, endTime, type, materialParam, depotList, oId, number); + map.put("total", total); + //存放数据json数组 + if (null != list) { + for (DepotHeadVo4InDetail dhd : list) { + resList.add(dhd); + } + } + map.put("rows", resList); + return R.success(map); + } + + /** + * 入库出库统计接口 + * @param currentPage + * @param pageSize + * @param oId + * @param materialParam + * @param depotId + * @param beginTime + * @param endTime + * @param type + * @param request + * @return + */ + @GetMapping(value = "/findInOutMaterialCount") + @ApiOperation(value = "入库出库统计接口") + public R findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "organId", required = false) Integer oId, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam("type") String type, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + List resList = new ArrayList<>(); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, materialParam, depotList, oId, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, depotList, oId); + map.put("total", total); + //存放数据json数组 + if (null != list) { + for (DepotHeadVo4InOutMCount dhc : list) { + resList.add(dhc); + } + } + map.put("rows", resList); + return R.success(map); + } + + /** + * 调拨明细统计 + * @param currentPage + * @param pageSize + * @param number + * @param materialParam + * @param depotIdF 调出仓库 + * @param depotId 调入仓库 + * @param beginTime + * @param endTime + * @param subType + * @param request + * @return + */ + @GetMapping(value = "/findAllocationDetail") + @ApiOperation(value = "调拨明细统计") + public R findallocationDetail(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("number") String number, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam(value = "depotIdF", required = false) Long depotIdF, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam("subType") String subType, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List depotList = new ArrayList<>(); + List depotFList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + if(depotIdF != null) { + depotFList.add(depotIdF); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotFList.add(object.getLong("id")); + } + } + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, number, materialParam, depotList, depotFList, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, number, materialParam, depotList, depotFList); + map.put("rows", list); + map.put("total", total); + return R.success(map); + } + + /** + * 对账单接口 + * @param currentPage + * @param pageSize + * @param beginTime + * @param endTime + * @param organId + * @param supType + * @param request + * @return + */ + @GetMapping(value = "/findStatementAccount") + @ApiOperation(value = "对账单接口") + public R findStatementAccount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "organId", required = false) Integer organId, + @RequestParam("supType") String supType, + HttpServletRequest request) throws Exception{ + + Map map = new HashMap(); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadService.findStatementAccount(beginTime, endTime, organId, supType, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findStatementAccountCount(beginTime, endTime, organId, supType); + map.put("rows", list); + map.put("total", total); + if(null!=organId) { + Supplier supplier = supplierService.getSupplier(organId); + BigDecimal beginNeed = BigDecimal.ZERO; + if (("客户").equals(supType)) { + if(supplier.getBeginNeedGet()!=null) { + beginNeed = supplier.getBeginNeedGet(); + } + } else if (("供应商").equals(supType)) { + if(supplier.getBeginNeedPay()!=null) { + beginNeed = supplier.getBeginNeedPay(); + } + } + BigDecimal firstMoney = depotHeadService.findTotalPay(organId, beginTime, supType) + .subtract(accountHeadService.findTotalPay(organId, beginTime, supType)).add(beginNeed); + BigDecimal lastMoney = depotHeadService.findTotalPay(organId, endTime, supType) + .subtract(accountHeadService.findTotalPay(organId, endTime, supType)).add(beginNeed); + map.put("firstMoney", firstMoney); //期初 + map.put("lastMoney", lastMoney); //期末 + } + return R.success(map); + } + + /** + * 根据编号查询单据信息 + * @param number + * @param request + * @return + */ + @GetMapping(value = "/getDetailByNumber") + @ApiOperation(value = "根据编号查询单据信息") + public R getDetailByNumber(@RequestParam("number") String number, + HttpServletRequest request)throws Exception { + + DepotHeadVo4List dhl = new DepotHeadVo4List(); + List list = depotHeadService.getDetailByNumber(number); + if(list.size() == 1) { + dhl = list.get(0); + } + return R.success(dhl); + } + + /** + * 新增单据主表及单据子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/addDepotHeadAndDetail") + @ApiOperation(value = "新增单据主表及单据子表信息") + public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + depotHeadService.addDepotHeadAndDetail(body, request); + return result; + } + + /** + * 更新单据主表及单据子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PutMapping(value = "/updateDepotHeadAndDetail") + @ApiOperation(value = "更新单据主表及单据子表信息") + public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + depotHeadService.updateDepotHeadAndDetail(body,request); + return result; + } + + /** + * 统计今日采购额、本月采购额、今日销售额、本月销售额、今日零售额、本月零售额 + * @param request + * @return + */ + @GetMapping(value = "/getBuyAndSaleStatistics") + @ApiOperation(value = "统计今日采购额、本月采购额、今日销售额、本月销售额、今日零售额、本月零售额") + public R getBuyAndSaleStatistics(HttpServletRequest request) { + + Map map = new HashMap(); + String today = Tools.getNow() + BusinessConstants.DAY_FIRST_TIME; + String firstDay = Tools.firstDayOfMonth(Tools.getCurrentMonth()) + BusinessConstants.DAY_FIRST_TIME; + BigDecimal todayBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购", + 1, today, getNow3()); //今日采购入库 + BigDecimal todayBuyBack = depotHeadService.getBuyAndSaleStatistics("出库", "采购退货", + 1, today, getNow3()); //今日采购退货 + BigDecimal todaySale = depotHeadService.getBuyAndSaleStatistics("出库", "销售", + 1, today, getNow3()); //今日销售出库 + BigDecimal todaySaleBack = depotHeadService.getBuyAndSaleStatistics("入库", "销售退货", + 1, today, getNow3()); //今日销售退货 + BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售", + today, getNow3()); //今日零售出库 + BigDecimal todayRetailSaleBack = depotHeadService.getBuyAndSaleRetailStatistics("入库", "零售退货", + today, getNow3()); //今日零售退货 + BigDecimal monthBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购", + 1, firstDay, getNow3()); //本月采购入库 + BigDecimal monthBuyBack = depotHeadService.getBuyAndSaleStatistics("出库", "采购退货", + 1, firstDay, getNow3()); //本月采购退货 + BigDecimal monthSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售", + 1,firstDay, getNow3()); //本月销售出库 + BigDecimal monthSaleBack = depotHeadService.getBuyAndSaleStatistics("入库", "销售退货", + 1,firstDay, getNow3()); //本月销售退货 + BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售", + firstDay, getNow3()); //本月零售出库 + BigDecimal monthRetailSaleBack = depotHeadService.getBuyAndSaleRetailStatistics("入库", "零售退货", + firstDay, getNow3()); //本月零售退货 + map.put("todayBuy", todayBuy.subtract(todayBuyBack)); + map.put("todaySale", todaySale.subtract(todaySaleBack)); + map.put("todayRetailSale", todayRetailSale.subtract(todayRetailSaleBack)); + map.put("monthBuy", monthBuy.subtract(monthBuyBack)); + map.put("monthSale", monthSale.subtract(monthSaleBack)); + map.put("monthRetailSale", monthRetailSale.subtract(monthRetailSaleBack)); + return R.success(map); + } + + /** + * 根据当前用户获取操作员数组,用于控制当前用户的数据权限,限制可以看到的单据范围 + * 注意:该接口提供给部分插件使用,勿删 + * @param request + * @return + */ + @GetMapping(value = "/getCreatorByCurrentUser") + @ApiOperation(value = "根据当前用户获取操作员数组") + public R getCreatorByRoleType(HttpServletRequest request) { + + Map map = new HashMap(); + String creator = ""; + String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString(); + if(StringUtil.isNotEmpty(roleType)) { + creator = depotHeadService.getCreatorByRoleType(roleType); + } + return R.success(creator); + } + + /** + * 查询存在欠款的单据 + * @param search + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/debtList") + @ApiOperation(value = "查询存在欠款的单据") + public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + String organIdStr = StringUtil.getInfo(search, "organId"); + Long organId = Long.parseLong(organIdStr); + String materialParam = StringUtil.getInfo(search, "materialParam"); + String number = StringUtil.getInfo(search, "number"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String type = StringUtil.getInfo(search, "type"); + String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); + String status = StringUtil.getInfo(search, "status"); + List list = depotHeadService.debtList(organId, materialParam, number, beginTime, endTime, type, subType, roleType, status); + if (list != null) { + objectMap.put("rows", list); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + objectMap.put("rows", new ArrayList<>()); + return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + } + + @GetMapping("/view") + public ModelAndView depotView(@RequestParam("no") String no) throws Exception { + ModelAndView model = new ModelAndView("depotView.html"); + DepotHead head = depotHeadService.getDepotHead(no); + if (head == null || head.getId() == null){ + model.addObject("order",null); + return model; + } + DepotHeadVo4Body body = new DepotHeadVo4Body(); + + body.setInfo(head); + + List list = depotItemService.getListByHeaderId(head.getId()); + List listRs = BeanUtil.copyToList(list, DepotItemDto.class); + body.setRows(listRs); + body.setId(head.getId()); + String sub = no.substring(0, 4).toUpperCase(); + logger.info("sub:{}",sub); + + Supplier supplier = supplierService.getSupplier(head.getOrganId()); + Account acc = accountService.getAccount(head.getAccountId()); + + + model.addObject("supplier",supplier.getSupplier()); + model.addObject("create_time", DateUtil.format(head.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN)); + model.addObject("no",no); + model.addObject("link_no",head.getLinkNumber()); + model.addObject("discount",head.getDiscount()); + model.addObject("discount_money",head.getDiscountMoney()); + model.addObject("discount_last_money",head.getDiscountLastMoney()); + model.addObject("other_money",head.getOtherMoney()); + model.addObject("account",acc.getName()); + model.addObject("total_price",head.getTotalPrice()); + model.addObject("debt",head.getDiscountLastMoney().subtract(head.getChangeAmount())); + + + model.addObject("title",sub); + model.addObject("order",body); + model.addObject("info",body.getInfo()); + return model; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/DepotItemController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotItemController.java new file mode 100644 index 00000000..16af6314 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/DepotItemController.java @@ -0,0 +1,640 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.zsw.base.R; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.mappers.MaterialInitialStockMapper; +import com.zsw.erp.datasource.vo.DepotItemStockWarningCount; +import com.zsw.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.zsw.erp.dto.depot.RecordVo; +import com.zsw.erp.dto.depotItem.BatchStockDto; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.materialExtend.MaterialExtendService; +import com.zsw.erp.service.depotItem.DepotItemService; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.unit.UnitService; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.utils.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.*; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + +@RestController +@RequestMapping(value = "/depotItem") +@Api(tags = {"单据明细"}) +public class DepotItemController { + private Logger logger = LoggerFactory.getLogger(DepotItemController.class); + + @Resource + private DepotItemService depotItemService; + + @Resource + private MaterialService materialService; + + @Resource + private MaterialInitialStockMapper initialStockMapper; + + @Resource + private MaterialExtendService materialExtendService; + + @Resource + private UnitService unitService; + + @Resource + private DepotService depotService; + + @Resource + private RedisService redisService; + + /** + * 只根据商品id查询单据列表 + * @param mId + * @param request + * @return + */ + @GetMapping(value = "/findDetailByTypeAndMaterialId") + @ApiOperation(value = "只根据商品id查询单据列表") + public String findDetailByTypeAndMaterialId( + @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, + @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, + @RequestParam("materialId") String mId, HttpServletRequest request)throws Exception { + Map parameterMap = ParamUtils.requestToMap(request); + parameterMap.put("mId", mId); + Map objectMap = new HashMap(); + if (pageSize != null && pageSize <= 0) { + pageSize = 10; + } + String offset = ParamUtils.getPageOffset(currentPage, pageSize); + if (StringUtil.isNotEmpty(offset)) { + parameterMap.put(Constants.OFFSET, offset); + } + List list = depotItemService.findDetailByTypeAndMaterialIdList(parameterMap); + List dataArray = Lists.newArrayList(); + // 先把期初入库填入 +// MaterialInitialStock initStock = initialStockMapper.selectOne(Wrappers.lambdaQuery() +// .eq(MaterialInitialStock::getMaterialId, mId)); + if (list != null) { + for (DepotItemVo4DetailByTypeAndMId d: list) { + RecordVo vo = new RecordVo(); + vo.setNumber(d.getNumber());//编号 + vo.setBarCode(d.getBarCode());//条码 + vo.setMaterialName(d.getMaterialName());//名称 + String type = d.getType(); + String subType = d.getSubType(); + if(("其它").equals(type)) { + vo.setType(subType);//进出类型 + } else { + vo.setType( subType + type); + } + vo.setDepotName(d.getDepotName());//仓库名称 + vo.setBasicNumber(d.getBnum());//数量 + vo.setOperTime(d.getOtime());//时间 + dataArray.add(vo); + } + } + if (list == null) { + objectMap.put("rows", new ArrayList()); + objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); + return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + objectMap.put("rows", dataArray); + objectMap.put("total", depotItemService.findDetailByTypeAndMaterialIdCounts(parameterMap)); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 根据商品条码和仓库id查询库存数量 + * @param depotId + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findStockByDepotAndBarCode") + @ApiOperation(value = "根据商品条码和仓库id查询库存数量") + public R findStockByDepotAndBarCode( + @RequestParam(value = "depotId",required = false) Long depotId, + @RequestParam("barCode") String barCode, + HttpServletRequest request) throws Exception{ + + Map map = new HashMap(); + BigDecimal stock = BigDecimal.ZERO; + List list = materialService.getMaterialByBarCode(barCode); + if(list!=null && list.size()>0) { + MaterialVo4Unit materialVo4Unit = list.get(0); + if(StringUtil.isNotEmpty(materialVo4Unit.getSku())){ + stock = depotItemService.getSkuStockByParam(depotId,materialVo4Unit.getMeId(),null,null); + } else { + stock = depotItemService.getStockByParam(depotId,materialVo4Unit.getId(),null,null).getStock(); + if(materialVo4Unit.getUnitId()!=null) { + Unit unit = unitService.getUnit(materialVo4Unit.getUnitId()); + String commodityUnit = materialVo4Unit.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + } + map.put("stock", stock); + return R.success(map); + } + + /** + * 单据明细列表 + * @param headerId + * @param mpList + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "单据明细列表") + public R getDetailList(@RequestParam("headerId") Long headerId, + @RequestParam("mpList") String mpList, + HttpServletRequest request)throws Exception { + + List dataList = new ArrayList(); + if(headerId != 0) { + dataList = depotItemService.getDetailList(headerId); + } + String[] mpArr = mpList.split(","); + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + item.put("materialExtendId", diEx.getMaterialExtendId() == null ? "" : diEx.getMaterialExtendId()); + item.put("barCode", diEx.getBarCode()); + item.put("name", diEx.getMName()); + item.put("standard", diEx.getMStandard()); + item.put("model", diEx.getMModel()); + item.put("color", diEx.getMColor()); + item.put("materialOther", getOtherInfo(mpArr, diEx)); + BigDecimal stock; + if(StringUtil.isNotEmpty(diEx.getSku())){ + stock = depotItemService.getSkuStockByParam(diEx.getDepotId(),diEx.getMaterialExtendId(),null,null); + } else { + stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null).getStock(); + Unit unitInfo = materialService.findUnit(diEx.getMaterialId()); //查询计量单位信息 + if (StringUtil.isNotEmpty(unitInfo.getName())) { + String materialUnit = diEx.getMaterialUnit(); + stock = unitService.parseStockByUnit(stock, unitInfo, materialUnit); + } + } + item.put("stock", stock); + item.put("unit", diEx.getMaterialUnit()); + item.put("snList", diEx.getSnList()); + item.put("batchNumber", diEx.getBatchNumber()); + item.put("expirationDate", Tools.parseDateToStr(diEx.getExpirationDate())); + item.put("sku", diEx.getSku()); + item.put("enableSerialNumber", diEx.getEnableSerialNumber()); + item.put("enableBatchNumber", diEx.getEnableBatchNumber()); + item.put("operNumber", diEx.getOperNumber()); + item.put("basicNumber", diEx.getBasicNumber()); + item.put("preNumber", diEx.getOperNumber()); //原数量 + item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialId(), diEx.getHeaderId())); //已入库|已出库 + item.put("unitPrice", diEx.getUnitPrice()); + item.put("taxUnitPrice", diEx.getTaxUnitPrice()); + item.put("allPrice", diEx.getAllPrice()); + item.put("remark", diEx.getRemark()); + item.put("depotId", diEx.getDepotId() == null ? "" : diEx.getDepotId()); + item.put("depotName", diEx.getDepotId() == null ? "" : diEx.getDepotName()); + item.put("anotherDepotId", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotId()); + item.put("anotherDepotName", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotName()); + item.put("taxRate", diEx.getTaxRate()); + item.put("taxMoney", diEx.getTaxMoney()); + item.put("taxLastMoney", diEx.getTaxLastMoney()); + item.put("mType", diEx.getMaterialType()); + item.put("op", 1); + dataArray.add(item); + } + } + outer.put("rows", dataArray); + return R.success(outer); + + } + + /** + * 获取扩展信息 + * + * @return + */ + public String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx)throws Exception { + String materialOther = ""; + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + materialOther = materialOther + ((diEx.getMMfrs() == null || diEx.getMMfrs().equals("")) ? "" : "(" + diEx.getMMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + materialOther = materialOther + ((diEx.getMOtherField1() == null || diEx.getMOtherField1().equals("")) ? "" : "(" + diEx.getMOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + materialOther = materialOther + ((diEx.getMOtherField2() == null || diEx.getMOtherField2().equals("")) ? "" : "(" + diEx.getMOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + materialOther = materialOther + ((diEx.getMOtherField3() == null || diEx.getMOtherField3().equals("")) ? "" : "(" + diEx.getMOtherField3() + ")"); + } + } + return materialOther; + } + + /** + * 查找所有的明细 + * @param currentPage + * @param pageSize + * @param depotIds + * @param monthTime + * @param materialParam + * @param mpList + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findByAll") + @ApiOperation(value = "查找所有的明细") + public R findByAll(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("depotIds") String depotIds, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + HttpServletRequest request)throws Exception { + + Map map = new HashMap<>(); + String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List depotList = StringUtil.strToLongList(depotIds); + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + timeB,(currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), timeB); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + List idList = new ArrayList<>(); + for (DepotItemVo4WithInfoEx m : dataList) { + idList.add(m.getMId()); + } + List meList = materialExtendService.getListByMIds(idList); + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + Long mId = diEx.getMId(); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("unitName", diEx.getMaterialUnit()); + BigDecimal prevSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,timeA); + Map intervalMap = depotItemService.getIntervalMapByParamWithDepotList(depotList,mId,timeA,timeB); + BigDecimal inSum = intervalMap.get("inSum"); + BigDecimal outSum = intervalMap.get("outSum"); + BigDecimal thisSum = prevSum.add(inSum).subtract(outSum); + item.put("prevSum", prevSum); + item.put("inSum", inSum); + item.put("outSum", outSum); + item.put("thisSum", thisSum); + for(MaterialExtend me:meList) { + if(me.getMaterialId().longValue() == diEx.getMId().longValue()) { + if(me.getPurchaseDecimal()!=null) { + item.put("unitPrice", me.getPurchaseDecimal()); + item.put("thisAllPrice", thisSum.multiply(me.getPurchaseDecimal())); + } + } + } + dataArray.add(item); + } + } + map.put("rows", dataArray); + return R.success(map); + } + + /** + * 统计总计金额 + * @param depotIds + * @param monthTime + * @param materialParam + * @param request + * @return + */ + @GetMapping(value = "/totalCountMoney") + @ApiOperation(value = "统计总计金额") + public R totalCountMoney(@RequestParam("depotIds") String depotIds, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + HttpServletRequest request) throws Exception{ + + Map map = new HashMap<>(); + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List depotList = StringUtil.strToLongList(depotIds); + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + endTime, null, null); + BigDecimal thisAllPrice = BigDecimal.ZERO; + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + Long mId = diEx.getMId(); + BigDecimal thisSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,endTime); + BigDecimal unitPrice = diEx.getPurchaseDecimal(); + if(unitPrice == null) { + unitPrice = BigDecimal.ZERO; + } + thisAllPrice = thisAllPrice.add(thisSum.multiply(unitPrice)); + } + } + map.put("totalCount", thisAllPrice); + return R.success(map); + } + + /** + * 进货统计 + * @param currentPage + * @param pageSize + * @param monthTime + * @param materialParam + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/buyIn") + @ApiOperation(value = "进货统计") + public R buyIn(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + endTime, (currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), endTime); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + BigDecimal InSum = depotItemService.buyOrSale("入库", "采购", diEx.getMId(), monthTime, "number"); + BigDecimal OutSum = depotItemService.buyOrSale("出库", "采购退货", diEx.getMId(), monthTime, "number"); + BigDecimal InSumPrice = depotItemService.buyOrSale("入库", "采购", diEx.getMId(), monthTime, "price"); + BigDecimal OutSumPrice = depotItemService.buyOrSale("出库", "采购退货", diEx.getMId(), monthTime, "price"); + BigDecimal InOutSumPrice = InSumPrice.subtract(OutSumPrice); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("materialUnit", diEx.getMaterialUnit()); + item.put("unitName", diEx.getUnitName()); + item.put("inSum", InSum); + item.put("outSum", OutSum); + item.put("inSumPrice", InSumPrice); + item.put("outSumPrice", OutSumPrice); + item.put("inOutSumPrice",InOutSumPrice);//实际采购金额 + dataArray.add(item); + } + } + map.put("rows", dataArray); + return R.success(map); + } + + /** + * 销售统计 + * @param currentPage + * @param pageSize + * @param monthTime + * @param materialParam + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/saleOut") + @ApiOperation(value = "销售统计") + public R saleOut(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + endTime,(currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), endTime); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + BigDecimal OutSumRetail = depotItemService.buyOrSale("出库", "零售", diEx.getMId(), monthTime,"number"); + BigDecimal OutSum = depotItemService.buyOrSale("出库", "销售", diEx.getMId(), monthTime,"number"); + BigDecimal InSumRetail = depotItemService.buyOrSale("入库", "零售退货", diEx.getMId(), monthTime,"number"); + BigDecimal InSum = depotItemService.buyOrSale("入库", "销售退货", diEx.getMId(), monthTime,"number"); + BigDecimal OutSumRetailPrice = depotItemService.buyOrSale("出库", "零售", diEx.getMId(), monthTime,"price"); + BigDecimal OutSumPrice = depotItemService.buyOrSale("出库", "销售", diEx.getMId(), monthTime,"price"); + BigDecimal InSumRetailPrice = depotItemService.buyOrSale("入库", "零售退货", diEx.getMId(), monthTime,"price"); + BigDecimal InSumPrice = depotItemService.buyOrSale("入库", "销售退货", diEx.getMId(), monthTime,"price"); + BigDecimal OutInSumPrice = (OutSumRetailPrice.add(OutSumPrice)).subtract(InSumRetailPrice.add(InSumPrice)); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("materialUnit", diEx.getMaterialUnit()); + item.put("unitName", diEx.getUnitName()); + item.put("outSum", OutSumRetail.add(OutSum)); + item.put("inSum", InSumRetail.add(InSum)); + item.put("outSumPrice", OutSumRetailPrice.add(OutSumPrice)); + item.put("inSumPrice", InSumRetailPrice.add(InSumPrice)); + item.put("outInSumPrice",OutInSumPrice);//实际销售金额 + dataArray.add(item); + } + } + map.put("rows", dataArray); + return R.success(map); + } + + /** + * 获取单位 + * @param materialUnit + * @param uName + * @return + */ + public String getUName(String materialUnit, String uName) { + String unitName = null; + if(StringUtil.isNotEmpty(materialUnit)) { + unitName = materialUnit; + } else if(StringUtil.isNotEmpty(uName)) { + unitName = uName; + } + return unitName; + } + + /** + * 库存预警报表 + * @param currentPage + * @param pageSize + * @return + */ + @GetMapping(value = "/findStockWarningCount") + @ApiOperation(value = "库存预警报表") + public R findStockWarningCount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("mpList") String mpList)throws Exception { + + Map map = new HashMap(); + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + String[] mpArr = mpList.split(","); + List list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList); + //存放数据json数组 + if (null != list) { + for (DepotItemStockWarningCount disw : list) { + DepotItemVo4WithInfoEx diEx = new DepotItemVo4WithInfoEx(); + diEx.setMMfrs(disw.getMMfrs()); + diEx.setMOtherField1(disw.getMOtherField1()); + diEx.setMOtherField2(disw.getMOtherField2()); + diEx.setMOtherField3(disw.getMOtherField3()); + disw.setMaterialOther(getOtherInfo(mpArr, diEx)); + disw.setMaterialUnit(getUName(disw.getMaterialUnit(), disw.getUnitName())); + if(disw.getCurrentNumber().compareTo(disw.getLowSafeStock())<0) { + disw.setLowCritical(disw.getLowSafeStock().subtract(disw.getCurrentNumber())); + disw.setHighCritical(BigDecimal.ZERO); + } + if(disw.getCurrentNumber().compareTo(disw.getHighSafeStock())>0) { + disw.setLowCritical(BigDecimal.ZERO); + disw.setHighCritical(disw.getCurrentNumber().subtract(disw.getHighSafeStock())); + } + } + } + int total = depotItemService.findStockWarningCountTotal(materialParam, depotList); + map.put("total", total); + map.put("rows", list); + return R.success(map); + } + + /** + * 统计采购、销售、零售的总金额 + * @param request + * @param response + * @return + * @throws Exception + */ + @GetMapping(value = "/buyOrSalePrice") + @ApiOperation(value = "统计采购、销售、零售的总金额") + public R buyOrSalePrice(HttpServletRequest request, HttpServletResponse response)throws Exception { + + Map map = new HashMap(); + String message = "成功"; + List list = Tools.getLastMonths(6); + JSONArray buyPriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutPrice("入库", "采购", month); + BigDecimal inPrice = depotItemService.inOrOutPrice("出库", "采购退货", month); + obj.put("x", month); + obj.put("y", outPrice.subtract(inPrice)); + buyPriceList.add(obj); + } + map.put("buyPriceList", buyPriceList); + JSONArray salePriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutPrice("出库", "销售", month); + BigDecimal inPrice = depotItemService.inOrOutPrice("入库", "销售退货", month); + obj.put("x", month); + obj.put("y", outPrice.subtract(inPrice)); + salePriceList.add(obj); + } + map.put("salePriceList", salePriceList); + JSONArray retailPriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutRetailPrice("出库", "零售", month); + BigDecimal inPrice = depotItemService.inOrOutRetailPrice("入库", "零售退货", month); + obj.put("x", month); + obj.put("y", outPrice.subtract(inPrice)); + retailPriceList.add(obj); + } + map.put("retailPriceList", retailPriceList); + return R.success(map); + } + + /** + * 获取批次商品列表信息 + * @param request + * @return + */ + @GetMapping(value = "/getBatchNumberList") + @ApiOperation(value = "获取批次商品列表信息") + public R getBatchNumberList(@RequestParam("name") String name, + @RequestParam("depotId") Long depotId, + @RequestParam("barCode") String barCode, + @RequestParam(value = "batchNumber", required = false) String batchNumber, + HttpServletRequest request) throws Exception{ + + Map map = new HashMap<>(); + List reslist = new ArrayList<>(); + List list = depotItemService.getBatchNumberList(name, depotId, barCode, batchNumber); + for(DepotItemVoBatchNumberList bn: list) { + if(bn.getTotalNum()!=null && bn.getTotalNum().compareTo(BigDecimal.ZERO)>0) { + reslist.add(bn); + } + bn.setExpirationDateStr(Tools.parseDateToStr(bn.getExpirationDate())); + } + map.put("rows", reslist); + map.put("total", reslist.size()); + return R.success(map); + } + + @GetMapping(value = "/batchStock") + @ApiOperation(value = "批次库存查询") + public R batchStock(BatchStockDto dto) { + Map map = new HashMap<>(); + map.put("rows", depotItemService.batchStockPage(dto)); + map.put("total", depotItemService.batchStockCount(dto)); + return R.success(map); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/FunctionController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/FunctionController.java new file mode 100644 index 00000000..6c9b10ce --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/FunctionController.java @@ -0,0 +1,241 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import com.google.common.collect.Lists; +import com.zsw.erp.datasource.entities.BtnDto; +import com.zsw.erp.datasource.entities.Function; +import com.zsw.erp.datasource.entities.UserBusiness; +import com.zsw.erp.service.functions.FunctionService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.base.R; +import com.zsw.erp.utils.Tools; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; +import java.util.stream.Collectors; + + +@RestController +@RequestMapping(value = "/function") +@Api(tags = {"功能管理"}) +public class FunctionController { + private Logger logger = LoggerFactory.getLogger(FunctionController.class); + + @Resource + private FunctionService functionService; + + @Resource + private UserBusinessService userBusinessService; + + /** + * 根据父编号查询菜单 + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/findMenuByPNumber") + @ApiOperation(value = "根据父编号查询菜单") + public JSONArray findMenuByPNumber(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + String pNumber = jsonObject.getStr("pNumber"); + Long userId = jsonObject.getLong("userId"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + try { + Long roleId = 0L; + List fc = Lists.newArrayList(); + UserBusiness role = userBusinessService.getBasicData(userId, "UserRole"); + roleId = role.getValue().get(0).longValue(); + //当前用户所拥有的功能列表,格式如:[1][2][5] +// List funList = userBusinessService.getBasicData(roleId.toString(), "RoleFunctions"); +// if(funList!=null && funList.size()>0){ +// fc = funList.get(0).getValue(); +// } +// List dataList = functionService.getRoleFunction(pNumber); + List dataList; + if (roleId == 1L){ + logger.info("当前是系统管理员,给予全部菜单和权限。"); + dataList = functionService.getRoleFunction(pNumber); + fc = functionService.getFunction().stream().map(Function::getId).collect(Collectors.toList()); + }else{ + dataList = functionService.getRoleFunction(pNumber); + UserBusiness fun = userBusinessService.getBasicData(roleId, "RoleFunctions"); + fc = fun.getValue().stream().map(Number::longValue).collect(Collectors.toList()); + } + + if (dataList.size() != 0) { + dataArray = getMenuByFunction(dataList, fc); + //增加首页菜单项 + JSONObject homeItem = new JSONObject(); + homeItem.set("id", 0); + homeItem.set("text", "首页"); + homeItem.set("icon", "home"); + homeItem.set("url", "/dashboard/analysis"); + homeItem.set("component", "/layouts/TabLayout"); + dataArray.add(0,homeItem); + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>>>>>>>>>>>查找异常", e); + } + return dataArray; + } + + public JSONArray getMenuByFunction(List dataList, List fc) throws Exception { + + dataList = dataList.stream() + .filter(function -> fc.contains(function.getId())) + .collect(Collectors.toList()); + + JSONArray dataArray = new JSONArray(); + for (Function function : dataList) { + JSONObject item = new JSONObject(); + List newList = functionService.getRoleFunction(function.getNumber()); + item.set("id", function.getId()); + item.set("text", function.getName()); + item.set("icon", function.getIcon()); + item.set("url", function.getUrl()); + item.set("component", function.getComponent()); + if (newList.size()>0) { + JSONArray childrenArr = getMenuByFunction(newList, fc); + if(childrenArr.size()>0) { + item.put("children", childrenArr); + dataArray.add(item); + } + } else { + if (fc.contains(function.getId())) { + dataArray.add(item); + } + } + } + return dataArray; + } + + /** + * 角色对应功能显示 + * @param request + * @return + */ + @GetMapping(value = "/findRoleFunction") + @ApiOperation(value = "角色对应功能显示") + public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, + HttpServletRequest request)throws Exception { + JSONArray arr = new JSONArray(); + try { + List dataListFun = functionService.findRoleFunction("0"); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.set("id", 0); + outer.set("key", 0); + outer.set("value", 0); + outer.set("title", "功能列表"); + outer.set("attributes", "功能列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataListFun) { + //根据条件从列表里面移除"系统管理" + List dataList = new ArrayList<>(); + for (Function fun : dataListFun) { + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if (tenantId!=0L) { + if(!("系统管理").equals(fun.getName())) { + dataList.add(fun); + } + } else { + //超管 + dataList.add(fun); + } + } + dataArray = getFunctionList(dataList, type, keyId); + outer.set("children", dataArray); + } + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + public JSONArray getFunctionList(List dataList, String type, Long keyId) throws Exception { + JSONArray dataArray = new JSONArray(); + //获取权限信息 + List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + if (null != dataList) { + for (Function function : dataList) { + JSONObject item = new JSONObject(); + item.set("id", function.getId()); + item.set("key", function.getId()); + item.set("value", function.getId()); + item.set("title", function.getName()); + item.set("attributes", function.getName()); + List funList = functionService.findRoleFunction(function.getNumber()); + if(funList.size()>0) { + JSONArray funArr = getFunctionList(funList, type, keyId); + item.set("children", funArr); + } else { + if (ubValue == null){ + item.set("checked", false); + }else { + Boolean flag = ubValue.contains(function.getId()); + item.set("checked", flag); + } + } + dataArray.add(item); + } + } + return dataArray; + } + + /** + * 根据id列表查找功能信息 + * @param roleId + * @param request + * @return + */ + @GetMapping(value = "/findRoleFunctionsById") + @ApiOperation(value = "根据id列表查找功能信息") + public R findByIds(@RequestParam("roleId") Long roleId, + HttpServletRequest request)throws Exception { + + UserBusiness ub = userBusinessService.getBasicData(roleId, "RoleFunctions"); + //按钮 + Map btnMap = new HashMap<>(); + List btnStr = ub.getBtnStr(); + if(ObjectUtil.isNotEmpty(btnStr)) { + for(BtnDto obj: btnStr) { + if(obj.getFunId()!=null && obj.getBtnStr()!=null) { + btnMap.put(obj.getFunId(), obj.getBtnStr()); + } + } + } + //菜单 + List funIds = ub.getValue().stream().map(Number::longValue).collect(Collectors.toList()); + List dataList = functionService.findByIds(funIds); + JSONObject outer = new JSONObject(); + outer.set("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (ObjectUtil.isNotEmpty(dataList)) { + for (Function function : dataList) { + JSONObject item = new JSONObject(); + item.set("id", function.getId()); + item.set("name", function.getName()); + item.set("pushBtn", function.getPushBtn()); + item.set("btnStr", ObjectUtil.isEmpty(btnMap.get(function.getId()))?"":btnMap.get(function.getId())); + dataArray.add(item); + } + } + outer.set("rows", dataArray); + return R.success(outer); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/InOutItemController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/InOutItemController.java new file mode 100644 index 00000000..288e737b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/InOutItemController.java @@ -0,0 +1,59 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.InOutItem; +import com.zsw.erp.service.inOutItem.InOutItemService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + + +@RestController +@RequestMapping(value = "/inOutItem") +@Api(tags = {"收支项目"}) +public class InOutItemController { + private Logger logger = LoggerFactory.getLogger(InOutItemController.class); + + @Resource + private InOutItemService inOutItemService; + + /** + * 查找收支项目信息-下拉框 + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找收支项目信息") + public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{ + String res = null; + try { + List dataList = inOutItemService.findBySelect(type); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (InOutItem inOutItem : dataList) { + JSONObject item = new JSONObject(); + item.put("id", inOutItem.getId()); + //收支项目名称 + item.put("name", inOutItem.getName()); + dataArray.add(item); + } + } + res = dataArray.toJSONString(); + } catch(Exception e){ + e.printStackTrace(); + res = "获取数据失败"; + } + return res; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java new file mode 100644 index 00000000..c425761f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/IndexController.java @@ -0,0 +1,14 @@ +package com.zsw.erp.controller; + +import com.zsw.base.R; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class IndexController { + + @RequestMapping("/") + public R index(){ + return R.success("","欢迎访问回乡进销存系统"); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/InventorySeasonController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/InventorySeasonController.java new file mode 100644 index 00000000..7722d886 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/InventorySeasonController.java @@ -0,0 +1,33 @@ +package com.zsw.erp.controller; + +import com.zsw.base.R; +import com.zsw.erp.service.inventorySeason.InventorySeasonService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Api(value = "期次管理",tags = "期次管理") +@RequestMapping("/inventory") +public class InventorySeasonController { + + @Autowired + private InventorySeasonService inventorySeasonService; + + + @ApiOperation("获取当前期次") + @GetMapping("/now") + public R getNow(){ + return R.success(inventorySeasonService.getNow()); + } + + @ApiOperation("结束当前期次 开始新的期次") + @GetMapping("/endNow") + public R endNow(){ + return R.success(inventorySeasonService.endNow()); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialAttributeController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialAttributeController.java new file mode 100644 index 00000000..250a2aff --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialAttributeController.java @@ -0,0 +1,39 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.base.R; +import com.zsw.erp.service.materialAttribute.MaterialAttributeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + + +@RestController +@RequestMapping(value = "/materialAttribute") +@Api(tags = {"商品属性"}) +public class MaterialAttributeController { + private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class); + + @Resource + private MaterialAttributeService materialAttributeService; + + /** + * 获取全部商品属性 + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getAll") + @ApiOperation(value = "获取全部商品属性") + public R getAll(HttpServletRequest request)throws Exception { + JSONObject obj = materialAttributeService.getAll(); + return R.success(obj); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialCategoryController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialCategoryController.java new file mode 100644 index 00000000..7c1df8c9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialCategoryController.java @@ -0,0 +1,141 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.MaterialCategory; +import com.zsw.erp.datasource.vo.TreeNode; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.service.materialCategory.MaterialCategoryService; +import com.zsw.base.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotNull; +import java.util.List; + + +@RestController +@RequestMapping(value = "/materialCategory") +@Api(tags = {"商品类别"}) +@Validated +public class MaterialCategoryController { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); + + @Resource + private MaterialCategoryService materialCategoryService; + + /** + * 获取全部商品类别 + * @param parentId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "获取全部商品类别") + public R getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{ + List materialCategoryList = materialCategoryService.getAllList(parentId); + return R.success(materialCategoryList); + } + + /** + * 根据id来查询商品名称 + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询商品名称") + public R findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { + List dataList = materialCategoryService.findById(id); + JSONObject outer = new JSONObject(); + if (null != dataList) { + for (MaterialCategory mc : dataList) { + outer.put("id", mc.getId()); + outer.put("name", mc.getName()); + outer.put("parentId", mc.getParentId()); + List dataParentList = materialCategoryService.findById(mc.getParentId()); + if(dataParentList!=null&&dataParentList.size()>0){ + outer.put("parentName", dataParentList.get(0).getName()); + } + outer.put("sort", mc.getSort()); + outer.put("serialNo", mc.getSerialNo()); + outer.put("remark", mc.getRemark()); + } + } + return R.success(outer); + } + /** + * create by: cjl + * description: + * 获取商品类别树数据 + * create time: 2019/2/19 11:49 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getMaterialCategoryTree") + @ApiOperation(value = "获取商品类别树数据") + public JSONArray getMaterialCategoryTree(@RequestParam(value = "id",defaultValue = "0") Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id); + if(materialCategoryTree!=null&&materialCategoryTree.size()>0){ + for(TreeNode node:materialCategoryTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + /** + * create by: cjl + * description: + * 新增商品类别数据 + * create time: 2019/2/19 17:17 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/addMaterialCategory") + @ApiOperation(value = "新增商品类别数据") + public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.addMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_MSG); + } + return result; + } + /** + * create by: cjl + * description: + * 修改商品类别数据 + * create time: 2019/2/20 9:30 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/editMaterialCategory") + @ApiOperation(value = "修改商品类别数据") + public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.editMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_EDIT_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_EDIT_FAILED_MSG); + } + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java new file mode 100644 index 00000000..03c935de --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialController.java @@ -0,0 +1,662 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.poi.excel.ExcelReader; +import cn.hutool.poi.excel.ExcelUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.base.R; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.depotItem.DepotItemService; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.unit.UnitService; +import com.zsw.erp.datasource.entities.MaterialVo4Unit; +import com.zsw.erp.datasource.entities.Unit; +import com.zsw.erp.utils.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/material") +@Api(tags = {"商品管理"}) +public class MaterialController { + private Logger logger = LoggerFactory.getLogger(MaterialController.class); + + @Resource + private MaterialService materialService; + + @Resource + private DepotItemService depotItemService; + + @Resource + private UnitService unitService; + + @Resource + private DepotService depotService; + + @Resource + private RedisService redisService; + + /** + * 检查商品是否存在 + * + * @param id + * @param name + * @param model + * @param color + * @param standard + * @param mfrs + * @param otherField1 + * @param otherField2 + * @param otherField3 + * @param unit + * @param unitId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsExist") + @ApiOperation(value = "检查商品是否存在") + public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, + @RequestParam("model") String model, @RequestParam("color") String color, + @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, + @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, + @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit, @RequestParam("unitId") Long unitId, + HttpServletRequest request) throws Exception { + Map objectMap = new HashMap(); + int exist = materialService.checkIsExist(id, name, StringUtil.toNull(model), StringUtil.toNull(color), + StringUtil.toNull(standard), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), + StringUtil.toNull(otherField2), StringUtil.toNull(otherField3), StringUtil.toNull(unit), unitId); + if (exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 批量设置状态-启用或者禁用 + * + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-启用或者禁用") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = materialService.batchSetStatus(status, ids); + if (res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 根据id来查询商品名称 + * + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询商品名称") + public R findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception { + List list = materialService.findById(id); + return R.success(list); + } + + /** + * 根据meId来查询商品名称 + * + * @param meId + * @param request + * @return + */ + @GetMapping(value = "/findByIdWithBarCode") + @ApiOperation(value = "根据meId来查询商品名称") + public R findByIdWithBarCode(@RequestParam("meId") Long meId, + @RequestParam("mpList") String mpList, + HttpServletRequest request) throws Exception { + + String[] mpArr = mpList.split(","); + MaterialVo4Unit mu = new MaterialVo4Unit(); + List list = materialService.findByIdWithBarCode(meId); + if (list != null && list.size() > 0) { + mu = list.get(0); + String expand = ""; //扩展信息 + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + expand = expand + ((mu.getMfrs() == null || mu.getMfrs().equals("")) ? "" : "(" + mu.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + expand = expand + ((mu.getOtherField1() == null || mu.getOtherField1().equals("")) ? "" : "(" + mu.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + expand = expand + ((mu.getOtherField2() == null || mu.getOtherField2().equals("")) ? "" : "(" + mu.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + expand = expand + ((mu.getOtherField3() == null || mu.getOtherField3().equals("")) ? "" : "(" + mu.getOtherField3() + ")"); + } + } + mu.setMaterialOther(expand); + } + return R.success(mu); + } + + /** + * 查找商品信息-下拉框 + * + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找商品信息") + public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam(value = "q", required = false) String q, + @RequestParam("mpList") String mpList, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request) throws Exception { + JSONObject object = new JSONObject(); + try { + List dataList = materialService.findBySelectWithBarCode(categoryId, q, (currentPage - 1) * pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = materialService.findBySelectWithBarCodeCount(categoryId, q); + object.put("total", total); + JSONArray dataArray = new JSONArray(); + //存放数据json数组 + if (null != dataList) { + for (MaterialVo4Unit material : dataList) { + JSONObject item = new JSONObject(); + item.put("id", material.getMeId()); //商品扩展表的id + String ratioStr = ""; //比例 + Unit unit = new Unit(); + if (material.getUnitId() == null) { + ratioStr = ""; + } else { + unit = unitService.getUnit(material.getUnitId()); + //拼接副单位的比例 + String commodityUnit = material.getCommodityUnit(); + if (commodityUnit.equals(unit.getBasicUnit())) { + ratioStr = "[基本]"; + } + if (commodityUnit.equals(unit.getOtherUnit())) { + ratioStr = "[" + unit.getRatio() + unit.getBasicUnit() + "]"; + } + if (commodityUnit.equals(unit.getOtherUnitTwo())) { + ratioStr = "[" + unit.getRatioTwo() + unit.getBasicUnit() + "]"; + } + if (commodityUnit.equals(unit.getOtherUnitThree())) { + ratioStr = "[" + unit.getRatioThree() + unit.getBasicUnit() + "]"; + } + } + item.put("mBarCode", material.getMBarCode()); + item.put("name", material.getName()); + item.put("categoryName", material.getCategoryName()); + item.put("standard", material.getStandard()); + item.put("model", material.getModel()); + item.put("color", material.getColor()); + item.put("unit", material.getCommodityUnit() + ratioStr); + item.put("sku", material.getSku()); + item.put("enableSerialNumber", material.getEnableSerialNumber()); + item.put("enableBatchNumber", material.getEnableBatchNumber()); + BigDecimal stock; + if (StringUtil.isNotEmpty(material.getSku())) { + stock = depotItemService.getSkuStockByParam(depotId, material.getMeId(), null, null); + } else { + stock = depotItemService.getStockByParam(depotId, material.getId(), null, null).getStock(); + if (material.getUnitId() != null) { + String commodityUnit = material.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + item.put("stock", stock); + String expand = ""; //扩展信息 + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + expand = expand + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + expand = expand + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + expand = expand + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + expand = expand + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")"); + } + } + item.put("expand", expand); + dataArray.add(item); + } + } + object.put("rows", dataArray); + } catch (Exception e) { + e.printStackTrace(); + } + return object; + } + + /** + * 根据商品id查找商品信息 + * + * @param meId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialByMeId") + @ApiOperation(value = "根据商品id查找商品信息") + public JSONObject getMaterialByMeId(@RequestParam(value = "meId", required = false) Long meId, + @RequestParam("mpList") String mpList, + HttpServletRequest request) throws Exception { + JSONObject item = new JSONObject(); + try { + String[] mpArr = mpList.split(","); + List materialList = materialService.getMaterialByMeId(meId); + if (materialList != null && materialList.size() != 1) { + return item; + } else if (materialList.size() == 1) { + MaterialVo4Unit material = materialList.get(0); + item.put("Id", material.getMeId()); //商品扩展表的id + String ratio; //比例 + if (material.getUnitId() == null || material.getUnitId().equals("")) { + ratio = ""; + } else { + ratio = material.getUnitName(); + ratio = ratio.substring(ratio.indexOf("(")); + } + //名称/型号/扩展信息/包装 + String MaterialName = ""; + MaterialName = MaterialName + material.getMBarCode() + "_" + material.getName() + + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")"); + String expand = ""; //扩展信息 + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("颜色")) { + expand = expand + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")"); + } + if (mpArr[i].equals("制造商")) { + expand = expand + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + expand = expand + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + expand = expand + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + expand = expand + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")"); + } + } + MaterialName = MaterialName + expand + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio; + item.put("MaterialName", MaterialName); + item.put("name", material.getName()); + item.put("expand", expand); + item.put("model", material.getModel()); + item.put("standard", material.getStandard()); + item.put("unit", material.getUnit() + ratio); + } + } catch (Exception e) { + e.printStackTrace(); + } + return item; + } + + /** + * 生成excel表格 + * + * @param barCode + * @param name + * @param standard + * @param model + * @param categoryId + * @param request + * @param response + */ + @GetMapping(value = "/exportExcel") + @ApiOperation(value = "生成excel表格") + public void exportExcel(@RequestParam("categoryId") String categoryId, + @RequestParam("barCode") String barCode, + @RequestParam("name") String name, + @RequestParam("standard") String standard, + @RequestParam("model") String model, + @RequestParam("mpList") String mpList, + HttpServletRequest request, HttpServletResponse response) { + try { + List dataList = materialService.findByAll(StringUtil.toNull(barCode), StringUtil.toNull(name), + StringUtil.toNull(standard), StringUtil.toNull(model), StringUtil.toNull(categoryId)); + String[] names = {"名称", "类型", "型号", "单位", "零售价", "最低售价", "采购价", "销售价", "备注", "状态"}; + String title = "商品信息"; + List objects = new ArrayList(); + if (null != dataList) { + for (MaterialVo4Unit m : dataList) { + String[] objs = new String[10]; + objs[0] = m.getName(); + objs[1] = m.getCategoryName(); + objs[2] = m.getModel(); + objs[3] = m.getCommodityUnit(); + objs[4] = m.getCommodityDecimal() == null ? "" : m.getCommodityDecimal().toString(); + objs[5] = m.getLowDecimal() == null ? "" : m.getLowDecimal().toString(); + objs[6] = m.getPurchaseDecimal() == null ? "" : m.getPurchaseDecimal().toString(); + objs[7] = m.getWholesaleDecimal() == null ? "" : m.getWholesaleDecimal().toString(); + objs[8] = m.getRemark(); + objs[9] = m.getEnabled() ? "启用" : "禁用"; + objects.add(objs); + } + } + File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects); + ExportExecUtil.showExec(file, file.getName(), response); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * excel表格导入产品(含初始库存) + * + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importExcel") + @ApiOperation(value = "excel表格导入产品") + public R importExcel(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) throws Exception { + + String message = "成功"; + //文件合法性校验 + ExcelReader reader = ExcelUtil.getReader(file.getInputStream(), 0); + List> list = reader.read(); + return materialService.importExcel(list, request); + } + + public BigDecimal parseBigDecimalEx(String str) throws Exception { + if (!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + /** + * 获取商品序列号 + * + * @param q + * @param currentPage + * @param pageSize + * @param request + * @param response + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialEnableSerialNumberList") + @ApiOperation(value = "获取商品序列号") + public JSONObject getMaterialEnableSerialNumberList( + @RequestParam(value = "q", required = false) String q, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + JSONObject object = new JSONObject(); + try { + List list = materialService.getMaterialEnableSerialNumberList(q, (currentPage - 1) * pageSize, pageSize); + Long count = materialService.getMaterialEnableSerialNumberCount(q); + object.put("rows", list); + object.put("total", count); + } catch (Exception e) { + e.printStackTrace(); + } + return object; + } + + /** + * 获取最大条码 + * + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaxBarCode") + @ApiOperation(value = "获取最大条码") + public R getMaxBarCode() throws Exception { + Map map = new HashMap(); + String barCode = materialService.getMaxBarCode(); + map.put("barCode", barCode); + return R.success(map); + } + + /** + * 商品名称模糊匹配 + * + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialNameList") + @ApiOperation(value = "商品名称模糊匹配") + public JSONArray getMaterialNameList() throws Exception { + JSONArray arr = new JSONArray(); + try { + List list = materialService.getMaterialNameList(); + for (String s : list) { + JSONObject item = new JSONObject(); + item.put("value", s); + item.put("text", s); + arr.add(item); + } + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 根据条码查询商品信息 + * + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialByBarCode") + @ApiOperation(value = "根据条码查询商品信息") + public R getMaterialByBarCode(@RequestParam("barCode") String barCode, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("mpList") String mpList, + @RequestParam(required = false, value = "prefixNo") String prefixNo, + HttpServletRequest request) throws Exception { + + String[] mpArr = mpList.split(","); + List list = materialService.getMaterialByBarCode(barCode); + if (list != null && list.size() > 0) { + for (MaterialVo4Unit mvo : list) { + String expand = ""; //扩展信息 + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + expand = expand + ((mvo.getMfrs() == null || mvo.getMfrs().equals("")) ? "" : "(" + mvo.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + expand = expand + ((mvo.getOtherField1() == null || mvo.getOtherField1().equals("")) ? "" : "(" + mvo.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + expand = expand + ((mvo.getOtherField2() == null || mvo.getOtherField2().equals("")) ? "" : "(" + mvo.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + expand = expand + ((mvo.getOtherField3() == null || mvo.getOtherField3().equals("")) ? "" : "(" + mvo.getOtherField3() + ")"); + } + } + mvo.setMaterialOther(expand); + if ("LSCK".equals(prefixNo) || "LSTH".equals(prefixNo)) { + //零售价 + mvo.setBillPrice(mvo.getCommodityDecimal()); + } else if ("CGDD".equals(prefixNo) || "CGRK".equals(prefixNo) || "CGTH".equals(prefixNo) + || "QTRK".equals(prefixNo) || "DBCK".equals(prefixNo) || "ZZD".equals(prefixNo) || "CXD".equals(prefixNo) + || "PDLR".equals(prefixNo) || "PDFP".equals(prefixNo)) { + //采购价 + mvo.setBillPrice(mvo.getPurchaseDecimal()); + } else if ("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) { + //销售价 + mvo.setBillPrice(mvo.getWholesaleDecimal()); + } + //仓库id + if (depotId == null) { + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for (Object obj : depotArr) { + JSONObject depotObj = JSONObject.parseObject(obj.toString()); + if (depotObj.get("isDefault") != null) { + Boolean isDefault = depotObj.getBoolean("isDefault"); + if (isDefault) { + Long id = depotObj.getLong("id"); + if (!"CGDD".equals(prefixNo) && !"XSDD".equals(prefixNo)) { + //除订单之外的单据才有仓库 + mvo.setDepotId(id); + } + getStockByMaterialInfo(mvo); + } + } + } + } else { + mvo.setDepotId(depotId); + getStockByMaterialInfo(mvo); + } + } + } + return R.success(list); + } + + /** + * 根据商品信息获取库存,进行赋值 + * + * @param mvo + * @throws Exception + */ + private void getStockByMaterialInfo(MaterialVo4Unit mvo) throws Exception { + BigDecimal stock; + if (StringUtil.isNotEmpty(mvo.getSku())) { + stock = depotItemService.getSkuStockByParam(mvo.getDepotId(), mvo.getMeId(), null, null); + } else { + stock = depotItemService.getStockByParam(mvo.getDepotId(), mvo.getId(), null, null).getStock(); + if (mvo.getUnitId() != null) { + Unit unit = unitService.getUnit(mvo.getUnitId()); + String commodityUnit = mvo.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + mvo.setStock(stock); + } + + /** + * 商品库存查询 + * + * @param currentPage + * @param pageSize + * @param depotIds + * @param categoryId + * @param materialParam + * @param mpList + * @param column + * @param order + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getListWithStock") + @ApiOperation(value = "商品库存查询") + public R getListWithStock(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "depotIds", required = false) String depotIds, + @RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam("materialParam") String materialParam, + @RequestParam("zeroStock") Integer zeroStock, + @RequestParam("mpList") String mpList, + @RequestParam("column") String column, + @RequestParam("order") String order, + @RequestParam("startTime") String startTime, + HttpServletRequest request) throws Exception { + + Map map = new HashMap<>(); + try { + List idList = new ArrayList<>(); + List depotList = new ArrayList<>(); + if (categoryId != null) { + idList = materialService.getListByParentId(categoryId); + } + if (StringUtil.isNotEmpty(depotIds)) { + depotList = StringUtil.strToLongList(depotIds); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for (Object obj : depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + List dataList = materialService.getListWithStock(depotList, idList, StringUtil.toNull(materialParam), zeroStock, + startTime, + StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage - 1) * pageSize, pageSize); +// int total = materialService.getListWithStockCount(depotList, idList, StringUtil.toNull(materialParam), zeroStock,startTime); + MaterialVo4Unit materialVo4Unit = materialService.getTotalStockAndPrice(depotList, idList, StringUtil.toNull(materialParam),startTime); + + + if (ObjectUtil.isEmpty(dataList)){ + map.put("total", 0); + map.put("currentStock", 0); + map.put("currentStockPrice", 0); + map.put("rows", dataList); + return R.success(map); + } + map.put("total", materialVo4Unit.getStock()); + map.put("currentStock", materialVo4Unit.getCurrentStock()); + map.put("currentStockPrice", materialVo4Unit.getCurrentStockPrice()); + //存放数据json数组 + map.put("rows", dataList); + return R.success(map); + } catch (Exception e) { + e.printStackTrace(); + return R.fail("获取数据失败"); + } + } + + /** + * 批量设置商品当前的实时库存(按每个仓库) + * + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/batchSetMaterialCurrentStock") + @ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)") + public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception { + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = materialService.batchSetMaterialCurrentStock(ids); + if (res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialExtendController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialExtendController.java new file mode 100644 index 00000000..56a05137 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialExtendController.java @@ -0,0 +1,109 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.MaterialExtend; +import com.zsw.erp.datasource.vo.MaterialExtendVo4List; +import com.zsw.erp.service.materialExtend.MaterialExtendService; +import com.zsw.base.R; +import com.zsw.erp.utils.StringUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RestController +@RequestMapping(value = "/materialsExtend") +@Api(tags = {"商品价格扩展"}) +public class MaterialExtendController { + private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class); + @Resource + private MaterialExtendService materialExtendService; + + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "价格信息列表") + public R getDetailList(@RequestParam("materialId") Long materialId, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List dataList = new ArrayList(); + if(materialId!=0) { + dataList = materialExtendService.getDetailList(materialId); + } + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (MaterialExtendVo4List md : dataList) { + JSONObject item = new JSONObject(); + item.put("id", md.getId()); + item.put("barCode", md.getBarCode()); + item.put("commodityUnit", md.getCommodityUnit()); + if(StringUtil.isNotEmpty(md.getSku())){ + item.put("sku", md.getSku()); + } + item.put("purchaseDecimal", md.getPurchaseDecimal()); + item.put("commodityDecimal", md.getCommodityDecimal()); + item.put("wholesaleDecimal", md.getWholesaleDecimal()); + item.put("lowDecimal", md.getLowDecimal()); + dataArray.add(item); + } + } + outer.put("rows", dataArray); + return R.success(outer); + } + + /** + * 根据条码查询商品信息 + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getInfoByBarCode") + @ApiOperation(value = "根据条码查询商品信息") + public R getInfoByBarCode(@RequestParam("barCode") String barCode, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode); + return R.success(materialExtend); + } + + /** + * 校验条码是否存在 + * @param id + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsBarCodeExist") + @ApiOperation(value = "校验条码是否存在") + public R checkIsBarCodeExist(@RequestParam("id") Long id, + @RequestParam("barCode") String barCode, + HttpServletRequest request)throws Exception { + + Map map = new HashMap<>(); + int exist = materialExtendService.checkIsBarCodeExist(id, barCode); + if(exist > 0) { + map.put("status", true); + } else { + map.put("status", false); + } + return R.success(map); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialPropertyController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialPropertyController.java new file mode 100644 index 00000000..0840eed5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MaterialPropertyController.java @@ -0,0 +1,19 @@ +package com.zsw.erp.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/29 15:24 + */ +@RestController +@RequestMapping(value = "/materialProperty") +@Api(tags = {"商品扩展字段"}) +public class MaterialPropertyController { + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/MsgController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/MsgController.java new file mode 100644 index 00000000..5dc85606 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/MsgController.java @@ -0,0 +1,111 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.MsgEx; +import com.zsw.erp.service.msg.MsgService; +import com.zsw.base.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RestController +@RequestMapping(value = "/msg") +@Api(tags = {"消息管理"}) +public class MsgController { + private Logger logger = LoggerFactory.getLogger(MsgController.class); + + @Resource + private MsgService msgService; + + /** + * 根据状态查询消息 + * @param status + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgByStatus") + @ApiOperation(value = "根据状态查询消息") + public R getMsgByStatus(@RequestParam("status") String status, + HttpServletRequest request)throws Exception { + + List list = msgService.getMsgByStatus(status); + return R.success(list); + } + + /** + * 批量更新状态 + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping("/batchUpdateStatus") + @ApiOperation(value = "批量更新状态") + public R batchUpdateStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + + String ids = jsonObject.getString("ids"); + String status = jsonObject.getString("status"); + msgService.batchUpdateStatus(ids, status); + return R.success(); + } + + /** + * 根据状态查询数量 + * @param status + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgCountByStatus") + @ApiOperation(value = "根据状态查询数量") + public R getMsgCountByStatus(@RequestParam("status") String status, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + Long count = msgService.getMsgCountByStatus(status); + map.put("count", count); + return R.success(map); + } + + /** + * 根据类型查询数量 + * @param type + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgCountByType") + @ApiOperation(value = "根据类型查询数量") + public R getMsgCountByType(@RequestParam("type") String type, + HttpServletRequest request)throws Exception { + + Map map = new HashMap<>(); + Integer count = msgService.getMsgCountByType(type); + map.put("count", count); + return R.success(map); + } + + /** + * 全部设置未已读 + * @param request + * @return + * @throws Exception + */ + @PostMapping("/readAllMsg") + @ApiOperation(value = "全部设置未已读") + public R readAllMsg(HttpServletRequest request)throws Exception { + msgService.readAllMsg(); + return R.success(); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/OrganizationController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/OrganizationController.java new file mode 100644 index 00000000..68141326 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/OrganizationController.java @@ -0,0 +1,130 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.base.R; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.Organization; +import com.zsw.erp.datasource.vo.TreeNode; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.service.organization.OrganizationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Required; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * create by: cjl + * description: + * + * create time: 2019/3/6 10:54 + */ +@RestController +@RequestMapping(value = "/organization") +@Api(tags = {"机构管理"}) +public class OrganizationController { + private Logger logger = LoggerFactory.getLogger(OrganizationController.class); + + @Resource + private OrganizationService organizationService; + /** + * 根据id来查询机构信息 + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询机构信息") + public R findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List dataList = organizationService.findById(id); + JSONObject outer = new JSONObject(); + if (null != dataList) { + for (Organization org : dataList) { + outer.put("id", org.getId()); + outer.put("orgAbr", org.getOrgAbr()); + outer.put("parentId", org.getParentId()); + List dataParentList = organizationService.findByParentId(org.getParentId()); + if(dataParentList!=null&&dataParentList.size()>0){ + //父级机构名称显示简称 + outer.put("orgParentName", dataParentList.get(0).getOrgAbr()); + } + outer.put("orgNo", org.getOrgNo()); + outer.put("sort", org.getSort()); + outer.put("remark", org.getRemark()); + } + } + return R.success(outer); + } + + /** + * create by: cjl + * description: + * 获取机构树数据 + * create time: 2019/2/19 11:49 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getOrganizationTree") + @ApiOperation(value = "获取机构树数据") + public JSONArray getOrganizationTree(@RequestParam(value = "id",defaultValue = "0") Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List organizationTree= organizationService.getOrganizationTree(id); + if(organizationTree!=null&&organizationTree.size()>0){ + for(TreeNode node:organizationTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj); + } + } + return arr; + } + /** + * create by: cjl + * description: + * 新增机构信息 + * create time: 2019/2/19 17:17 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/addOrganization") + @ApiOperation(value = "新增机构信息") + public Object addOrganization(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + Organization org= JSON.parseObject(beanJson, Organization.class); + int i= organizationService.addOrganization(org); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ADD_FAILED_CODE, + ExceptionConstants.ORGANIZATION_ADD_FAILED_MSG); + } + return result; + } + /** + * create by: cjl + * description: + * 修改机构信息 + * create time: 2019/2/20 9:30 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/editOrganization") + @ApiOperation(value = "修改机构信息") + public Object editOrganization(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + Organization org= JSON.parseObject(beanJson, Organization.class); + int i= organizationService.editOrganization(org); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_EDIT_FAILED_CODE, + ExceptionConstants.ORGANIZATION_EDIT_FAILED_MSG); + } + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/PersonController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/PersonController.java new file mode 100644 index 00000000..8de8133e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/PersonController.java @@ -0,0 +1,118 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.Person; +import com.zsw.erp.service.person.PersonService; +import com.zsw.base.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RestController +@RequestMapping(value = "/person") +@Api(tags = {"经手人管理"}) +public class PersonController { + private Logger logger = LoggerFactory.getLogger(PersonController.class); + + @Resource + private PersonService personService; + + /** + * 全部数据列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "全部数据列表") + public R getAllList(HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List personList = personService.getPerson(); + map.put("personList", personList); + return R.success(map); + } + + /** + * 根据Id获取经手人信息 + * @param personIds + * @param request + * @return + */ + @GetMapping(value = "/getPersonByIds") + @ApiOperation(value = "根据Id获取经手人信息") + public R getPersonByIds(@RequestParam("personIds") String personIds, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + Map personMap = personService.getPersonMap(); + String names = personService.getPersonByMapAndIds(personMap, personIds); + map.put("names", names); + return R.success(map); + } + + /** + * 根据类型获取经手人信息 + * @param type + * @param request + * @return + */ + @GetMapping(value = "/getPersonByType") + @ApiOperation(value = "根据类型获取经手人信息") + public R getPersonByType(@RequestParam("type") String type, + HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + List personList = personService.getPersonByType(type); + map.put("personList", personList); + return R.success(map); + } + + /** + * 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员 + * @param typeNum + * @param request + * @return + */ + @GetMapping(value = "/getPersonByNumType") + @ApiOperation(value = "根据类型获取经手人信息1-业务员,2-仓管员,3-财务员") + public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, + HttpServletRequest request)throws Exception { + JSONArray dataArray = new JSONArray(); + try { + String type = ""; + if (typeNum.equals("1")) { + type = "业务员"; + } else if (typeNum.equals("2")) { + type = "仓管员"; + } else if (typeNum.equals("3")) { + type = "财务员"; + } + List personList = personService.getPersonByType(type); + if (null != personList) { + for (Person person : personList) { + JSONObject item = new JSONObject(); + item.put("value", person.getId().toString()); + item.put("text", person.getName()); + dataArray.add(item); + } + } + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java new file mode 100644 index 00000000..01b6c05c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/PlatformConfigController.java @@ -0,0 +1,116 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.PlatformConfig; +import com.zsw.erp.service.platformConfig.PlatformConfigService; +import com.zsw.erp.service.user.UserService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/platformConfig") +@Api(tags = {"平台参数"}) +public class PlatformConfigController { + private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); + + @Value("${demonstrate.open}") + private boolean demonstrateOpen; + + @Resource + private PlatformConfigService platformConfigService; + + @Resource + private UserService userService; + + private static final String TEST_USER = "jsh"; + + /** + * 获取平台名称 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/name") + @ApiOperation(value = "获取平台名称") + public String getPlatformName(HttpServletRequest request)throws Exception { + String res; + try { + String platformKey = "platform_name"; + PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); + res = platformConfig.getPlatformValue(); + } catch(Exception e){ + e.printStackTrace(); + res = "ERP系统"; + } + return res; + } + + /** + * 获取官方网站地址 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/url") + @ApiOperation(value = "获取官方网站地址") + public String getPlatformUrl(HttpServletRequest request)throws Exception { + String res; + try { + String platformKey = "platform_url"; + PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); + res = platformConfig.getPlatformValue(); + } catch(Exception e){ + e.printStackTrace(); + res = "#"; + } + return res; + } + + /** + * 根据platformKey更新platformValue + * @param object + * @param request + * @return + */ + @PostMapping(value = "/updatePlatformConfigByKey") + @ApiOperation(value = "根据platformKey更新platformValue") + public String updatePlatformConfigByKey(@RequestBody JSONObject object, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + String platformKey = object.getString("platformKey"); + String platformValue = object.getString("platformValue"); + int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 根据platformKey查询信息 + * @param platformKey + * @param request + * @return + */ + @GetMapping(value = "/getPlatformConfigByKey") + @ApiOperation(value = "根据platformKey查询信息") + public R getPlatformConfigByKey(@RequestParam("platformKey") String platformKey, + HttpServletRequest request)throws Exception { + + PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey); + return R.success(platformConfig); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java new file mode 100644 index 00000000..436c33e0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/ResourceController.java @@ -0,0 +1,150 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.service.CommonQueryManager; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.ErpInfo; +import com.zsw.erp.utils.ParamUtils; +import com.zsw.erp.utils.StringUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + +@RestController +@Api(tags = {"资源接口"}) +public class ResourceController { + + @Resource + private CommonQueryManager configResourceManager; + + @GetMapping(value = "/{apiName}/info") + @ApiOperation(value = "根据id获取信息") + public String getList(@PathVariable("apiName") String apiName, + @RequestParam("id") Long id, + HttpServletRequest request) throws Exception { + Object obj = configResourceManager.selectOne(apiName, id); + Map objectMap = new HashMap(); + if(obj != null) { + objectMap.put("info", obj); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/{apiName}/list") + @ApiOperation(value = "获取信息列表") + public String getList(@PathVariable("apiName") String apiName, + @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, + @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, + @RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + Map parameterMap = ParamUtils.requestToMap(request); + parameterMap.put(Constants.SEARCH, search); + Map objectMap = new HashMap(); + if (pageSize != null && pageSize <= 0) { + pageSize = 10; + } + String offset = ParamUtils.getPageOffset(currentPage, pageSize); + if (StringUtil.isNotEmpty(offset)) { + parameterMap.put(Constants.OFFSET, offset); + } + List list = configResourceManager.select(apiName, parameterMap); + if (list != null) { + objectMap.put("total", configResourceManager.counts(apiName, parameterMap)); + objectMap.put("rows", list); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); + objectMap.put("rows", new ArrayList()); + return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + } + + @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "新增") + public String addResource(@PathVariable("apiName") String apiName, + @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int insert = configResourceManager.insert(apiName, obj, request); + if(insert > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(insert == -1) { + return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "修改") + public String updateResource(@PathVariable("apiName") String apiName, + @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int update = configResourceManager.update(apiName, obj, request); + if(update > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(update == -1) { + return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "删除") + public String deleteResource(@PathVariable("apiName") String apiName, + @RequestParam("id") Long id, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int delete = configResourceManager.delete(apiName, id, request); + if(delete > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(delete == -1) { + return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "批量删除") + public String batchDeleteResource(@PathVariable("apiName") String apiName, + @RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int delete = configResourceManager.deleteBatch(apiName, ids, request); + if(delete > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(delete == -1) { + return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/{apiName}/checkIsNameExist") + @ApiOperation(value = "检查名称是否存在") + public String checkIsNameExist(@PathVariable("apiName") String apiName, + @RequestParam Long id, @RequestParam(value ="name", required = false) String name, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int exist = configResourceManager.checkIsNameExist(apiName, id, name); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java new file mode 100644 index 00000000..3d734dec --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/RoleController.java @@ -0,0 +1,71 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.Role; +import com.zsw.erp.service.role.RoleService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + + +@RestController +@RequestMapping(value = "/role") +@Api(tags = {"角色管理"}) +public class RoleController { + private Logger logger = LoggerFactory.getLogger(RoleController.class); + + @Resource + private RoleService roleService; + + @Resource + private UserBusinessService userBusinessService; + + /** + * 角色对应应用显示 + * @param request + * @return + */ + @GetMapping(value = "/findUserRole") + @ApiOperation(value = "查询用户的角色") + public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, + HttpServletRequest request)throws Exception { + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = roleService.findUserRole(); + if (null != dataList) { + for (Role role : dataList) { + JSONObject item = new JSONObject(); + item.put("id", role.getId()); + item.put("text", role.getName()); + Boolean flag = ubValue.contains(role.getId()); + if (flag) { + item.put("checked", true); + } + arr.add(item); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + @GetMapping(value = "/allList") + @ApiOperation(value = "查询全部角色列表") + public List allList(HttpServletRequest request)throws Exception { + return roleService.allList(); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SequenceController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/SequenceController.java new file mode 100644 index 00000000..5c0c8252 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/SequenceController.java @@ -0,0 +1,43 @@ +package com.zsw.erp.controller; + +import com.zsw.erp.service.sequence.SequenceService; +import com.zsw.base.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + + +@RestController +@RequestMapping(value = "/sequence") +@Api(tags = {"单据编号"}) +public class SequenceController { + private Logger logger = LoggerFactory.getLogger(SequenceController.class); + + @Resource + private SequenceService sequenceService; + + /** + * 单据编号生成接口 + * @param request + * @return + */ + @GetMapping(value = "/buildNumber") + @ApiOperation(value = "单据编号生成接口") + public R buildNumber(HttpServletRequest request)throws Exception { + + Map map = new HashMap(); + String number = sequenceService.buildOnlyNumber(); + map.put("defaultNumber", number); + return R.success(map); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SerialNumberController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/SerialNumberController.java new file mode 100644 index 00000000..3db12527 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/SerialNumberController.java @@ -0,0 +1,93 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.SerialNumber; +import com.zsw.erp.service.serialNumber.SerialNumberService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/22 10:29 + */ +@RestController +@RequestMapping(value = "/serialNumber") +@Api(tags = {"序列号管理"}) +public class SerialNumberController { + private Logger logger = LoggerFactory.getLogger(SerialNumberController.class); + + @Resource + private SerialNumberService serialNumberService; + + /** + * create by: cjl + * description: + *批量添加序列号 + * create time: 2019/1/29 15:11 + * @Param: materialName + * @Param: serialNumberPrefix + * @Param: batAddTotal + * @Param: remark + * @return java.lang.Object + */ + @PostMapping("/batAddSerialNumber") + @ApiOperation(value = "批量添加序列号") + public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception{ + Map objectMap = new HashMap<>(); + String materialCode = jsonObject.getString("materialCode"); + String serialNumberPrefix = jsonObject.getString("serialNumberPrefix"); + Integer batAddTotal = jsonObject.getInteger("batAddTotal"); + String remark = jsonObject.getString("remark"); + int insert = serialNumberService.batAddSerialNumber(materialCode,serialNumberPrefix,batAddTotal,remark); + if(insert > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(insert == -1) { + return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 获取序列号商品 + * @param name + * @param depotId + * @param barCode + * @param currentPage + * @param pageSize + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getEnableSerialNumberList") + @ApiOperation(value = "获取序列号商品") + public R getEnableSerialNumberList(@RequestParam("name") String name, + @RequestParam("depotId") Long depotId, + @RequestParam("barCode") String barCode, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request)throws Exception { + + Map map = new HashMap<>(); + List list = serialNumberService.getEnableSerialNumberList(name, depotId, barCode, (currentPage-1)*pageSize, pageSize); + Long total = serialNumberService.getEnableSerialNumberCount(name, depotId, barCode); + map.put("rows", list); + map.put("total", total); + return R.success(map); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java new file mode 100644 index 00000000..0dc86b16 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/SupplierController.java @@ -0,0 +1,358 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.zsw.erp.datasource.entities.Supplier; +import com.zsw.erp.dto.supplier.SupplierVo; +import com.zsw.erp.service.supplier.SupplierService; +import com.zsw.erp.service.systemConfig.SystemConfigService; +import com.zsw.erp.service.tenant.TenantService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import com.zsw.erp.utils.ExportExecUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/supplier") +@Api(tags = {"商家管理"}) +public class SupplierController { + private Logger logger = LoggerFactory.getLogger(SupplierController.class); + + @Resource + private SupplierService supplierService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private SystemConfigService systemConfigService; + + @Resource + private UserService userService; + + @Resource + private TenantService tenantService; + + @GetMapping(value = "/checkIsNameAndTypeExist") + @ApiOperation(value = "检查名称和类型是否存在") + public String checkIsNameAndTypeExist(@RequestParam Long id, + @RequestParam(value ="name") String name, + @RequestParam(value ="type") String type, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int exist = supplierService.checkIsNameAndTypeExist(id, name, type); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 查找客户信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_cus") + @ApiOperation(value = "查找客户信息") + public List findBySelectCus(HttpServletRequest request) throws Exception { + List list = Lists.newArrayList(); + // String type = "UserCustomer"; + // Long userId = userService.getUserId(request); + //获取权限信息 + // List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId); + List supplierList = supplierService.findBySelectCus(); + if (null != supplierList) { + boolean customerFlag = systemConfigService.getCustomerFlag(); + for (Supplier supplier : supplierList) { + // JSONObject item = new JSONObject(); + // Boolean flag = ubValue.contains(supplier.getId()); + if (!customerFlag ) { //flag + SupplierVo vo = new SupplierVo(); + vo.setId(supplier.getId()); + vo.setSupplier(supplier.getSupplier()); + vo.setTargetType(false); + list.add(vo); + } + } + } + addSupplier(list); + return list; + } + + /** + * 查找供应商信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_sup") + @ApiOperation(value = "查找供应商信息") + public List findBySelectSup(HttpServletRequest request) throws Exception{ + List list = Lists.newArrayList(); + List supplierList = supplierService.findBySelectSup(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + SupplierVo vo = new SupplierVo(); + vo.setId(supplier.getId()); + vo.setSupplier(supplier.getSupplier()); + vo.setTargetType(false); + list.add(vo); + } + } + addSupplier(list); + return list; + } + + private void addSupplier(List list) { +// // 把系统租户倒进来 +// List tenants = tenantService.getTenant(); +// //过滤自己 +// tenants = tenants.stream().filter(t-> !t.getTenantId().equals(LocalUser.getTenantId())).collect(Collectors.toList()); +// for (Tenant tenant:tenants){ +// SupplierVo vo = new SupplierVo(); +// vo.setId(tenant.getId()); +// SystemConfig systemConfig = systemConfigService.getSystemConfigByTenentId(tenant.getTenantId()); +// vo.setSupplier(ObjectUtil.isEmpty(systemConfig)?"租户:"+tenant.getTenantId():systemConfig.getCompanyName()); +// vo.setTargetType(true); +// list.add(vo); +// } + } + + /** + * 查找往来单位,含供应商和客户信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_organ") + @ApiOperation(value = "查找往来单位,含供应商和客户信息") + public JSONArray findBySelectOrgan(HttpServletRequest request) throws Exception{ + JSONArray arr = new JSONArray(); + try { + JSONArray dataArray = new JSONArray(); + //1、获取供应商信息 + List supplierList = supplierService.findBySelectSup(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier() + "[供应商]"); //供应商名称 + dataArray.add(item); + } + } + //2、获取客户信息 + String type = "UserCustomer"; + Long userId = userService.getUserId(request); + List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId); + List customerList = supplierService.findBySelectCus(); + if (null != customerList) { + boolean customerFlag = systemConfigService.getCustomerFlag(); + for (Supplier supplier : customerList) { + JSONObject item = new JSONObject(); + Boolean flag = ubValue.contains(supplier.getId()); + if (!customerFlag || flag) { + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier() + "[客户]"); //客户名称 + dataArray.add(item); + } + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 查找会员信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_retail") + @ApiOperation(value = "查找会员信息") + public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception { + JSONArray arr = new JSONArray(); + try { + List supplierList = supplierService.findBySelectRetail(); + JSONArray dataArray = new JSONArray(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + //客户名称 + item.put("supplier", supplier.getSupplier()); + item.put("advanceIn", supplier.getAdvanceIn()); //预付款金额 + dataArray.add(item); + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = supplierService.batchSetStatus(status, ids); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 用户对应客户显示 + * @param type + * @param keyId + * @param request + * @return + */ + @GetMapping(value = "/findUserCustomer") + @ApiOperation(value = "用户对应客户显示") + public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") Long keyId, + HttpServletRequest request) throws Exception{ + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + List ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = supplierService.findUserCustomer(); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.put("id", 0); + outer.put("key", 0); + outer.put("value", 0); + outer.put("title", "客户列表"); + outer.put("attributes", "客户列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Supplier supplier : dataList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + item.put("key", supplier.getId()); + item.put("value", supplier.getId()); + item.put("title", supplier.getSupplier()); + item.put("attributes", supplier.getSupplier()); + Boolean flag = ubValue.contains(supplier.getId()); + if (flag) { + item.put("checked", true); + } + dataArray.add(item); + } + } + outer.put("children", dataArray); + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 导入供应商 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importVendor") + @ApiOperation(value = "导入供应商") + public R importVendor(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + + supplierService.importVendor(file, request); + return R.success(); + } + + /** + * 导入客户 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importCustomer") + @ApiOperation(value = "导入客户") + public R importCustomer(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + + supplierService.importCustomer(file, request); + return R.success(); + } + + /** + * 导入会员 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importMember") + @ApiOperation(value = "导入会员") + public R importMember(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + + supplierService.importMember(file, request); + return R.success(); + } + + /** + * 生成excel表格 + * @param supplier + * @param type + * @param phonenum + * @param telephone + * @param request + * @param response + * @return + */ + @GetMapping(value = "/exportExcel") + public void exportExcel(@RequestParam(value = "supplier", required = false) String supplier, + @RequestParam("type") String type, + @RequestParam(value = "phonenum", required = false) String phonenum, + @RequestParam(value = "telephone", required = false) String telephone, + HttpServletRequest request, HttpServletResponse response) { + try { + List dataList = supplierService.findByAll(supplier, type, phonenum, telephone); + File file = supplierService.exportExcel(dataList, type); + ExportExecUtil.showExec(file, file.getName(), response); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java new file mode 100644 index 00000000..01f1f5c3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/SystemConfigController.java @@ -0,0 +1,239 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.lang.UUID; +import com.alibaba.fastjson.JSON; +import com.qiniu.http.Response; +import com.qiniu.storage.Configuration; +import com.qiniu.storage.Region; +import com.qiniu.storage.UploadManager; +import com.qiniu.storage.model.DefaultPutRet; +import com.qiniu.util.Auth; +import com.zsw.base.R; +import com.zsw.erp.config.QiniuConfigProperty; +import com.zsw.erp.datasource.entities.SystemConfig; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.systemConfig.SystemConfigService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.SneakyThrows; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.util.AntPathMatcher; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.HandlerMapping; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Date; +import java.util.List; + +/** + * Description + * @Date: 2021-3-13 0:01 + */ +@RestController +@RequestMapping(value = "/systemConfig") +@Api(tags = {"系统参数"}) +@EnableConfigurationProperties(QiniuConfigProperty.class) +public class SystemConfigController { + private Logger logger = LoggerFactory.getLogger(SystemConfigController.class); + + @Resource + QiniuConfigProperty qiniuConfigProperty; + + @Resource + private UserService userService; + + @Resource + private DepotService depotService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private SystemConfigService systemConfigService; + + @Value(value="${spring.servlet.multipart.max-file-size}") + private Long maxFileSize; + + @Value(value="${spring.servlet.multipart.max-request-size}") + private Long maxRequestSize; + + /** + * 获取当前租户的配置信息 + * @param request + * @return + */ + @GetMapping(value = "/getCurrentInfo") + @ApiOperation(value = "获取当前租户的配置信息") + public R getCurrentInfo(HttpServletRequest request) throws Exception { + + List list = systemConfigService.getSystemConfig(); + if(list.size()>0) { + return R.success(list.get(0)); + }else{ + return R.fail("错误"); + } + } + + /** + * 获取文件大小限制 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/fileSizeLimit") + @ApiOperation(value = "获取文件大小限制") + public R fileSizeLimit(HttpServletRequest request) throws Exception { + + Long limit = 0L; + if(maxFileSize UTF-8 进行编码转换 + String imgPath = extractPathFromPattern(request); + if(StringUtil.isEmpty(imgPath) || imgPath=="null"){ + return; + } + // 其余处理略 + InputStream inputStream = null; + OutputStream outputStream = null; + try { + imgPath = imgPath.replace("..", ""); + if (imgPath.endsWith(",")) { + imgPath = imgPath.substring(0, imgPath.length() - 1); + } + String fileUrl = File.separator + imgPath; + File file = new File(fileUrl); + if(!file.exists()){ + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1")); + inputStream = new BufferedInputStream(new FileInputStream(fileUrl)); + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + logger.error("预览文件失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + } + } + + /** + * 把指定URL后的字符串全部截断当成参数 + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * @param request + * @return + */ + private static String extractPathFromPattern(final HttpServletRequest request) { + String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); + String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); + return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java new file mode 100644 index 00000000..b3559572 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/TenantController.java @@ -0,0 +1,57 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.tenant.TenantService; +import com.zsw.erp.utils.ErpInfo; +import com.zsw.erp.utils.ResponseCode; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; +import static com.zsw.erp.utils.ResponseJsonUtil.success; + + +@RestController +@RequestMapping(value = "/tenant") +@Api(tags = {"租户管理"}) +public class TenantController { + private Logger logger = LoggerFactory.getLogger(TenantController.class); + + @Resource + private TenantService tenantService; + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = tenantService.batchSetStatus(status, ids); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping("/listAllTenant") + @ApiOperation("列举全部租户") + public ResponseCode listAllTenant() throws Exception { + return success(tenantService.getTenant()); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java new file mode 100644 index 00000000..0bcb5b61 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/TestController.java @@ -0,0 +1,35 @@ +package com.zsw.erp.controller; + +import com.zsw.base.R; +import com.zsw.jwt.model.TenantAuthInfo; +import com.zsw.pos.authority.dto.auth.LoginParamDTO; +import com.zsw.pos.oauth.service.LoginService; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Slf4j +@Validated +public class TestController { + + @DubboReference + private LoginService loginService; + + @GetMapping("/test/login") + public R test(@RequestParam String username, @RequestParam String password){ + + LoginParamDTO dto = new LoginParamDTO(); + dto.setAccount(username); + dto.setPassword(password); + dto.setGrantType("password"); + R rs = loginService.grant(dto); + log.debug("login result : {}",rs.getData()); + return rs; + } + +} + diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/UnitController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/UnitController.java new file mode 100644 index 00000000..fe26422a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/UnitController.java @@ -0,0 +1,19 @@ +package com.zsw.erp.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/4/1 15:38 + */ +@RestController +@RequestMapping(value = "/unit") + @Api(tags = {"单位管理"}) +public class UnitController { + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java new file mode 100644 index 00000000..7d66f5a9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/UserBusinessController.java @@ -0,0 +1,104 @@ +package com.zsw.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.zsw.erp.datasource.dto.BtnStrDto; +import com.zsw.erp.datasource.entities.UserBusiness; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.base.R; +import com.zsw.erp.utils.ErpInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/userBusiness") +@Api(tags = {"用户角色模块的关系"}) +public class UserBusinessController { + private Logger logger = LoggerFactory.getLogger(UserBusinessController.class); + + @Resource + private UserBusinessService userBusinessService; + @Resource + private UserService userService; + + /** + * 获取信息 + * @param keyId + * @param type + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getBasicData") + @ApiOperation(value = "获取信息") + public R getBasicData(@RequestParam(value = "KeyId") Long keyId, + @RequestParam(value = "Type") String type, + HttpServletRequest request)throws Exception { + + UserBusiness list = userBusinessService.getBasicData(keyId, type); + Map mapData = new HashMap(); + mapData.put("userBusinessList", Lists.newArrayList(list)); + return R.success(mapData); + } + + /** + * 校验存在 + * @param type + * @param keyId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsValueExist") + @ApiOperation(value = "校验存在") + public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, + @RequestParam(value ="keyId", required = false) String keyId, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + Long id = userBusinessService.checkIsValueExist(type, keyId); + if(id != null) { + objectMap.put("id", id); + } else { + objectMap.put("id", null); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 更新角色的按钮权限 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/updateBtnStr") + @ApiOperation(value = "更新角色的按钮权限") + public R updateBtnStr(@RequestBody BtnStrDto dto, + HttpServletRequest request)throws Exception { + + String roleId = dto.getRoleId(); +// JSONArray btnStrArray = jsonObject.getJSONArray("btnStr"); +// List btnStr = btnStrArray.toJavaList(BtnDto.class); + String keyId = roleId; + String type = "RoleFunctions"; + int back = userBusinessService.updateBtnStr(keyId, type, dto.getBtnStr()); + if(back > 0) { + return R.success("成功"); + }else { + return R.fail("更新失败"); + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java b/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java new file mode 100644 index 00000000..302f735a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/controller/UserController.java @@ -0,0 +1,483 @@ +package com.zsw.erp.controller; + +import cn.hutool.core.date.*; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.jwt.*; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.BtnDto; +import com.zsw.erp.datasource.dto.UserLoginDto; +import com.zsw.erp.datasource.entities.Tenant; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.entities.UserEx; +import com.zsw.erp.datasource.vo.TreeNodeEx; +import com.zsw.erp.exception.BusinessParamCheckingException; +import com.zsw.erp.service.inventorySeason.InventorySeasonService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.tenant.TenantService; +import com.zsw.erp.service.user.UserService; +import com.zsw.base.R; +import com.zsw.erp.utils.*; +import com.zsw.jwt.model.AuthInfo; +import com.zsw.jwt.model.TenantAuthInfo; +import com.zsw.pos.authority.dto.auth.LoginParamDTO; +import com.zsw.pos.oauth.service.LoginService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.dubbo.config.annotation.DubboReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.*; + +import static com.zsw.erp.utils.ResponseJsonUtil.returnJson; + + +@RestController +@RequestMapping(value = "/user") +@Api(tags = {"用户管理"}) +public class UserController { + private Logger logger = LoggerFactory.getLogger(UserController.class); + + @Value("${manage.roleId}") + private Integer manageRoleId; + + @Value("${demonstrate.open}") + private boolean demonstrateOpen; + + @Resource + private UserService userService; + + @Resource + private TenantService tenantService; + + @Resource + private LogService logService; + + @Resource + private RedisService redisService; + + @Resource + private InventorySeasonService inventorySeasonService; + + @DubboReference + private LoginService loginService; + + @Value("${tenant.userNumLimit}") + private Integer systemLimit; + + private static final String TEST_USER = "jsh"; + private static String SUCCESS = "操作成功"; + private static String ERROR = "操作失败"; + private static final String HTTP = "http://"; + private static final String CODE_OK = "200"; + private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; + + @PostMapping(value = "/login") + @ApiOperation(value = "登录") + public R login(@RequestBody User userParam, + HttpServletRequest request)throws Exception { + logger.info("============用户登录 login 方法调用开始=============="); + String msgTip = ""; + User user=null; + + String loginName = userParam.getLoginName().trim(); + String password = userParam.getPassword().trim(); + + String posTenantCode = null; + JWTPayload payload = new JWTPayload(); + + // 登录zsw-admin + LoginParamDTO dto = new LoginParamDTO(); + dto.setAccount(loginName); + dto.setPassword(password); + R result = loginService.grant(dto); + logger.error("result:{}",result); + if (result.getIsSuccess()){ + // 检查系统里是否存在租户和账户 没有准备走注册流程 + posTenantCode = result.getData().getTenantCode(); + // 在这里带了太多的门店ID + payload.setPayload("loginName",loginName); + payload.setPayload("tenantId",posTenantCode); + } + + //获取用户状态 + //int userStatus = -1; + redisService.deleteObjectBySession(request,"userId"); + UserLoginDto loginDto = userService.validateUser(loginName, password); + + switch (loginDto.getUserStatus()) { + case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST: + msgTip = "user is not exist"; + if (posTenantCode != null){ + // 用户不存在 但是用户不存在 可能报错。 + UserEx ex = new UserEx(); + ex.setLoginName(loginName); + ex.setPassword(password); + ex.setTenantId(Long.parseLong(posTenantCode)); + LocalDateTime time = LocalDateTimeUtil.offset(LocalDateTime.now(), 10, ChronoUnit.YEARS); + DateTimeFormatter formater = DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN); + String t = time.format(formater); + ex.setExpireTime(t); + user = this.registerUser(ex,request); + payload.setPayload("userId",user.getId()); + payload.setPayload("loginName",loginName); + payload.setPayload("tenantId",posTenantCode); + msgTip = "user can login"; + } + break; + case ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR: + msgTip = "user password error"; + break; + case ExceptionCodeConstants.UserExceptionCode.BLACK_USER: + msgTip = "user is black"; + break; + case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION: + msgTip = "access service error"; + break; + case ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT: + msgTip = "tenant is black"; + break; + case ExceptionCodeConstants.UserExceptionCode.EXPIRE_TENANT: + msgTip = "tenant is expire"; + break; + case ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT: + msgTip = "user can login"; + user = loginDto.getUser(); + payload.setPayload("userId",user.getId()); + payload.setPayload("loginName",loginName); + payload.setPayload("tenantId",user.getTenantId()); + break; + default: + break; + } + + // 1个月过期 + DateTime exAt = DateUtil.offset(new Date(), DateField.MONTH, 1); + payload.setExpiresAt(exAt); + String token = JWTUtil.createToken(payload.getClaimsJson(), "88888888".getBytes(StandardCharsets.UTF_8)); + + Map data = new HashMap(); + data.put("msgTip", msgTip); + if(user!=null){ + redisService.storageObjectBySession(token,"userId",user.getId()); + String roleType = userService.getRoleTypeByUserId(user.getId()); //角色类型 + if (roleType == null){ + logger.error("角色错误!"); + } + redisService.storageObjectBySession(token,"roleType",roleType); + redisService.storageObjectBySession(token,"clientIp", Tools.getLocalIp(request)); + logService.insertLogWithUserId(user.getId(), user.getTenantId(), "用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getLoginName()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List btnStrArr = userService.getBtnStrArrById(user.getId()); + data.put("token", token); + data.put("user", user); + LocalUser.setTenantId(user.getTenantId()); + LocalUser.setUserId(user.getId()); + data.put("season",inventorySeasonService.getNow()); + //用户的按钮权限 + if(!"admin".equals(user.getLoginName())){ + data.put("userBtn", btnStrArr); + } + data.put("roleType", roleType); + logger.info("===============用户登录 login 方法调用结束==============="); + return R.success(data); + }else{ + return R.fail("用户名或者密码错误"); + } + + + } + + @GetMapping(value = "/getUserSession") + @ApiOperation(value = "获取用户信息") + public R getSessionUser(HttpServletRequest request)throws Exception { + Map data = new HashMap<>(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + user.setPassword(null); + data.put("user", user); + return R.success(data); + } + + @GetMapping(value = "/logout") + @ApiOperation(value = "退出") + public R logout(HttpServletRequest request, HttpServletResponse response)throws Exception { + redisService.deleteObjectBySession(request,"userId"); + return R.success(); + } + + @PostMapping(value = "/resetPwd") + @ApiOperation(value = "重置密码") + public String resetPwd(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception { + Map objectMap = new HashMap<>(); + Long id = jsonObject.getLong("id"); + String password = "123456"; + String md5Pwd = Tools.md5Encryp(password); + int update = userService.resetPwd(md5Pwd, id); + if(update > 0) { + return returnJson(objectMap, SUCCESS, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } + + @PutMapping(value = "/updatePwd") + @ApiOperation(value = "更新密码") + public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { + Integer flag = 0; + Map objectMap = new HashMap(); + try { + String info = ""; + Long userId = jsonObject.getLong("userId"); + String oldpwd = jsonObject.getString("oldpassword"); + String password = jsonObject.getString("password"); + User user = userService.getUser(userId); + //必须和原始密码一致才可以更新密码 + if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){ + flag = 3; //jsh用户不能修改密码 + info = "jsh用户不能修改密码"; + } else if (oldpwd.equalsIgnoreCase(user.getPassword())) { + user.setPassword(password); + flag = userService.updateUserByObj(user); //1-成功 + info = "修改成功"; + } else { + flag = 2; //原始密码输入错误 + info = "原始密码输入错误"; + } + objectMap.put("status", flag); + if(flag > 0) { + return returnJson(objectMap, info, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } catch (Exception e) { + logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e); + flag = 3; + objectMap.put("status", flag); + return returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } + + /** + * 获取全部用户数据列表 + * @param request + * @return + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "获取全部用户数据列表") + public R getAllList(HttpServletRequest request)throws Exception { + + Map data = new HashMap(); + List dataList = userService.getUser(); + if(dataList!=null) { + data.put("userList", dataList); + } + return R.success(data); + } + + /** + * 用户列表,用于用户下拉框 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getUserList") + @ApiOperation(value = "用户列表") + public JSONArray getUserList(HttpServletRequest request)throws Exception { + JSONArray dataArray = new JSONArray(); + try { + List dataList = userService.getUser(); + if (null != dataList) { + for (User user : dataList) { + JSONObject item = new JSONObject(); + item.put("id", user.getId()); + item.put("userName", user.getUsername()); + dataArray.add(item); + } + } + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } + + /** + * create by: cjl + * description: + * 新增用户及机构和用户关系 + * create time: 2019/3/8 16:06 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping("/addUser") + @ApiOperation(value = "新增用户") + @ResponseBody + public Object addUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + // 系统的人数限制 + Object limit = redisService.getObjectFromSessionByKey(request, "userNumLimit"); + Long userNumLimit = ObjectUtil.isNotEmpty(limit) + ? Long.parseLong(limit.toString()) + : systemLimit; + Long count = userService.countUser(null,null); + if(count>= userNumLimit) { + throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE, + ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG); + } else { + UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); + userService.addUserAndOrgUserRel(ue, request); + } + return result; + } + + /** + * create by: cjl + * description: + * 修改用户及机构和用户关系 + * create time: 2019/3/8 16:06 + * @Param: beanJson + * @return java.lang.Object + */ + @PutMapping("/updateUser") + @ApiOperation(value = "修改用户") + @ResponseBody + public Object updateUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); + userService.updateUserAndOrgUserRel(ue, request); + return result; + } + + /** + * 注册用户 + * @param ue + * @return + * @throws Exception + */ + @PostMapping(value = "/registerUser") + @ApiOperation(value = "注册用户") + public UserEx registerUser(@RequestBody UserEx ue, + HttpServletRequest request)throws Exception{ + logger.error("用户注册开始..."); + JSONObject result = ExceptionConstants.standardSuccess(); + ue.setUsername(ue.getLoginName()); + userService.checkUserNameAndLoginName(ue); //检查用户名和登录名 + ue = userService.registerUser(ue,manageRoleId,request); + return ue; + } + + /** + * 获取机构用户树 + * @return + * @throws Exception + */ + @RequestMapping("/getOrganizationUserTree") + @ApiOperation(value = "获取机构用户树") + public JSONArray getOrganizationUserTree()throws Exception{ + JSONArray arr=new JSONArray(); + List organizationUserTree= userService.getOrganizationUserTree(); + if(organizationUserTree!=null&&organizationUserTree.size()>0){ + for(TreeNodeEx node:organizationUserTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + + /** + * 获取当前用户的角色类型 + * @param request + * @return + */ + @GetMapping("/getRoleTypeByCurrentUser") + @ApiOperation(value = "获取当前用户的角色类型") + public R getRoleTypeByCurrentUser(HttpServletRequest request) { + + Map data = new HashMap(); + String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString(); + data.put("roleType", roleType); + return R.success(data); + } + + /** + * 获取随机校验码 + * @param response + * @param key + * @return + */ + @GetMapping(value = "/randomImage/{key}") + @ApiOperation(value = "获取随机校验码") + public R randomImage(HttpServletResponse response,@PathVariable String key) throws IOException { + + Map data = new HashMap<>(); + String codeNum = Tools.getCharAndNum(4); + String base64 = RandImageUtil.generate(codeNum); + data.put("codeNum", codeNum); + data.put("base64", base64); + return R.success(data); + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Byte status = jsonObject.getByte("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = userService.batchSetStatus(status, ids); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 获取当前用户的用户数量和租户信息 + * @param request + * @return + */ + @GetMapping(value = "/infoWithTenant") + @ApiOperation(value = "获取当前用户的用户数量和租户信息") + public R randomImage(HttpServletRequest request){ + + Map data = new HashMap<>(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + //获取当前用户数 + Long userCurrentNum = userService.countUser(null, null); + Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId()); + data.put("type", tenant.getType()); //租户类型,0免费租户,1付费租户 + data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime())); + data.put("userCurrentNum", userCurrentNum); + data.put("userNumLimit", tenant.getUserNumLimit()); + return R.success(data); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BomDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BomDto.java new file mode 100644 index 00000000..5b6fb5ae --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BomDto.java @@ -0,0 +1,8 @@ +package com.zsw.erp.datasource.dto; + +import com.zsw.erp.datasource.entities.Bom; +import lombok.Data; + +@Data +public class BomDto extends Bom { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BtnStrDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BtnStrDto.java new file mode 100644 index 00000000..d39852e2 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/BtnStrDto.java @@ -0,0 +1,14 @@ +package com.zsw.erp.datasource.dto; + +import com.zsw.erp.datasource.entities.BtnDto; +import lombok.Data; + +import java.util.List; + +@Data +public class BtnStrDto { + + private String roleId; + + private List btnStr; +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/DepotItemDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/DepotItemDto.java new file mode 100644 index 00000000..f57317fe --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/DepotItemDto.java @@ -0,0 +1,41 @@ +package com.zsw.erp.datasource.dto; + +import cn.hutool.core.date.DatePattern; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotItemDto { + BigDecimal allPrice; + String barCode; + String batchNumber; + String color; + Long depotId; + @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN) + Date expirationDate; + BigDecimal finishNumber; + String id; + String materialOther; + String model; + String name; + BigDecimal operNumber; + BigDecimal orderNum; + BigDecimal preNumber; + String remark; + String sku; + String snList; + String standard; + Integer stock; + BigDecimal taxLastMoney; + BigDecimal taxMoney; + BigDecimal taxRate; + String unit; + BigDecimal unitPrice; + BigDecimal taxUnitPrice; + Long anotherDepotId; + String mType; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/StockInitDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/StockInitDto.java new file mode 100644 index 00000000..7d1539f4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/StockInitDto.java @@ -0,0 +1,26 @@ +package com.zsw.erp.datasource.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class StockInitDto { + + private Long id; + + private Long materialId; + + private Long depotId; + + @ApiModelProperty("加权总金额") + private BigDecimal totalPrice = BigDecimal.ZERO; + + private BigDecimal number = BigDecimal.ZERO; + + private BigDecimal lowSafeStock = BigDecimal.ZERO; + + private BigDecimal highSafeStock = BigDecimal.ZERO; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java new file mode 100644 index 00000000..da4e775d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/dto/UserLoginDto.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.dto; + +import com.zsw.erp.datasource.entities.User; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +public class UserLoginDto { + + private Integer userStatus; + + private User user; + + public static UserLoginDto buildStatus(Integer status){ + return UserLoginDto.builder().userStatus(status).build(); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Account.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Account.java new file mode 100644 index 00000000..0c631d9d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Account.java @@ -0,0 +1,98 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Account { + @TableId(type = IdType.AUTO) + private Long id; + + private String name; + + private String serialNo; + + private BigDecimal initialAmount; + + private BigDecimal currentAmount; + + private String remark; + + private Boolean isDefault; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo == null ? null : serialNo.trim(); + } + + public BigDecimal getInitialAmount() { + return initialAmount; + } + + public void setInitialAmount(BigDecimal initialAmount) { + this.initialAmount = initialAmount; + } + + public BigDecimal getCurrentAmount() { + return currentAmount; + } + + public void setCurrentAmount(BigDecimal currentAmount) { + this.currentAmount = currentAmount; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountExample.java new file mode 100644 index 00000000..4555dbd7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountExample.java @@ -0,0 +1,780 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class AccountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNull() { + addCriterion("serial_no is null"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNotNull() { + addCriterion("serial_no is not null"); + return (Criteria) this; + } + + public Criteria andSerialNoEqualTo(String value) { + addCriterion("serial_no =", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotEqualTo(String value) { + addCriterion("serial_no <>", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThan(String value) { + addCriterion("serial_no >", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThanOrEqualTo(String value) { + addCriterion("serial_no >=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThan(String value) { + addCriterion("serial_no <", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThanOrEqualTo(String value) { + addCriterion("serial_no <=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLike(String value) { + addCriterion("serial_no like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotLike(String value) { + addCriterion("serial_no not like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoIn(List values) { + addCriterion("serial_no in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotIn(List values) { + addCriterion("serial_no not in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoBetween(String value1, String value2) { + addCriterion("serial_no between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotBetween(String value1, String value2) { + addCriterion("serial_no not between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andInitialAmountIsNull() { + addCriterion("initial_amount is null"); + return (Criteria) this; + } + + public Criteria andInitialAmountIsNotNull() { + addCriterion("initial_amount is not null"); + return (Criteria) this; + } + + public Criteria andInitialAmountEqualTo(BigDecimal value) { + addCriterion("initial_amount =", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotEqualTo(BigDecimal value) { + addCriterion("initial_amount <>", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountGreaterThan(BigDecimal value) { + addCriterion("initial_amount >", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("initial_amount >=", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountLessThan(BigDecimal value) { + addCriterion("initial_amount <", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("initial_amount <=", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountIn(List values) { + addCriterion("initial_amount in", values, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotIn(List values) { + addCriterion("initial_amount not in", values, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("initial_amount between", value1, value2, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("initial_amount not between", value1, value2, "initialAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIsNull() { + addCriterion("current_amount is null"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIsNotNull() { + addCriterion("current_amount is not null"); + return (Criteria) this; + } + + public Criteria andCurrentAmountEqualTo(BigDecimal value) { + addCriterion("current_amount =", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotEqualTo(BigDecimal value) { + addCriterion("current_amount <>", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountGreaterThan(BigDecimal value) { + addCriterion("current_amount >", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("current_amount >=", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountLessThan(BigDecimal value) { + addCriterion("current_amount <", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("current_amount <=", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIn(List values) { + addCriterion("current_amount in", values, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotIn(List values) { + addCriterion("current_amount not in", values, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_amount between", value1, value2, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_amount not between", value1, value2, "currentAmount"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNull() { + addCriterion("is_default is null"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNotNull() { + addCriterion("is_default is not null"); + return (Criteria) this; + } + + public Criteria andIsDefaultEqualTo(Boolean value) { + addCriterion("is_default =", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotEqualTo(Boolean value) { + addCriterion("is_default <>", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThan(Boolean value) { + addCriterion("is_default >", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_default >=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThan(Boolean value) { + addCriterion("is_default <", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThanOrEqualTo(Boolean value) { + addCriterion("is_default <=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultIn(List values) { + addCriterion("is_default in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotIn(List values) { + addCriterion("is_default not in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultBetween(Boolean value1, Boolean value2) { + addCriterion("is_default between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_default not between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHead.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHead.java new file mode 100644 index 00000000..a6e4d599 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHead.java @@ -0,0 +1,169 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class AccountHead { + @TableId(type = IdType.AUTO) + private Long id; + + private String type; + + private Long organId; + + private Long handsPersonId; + + private Long creator; + + private BigDecimal changeAmount; + + private BigDecimal discountMoney; + + private BigDecimal totalPrice; + + private Long accountId; + + private String billNo; + + private Date billTime; + + private String remark; + + private String fileName; + + private String status; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Long getOrganId() { + return organId; + } + + public void setOrganId(Long organId) { + this.organId = organId; + } + + public Long getHandsPersonId() { + return handsPersonId; + } + + public void setHandsPersonId(Long handsPersonId) { + this.handsPersonId = handsPersonId; + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(BigDecimal discountMoney) { + this.discountMoney = discountMoney; + } + + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public String getBillNo() { + return billNo; + } + + public void setBillNo(String billNo) { + this.billNo = billNo == null ? null : billNo.trim(); + } + + public Date getBillTime() { + return billTime; + } + + public void setBillTime(Date billTime) { + this.billTime = billTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadExample.java new file mode 100644 index 00000000..29a37d66 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadExample.java @@ -0,0 +1,1221 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class AccountHeadExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountHeadExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNull() { + addCriterion("organ_id is null"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNotNull() { + addCriterion("organ_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganIdEqualTo(Long value) { + addCriterion("organ_id =", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotEqualTo(Long value) { + addCriterion("organ_id <>", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThan(Long value) { + addCriterion("organ_id >", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThanOrEqualTo(Long value) { + addCriterion("organ_id >=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThan(Long value) { + addCriterion("organ_id <", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThanOrEqualTo(Long value) { + addCriterion("organ_id <=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdIn(List values) { + addCriterion("organ_id in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotIn(List values) { + addCriterion("organ_id not in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdBetween(Long value1, Long value2) { + addCriterion("organ_id between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotBetween(Long value1, Long value2) { + addCriterion("organ_id not between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIsNull() { + addCriterion("hands_person_id is null"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIsNotNull() { + addCriterion("hands_person_id is not null"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdEqualTo(Long value) { + addCriterion("hands_person_id =", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotEqualTo(Long value) { + addCriterion("hands_person_id <>", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdGreaterThan(Long value) { + addCriterion("hands_person_id >", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdGreaterThanOrEqualTo(Long value) { + addCriterion("hands_person_id >=", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdLessThan(Long value) { + addCriterion("hands_person_id <", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdLessThanOrEqualTo(Long value) { + addCriterion("hands_person_id <=", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIn(List values) { + addCriterion("hands_person_id in", values, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotIn(List values) { + addCriterion("hands_person_id not in", values, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdBetween(Long value1, Long value2) { + addCriterion("hands_person_id between", value1, value2, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotBetween(Long value1, Long value2) { + addCriterion("hands_person_id not between", value1, value2, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNull() { + addCriterion("change_amount is null"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNotNull() { + addCriterion("change_amount is not null"); + return (Criteria) this; + } + + public Criteria andChangeAmountEqualTo(BigDecimal value) { + addCriterion("change_amount =", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotEqualTo(BigDecimal value) { + addCriterion("change_amount <>", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThan(BigDecimal value) { + addCriterion("change_amount >", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount >=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThan(BigDecimal value) { + addCriterion("change_amount <", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount <=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountIn(List values) { + addCriterion("change_amount in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotIn(List values) { + addCriterion("change_amount not in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount not between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNull() { + addCriterion("discount_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNotNull() { + addCriterion("discount_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyEqualTo(BigDecimal value) { + addCriterion("discount_money =", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_money <>", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_money >", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money >=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThan(BigDecimal value) { + addCriterion("discount_money <", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money <=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIn(List values) { + addCriterion("discount_money in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotIn(List values) { + addCriterion("discount_money not in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money not between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNull() { + addCriterion("total_price is null"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNotNull() { + addCriterion("total_price is not null"); + return (Criteria) this; + } + + public Criteria andTotalPriceEqualTo(BigDecimal value) { + addCriterion("total_price =", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotEqualTo(BigDecimal value) { + addCriterion("total_price <>", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThan(BigDecimal value) { + addCriterion("total_price >", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_price >=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThan(BigDecimal value) { + addCriterion("total_price <", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_price <=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceIn(List values) { + addCriterion("total_price in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotIn(List values) { + addCriterion("total_price not in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price not between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andBillNoIsNull() { + addCriterion("bill_no is null"); + return (Criteria) this; + } + + public Criteria andBillNoIsNotNull() { + addCriterion("bill_no is not null"); + return (Criteria) this; + } + + public Criteria andBillNoEqualTo(String value) { + addCriterion("bill_no =", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotEqualTo(String value) { + addCriterion("bill_no <>", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoGreaterThan(String value) { + addCriterion("bill_no >", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoGreaterThanOrEqualTo(String value) { + addCriterion("bill_no >=", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLessThan(String value) { + addCriterion("bill_no <", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLessThanOrEqualTo(String value) { + addCriterion("bill_no <=", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLike(String value) { + addCriterion("bill_no like", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotLike(String value) { + addCriterion("bill_no not like", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoIn(List values) { + addCriterion("bill_no in", values, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotIn(List values) { + addCriterion("bill_no not in", values, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoBetween(String value1, String value2) { + addCriterion("bill_no between", value1, value2, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotBetween(String value1, String value2) { + addCriterion("bill_no not between", value1, value2, "billNo"); + return (Criteria) this; + } + + public Criteria andBillTimeIsNull() { + addCriterion("bill_time is null"); + return (Criteria) this; + } + + public Criteria andBillTimeIsNotNull() { + addCriterion("bill_time is not null"); + return (Criteria) this; + } + + public Criteria andBillTimeEqualTo(Date value) { + addCriterion("bill_time =", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotEqualTo(Date value) { + addCriterion("bill_time <>", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeGreaterThan(Date value) { + addCriterion("bill_time >", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeGreaterThanOrEqualTo(Date value) { + addCriterion("bill_time >=", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeLessThan(Date value) { + addCriterion("bill_time <", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeLessThanOrEqualTo(Date value) { + addCriterion("bill_time <=", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeIn(List values) { + addCriterion("bill_time in", values, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotIn(List values) { + addCriterion("bill_time not in", values, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeBetween(Date value1, Date value2) { + addCriterion("bill_time between", value1, value2, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotBetween(Date value1, Date value2) { + addCriterion("bill_time not between", value1, value2, "billTime"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4Body.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4Body.java new file mode 100644 index 00000000..fcac1c24 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4Body.java @@ -0,0 +1,34 @@ +package com.zsw.erp.datasource.entities; + +public class AccountHeadVo4Body { + + private Long id; + + private String info; + + private String rows; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getRows() { + return rows; + } + + public void setRows(String rows) { + this.rows = rows; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4ListEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4ListEx.java new file mode 100644 index 00000000..a61df44d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountHeadVo4ListEx.java @@ -0,0 +1,19 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; + + +@Data +public class AccountHeadVo4ListEx extends AccountHead{ + + private String organName; + + private String handsPersonName; + + private String userName; + + private String accountName; + + private String billTimeStr; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItem.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItem.java new file mode 100644 index 00000000..7a36b43b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItem.java @@ -0,0 +1,118 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class AccountItem { + @TableId(type = IdType.AUTO) + private Long id; + + private Long headerId; + + private Long accountId; + + private Long inOutItemId; + + private Long billId; + + private BigDecimal needDebt; + + private BigDecimal finishDebt; + + private BigDecimal eachAmount; + + private String remark; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getHeaderId() { + return headerId; + } + + public void setHeaderId(Long headerId) { + this.headerId = headerId; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public Long getInOutItemId() { + return inOutItemId; + } + + public void setInOutItemId(Long inOutItemId) { + this.inOutItemId = inOutItemId; + } + + public Long getBillId() { + return billId; + } + + public void setBillId(Long billId) { + this.billId = billId; + } + + public BigDecimal getNeedDebt() { + return needDebt; + } + + public void setNeedDebt(BigDecimal needDebt) { + this.needDebt = needDebt; + } + + public BigDecimal getFinishDebt() { + return finishDebt; + } + + public void setFinishDebt(BigDecimal finishDebt) { + this.finishDebt = finishDebt; + } + + public BigDecimal getEachAmount() { + return eachAmount; + } + + public void setEachAmount(BigDecimal eachAmount) { + this.eachAmount = eachAmount; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItemExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItemExample.java new file mode 100644 index 00000000..bdfc114e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/AccountItemExample.java @@ -0,0 +1,880 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class AccountItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNull() { + addCriterion("header_id is null"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNotNull() { + addCriterion("header_id is not null"); + return (Criteria) this; + } + + public Criteria andHeaderIdEqualTo(Long value) { + addCriterion("header_id =", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotEqualTo(Long value) { + addCriterion("header_id <>", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThan(Long value) { + addCriterion("header_id >", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThanOrEqualTo(Long value) { + addCriterion("header_id >=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThan(Long value) { + addCriterion("header_id <", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThanOrEqualTo(Long value) { + addCriterion("header_id <=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdIn(List values) { + addCriterion("header_id in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotIn(List values) { + addCriterion("header_id not in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdBetween(Long value1, Long value2) { + addCriterion("header_id between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotBetween(Long value1, Long value2) { + addCriterion("header_id not between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIsNull() { + addCriterion("in_out_item_id is null"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIsNotNull() { + addCriterion("in_out_item_id is not null"); + return (Criteria) this; + } + + public Criteria andInOutItemIdEqualTo(Long value) { + addCriterion("in_out_item_id =", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotEqualTo(Long value) { + addCriterion("in_out_item_id <>", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdGreaterThan(Long value) { + addCriterion("in_out_item_id >", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdGreaterThanOrEqualTo(Long value) { + addCriterion("in_out_item_id >=", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdLessThan(Long value) { + addCriterion("in_out_item_id <", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdLessThanOrEqualTo(Long value) { + addCriterion("in_out_item_id <=", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIn(List values) { + addCriterion("in_out_item_id in", values, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotIn(List values) { + addCriterion("in_out_item_id not in", values, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdBetween(Long value1, Long value2) { + addCriterion("in_out_item_id between", value1, value2, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotBetween(Long value1, Long value2) { + addCriterion("in_out_item_id not between", value1, value2, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andBillIdIsNull() { + addCriterion("bill_id is null"); + return (Criteria) this; + } + + public Criteria andBillIdIsNotNull() { + addCriterion("bill_id is not null"); + return (Criteria) this; + } + + public Criteria andBillIdEqualTo(Long value) { + addCriterion("bill_id =", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotEqualTo(Long value) { + addCriterion("bill_id <>", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThan(Long value) { + addCriterion("bill_id >", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThanOrEqualTo(Long value) { + addCriterion("bill_id >=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThan(Long value) { + addCriterion("bill_id <", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThanOrEqualTo(Long value) { + addCriterion("bill_id <=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdIn(List values) { + addCriterion("bill_id in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotIn(List values) { + addCriterion("bill_id not in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdBetween(Long value1, Long value2) { + addCriterion("bill_id between", value1, value2, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotBetween(Long value1, Long value2) { + addCriterion("bill_id not between", value1, value2, "billId"); + return (Criteria) this; + } + + public Criteria andNeedDebtIsNull() { + addCriterion("need_debt is null"); + return (Criteria) this; + } + + public Criteria andNeedDebtIsNotNull() { + addCriterion("need_debt is not null"); + return (Criteria) this; + } + + public Criteria andNeedDebtEqualTo(BigDecimal value) { + addCriterion("need_debt =", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotEqualTo(BigDecimal value) { + addCriterion("need_debt <>", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtGreaterThan(BigDecimal value) { + addCriterion("need_debt >", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("need_debt >=", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtLessThan(BigDecimal value) { + addCriterion("need_debt <", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtLessThanOrEqualTo(BigDecimal value) { + addCriterion("need_debt <=", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtIn(List values) { + addCriterion("need_debt in", values, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotIn(List values) { + addCriterion("need_debt not in", values, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("need_debt between", value1, value2, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("need_debt not between", value1, value2, "needDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtIsNull() { + addCriterion("finish_debt is null"); + return (Criteria) this; + } + + public Criteria andFinishDebtIsNotNull() { + addCriterion("finish_debt is not null"); + return (Criteria) this; + } + + public Criteria andFinishDebtEqualTo(BigDecimal value) { + addCriterion("finish_debt =", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotEqualTo(BigDecimal value) { + addCriterion("finish_debt <>", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtGreaterThan(BigDecimal value) { + addCriterion("finish_debt >", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("finish_debt >=", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtLessThan(BigDecimal value) { + addCriterion("finish_debt <", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtLessThanOrEqualTo(BigDecimal value) { + addCriterion("finish_debt <=", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtIn(List values) { + addCriterion("finish_debt in", values, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotIn(List values) { + addCriterion("finish_debt not in", values, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("finish_debt between", value1, value2, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("finish_debt not between", value1, value2, "finishDebt"); + return (Criteria) this; + } + + public Criteria andEachAmountIsNull() { + addCriterion("each_amount is null"); + return (Criteria) this; + } + + public Criteria andEachAmountIsNotNull() { + addCriterion("each_amount is not null"); + return (Criteria) this; + } + + public Criteria andEachAmountEqualTo(BigDecimal value) { + addCriterion("each_amount =", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotEqualTo(BigDecimal value) { + addCriterion("each_amount <>", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountGreaterThan(BigDecimal value) { + addCriterion("each_amount >", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("each_amount >=", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountLessThan(BigDecimal value) { + addCriterion("each_amount <", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("each_amount <=", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountIn(List values) { + addCriterion("each_amount in", values, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotIn(List values) { + addCriterion("each_amount not in", values, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("each_amount between", value1, value2, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("each_amount not between", value1, value2, "eachAmount"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Bom.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Bom.java new file mode 100644 index 00000000..643a872a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Bom.java @@ -0,0 +1,27 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@TableName("bom") +public class Bom { + + private Long id ; + + private Long skuId; + + private String name; + + private Boolean status; + + private List bomInfos; + + @ApiModelProperty("BOM总价 依据info计算后存储") + private BigDecimal price; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BomInfo.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BomInfo.java new file mode 100644 index 00000000..f1b54946 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BomInfo.java @@ -0,0 +1,22 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class BomInfo { + + private Long materialId; + + private String material; + + private Long unitId; + + private String unit; + + private BigDecimal dosage; + + private BigDecimal price; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BtnDto.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BtnDto.java new file mode 100644 index 00000000..495a50a5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/BtnDto.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BtnDto implements Serializable { + + private Long funId; + + private String btnStr; + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Depot.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Depot.java new file mode 100644 index 00000000..b6c75eee --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Depot.java @@ -0,0 +1,393 @@ +package com.zsw.erp.datasource.entities; + +import java.io.Serializable; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Depot implements Serializable { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.id + * + * @mbggenerated + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.name + * + * @mbggenerated + */ + private String name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.address + * + * @mbggenerated + */ + private String address; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.warehousing + * + * @mbggenerated + */ + private BigDecimal warehousing; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.truckage + * + * @mbggenerated + */ + private BigDecimal truckage; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.type + * + * @mbggenerated + */ + private Integer type; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.sort + * + * @mbggenerated + */ + private String sort; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.remark + * + * @mbggenerated + */ + private String remark; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.principal + * + * @mbggenerated + */ + private Long principal; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.tenant_id + * + * @mbggenerated + */ + private Long tenantId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.delete_Flag + * + * @mbggenerated + */ + private String deleteFlag; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_depot.is_default + * + * @mbggenerated + */ + private Boolean isDefault; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.id + * + * @return the value of jsh_depot.id + * + * @mbggenerated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.id + * + * @param id the value for jsh_depot.id + * + * @mbggenerated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.name + * + * @return the value of jsh_depot.name + * + * @mbggenerated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.name + * + * @param name the value for jsh_depot.name + * + * @mbggenerated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.address + * + * @return the value of jsh_depot.address + * + * @mbggenerated + */ + public String getAddress() { + return address; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.address + * + * @param address the value for jsh_depot.address + * + * @mbggenerated + */ + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.warehousing + * + * @return the value of jsh_depot.warehousing + * + * @mbggenerated + */ + public BigDecimal getWarehousing() { + return warehousing; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.warehousing + * + * @param warehousing the value for jsh_depot.warehousing + * + * @mbggenerated + */ + public void setWarehousing(BigDecimal warehousing) { + this.warehousing = warehousing; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.truckage + * + * @return the value of jsh_depot.truckage + * + * @mbggenerated + */ + public BigDecimal getTruckage() { + return truckage; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.truckage + * + * @param truckage the value for jsh_depot.truckage + * + * @mbggenerated + */ + public void setTruckage(BigDecimal truckage) { + this.truckage = truckage; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.type + * + * @return the value of jsh_depot.type + * + * @mbggenerated + */ + public Integer getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.type + * + * @param type the value for jsh_depot.type + * + * @mbggenerated + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.sort + * + * @return the value of jsh_depot.sort + * + * @mbggenerated + */ + public String getSort() { + return sort; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.sort + * + * @param sort the value for jsh_depot.sort + * + * @mbggenerated + */ + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.remark + * + * @return the value of jsh_depot.remark + * + * @mbggenerated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.remark + * + * @param remark the value for jsh_depot.remark + * + * @mbggenerated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.principal + * + * @return the value of jsh_depot.principal + * + * @mbggenerated + */ + public Long getPrincipal() { + return principal; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.principal + * + * @param principal the value for jsh_depot.principal + * + * @mbggenerated + */ + public void setPrincipal(Long principal) { + this.principal = principal; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.tenant_id + * + * @return the value of jsh_depot.tenant_id + * + * @mbggenerated + */ + public Long getTenantId() { + return tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.tenant_id + * + * @param tenantId the value for jsh_depot.tenant_id + * + * @mbggenerated + */ + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.delete_Flag + * + * @return the value of jsh_depot.delete_Flag + * + * @mbggenerated + */ + public String getDeleteFlag() { + return deleteFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.delete_Flag + * + * @param deleteFlag the value for jsh_depot.delete_Flag + * + * @mbggenerated + */ + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_depot.is_default + * + * @return the value of jsh_depot.is_default + * + * @mbggenerated + */ + public Boolean getIsDefault() { + return isDefault; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_depot.is_default + * + * @param isDefault the value for jsh_depot.is_default + * + * @mbggenerated + */ + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotEx.java new file mode 100644 index 00000000..81dd0ded --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotEx.java @@ -0,0 +1,26 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/2/25 11:40 + */ +@Data +public class DepotEx extends Depot{ + //负责人名字 + private String principalName; + + private BigDecimal initStock; + + private BigDecimal currentStock; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotExample.java new file mode 100644 index 00000000..953f301c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotExample.java @@ -0,0 +1,1073 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class DepotExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_depot + * + * @mbggenerated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_depot + * + * @mbggenerated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_depot + * + * @mbggenerated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public DepotExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_depot + * + * @mbggenerated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andWarehousingIsNull() { + addCriterion("warehousing is null"); + return (Criteria) this; + } + + public Criteria andWarehousingIsNotNull() { + addCriterion("warehousing is not null"); + return (Criteria) this; + } + + public Criteria andWarehousingEqualTo(BigDecimal value) { + addCriterion("warehousing =", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotEqualTo(BigDecimal value) { + addCriterion("warehousing <>", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingGreaterThan(BigDecimal value) { + addCriterion("warehousing >", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("warehousing >=", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingLessThan(BigDecimal value) { + addCriterion("warehousing <", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingLessThanOrEqualTo(BigDecimal value) { + addCriterion("warehousing <=", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingIn(List values) { + addCriterion("warehousing in", values, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotIn(List values) { + addCriterion("warehousing not in", values, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("warehousing between", value1, value2, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("warehousing not between", value1, value2, "warehousing"); + return (Criteria) this; + } + + public Criteria andTruckageIsNull() { + addCriterion("truckage is null"); + return (Criteria) this; + } + + public Criteria andTruckageIsNotNull() { + addCriterion("truckage is not null"); + return (Criteria) this; + } + + public Criteria andTruckageEqualTo(BigDecimal value) { + addCriterion("truckage =", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotEqualTo(BigDecimal value) { + addCriterion("truckage <>", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageGreaterThan(BigDecimal value) { + addCriterion("truckage >", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("truckage >=", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageLessThan(BigDecimal value) { + addCriterion("truckage <", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageLessThanOrEqualTo(BigDecimal value) { + addCriterion("truckage <=", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageIn(List values) { + addCriterion("truckage in", values, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotIn(List values) { + addCriterion("truckage not in", values, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("truckage between", value1, value2, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("truckage not between", value1, value2, "truckage"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNull() { + addCriterion("principal is null"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNotNull() { + addCriterion("principal is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalEqualTo(Long value) { + addCriterion("principal =", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotEqualTo(Long value) { + addCriterion("principal <>", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThan(Long value) { + addCriterion("principal >", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThanOrEqualTo(Long value) { + addCriterion("principal >=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThan(Long value) { + addCriterion("principal <", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThanOrEqualTo(Long value) { + addCriterion("principal <=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalIn(List values) { + addCriterion("principal in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotIn(List values) { + addCriterion("principal not in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalBetween(Long value1, Long value2) { + addCriterion("principal between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotBetween(Long value1, Long value2) { + addCriterion("principal not between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNull() { + addCriterion("is_default is null"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNotNull() { + addCriterion("is_default is not null"); + return (Criteria) this; + } + + public Criteria andIsDefaultEqualTo(Boolean value) { + addCriterion("is_default =", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotEqualTo(Boolean value) { + addCriterion("is_default <>", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThan(Boolean value) { + addCriterion("is_default >", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_default >=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThan(Boolean value) { + addCriterion("is_default <", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThanOrEqualTo(Boolean value) { + addCriterion("is_default <=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultIn(List values) { + addCriterion("is_default in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotIn(List values) { + addCriterion("is_default not in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultBetween(Boolean value1, Boolean value2) { + addCriterion("is_default between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_default not between", value1, value2, "isDefault"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_depot + * + * @mbggenerated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_depot + * + * @mbggenerated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHead.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHead.java new file mode 100644 index 00000000..a67a6ae4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHead.java @@ -0,0 +1,73 @@ +package com.zsw.erp.datasource.entities; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class DepotHead { + @TableId(type = IdType.AUTO) + private Long id; + + private String type; + + private String subType; + + private String defaultNumber; + + private String number; + + private Date createTime; + + private Date operTime; + + private Long organId; + + private Long creator; + + private Long accountId; + + private BigDecimal changeAmount; + + private BigDecimal backAmount; + + private BigDecimal totalPrice; + + private String payType; + + private String billType; + + private String remark; + + private String fileName; + + private String salesMan; + + private String accountIdList; + + private String accountMoneyList; + + private BigDecimal discount; + + private BigDecimal discountMoney; + + private BigDecimal discountLastMoney; + + private BigDecimal otherMoney; + + private String status; + + private String linkNumber; + + private Long tenantId; + + private String deleteFlag; + + @ApiModelProperty("订单目标类型 false=内部订单,true=外部订单") + private Boolean targetType = false; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadExample.java new file mode 100644 index 00000000..1921d0fb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadExample.java @@ -0,0 +1,2021 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class DepotHeadExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DepotHeadExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSubTypeIsNull() { + addCriterion("sub_type is null"); + return (Criteria) this; + } + + public Criteria andSubTypeIsNotNull() { + addCriterion("sub_type is not null"); + return (Criteria) this; + } + + public Criteria andSubTypeEqualTo(String value) { + addCriterion("sub_type =", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotEqualTo(String value) { + addCriterion("sub_type <>", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeGreaterThan(String value) { + addCriterion("sub_type >", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeGreaterThanOrEqualTo(String value) { + addCriterion("sub_type >=", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLessThan(String value) { + addCriterion("sub_type <", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLessThanOrEqualTo(String value) { + addCriterion("sub_type <=", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLike(String value) { + addCriterion("sub_type like", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotLike(String value) { + addCriterion("sub_type not like", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeIn(List values) { + addCriterion("sub_type in", values, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotIn(List values) { + addCriterion("sub_type not in", values, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeBetween(String value1, String value2) { + addCriterion("sub_type between", value1, value2, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotBetween(String value1, String value2) { + addCriterion("sub_type not between", value1, value2, "subType"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIsNull() { + addCriterion("default_number is null"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIsNotNull() { + addCriterion("default_number is not null"); + return (Criteria) this; + } + + public Criteria andDefaultNumberEqualTo(String value) { + addCriterion("default_number =", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotEqualTo(String value) { + addCriterion("default_number <>", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberGreaterThan(String value) { + addCriterion("default_number >", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberGreaterThanOrEqualTo(String value) { + addCriterion("default_number >=", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLessThan(String value) { + addCriterion("default_number <", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLessThanOrEqualTo(String value) { + addCriterion("default_number <=", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLike(String value) { + addCriterion("default_number like", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotLike(String value) { + addCriterion("default_number not like", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIn(List values) { + addCriterion("default_number in", values, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotIn(List values) { + addCriterion("default_number not in", values, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberBetween(String value1, String value2) { + addCriterion("default_number between", value1, value2, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotBetween(String value1, String value2) { + addCriterion("default_number not between", value1, value2, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(String value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(String value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(String value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(String value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(String value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(String value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLike(String value) { + addCriterion("number like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotLike(String value) { + addCriterion("number not like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(String value1, String value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(String value1, String value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andOperTimeIsNull() { + addCriterion("oper_time is null"); + return (Criteria) this; + } + + public Criteria andOperTimeIsNotNull() { + addCriterion("oper_time is not null"); + return (Criteria) this; + } + + public Criteria andOperTimeEqualTo(Date value) { + addCriterion("oper_time =", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotEqualTo(Date value) { + addCriterion("oper_time <>", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeGreaterThan(Date value) { + addCriterion("oper_time >", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeGreaterThanOrEqualTo(Date value) { + addCriterion("oper_time >=", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeLessThan(Date value) { + addCriterion("oper_time <", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeLessThanOrEqualTo(Date value) { + addCriterion("oper_time <=", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeIn(List values) { + addCriterion("oper_time in", values, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotIn(List values) { + addCriterion("oper_time not in", values, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeBetween(Date value1, Date value2) { + addCriterion("oper_time between", value1, value2, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotBetween(Date value1, Date value2) { + addCriterion("oper_time not between", value1, value2, "operTime"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNull() { + addCriterion("organ_id is null"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNotNull() { + addCriterion("organ_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganIdEqualTo(Long value) { + addCriterion("organ_id =", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotEqualTo(Long value) { + addCriterion("organ_id <>", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThan(Long value) { + addCriterion("organ_id >", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThanOrEqualTo(Long value) { + addCriterion("organ_id >=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThan(Long value) { + addCriterion("organ_id <", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThanOrEqualTo(Long value) { + addCriterion("organ_id <=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdIn(List values) { + addCriterion("organ_id in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotIn(List values) { + addCriterion("organ_id not in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdBetween(Long value1, Long value2) { + addCriterion("organ_id between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotBetween(Long value1, Long value2) { + addCriterion("organ_id not between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNull() { + addCriterion("change_amount is null"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNotNull() { + addCriterion("change_amount is not null"); + return (Criteria) this; + } + + public Criteria andChangeAmountEqualTo(BigDecimal value) { + addCriterion("change_amount =", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotEqualTo(BigDecimal value) { + addCriterion("change_amount <>", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThan(BigDecimal value) { + addCriterion("change_amount >", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount >=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThan(BigDecimal value) { + addCriterion("change_amount <", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount <=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountIn(List values) { + addCriterion("change_amount in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotIn(List values) { + addCriterion("change_amount not in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount not between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountIsNull() { + addCriterion("back_amount is null"); + return (Criteria) this; + } + + public Criteria andBackAmountIsNotNull() { + addCriterion("back_amount is not null"); + return (Criteria) this; + } + + public Criteria andBackAmountEqualTo(BigDecimal value) { + addCriterion("back_amount =", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotEqualTo(BigDecimal value) { + addCriterion("back_amount <>", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountGreaterThan(BigDecimal value) { + addCriterion("back_amount >", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("back_amount >=", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountLessThan(BigDecimal value) { + addCriterion("back_amount <", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("back_amount <=", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountIn(List values) { + addCriterion("back_amount in", values, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotIn(List values) { + addCriterion("back_amount not in", values, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("back_amount between", value1, value2, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("back_amount not between", value1, value2, "backAmount"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNull() { + addCriterion("total_price is null"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNotNull() { + addCriterion("total_price is not null"); + return (Criteria) this; + } + + public Criteria andTotalPriceEqualTo(BigDecimal value) { + addCriterion("total_price =", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotEqualTo(BigDecimal value) { + addCriterion("total_price <>", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThan(BigDecimal value) { + addCriterion("total_price >", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_price >=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThan(BigDecimal value) { + addCriterion("total_price <", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_price <=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceIn(List values) { + addCriterion("total_price in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotIn(List values) { + addCriterion("total_price not in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price not between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNull() { + addCriterion("pay_type is null"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNotNull() { + addCriterion("pay_type is not null"); + return (Criteria) this; + } + + public Criteria andPayTypeEqualTo(String value) { + addCriterion("pay_type =", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotEqualTo(String value) { + addCriterion("pay_type <>", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThan(String value) { + addCriterion("pay_type >", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThanOrEqualTo(String value) { + addCriterion("pay_type >=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThan(String value) { + addCriterion("pay_type <", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThanOrEqualTo(String value) { + addCriterion("pay_type <=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLike(String value) { + addCriterion("pay_type like", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotLike(String value) { + addCriterion("pay_type not like", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeIn(List values) { + addCriterion("pay_type in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotIn(List values) { + addCriterion("pay_type not in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeBetween(String value1, String value2) { + addCriterion("pay_type between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotBetween(String value1, String value2) { + addCriterion("pay_type not between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andBillTypeIsNull() { + addCriterion("bill_type is null"); + return (Criteria) this; + } + + public Criteria andBillTypeIsNotNull() { + addCriterion("bill_type is not null"); + return (Criteria) this; + } + + public Criteria andBillTypeEqualTo(String value) { + addCriterion("bill_type =", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotEqualTo(String value) { + addCriterion("bill_type <>", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeGreaterThan(String value) { + addCriterion("bill_type >", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeGreaterThanOrEqualTo(String value) { + addCriterion("bill_type >=", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLessThan(String value) { + addCriterion("bill_type <", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLessThanOrEqualTo(String value) { + addCriterion("bill_type <=", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLike(String value) { + addCriterion("bill_type like", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotLike(String value) { + addCriterion("bill_type not like", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeIn(List values) { + addCriterion("bill_type in", values, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotIn(List values) { + addCriterion("bill_type not in", values, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeBetween(String value1, String value2) { + addCriterion("bill_type between", value1, value2, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotBetween(String value1, String value2) { + addCriterion("bill_type not between", value1, value2, "billType"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andSalesManIsNull() { + addCriterion("sales_man is null"); + return (Criteria) this; + } + + public Criteria andSalesManIsNotNull() { + addCriterion("sales_man is not null"); + return (Criteria) this; + } + + public Criteria andSalesManEqualTo(String value) { + addCriterion("sales_man =", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotEqualTo(String value) { + addCriterion("sales_man <>", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManGreaterThan(String value) { + addCriterion("sales_man >", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManGreaterThanOrEqualTo(String value) { + addCriterion("sales_man >=", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLessThan(String value) { + addCriterion("sales_man <", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLessThanOrEqualTo(String value) { + addCriterion("sales_man <=", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLike(String value) { + addCriterion("sales_man like", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotLike(String value) { + addCriterion("sales_man not like", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManIn(List values) { + addCriterion("sales_man in", values, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotIn(List values) { + addCriterion("sales_man not in", values, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManBetween(String value1, String value2) { + addCriterion("sales_man between", value1, value2, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotBetween(String value1, String value2) { + addCriterion("sales_man not between", value1, value2, "salesMan"); + return (Criteria) this; + } + + public Criteria andAccountIdListIsNull() { + addCriterion("account_id_list is null"); + return (Criteria) this; + } + + public Criteria andAccountIdListIsNotNull() { + addCriterion("account_id_list is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdListEqualTo(String value) { + addCriterion("account_id_list =", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotEqualTo(String value) { + addCriterion("account_id_list <>", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListGreaterThan(String value) { + addCriterion("account_id_list >", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListGreaterThanOrEqualTo(String value) { + addCriterion("account_id_list >=", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLessThan(String value) { + addCriterion("account_id_list <", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLessThanOrEqualTo(String value) { + addCriterion("account_id_list <=", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLike(String value) { + addCriterion("account_id_list like", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotLike(String value) { + addCriterion("account_id_list not like", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListIn(List values) { + addCriterion("account_id_list in", values, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotIn(List values) { + addCriterion("account_id_list not in", values, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListBetween(String value1, String value2) { + addCriterion("account_id_list between", value1, value2, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotBetween(String value1, String value2) { + addCriterion("account_id_list not between", value1, value2, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIsNull() { + addCriterion("account_money_list is null"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIsNotNull() { + addCriterion("account_money_list is not null"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListEqualTo(String value) { + addCriterion("account_money_list =", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotEqualTo(String value) { + addCriterion("account_money_list <>", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListGreaterThan(String value) { + addCriterion("account_money_list >", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListGreaterThanOrEqualTo(String value) { + addCriterion("account_money_list >=", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLessThan(String value) { + addCriterion("account_money_list <", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLessThanOrEqualTo(String value) { + addCriterion("account_money_list <=", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLike(String value) { + addCriterion("account_money_list like", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotLike(String value) { + addCriterion("account_money_list not like", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIn(List values) { + addCriterion("account_money_list in", values, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotIn(List values) { + addCriterion("account_money_list not in", values, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListBetween(String value1, String value2) { + addCriterion("account_money_list between", value1, value2, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotBetween(String value1, String value2) { + addCriterion("account_money_list not between", value1, value2, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andDiscountIsNull() { + addCriterion("discount is null"); + return (Criteria) this; + } + + public Criteria andDiscountIsNotNull() { + addCriterion("discount is not null"); + return (Criteria) this; + } + + public Criteria andDiscountEqualTo(BigDecimal value) { + addCriterion("discount =", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotEqualTo(BigDecimal value) { + addCriterion("discount <>", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThan(BigDecimal value) { + addCriterion("discount >", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount >=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThan(BigDecimal value) { + addCriterion("discount <", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount <=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountIn(List values) { + addCriterion("discount in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotIn(List values) { + addCriterion("discount not in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount not between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNull() { + addCriterion("discount_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNotNull() { + addCriterion("discount_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyEqualTo(BigDecimal value) { + addCriterion("discount_money =", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_money <>", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_money >", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money >=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThan(BigDecimal value) { + addCriterion("discount_money <", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money <=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIn(List values) { + addCriterion("discount_money in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotIn(List values) { + addCriterion("discount_money not in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money not between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIsNull() { + addCriterion("discount_last_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIsNotNull() { + addCriterion("discount_last_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyEqualTo(BigDecimal value) { + addCriterion("discount_last_money =", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_last_money <>", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_last_money >", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_last_money >=", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyLessThan(BigDecimal value) { + addCriterion("discount_last_money <", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_last_money <=", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIn(List values) { + addCriterion("discount_last_money in", values, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotIn(List values) { + addCriterion("discount_last_money not in", values, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_last_money between", value1, value2, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_last_money not between", value1, value2, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIsNull() { + addCriterion("other_money is null"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIsNotNull() { + addCriterion("other_money is not null"); + return (Criteria) this; + } + + public Criteria andOtherMoneyEqualTo(BigDecimal value) { + addCriterion("other_money =", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotEqualTo(BigDecimal value) { + addCriterion("other_money <>", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyGreaterThan(BigDecimal value) { + addCriterion("other_money >", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("other_money >=", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyLessThan(BigDecimal value) { + addCriterion("other_money <", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("other_money <=", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIn(List values) { + addCriterion("other_money in", values, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotIn(List values) { + addCriterion("other_money not in", values, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("other_money between", value1, value2, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("other_money not between", value1, value2, "otherMoney"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andLinkNumberIsNull() { + addCriterion("link_number is null"); + return (Criteria) this; + } + + public Criteria andLinkNumberIsNotNull() { + addCriterion("link_number is not null"); + return (Criteria) this; + } + + public Criteria andLinkNumberEqualTo(String value) { + addCriterion("link_number =", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotEqualTo(String value) { + addCriterion("link_number <>", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberGreaterThan(String value) { + addCriterion("link_number >", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberGreaterThanOrEqualTo(String value) { + addCriterion("link_number >=", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLessThan(String value) { + addCriterion("link_number <", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLessThanOrEqualTo(String value) { + addCriterion("link_number <=", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLike(String value) { + addCriterion("link_number like", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotLike(String value) { + addCriterion("link_number not like", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberIn(List values) { + addCriterion("link_number in", values, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotIn(List values) { + addCriterion("link_number not in", values, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberBetween(String value1, String value2) { + addCriterion("link_number between", value1, value2, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotBetween(String value1, String value2) { + addCriterion("link_number not between", value1, value2, "linkNumber"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadVo4Body.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadVo4Body.java new file mode 100644 index 00000000..494ba479 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotHeadVo4Body.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.entities; + +import com.zsw.erp.datasource.dto.DepotItemDto; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class DepotHeadVo4Body { + + private Long id; + + private DepotHead info; + + private List rows; + + private BigDecimal preTotalPrice; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItem.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItem.java new file mode 100644 index 00000000..94340ad0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItem.java @@ -0,0 +1,62 @@ +package com.zsw.erp.datasource.entities; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class DepotItem { + @TableId(type = IdType.AUTO) + private Long id; + + private Long headerId; + + private Long materialId; + + private Long materialExtendId; + + private String materialUnit; + + private String sku; + + private BigDecimal operNumber; + + private BigDecimal basicNumber; + + private BigDecimal unitPrice; + + private BigDecimal taxUnitPrice; + + private BigDecimal allPrice; + + private String remark; + + @ApiModelProperty("仓库ID") + private Long depotId; + + @ApiModelProperty("调拨仓库") + private Long anotherDepotId; + + private BigDecimal taxRate; + + private BigDecimal taxMoney; + + private BigDecimal taxLastMoney; + + private String materialType; + + private String snList; + + private String batchNumber; + + private Date expirationDate; + + private Long tenantId; + + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemExample.java new file mode 100644 index 00000000..02a7ebf8 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemExample.java @@ -0,0 +1,1651 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class DepotItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DepotItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNull() { + addCriterion("header_id is null"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNotNull() { + addCriterion("header_id is not null"); + return (Criteria) this; + } + + public Criteria andHeaderIdEqualTo(Long value) { + addCriterion("header_id =", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotEqualTo(Long value) { + addCriterion("header_id <>", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThan(Long value) { + addCriterion("header_id >", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThanOrEqualTo(Long value) { + addCriterion("header_id >=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThan(Long value) { + addCriterion("header_id <", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThanOrEqualTo(Long value) { + addCriterion("header_id <=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdIn(List values) { + addCriterion("header_id in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotIn(List values) { + addCriterion("header_id not in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdBetween(Long value1, Long value2) { + addCriterion("header_id between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotBetween(Long value1, Long value2) { + addCriterion("header_id not between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIsNull() { + addCriterion("material_extend_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIsNotNull() { + addCriterion("material_extend_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdEqualTo(Long value) { + addCriterion("material_extend_id =", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotEqualTo(Long value) { + addCriterion("material_extend_id <>", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdGreaterThan(Long value) { + addCriterion("material_extend_id >", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_extend_id >=", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdLessThan(Long value) { + addCriterion("material_extend_id <", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdLessThanOrEqualTo(Long value) { + addCriterion("material_extend_id <=", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIn(List values) { + addCriterion("material_extend_id in", values, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotIn(List values) { + addCriterion("material_extend_id not in", values, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdBetween(Long value1, Long value2) { + addCriterion("material_extend_id between", value1, value2, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotBetween(Long value1, Long value2) { + addCriterion("material_extend_id not between", value1, value2, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIsNull() { + addCriterion("material_unit is null"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIsNotNull() { + addCriterion("material_unit is not null"); + return (Criteria) this; + } + + public Criteria andMaterialUnitEqualTo(String value) { + addCriterion("material_unit =", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotEqualTo(String value) { + addCriterion("material_unit <>", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitGreaterThan(String value) { + addCriterion("material_unit >", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitGreaterThanOrEqualTo(String value) { + addCriterion("material_unit >=", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLessThan(String value) { + addCriterion("material_unit <", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLessThanOrEqualTo(String value) { + addCriterion("material_unit <=", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLike(String value) { + addCriterion("material_unit like", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotLike(String value) { + addCriterion("material_unit not like", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIn(List values) { + addCriterion("material_unit in", values, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotIn(List values) { + addCriterion("material_unit not in", values, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitBetween(String value1, String value2) { + addCriterion("material_unit between", value1, value2, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotBetween(String value1, String value2) { + addCriterion("material_unit not between", value1, value2, "materialUnit"); + return (Criteria) this; + } + + public Criteria andSkuIsNull() { + addCriterion("sku is null"); + return (Criteria) this; + } + + public Criteria andSkuIsNotNull() { + addCriterion("sku is not null"); + return (Criteria) this; + } + + public Criteria andSkuEqualTo(String value) { + addCriterion("sku =", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotEqualTo(String value) { + addCriterion("sku <>", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThan(String value) { + addCriterion("sku >", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThanOrEqualTo(String value) { + addCriterion("sku >=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThan(String value) { + addCriterion("sku <", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThanOrEqualTo(String value) { + addCriterion("sku <=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLike(String value) { + addCriterion("sku like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotLike(String value) { + addCriterion("sku not like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuIn(List values) { + addCriterion("sku in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotIn(List values) { + addCriterion("sku not in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuBetween(String value1, String value2) { + addCriterion("sku between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotBetween(String value1, String value2) { + addCriterion("sku not between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andOperNumberIsNull() { + addCriterion("oper_number is null"); + return (Criteria) this; + } + + public Criteria andOperNumberIsNotNull() { + addCriterion("oper_number is not null"); + return (Criteria) this; + } + + public Criteria andOperNumberEqualTo(BigDecimal value) { + addCriterion("oper_number =", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotEqualTo(BigDecimal value) { + addCriterion("oper_number <>", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberGreaterThan(BigDecimal value) { + addCriterion("oper_number >", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("oper_number >=", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberLessThan(BigDecimal value) { + addCriterion("oper_number <", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("oper_number <=", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberIn(List values) { + addCriterion("oper_number in", values, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotIn(List values) { + addCriterion("oper_number not in", values, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("oper_number between", value1, value2, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("oper_number not between", value1, value2, "operNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberIsNull() { + addCriterion("basic_number is null"); + return (Criteria) this; + } + + public Criteria andBasicNumberIsNotNull() { + addCriterion("basic_number is not null"); + return (Criteria) this; + } + + public Criteria andBasicNumberEqualTo(BigDecimal value) { + addCriterion("basic_number =", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotEqualTo(BigDecimal value) { + addCriterion("basic_number <>", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberGreaterThan(BigDecimal value) { + addCriterion("basic_number >", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("basic_number >=", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberLessThan(BigDecimal value) { + addCriterion("basic_number <", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("basic_number <=", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberIn(List values) { + addCriterion("basic_number in", values, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotIn(List values) { + addCriterion("basic_number not in", values, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("basic_number between", value1, value2, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("basic_number not between", value1, value2, "basicNumber"); + return (Criteria) this; + } + + public Criteria andUnitPriceIsNull() { + addCriterion("unit_price is null"); + return (Criteria) this; + } + + public Criteria andUnitPriceIsNotNull() { + addCriterion("unit_price is not null"); + return (Criteria) this; + } + + public Criteria andUnitPriceEqualTo(BigDecimal value) { + addCriterion("unit_price =", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("unit_price <>", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceGreaterThan(BigDecimal value) { + addCriterion("unit_price >", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("unit_price >=", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceLessThan(BigDecimal value) { + addCriterion("unit_price <", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("unit_price <=", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceIn(List values) { + addCriterion("unit_price in", values, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotIn(List values) { + addCriterion("unit_price not in", values, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("unit_price between", value1, value2, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("unit_price not between", value1, value2, "unitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIsNull() { + addCriterion("tax_unit_price is null"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIsNotNull() { + addCriterion("tax_unit_price is not null"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceEqualTo(BigDecimal value) { + addCriterion("tax_unit_price =", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("tax_unit_price <>", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceGreaterThan(BigDecimal value) { + addCriterion("tax_unit_price >", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_unit_price >=", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceLessThan(BigDecimal value) { + addCriterion("tax_unit_price <", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_unit_price <=", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIn(List values) { + addCriterion("tax_unit_price in", values, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotIn(List values) { + addCriterion("tax_unit_price not in", values, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_unit_price between", value1, value2, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_unit_price not between", value1, value2, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceIsNull() { + addCriterion("all_price is null"); + return (Criteria) this; + } + + public Criteria andAllPriceIsNotNull() { + addCriterion("all_price is not null"); + return (Criteria) this; + } + + public Criteria andAllPriceEqualTo(BigDecimal value) { + addCriterion("all_price =", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotEqualTo(BigDecimal value) { + addCriterion("all_price <>", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceGreaterThan(BigDecimal value) { + addCriterion("all_price >", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_price >=", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceLessThan(BigDecimal value) { + addCriterion("all_price <", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_price <=", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceIn(List values) { + addCriterion("all_price in", values, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotIn(List values) { + addCriterion("all_price not in", values, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_price between", value1, value2, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_price not between", value1, value2, "allPrice"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIsNull() { + addCriterion("another_depot_id is null"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIsNotNull() { + addCriterion("another_depot_id is not null"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdEqualTo(Long value) { + addCriterion("another_depot_id =", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotEqualTo(Long value) { + addCriterion("another_depot_id <>", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdGreaterThan(Long value) { + addCriterion("another_depot_id >", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("another_depot_id >=", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdLessThan(Long value) { + addCriterion("another_depot_id <", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdLessThanOrEqualTo(Long value) { + addCriterion("another_depot_id <=", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIn(List values) { + addCriterion("another_depot_id in", values, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotIn(List values) { + addCriterion("another_depot_id not in", values, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdBetween(Long value1, Long value2) { + addCriterion("another_depot_id between", value1, value2, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotBetween(Long value1, Long value2) { + addCriterion("another_depot_id not between", value1, value2, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNull() { + addCriterion("tax_rate is null"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNotNull() { + addCriterion("tax_rate is not null"); + return (Criteria) this; + } + + public Criteria andTaxRateEqualTo(BigDecimal value) { + addCriterion("tax_rate =", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotEqualTo(BigDecimal value) { + addCriterion("tax_rate <>", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThan(BigDecimal value) { + addCriterion("tax_rate >", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate >=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThan(BigDecimal value) { + addCriterion("tax_rate <", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate <=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateIn(List values) { + addCriterion("tax_rate in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotIn(List values) { + addCriterion("tax_rate not in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate not between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIsNull() { + addCriterion("tax_money is null"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIsNotNull() { + addCriterion("tax_money is not null"); + return (Criteria) this; + } + + public Criteria andTaxMoneyEqualTo(BigDecimal value) { + addCriterion("tax_money =", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotEqualTo(BigDecimal value) { + addCriterion("tax_money <>", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyGreaterThan(BigDecimal value) { + addCriterion("tax_money >", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_money >=", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyLessThan(BigDecimal value) { + addCriterion("tax_money <", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_money <=", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIn(List values) { + addCriterion("tax_money in", values, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotIn(List values) { + addCriterion("tax_money not in", values, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_money between", value1, value2, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_money not between", value1, value2, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIsNull() { + addCriterion("tax_last_money is null"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIsNotNull() { + addCriterion("tax_last_money is not null"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyEqualTo(BigDecimal value) { + addCriterion("tax_last_money =", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotEqualTo(BigDecimal value) { + addCriterion("tax_last_money <>", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyGreaterThan(BigDecimal value) { + addCriterion("tax_last_money >", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_last_money >=", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyLessThan(BigDecimal value) { + addCriterion("tax_last_money <", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_last_money <=", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIn(List values) { + addCriterion("tax_last_money in", values, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotIn(List values) { + addCriterion("tax_last_money not in", values, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_last_money between", value1, value2, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_last_money not between", value1, value2, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIsNull() { + addCriterion("material_type is null"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIsNotNull() { + addCriterion("material_type is not null"); + return (Criteria) this; + } + + public Criteria andMaterialTypeEqualTo(String value) { + addCriterion("material_type =", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotEqualTo(String value) { + addCriterion("material_type <>", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeGreaterThan(String value) { + addCriterion("material_type >", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeGreaterThanOrEqualTo(String value) { + addCriterion("material_type >=", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLessThan(String value) { + addCriterion("material_type <", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLessThanOrEqualTo(String value) { + addCriterion("material_type <=", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLike(String value) { + addCriterion("material_type like", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotLike(String value) { + addCriterion("material_type not like", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIn(List values) { + addCriterion("material_type in", values, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotIn(List values) { + addCriterion("material_type not in", values, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeBetween(String value1, String value2) { + addCriterion("material_type between", value1, value2, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotBetween(String value1, String value2) { + addCriterion("material_type not between", value1, value2, "materialType"); + return (Criteria) this; + } + + public Criteria andSnListIsNull() { + addCriterion("sn_list is null"); + return (Criteria) this; + } + + public Criteria andSnListIsNotNull() { + addCriterion("sn_list is not null"); + return (Criteria) this; + } + + public Criteria andSnListEqualTo(String value) { + addCriterion("sn_list =", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotEqualTo(String value) { + addCriterion("sn_list <>", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListGreaterThan(String value) { + addCriterion("sn_list >", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListGreaterThanOrEqualTo(String value) { + addCriterion("sn_list >=", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLessThan(String value) { + addCriterion("sn_list <", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLessThanOrEqualTo(String value) { + addCriterion("sn_list <=", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLike(String value) { + addCriterion("sn_list like", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotLike(String value) { + addCriterion("sn_list not like", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListIn(List values) { + addCriterion("sn_list in", values, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotIn(List values) { + addCriterion("sn_list not in", values, "snList"); + return (Criteria) this; + } + + public Criteria andSnListBetween(String value1, String value2) { + addCriterion("sn_list between", value1, value2, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotBetween(String value1, String value2) { + addCriterion("sn_list not between", value1, value2, "snList"); + return (Criteria) this; + } + + public Criteria andBatchNumberIsNull() { + addCriterion("batch_number is null"); + return (Criteria) this; + } + + public Criteria andBatchNumberIsNotNull() { + addCriterion("batch_number is not null"); + return (Criteria) this; + } + + public Criteria andBatchNumberEqualTo(String value) { + addCriterion("batch_number =", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotEqualTo(String value) { + addCriterion("batch_number <>", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberGreaterThan(String value) { + addCriterion("batch_number >", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberGreaterThanOrEqualTo(String value) { + addCriterion("batch_number >=", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLessThan(String value) { + addCriterion("batch_number <", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLessThanOrEqualTo(String value) { + addCriterion("batch_number <=", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLike(String value) { + addCriterion("batch_number like", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotLike(String value) { + addCriterion("batch_number not like", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberIn(List values) { + addCriterion("batch_number in", values, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotIn(List values) { + addCriterion("batch_number not in", values, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberBetween(String value1, String value2) { + addCriterion("batch_number between", value1, value2, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotBetween(String value1, String value2) { + addCriterion("batch_number not between", value1, value2, "batchNumber"); + return (Criteria) this; + } + + public Criteria andExpirationDateIsNull() { + addCriterion("expiration_date is null"); + return (Criteria) this; + } + + public Criteria andExpirationDateIsNotNull() { + addCriterion("expiration_date is not null"); + return (Criteria) this; + } + + public Criteria andExpirationDateEqualTo(Date value) { + addCriterion("expiration_date =", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotEqualTo(Date value) { + addCriterion("expiration_date <>", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateGreaterThan(Date value) { + addCriterion("expiration_date >", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateGreaterThanOrEqualTo(Date value) { + addCriterion("expiration_date >=", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateLessThan(Date value) { + addCriterion("expiration_date <", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateLessThanOrEqualTo(Date value) { + addCriterion("expiration_date <=", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateIn(List values) { + addCriterion("expiration_date in", values, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotIn(List values) { + addCriterion("expiration_date not in", values, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateBetween(Date value1, Date value2) { + addCriterion("expiration_date between", value1, value2, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotBetween(Date value1, Date value2) { + addCriterion("expiration_date not between", value1, value2, "expirationDate"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java new file mode 100644 index 00000000..d26bf3ad --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java @@ -0,0 +1,27 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotItemVo4DetailByTypeAndMId { + + private String number; + + private String barCode; + + private String materialName; + + private String type; + + private String subType; + + private BigDecimal bnum; + + private String depotName; + + private Date otime; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4Material.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4Material.java new file mode 100644 index 00000000..983e7bd0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4Material.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.entities; + +public class DepotItemVo4Material extends DepotItem{ + + private String mname; + + private String mmodel; + + public String getMname() { + return mname; + } + + public void setMname(String mname) { + this.mname = mname; + } + + public String getMmodel() { + return mmodel; + } + + public void setMmodel(String mmodel) { + this.mmodel = mmodel; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java new file mode 100644 index 00000000..15ad7115 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/DepotItemVo4WithInfoEx.java @@ -0,0 +1,226 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; + +public class DepotItemVo4WithInfoEx extends DepotItem{ + + private Long MId; + + private String MName; + + private String MModel; + + private String MaterialUnit; + + private String MColor; + + private String MStandard; + + private String MMfrs; + + private String MOtherField1; + + private String MOtherField2; + + private String MOtherField3; + + private String enableSerialNumber; + + private String enableBatchNumber; + + private String DepotName; + + private String AnotherDepotName; + + private Long UnitId; + + private String unitName; + + private Integer ratio; + + private String otherUnit; + + private BigDecimal presetPriceOne; + + private String priceStrategy; + + private BigDecimal purchaseDecimal; + + private String barCode; + + public Long getMId() { + return MId; + } + + public void setMId(Long MId) { + this.MId = MId; + } + + public String getMName() { + return MName; + } + + public void setMName(String MName) { + this.MName = MName; + } + + public String getMModel() { + return MModel; + } + + public void setMModel(String MModel) { + this.MModel = MModel; + } + + public String getMaterialUnit() { + return MaterialUnit; + } + + public void setMaterialUnit(String materialUnit) { + MaterialUnit = materialUnit; + } + + public String getMColor() { + return MColor; + } + + public void setMColor(String MColor) { + this.MColor = MColor; + } + + public String getMStandard() { + return MStandard; + } + + public void setMStandard(String MStandard) { + this.MStandard = MStandard; + } + + public String getMMfrs() { + return MMfrs; + } + + public void setMMfrs(String MMfrs) { + this.MMfrs = MMfrs; + } + + public String getMOtherField1() { + return MOtherField1; + } + + public void setMOtherField1(String MOtherField1) { + this.MOtherField1 = MOtherField1; + } + + public String getMOtherField2() { + return MOtherField2; + } + + public void setMOtherField2(String MOtherField2) { + this.MOtherField2 = MOtherField2; + } + + public String getMOtherField3() { + return MOtherField3; + } + + public void setMOtherField3(String MOtherField3) { + this.MOtherField3 = MOtherField3; + } + + public String getEnableSerialNumber() { + return enableSerialNumber; + } + + public void setEnableSerialNumber(String enableSerialNumber) { + this.enableSerialNumber = enableSerialNumber; + } + + public String getEnableBatchNumber() { + return enableBatchNumber; + } + + public void setEnableBatchNumber(String enableBatchNumber) { + this.enableBatchNumber = enableBatchNumber; + } + + public String getDepotName() { + return DepotName; + } + + public void setDepotName(String depotName) { + DepotName = depotName; + } + + public String getAnotherDepotName() { + return AnotherDepotName; + } + + public void setAnotherDepotName(String anotherDepotName) { + AnotherDepotName = anotherDepotName; + } + + public Long getUnitId() { + return UnitId; + } + + public void setUnitId(Long unitId) { + UnitId = unitId; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public Integer getRatio() { + return ratio; + } + + public void setRatio(Integer ratio) { + this.ratio = ratio; + } + + public String getOtherUnit() { + return otherUnit; + } + + public void setOtherUnit(String otherUnit) { + this.otherUnit = otherUnit; + } + + public BigDecimal getPresetPriceOne() { + return presetPriceOne; + } + + public void setPresetPriceOne(BigDecimal presetPriceOne) { + this.presetPriceOne = presetPriceOne; + } + + public String getPriceStrategy() { + return priceStrategy; + } + + public void setPriceStrategy(String priceStrategy) { + this.priceStrategy = priceStrategy; + } + + public BigDecimal getPurchaseDecimal() { + return purchaseDecimal; + } + + public void setPurchaseDecimal(BigDecimal purchaseDecimal) { + this.purchaseDecimal = purchaseDecimal; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Function.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Function.java new file mode 100644 index 00000000..1e3b22d7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Function.java @@ -0,0 +1,136 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Function { + @TableId(type = IdType.AUTO) + private Long id; + + private String number; + + private String name; + + private String parentNumber; + + private String url; + + private String component; + + private Boolean state; + + private String sort; + + private Boolean enabled; + + private String type; + + private String pushBtn; + + private String icon; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number == null ? null : number.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getParentNumber() { + return parentNumber; + } + + public void setParentNumber(String parentNumber) { + this.parentNumber = parentNumber == null ? null : parentNumber.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component == null ? null : component.trim(); + } + + public Boolean getState() { + return state; + } + + public void setState(Boolean state) { + this.state = state; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getPushBtn() { + return pushBtn; + } + + public void setPushBtn(String pushBtn) { + this.pushBtn = pushBtn == null ? null : pushBtn.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/FunctionExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/FunctionExample.java new file mode 100644 index 00000000..ad433b6f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/FunctionExample.java @@ -0,0 +1,1079 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class FunctionExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public FunctionExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(String value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(String value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(String value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(String value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(String value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(String value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLike(String value) { + addCriterion("number like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotLike(String value) { + addCriterion("number not like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(String value1, String value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(String value1, String value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andParentNumberIsNull() { + addCriterion("parent_number is null"); + return (Criteria) this; + } + + public Criteria andParentNumberIsNotNull() { + addCriterion("parent_number is not null"); + return (Criteria) this; + } + + public Criteria andParentNumberEqualTo(String value) { + addCriterion("parent_number =", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotEqualTo(String value) { + addCriterion("parent_number <>", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberGreaterThan(String value) { + addCriterion("parent_number >", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberGreaterThanOrEqualTo(String value) { + addCriterion("parent_number >=", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLessThan(String value) { + addCriterion("parent_number <", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLessThanOrEqualTo(String value) { + addCriterion("parent_number <=", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLike(String value) { + addCriterion("parent_number like", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotLike(String value) { + addCriterion("parent_number not like", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberIn(List values) { + addCriterion("parent_number in", values, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotIn(List values) { + addCriterion("parent_number not in", values, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberBetween(String value1, String value2) { + addCriterion("parent_number between", value1, value2, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotBetween(String value1, String value2) { + addCriterion("parent_number not between", value1, value2, "parentNumber"); + return (Criteria) this; + } + + public Criteria andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andComponentIsNull() { + addCriterion("component is null"); + return (Criteria) this; + } + + public Criteria andComponentIsNotNull() { + addCriterion("component is not null"); + return (Criteria) this; + } + + public Criteria andComponentEqualTo(String value) { + addCriterion("component =", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotEqualTo(String value) { + addCriterion("component <>", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThan(String value) { + addCriterion("component >", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThanOrEqualTo(String value) { + addCriterion("component >=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThan(String value) { + addCriterion("component <", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThanOrEqualTo(String value) { + addCriterion("component <=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLike(String value) { + addCriterion("component like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotLike(String value) { + addCriterion("component not like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentIn(List values) { + addCriterion("component in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotIn(List values) { + addCriterion("component not in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentBetween(String value1, String value2) { + addCriterion("component between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotBetween(String value1, String value2) { + addCriterion("component not between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andStateIsNull() { + addCriterion("state is null"); + return (Criteria) this; + } + + public Criteria andStateIsNotNull() { + addCriterion("state is not null"); + return (Criteria) this; + } + + public Criteria andStateEqualTo(Boolean value) { + addCriterion("state =", value, "state"); + return (Criteria) this; + } + + public Criteria andStateNotEqualTo(Boolean value) { + addCriterion("state <>", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThan(Boolean value) { + addCriterion("state >", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThanOrEqualTo(Boolean value) { + addCriterion("state >=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThan(Boolean value) { + addCriterion("state <", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThanOrEqualTo(Boolean value) { + addCriterion("state <=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateIn(List values) { + addCriterion("state in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateNotIn(List values) { + addCriterion("state not in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateBetween(Boolean value1, Boolean value2) { + addCriterion("state between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andStateNotBetween(Boolean value1, Boolean value2) { + addCriterion("state not between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andPushBtnIsNull() { + addCriterion("push_btn is null"); + return (Criteria) this; + } + + public Criteria andPushBtnIsNotNull() { + addCriterion("push_btn is not null"); + return (Criteria) this; + } + + public Criteria andPushBtnEqualTo(String value) { + addCriterion("push_btn =", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotEqualTo(String value) { + addCriterion("push_btn <>", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnGreaterThan(String value) { + addCriterion("push_btn >", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnGreaterThanOrEqualTo(String value) { + addCriterion("push_btn >=", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLessThan(String value) { + addCriterion("push_btn <", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLessThanOrEqualTo(String value) { + addCriterion("push_btn <=", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLike(String value) { + addCriterion("push_btn like", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotLike(String value) { + addCriterion("push_btn not like", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnIn(List values) { + addCriterion("push_btn in", values, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotIn(List values) { + addCriterion("push_btn not in", values, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnBetween(String value1, String value2) { + addCriterion("push_btn between", value1, value2, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotBetween(String value1, String value2) { + addCriterion("push_btn not between", value1, value2, "pushBtn"); + return (Criteria) this; + } + + public Criteria andIconIsNull() { + addCriterion("icon is null"); + return (Criteria) this; + } + + public Criteria andIconIsNotNull() { + addCriterion("icon is not null"); + return (Criteria) this; + } + + public Criteria andIconEqualTo(String value) { + addCriterion("icon =", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotEqualTo(String value) { + addCriterion("icon <>", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThan(String value) { + addCriterion("icon >", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThanOrEqualTo(String value) { + addCriterion("icon >=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThan(String value) { + addCriterion("icon <", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThanOrEqualTo(String value) { + addCriterion("icon <=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLike(String value) { + addCriterion("icon like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotLike(String value) { + addCriterion("icon not like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconIn(List values) { + addCriterion("icon in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotIn(List values) { + addCriterion("icon not in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconBetween(String value1, String value2) { + addCriterion("icon between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotBetween(String value1, String value2) { + addCriterion("icon not between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItem.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItem.java new file mode 100644 index 00000000..d191bf82 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItem.java @@ -0,0 +1,66 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class InOutItem { + @TableId(type = IdType.AUTO) + private Long id; + + private String name; + + private String type; + + private String remark; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItemExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItemExample.java new file mode 100644 index 00000000..5fc38fc9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InOutItemExample.java @@ -0,0 +1,599 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class InOutItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public InOutItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java new file mode 100644 index 00000000..b0cc02bf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java @@ -0,0 +1,29 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class InventorySeason { + + @TableId(type = IdType.AUTO) + private Long id; + + private String mouth; + + private String batch; + + private String mark; + + private LocalDateTime startTime; + + private LocalDateTime endTime; + + private Long creator; + + private Long tenantId; + + @TableLogic(delval = "1") + private String deleteFlag; +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Log.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Log.java new file mode 100644 index 00000000..8d728558 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Log.java @@ -0,0 +1,89 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Log { + + @TableId(type = IdType.AUTO) + private Long id; + + private Long userId; + + private String operation; + + private String clientIp; + + private Date createTime; + + private Byte status; + + private String content; + + private Long tenantId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation == null ? null : operation.trim(); + } + + public String getClientIp() { + return clientIp; + } + + public void setClientIp(String clientIp) { + this.clientIp = clientIp == null ? null : clientIp.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/LogExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/LogExample.java new file mode 100644 index 00000000..1f52fc49 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/LogExample.java @@ -0,0 +1,710 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public LogExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andOperationIsNull() { + addCriterion("operation is null"); + return (Criteria) this; + } + + public Criteria andOperationIsNotNull() { + addCriterion("operation is not null"); + return (Criteria) this; + } + + public Criteria andOperationEqualTo(String value) { + addCriterion("operation =", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotEqualTo(String value) { + addCriterion("operation <>", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThan(String value) { + addCriterion("operation >", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThanOrEqualTo(String value) { + addCriterion("operation >=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThan(String value) { + addCriterion("operation <", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThanOrEqualTo(String value) { + addCriterion("operation <=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLike(String value) { + addCriterion("operation like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotLike(String value) { + addCriterion("operation not like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationIn(List values) { + addCriterion("operation in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotIn(List values) { + addCriterion("operation not in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationBetween(String value1, String value2) { + addCriterion("operation between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotBetween(String value1, String value2) { + addCriterion("operation not between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andClientIpIsNull() { + addCriterion("client_ip is null"); + return (Criteria) this; + } + + public Criteria andClientIpIsNotNull() { + addCriterion("client_ip is not null"); + return (Criteria) this; + } + + public Criteria andClientIpEqualTo(String value) { + addCriterion("client_ip =", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotEqualTo(String value) { + addCriterion("client_ip <>", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpGreaterThan(String value) { + addCriterion("client_ip >", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpGreaterThanOrEqualTo(String value) { + addCriterion("client_ip >=", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLessThan(String value) { + addCriterion("client_ip <", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLessThanOrEqualTo(String value) { + addCriterion("client_ip <=", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLike(String value) { + addCriterion("client_ip like", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotLike(String value) { + addCriterion("client_ip not like", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpIn(List values) { + addCriterion("client_ip in", values, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotIn(List values) { + addCriterion("client_ip not in", values, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpBetween(String value1, String value2) { + addCriterion("client_ip between", value1, value2, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotBetween(String value1, String value2) { + addCriterion("client_ip not between", value1, value2, "clientIp"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Byte value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Byte value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Byte value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Byte value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Byte value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Byte value1, Byte value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Byte value1, Byte value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andContentIsNull() { + addCriterion("content is null"); + return (Criteria) this; + } + + public Criteria andContentIsNotNull() { + addCriterion("content is not null"); + return (Criteria) this; + } + + public Criteria andContentEqualTo(String value) { + addCriterion("content =", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotEqualTo(String value) { + addCriterion("content <>", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThan(String value) { + addCriterion("content >", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThanOrEqualTo(String value) { + addCriterion("content >=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThan(String value) { + addCriterion("content <", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThanOrEqualTo(String value) { + addCriterion("content <=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLike(String value) { + addCriterion("content like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotLike(String value) { + addCriterion("content not like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentIn(List values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List values) { + addCriterion("content not in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentBetween(String value1, String value2) { + addCriterion("content between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andContentNotBetween(String value1, String value2) { + addCriterion("content not between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Material.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Material.java new file mode 100644 index 00000000..1e282f1d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Material.java @@ -0,0 +1,57 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Material { + + @TableId(type = IdType.AUTO) + private Long id; + + private Long categoryId; + + private String name; + + private String mfrs; + + private String model; + + private String standard; + + private String color; + + private String unit; + + private String remark; + + private String imgName; + + private Long unitId; + + private Integer expiryNum; + + private BigDecimal weight; + + private Boolean enabled; + + private String otherField1; + + private String otherField2; + + private String otherField3; + + private String enableSerialNumber; + + private String enableBatchNumber; + + private Long tenantId; + + @TableLogic + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttribute.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttribute.java new file mode 100644 index 00000000..2c36d24d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttribute.java @@ -0,0 +1,66 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class MaterialAttribute { + @TableId(type = IdType.AUTO) + private Long id; + + private String attributeField; + + private String attributeName; + + private String attributeValue; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAttributeField() { + return attributeField; + } + + public void setAttributeField(String attributeField) { + this.attributeField = attributeField == null ? null : attributeField.trim(); + } + + public String getAttributeName() { + return attributeName; + } + + public void setAttributeName(String attributeName) { + this.attributeName = attributeName == null ? null : attributeName.trim(); + } + + public String getAttributeValue() { + return attributeValue; + } + + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue == null ? null : attributeValue.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttributeExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttributeExample.java new file mode 100644 index 00000000..c7e6222a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialAttributeExample.java @@ -0,0 +1,599 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class MaterialAttributeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialAttributeExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAttributeFieldIsNull() { + addCriterion("attribute_field is null"); + return (Criteria) this; + } + + public Criteria andAttributeFieldIsNotNull() { + addCriterion("attribute_field is not null"); + return (Criteria) this; + } + + public Criteria andAttributeFieldEqualTo(String value) { + addCriterion("attribute_field =", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldNotEqualTo(String value) { + addCriterion("attribute_field <>", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldGreaterThan(String value) { + addCriterion("attribute_field >", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldGreaterThanOrEqualTo(String value) { + addCriterion("attribute_field >=", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldLessThan(String value) { + addCriterion("attribute_field <", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldLessThanOrEqualTo(String value) { + addCriterion("attribute_field <=", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldLike(String value) { + addCriterion("attribute_field like", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldNotLike(String value) { + addCriterion("attribute_field not like", value, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldIn(List values) { + addCriterion("attribute_field in", values, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldNotIn(List values) { + addCriterion("attribute_field not in", values, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldBetween(String value1, String value2) { + addCriterion("attribute_field between", value1, value2, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeFieldNotBetween(String value1, String value2) { + addCriterion("attribute_field not between", value1, value2, "attributeField"); + return (Criteria) this; + } + + public Criteria andAttributeNameIsNull() { + addCriterion("attribute_name is null"); + return (Criteria) this; + } + + public Criteria andAttributeNameIsNotNull() { + addCriterion("attribute_name is not null"); + return (Criteria) this; + } + + public Criteria andAttributeNameEqualTo(String value) { + addCriterion("attribute_name =", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotEqualTo(String value) { + addCriterion("attribute_name <>", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameGreaterThan(String value) { + addCriterion("attribute_name >", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameGreaterThanOrEqualTo(String value) { + addCriterion("attribute_name >=", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLessThan(String value) { + addCriterion("attribute_name <", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLessThanOrEqualTo(String value) { + addCriterion("attribute_name <=", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLike(String value) { + addCriterion("attribute_name like", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotLike(String value) { + addCriterion("attribute_name not like", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameIn(List values) { + addCriterion("attribute_name in", values, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotIn(List values) { + addCriterion("attribute_name not in", values, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameBetween(String value1, String value2) { + addCriterion("attribute_name between", value1, value2, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotBetween(String value1, String value2) { + addCriterion("attribute_name not between", value1, value2, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeValueIsNull() { + addCriterion("attribute_value is null"); + return (Criteria) this; + } + + public Criteria andAttributeValueIsNotNull() { + addCriterion("attribute_value is not null"); + return (Criteria) this; + } + + public Criteria andAttributeValueEqualTo(String value) { + addCriterion("attribute_value =", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotEqualTo(String value) { + addCriterion("attribute_value <>", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueGreaterThan(String value) { + addCriterion("attribute_value >", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueGreaterThanOrEqualTo(String value) { + addCriterion("attribute_value >=", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLessThan(String value) { + addCriterion("attribute_value <", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLessThanOrEqualTo(String value) { + addCriterion("attribute_value <=", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLike(String value) { + addCriterion("attribute_value like", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotLike(String value) { + addCriterion("attribute_value not like", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueIn(List values) { + addCriterion("attribute_value in", values, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotIn(List values) { + addCriterion("attribute_value not in", values, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueBetween(String value1, String value2) { + addCriterion("attribute_value between", value1, value2, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotBetween(String value1, String value2) { + addCriterion("attribute_value not between", value1, value2, "attributeValue"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategory.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategory.java new file mode 100644 index 00000000..8bb5ffff --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategory.java @@ -0,0 +1,118 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class MaterialCategory { + @TableId(type = IdType.AUTO) + private Long id; + + private String name; + + private Short categoryLevel; + + private Long parentId; + + private String sort; + + private String serialNo; + + private String remark; + + private Date createTime; + + private Date updateTime; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Short getCategoryLevel() { + return categoryLevel; + } + + public void setCategoryLevel(Short categoryLevel) { + this.categoryLevel = categoryLevel; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo == null ? null : serialNo.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategoryExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategoryExample.java new file mode 100644 index 00000000..60a324bd --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCategoryExample.java @@ -0,0 +1,910 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MaterialCategoryExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialCategoryExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIsNull() { + addCriterion("category_level is null"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIsNotNull() { + addCriterion("category_level is not null"); + return (Criteria) this; + } + + public Criteria andCategoryLevelEqualTo(Short value) { + addCriterion("category_level =", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotEqualTo(Short value) { + addCriterion("category_level <>", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelGreaterThan(Short value) { + addCriterion("category_level >", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelGreaterThanOrEqualTo(Short value) { + addCriterion("category_level >=", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelLessThan(Short value) { + addCriterion("category_level <", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelLessThanOrEqualTo(Short value) { + addCriterion("category_level <=", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIn(List values) { + addCriterion("category_level in", values, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotIn(List values) { + addCriterion("category_level not in", values, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelBetween(Short value1, Short value2) { + addCriterion("category_level between", value1, value2, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotBetween(Short value1, Short value2) { + addCriterion("category_level not between", value1, value2, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNull() { + addCriterion("serial_no is null"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNotNull() { + addCriterion("serial_no is not null"); + return (Criteria) this; + } + + public Criteria andSerialNoEqualTo(String value) { + addCriterion("serial_no =", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotEqualTo(String value) { + addCriterion("serial_no <>", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThan(String value) { + addCriterion("serial_no >", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThanOrEqualTo(String value) { + addCriterion("serial_no >=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThan(String value) { + addCriterion("serial_no <", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThanOrEqualTo(String value) { + addCriterion("serial_no <=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLike(String value) { + addCriterion("serial_no like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotLike(String value) { + addCriterion("serial_no not like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoIn(List values) { + addCriterion("serial_no in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotIn(List values) { + addCriterion("serial_no not in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoBetween(String value1, String value2) { + addCriterion("serial_no between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotBetween(String value1, String value2) { + addCriterion("serial_no not between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStock.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStock.java new file mode 100644 index 00000000..2e7e639f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStock.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.entities; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class MaterialCurrentStock { + @TableId(type = IdType.AUTO) + private Long id; + + private Long materialId; + + private Long depotId; + +// @ApiModelProperty("加权单价") +// private BigDecimal weightPrice; +// +// @ApiModelProperty("加权总金额") +// private BigDecimal totalPrice; + + private BigDecimal currentNumber; + + private Long tenantId; + + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStockExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStockExample.java new file mode 100644 index 00000000..daaea0d9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStockExample.java @@ -0,0 +1,570 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialCurrentStockExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialCurrentStockExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIsNull() { + addCriterion("current_number is null"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIsNotNull() { + addCriterion("current_number is not null"); + return (Criteria) this; + } + + public Criteria andCurrentNumberEqualTo(BigDecimal value) { + addCriterion("current_number =", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotEqualTo(BigDecimal value) { + addCriterion("current_number <>", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberGreaterThan(BigDecimal value) { + addCriterion("current_number >", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("current_number >=", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberLessThan(BigDecimal value) { + addCriterion("current_number <", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("current_number <=", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIn(List values) { + addCriterion("current_number in", values, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotIn(List values) { + addCriterion("current_number not in", values, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_number between", value1, value2, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_number not between", value1, value2, "currentNumber"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExample.java new file mode 100644 index 00000000..7a766416 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExample.java @@ -0,0 +1,1600 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCategoryIdIsNull() { + addCriterion("category_id is null"); + return (Criteria) this; + } + + public Criteria andCategoryIdIsNotNull() { + addCriterion("category_id is not null"); + return (Criteria) this; + } + + public Criteria andCategoryIdEqualTo(Long value) { + addCriterion("category_id =", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotEqualTo(Long value) { + addCriterion("category_id <>", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdGreaterThan(Long value) { + addCriterion("category_id >", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) { + addCriterion("category_id >=", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdLessThan(Long value) { + addCriterion("category_id <", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdLessThanOrEqualTo(Long value) { + addCriterion("category_id <=", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdIn(List values) { + addCriterion("category_id in", values, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotIn(List values) { + addCriterion("category_id not in", values, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdBetween(Long value1, Long value2) { + addCriterion("category_id between", value1, value2, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotBetween(Long value1, Long value2) { + addCriterion("category_id not between", value1, value2, "categoryId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andMfrsIsNull() { + addCriterion("mfrs is null"); + return (Criteria) this; + } + + public Criteria andMfrsIsNotNull() { + addCriterion("mfrs is not null"); + return (Criteria) this; + } + + public Criteria andMfrsEqualTo(String value) { + addCriterion("mfrs =", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotEqualTo(String value) { + addCriterion("mfrs <>", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsGreaterThan(String value) { + addCriterion("mfrs >", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsGreaterThanOrEqualTo(String value) { + addCriterion("mfrs >=", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLessThan(String value) { + addCriterion("mfrs <", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLessThanOrEqualTo(String value) { + addCriterion("mfrs <=", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLike(String value) { + addCriterion("mfrs like", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotLike(String value) { + addCriterion("mfrs not like", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsIn(List values) { + addCriterion("mfrs in", values, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotIn(List values) { + addCriterion("mfrs not in", values, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsBetween(String value1, String value2) { + addCriterion("mfrs between", value1, value2, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotBetween(String value1, String value2) { + addCriterion("mfrs not between", value1, value2, "mfrs"); + return (Criteria) this; + } + + public Criteria andModelIsNull() { + addCriterion("model is null"); + return (Criteria) this; + } + + public Criteria andModelIsNotNull() { + addCriterion("model is not null"); + return (Criteria) this; + } + + public Criteria andModelEqualTo(String value) { + addCriterion("model =", value, "model"); + return (Criteria) this; + } + + public Criteria andModelNotEqualTo(String value) { + addCriterion("model <>", value, "model"); + return (Criteria) this; + } + + public Criteria andModelGreaterThan(String value) { + addCriterion("model >", value, "model"); + return (Criteria) this; + } + + public Criteria andModelGreaterThanOrEqualTo(String value) { + addCriterion("model >=", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLessThan(String value) { + addCriterion("model <", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLessThanOrEqualTo(String value) { + addCriterion("model <=", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLike(String value) { + addCriterion("model like", value, "model"); + return (Criteria) this; + } + + public Criteria andModelNotLike(String value) { + addCriterion("model not like", value, "model"); + return (Criteria) this; + } + + public Criteria andModelIn(List values) { + addCriterion("model in", values, "model"); + return (Criteria) this; + } + + public Criteria andModelNotIn(List values) { + addCriterion("model not in", values, "model"); + return (Criteria) this; + } + + public Criteria andModelBetween(String value1, String value2) { + addCriterion("model between", value1, value2, "model"); + return (Criteria) this; + } + + public Criteria andModelNotBetween(String value1, String value2) { + addCriterion("model not between", value1, value2, "model"); + return (Criteria) this; + } + + public Criteria andStandardIsNull() { + addCriterion("standard is null"); + return (Criteria) this; + } + + public Criteria andStandardIsNotNull() { + addCriterion("standard is not null"); + return (Criteria) this; + } + + public Criteria andStandardEqualTo(String value) { + addCriterion("standard =", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotEqualTo(String value) { + addCriterion("standard <>", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardGreaterThan(String value) { + addCriterion("standard >", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardGreaterThanOrEqualTo(String value) { + addCriterion("standard >=", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLessThan(String value) { + addCriterion("standard <", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLessThanOrEqualTo(String value) { + addCriterion("standard <=", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLike(String value) { + addCriterion("standard like", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotLike(String value) { + addCriterion("standard not like", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardIn(List values) { + addCriterion("standard in", values, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotIn(List values) { + addCriterion("standard not in", values, "standard"); + return (Criteria) this; + } + + public Criteria andStandardBetween(String value1, String value2) { + addCriterion("standard between", value1, value2, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotBetween(String value1, String value2) { + addCriterion("standard not between", value1, value2, "standard"); + return (Criteria) this; + } + + public Criteria andColorIsNull() { + addCriterion("color is null"); + return (Criteria) this; + } + + public Criteria andColorIsNotNull() { + addCriterion("color is not null"); + return (Criteria) this; + } + + public Criteria andColorEqualTo(String value) { + addCriterion("color =", value, "color"); + return (Criteria) this; + } + + public Criteria andColorNotEqualTo(String value) { + addCriterion("color <>", value, "color"); + return (Criteria) this; + } + + public Criteria andColorGreaterThan(String value) { + addCriterion("color >", value, "color"); + return (Criteria) this; + } + + public Criteria andColorGreaterThanOrEqualTo(String value) { + addCriterion("color >=", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLessThan(String value) { + addCriterion("color <", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLessThanOrEqualTo(String value) { + addCriterion("color <=", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLike(String value) { + addCriterion("color like", value, "color"); + return (Criteria) this; + } + + public Criteria andColorNotLike(String value) { + addCriterion("color not like", value, "color"); + return (Criteria) this; + } + + public Criteria andColorIn(List values) { + addCriterion("color in", values, "color"); + return (Criteria) this; + } + + public Criteria andColorNotIn(List values) { + addCriterion("color not in", values, "color"); + return (Criteria) this; + } + + public Criteria andColorBetween(String value1, String value2) { + addCriterion("color between", value1, value2, "color"); + return (Criteria) this; + } + + public Criteria andColorNotBetween(String value1, String value2) { + addCriterion("color not between", value1, value2, "color"); + return (Criteria) this; + } + + public Criteria andUnitIsNull() { + addCriterion("unit is null"); + return (Criteria) this; + } + + public Criteria andUnitIsNotNull() { + addCriterion("unit is not null"); + return (Criteria) this; + } + + public Criteria andUnitEqualTo(String value) { + addCriterion("unit =", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotEqualTo(String value) { + addCriterion("unit <>", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitGreaterThan(String value) { + addCriterion("unit >", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitGreaterThanOrEqualTo(String value) { + addCriterion("unit >=", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLessThan(String value) { + addCriterion("unit <", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLessThanOrEqualTo(String value) { + addCriterion("unit <=", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLike(String value) { + addCriterion("unit like", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotLike(String value) { + addCriterion("unit not like", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitIn(List values) { + addCriterion("unit in", values, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotIn(List values) { + addCriterion("unit not in", values, "unit"); + return (Criteria) this; + } + + public Criteria andUnitBetween(String value1, String value2) { + addCriterion("unit between", value1, value2, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotBetween(String value1, String value2) { + addCriterion("unit not between", value1, value2, "unit"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andImgNameIsNull() { + addCriterion("img_name is null"); + return (Criteria) this; + } + + public Criteria andImgNameIsNotNull() { + addCriterion("img_name is not null"); + return (Criteria) this; + } + + public Criteria andImgNameEqualTo(String value) { + addCriterion("img_name =", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotEqualTo(String value) { + addCriterion("img_name <>", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameGreaterThan(String value) { + addCriterion("img_name >", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameGreaterThanOrEqualTo(String value) { + addCriterion("img_name >=", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLessThan(String value) { + addCriterion("img_name <", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLessThanOrEqualTo(String value) { + addCriterion("img_name <=", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLike(String value) { + addCriterion("img_name like", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotLike(String value) { + addCriterion("img_name not like", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameIn(List values) { + addCriterion("img_name in", values, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotIn(List values) { + addCriterion("img_name not in", values, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameBetween(String value1, String value2) { + addCriterion("img_name between", value1, value2, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotBetween(String value1, String value2) { + addCriterion("img_name not between", value1, value2, "imgName"); + return (Criteria) this; + } + + public Criteria andUnitIdIsNull() { + addCriterion("unit_id is null"); + return (Criteria) this; + } + + public Criteria andUnitIdIsNotNull() { + addCriterion("unit_id is not null"); + return (Criteria) this; + } + + public Criteria andUnitIdEqualTo(Long value) { + addCriterion("unit_id =", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotEqualTo(Long value) { + addCriterion("unit_id <>", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdGreaterThan(Long value) { + addCriterion("unit_id >", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdGreaterThanOrEqualTo(Long value) { + addCriterion("unit_id >=", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdLessThan(Long value) { + addCriterion("unit_id <", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdLessThanOrEqualTo(Long value) { + addCriterion("unit_id <=", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdIn(List values) { + addCriterion("unit_id in", values, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotIn(List values) { + addCriterion("unit_id not in", values, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdBetween(Long value1, Long value2) { + addCriterion("unit_id between", value1, value2, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotBetween(Long value1, Long value2) { + addCriterion("unit_id not between", value1, value2, "unitId"); + return (Criteria) this; + } + + public Criteria andExpiryNumIsNull() { + addCriterion("expiry_num is null"); + return (Criteria) this; + } + + public Criteria andExpiryNumIsNotNull() { + addCriterion("expiry_num is not null"); + return (Criteria) this; + } + + public Criteria andExpiryNumEqualTo(Integer value) { + addCriterion("expiry_num =", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotEqualTo(Integer value) { + addCriterion("expiry_num <>", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumGreaterThan(Integer value) { + addCriterion("expiry_num >", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumGreaterThanOrEqualTo(Integer value) { + addCriterion("expiry_num >=", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumLessThan(Integer value) { + addCriterion("expiry_num <", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumLessThanOrEqualTo(Integer value) { + addCriterion("expiry_num <=", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumIn(List values) { + addCriterion("expiry_num in", values, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotIn(List values) { + addCriterion("expiry_num not in", values, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumBetween(Integer value1, Integer value2) { + addCriterion("expiry_num between", value1, value2, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotBetween(Integer value1, Integer value2) { + addCriterion("expiry_num not between", value1, value2, "expiryNum"); + return (Criteria) this; + } + + public Criteria andWeightIsNull() { + addCriterion("weight is null"); + return (Criteria) this; + } + + public Criteria andWeightIsNotNull() { + addCriterion("weight is not null"); + return (Criteria) this; + } + + public Criteria andWeightEqualTo(BigDecimal value) { + addCriterion("weight =", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotEqualTo(BigDecimal value) { + addCriterion("weight <>", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightGreaterThan(BigDecimal value) { + addCriterion("weight >", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("weight >=", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightLessThan(BigDecimal value) { + addCriterion("weight <", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightLessThanOrEqualTo(BigDecimal value) { + addCriterion("weight <=", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightIn(List values) { + addCriterion("weight in", values, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotIn(List values) { + addCriterion("weight not in", values, "weight"); + return (Criteria) this; + } + + public Criteria andWeightBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("weight between", value1, value2, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("weight not between", value1, value2, "weight"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andOtherField1IsNull() { + addCriterion("other_field1 is null"); + return (Criteria) this; + } + + public Criteria andOtherField1IsNotNull() { + addCriterion("other_field1 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField1EqualTo(String value) { + addCriterion("other_field1 =", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotEqualTo(String value) { + addCriterion("other_field1 <>", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1GreaterThan(String value) { + addCriterion("other_field1 >", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1GreaterThanOrEqualTo(String value) { + addCriterion("other_field1 >=", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1LessThan(String value) { + addCriterion("other_field1 <", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1LessThanOrEqualTo(String value) { + addCriterion("other_field1 <=", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1Like(String value) { + addCriterion("other_field1 like", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotLike(String value) { + addCriterion("other_field1 not like", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1In(List values) { + addCriterion("other_field1 in", values, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotIn(List values) { + addCriterion("other_field1 not in", values, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1Between(String value1, String value2) { + addCriterion("other_field1 between", value1, value2, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotBetween(String value1, String value2) { + addCriterion("other_field1 not between", value1, value2, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField2IsNull() { + addCriterion("other_field2 is null"); + return (Criteria) this; + } + + public Criteria andOtherField2IsNotNull() { + addCriterion("other_field2 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField2EqualTo(String value) { + addCriterion("other_field2 =", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotEqualTo(String value) { + addCriterion("other_field2 <>", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2GreaterThan(String value) { + addCriterion("other_field2 >", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2GreaterThanOrEqualTo(String value) { + addCriterion("other_field2 >=", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2LessThan(String value) { + addCriterion("other_field2 <", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2LessThanOrEqualTo(String value) { + addCriterion("other_field2 <=", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2Like(String value) { + addCriterion("other_field2 like", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotLike(String value) { + addCriterion("other_field2 not like", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2In(List values) { + addCriterion("other_field2 in", values, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotIn(List values) { + addCriterion("other_field2 not in", values, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2Between(String value1, String value2) { + addCriterion("other_field2 between", value1, value2, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotBetween(String value1, String value2) { + addCriterion("other_field2 not between", value1, value2, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField3IsNull() { + addCriterion("other_field3 is null"); + return (Criteria) this; + } + + public Criteria andOtherField3IsNotNull() { + addCriterion("other_field3 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField3EqualTo(String value) { + addCriterion("other_field3 =", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotEqualTo(String value) { + addCriterion("other_field3 <>", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3GreaterThan(String value) { + addCriterion("other_field3 >", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3GreaterThanOrEqualTo(String value) { + addCriterion("other_field3 >=", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3LessThan(String value) { + addCriterion("other_field3 <", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3LessThanOrEqualTo(String value) { + addCriterion("other_field3 <=", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3Like(String value) { + addCriterion("other_field3 like", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotLike(String value) { + addCriterion("other_field3 not like", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3In(List values) { + addCriterion("other_field3 in", values, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotIn(List values) { + addCriterion("other_field3 not in", values, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3Between(String value1, String value2) { + addCriterion("other_field3 between", value1, value2, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotBetween(String value1, String value2) { + addCriterion("other_field3 not between", value1, value2, "otherField3"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIsNull() { + addCriterion("enable_serial_number is null"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIsNotNull() { + addCriterion("enable_serial_number is not null"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberEqualTo(String value) { + addCriterion("enable_serial_number =", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotEqualTo(String value) { + addCriterion("enable_serial_number <>", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberGreaterThan(String value) { + addCriterion("enable_serial_number >", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("enable_serial_number >=", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLessThan(String value) { + addCriterion("enable_serial_number <", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLessThanOrEqualTo(String value) { + addCriterion("enable_serial_number <=", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLike(String value) { + addCriterion("enable_serial_number like", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotLike(String value) { + addCriterion("enable_serial_number not like", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIn(List values) { + addCriterion("enable_serial_number in", values, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotIn(List values) { + addCriterion("enable_serial_number not in", values, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberBetween(String value1, String value2) { + addCriterion("enable_serial_number between", value1, value2, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotBetween(String value1, String value2) { + addCriterion("enable_serial_number not between", value1, value2, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIsNull() { + addCriterion("enable_batch_number is null"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIsNotNull() { + addCriterion("enable_batch_number is not null"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberEqualTo(String value) { + addCriterion("enable_batch_number =", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotEqualTo(String value) { + addCriterion("enable_batch_number <>", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberGreaterThan(String value) { + addCriterion("enable_batch_number >", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberGreaterThanOrEqualTo(String value) { + addCriterion("enable_batch_number >=", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLessThan(String value) { + addCriterion("enable_batch_number <", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLessThanOrEqualTo(String value) { + addCriterion("enable_batch_number <=", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLike(String value) { + addCriterion("enable_batch_number like", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotLike(String value) { + addCriterion("enable_batch_number not like", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIn(List values) { + addCriterion("enable_batch_number in", values, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotIn(List values) { + addCriterion("enable_batch_number not in", values, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberBetween(String value1, String value2) { + addCriterion("enable_batch_number between", value1, value2, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotBetween(String value1, String value2) { + addCriterion("enable_batch_number not between", value1, value2, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtend.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtend.java new file mode 100644 index 00000000..3c504008 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtend.java @@ -0,0 +1,49 @@ +package com.zsw.erp.datasource.entities; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class MaterialExtend { + @TableId(type = IdType.AUTO) + private Long id; + + private Long materialId; + + private String barCode; + + private String commodityUnit; + + private String sku; + + private BigDecimal purchaseDecimal; + +// @ApiModelProperty("加权单价") +// private BigDecimal weightDecimal; + + private BigDecimal commodityDecimal; + + private BigDecimal wholesaleDecimal; + + private BigDecimal lowDecimal; + + private String defaultFlag; + + private Date createTime; + + private String createSerial; + + private String updateSerial; + + private Long updateTime; + + private Long tenantId; + + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtendExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtendExample.java new file mode 100644 index 00000000..61096a01 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtendExample.java @@ -0,0 +1,1231 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MaterialExtendExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialExtendExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andBarCodeIsNull() { + addCriterion("bar_code is null"); + return (Criteria) this; + } + + public Criteria andBarCodeIsNotNull() { + addCriterion("bar_code is not null"); + return (Criteria) this; + } + + public Criteria andBarCodeEqualTo(String value) { + addCriterion("bar_code =", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotEqualTo(String value) { + addCriterion("bar_code <>", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeGreaterThan(String value) { + addCriterion("bar_code >", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeGreaterThanOrEqualTo(String value) { + addCriterion("bar_code >=", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLessThan(String value) { + addCriterion("bar_code <", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLessThanOrEqualTo(String value) { + addCriterion("bar_code <=", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLike(String value) { + addCriterion("bar_code like", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotLike(String value) { + addCriterion("bar_code not like", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeIn(List values) { + addCriterion("bar_code in", values, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotIn(List values) { + addCriterion("bar_code not in", values, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeBetween(String value1, String value2) { + addCriterion("bar_code between", value1, value2, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotBetween(String value1, String value2) { + addCriterion("bar_code not between", value1, value2, "barCode"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIsNull() { + addCriterion("commodity_unit is null"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIsNotNull() { + addCriterion("commodity_unit is not null"); + return (Criteria) this; + } + + public Criteria andCommodityUnitEqualTo(String value) { + addCriterion("commodity_unit =", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotEqualTo(String value) { + addCriterion("commodity_unit <>", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitGreaterThan(String value) { + addCriterion("commodity_unit >", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitGreaterThanOrEqualTo(String value) { + addCriterion("commodity_unit >=", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLessThan(String value) { + addCriterion("commodity_unit <", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLessThanOrEqualTo(String value) { + addCriterion("commodity_unit <=", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLike(String value) { + addCriterion("commodity_unit like", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotLike(String value) { + addCriterion("commodity_unit not like", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIn(List values) { + addCriterion("commodity_unit in", values, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotIn(List values) { + addCriterion("commodity_unit not in", values, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitBetween(String value1, String value2) { + addCriterion("commodity_unit between", value1, value2, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotBetween(String value1, String value2) { + addCriterion("commodity_unit not between", value1, value2, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andSkuIsNull() { + addCriterion("sku is null"); + return (Criteria) this; + } + + public Criteria andSkuIsNotNull() { + addCriterion("sku is not null"); + return (Criteria) this; + } + + public Criteria andSkuEqualTo(String value) { + addCriterion("sku =", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotEqualTo(String value) { + addCriterion("sku <>", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThan(String value) { + addCriterion("sku >", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThanOrEqualTo(String value) { + addCriterion("sku >=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThan(String value) { + addCriterion("sku <", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThanOrEqualTo(String value) { + addCriterion("sku <=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLike(String value) { + addCriterion("sku like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotLike(String value) { + addCriterion("sku not like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuIn(List values) { + addCriterion("sku in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotIn(List values) { + addCriterion("sku not in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuBetween(String value1, String value2) { + addCriterion("sku between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotBetween(String value1, String value2) { + addCriterion("sku not between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIsNull() { + addCriterion("purchase_decimal is null"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIsNotNull() { + addCriterion("purchase_decimal is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalEqualTo(BigDecimal value) { + addCriterion("purchase_decimal =", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotEqualTo(BigDecimal value) { + addCriterion("purchase_decimal <>", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalGreaterThan(BigDecimal value) { + addCriterion("purchase_decimal >", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_decimal >=", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalLessThan(BigDecimal value) { + addCriterion("purchase_decimal <", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_decimal <=", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIn(List values) { + addCriterion("purchase_decimal in", values, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotIn(List values) { + addCriterion("purchase_decimal not in", values, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_decimal between", value1, value2, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_decimal not between", value1, value2, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIsNull() { + addCriterion("commodity_decimal is null"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIsNotNull() { + addCriterion("commodity_decimal is not null"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalEqualTo(BigDecimal value) { + addCriterion("commodity_decimal =", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotEqualTo(BigDecimal value) { + addCriterion("commodity_decimal <>", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalGreaterThan(BigDecimal value) { + addCriterion("commodity_decimal >", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("commodity_decimal >=", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalLessThan(BigDecimal value) { + addCriterion("commodity_decimal <", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("commodity_decimal <=", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIn(List values) { + addCriterion("commodity_decimal in", values, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotIn(List values) { + addCriterion("commodity_decimal not in", values, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("commodity_decimal between", value1, value2, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("commodity_decimal not between", value1, value2, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIsNull() { + addCriterion("wholesale_decimal is null"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIsNotNull() { + addCriterion("wholesale_decimal is not null"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal =", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal <>", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalGreaterThan(BigDecimal value) { + addCriterion("wholesale_decimal >", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal >=", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalLessThan(BigDecimal value) { + addCriterion("wholesale_decimal <", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal <=", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIn(List values) { + addCriterion("wholesale_decimal in", values, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotIn(List values) { + addCriterion("wholesale_decimal not in", values, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("wholesale_decimal between", value1, value2, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("wholesale_decimal not between", value1, value2, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalIsNull() { + addCriterion("low_decimal is null"); + return (Criteria) this; + } + + public Criteria andLowDecimalIsNotNull() { + addCriterion("low_decimal is not null"); + return (Criteria) this; + } + + public Criteria andLowDecimalEqualTo(BigDecimal value) { + addCriterion("low_decimal =", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotEqualTo(BigDecimal value) { + addCriterion("low_decimal <>", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalGreaterThan(BigDecimal value) { + addCriterion("low_decimal >", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("low_decimal >=", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalLessThan(BigDecimal value) { + addCriterion("low_decimal <", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("low_decimal <=", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalIn(List values) { + addCriterion("low_decimal in", values, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotIn(List values) { + addCriterion("low_decimal not in", values, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_decimal between", value1, value2, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_decimal not between", value1, value2, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIsNull() { + addCriterion("default_flag is null"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIsNotNull() { + addCriterion("default_flag is not null"); + return (Criteria) this; + } + + public Criteria andDefaultFlagEqualTo(String value) { + addCriterion("default_flag =", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotEqualTo(String value) { + addCriterion("default_flag <>", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagGreaterThan(String value) { + addCriterion("default_flag >", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagGreaterThanOrEqualTo(String value) { + addCriterion("default_flag >=", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLessThan(String value) { + addCriterion("default_flag <", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLessThanOrEqualTo(String value) { + addCriterion("default_flag <=", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLike(String value) { + addCriterion("default_flag like", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotLike(String value) { + addCriterion("default_flag not like", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIn(List values) { + addCriterion("default_flag in", values, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotIn(List values) { + addCriterion("default_flag not in", values, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagBetween(String value1, String value2) { + addCriterion("default_flag between", value1, value2, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotBetween(String value1, String value2) { + addCriterion("default_flag not between", value1, value2, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateSerialIsNull() { + addCriterion("create_serial is null"); + return (Criteria) this; + } + + public Criteria andCreateSerialIsNotNull() { + addCriterion("create_serial is not null"); + return (Criteria) this; + } + + public Criteria andCreateSerialEqualTo(String value) { + addCriterion("create_serial =", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotEqualTo(String value) { + addCriterion("create_serial <>", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialGreaterThan(String value) { + addCriterion("create_serial >", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialGreaterThanOrEqualTo(String value) { + addCriterion("create_serial >=", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLessThan(String value) { + addCriterion("create_serial <", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLessThanOrEqualTo(String value) { + addCriterion("create_serial <=", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLike(String value) { + addCriterion("create_serial like", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotLike(String value) { + addCriterion("create_serial not like", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialIn(List values) { + addCriterion("create_serial in", values, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotIn(List values) { + addCriterion("create_serial not in", values, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialBetween(String value1, String value2) { + addCriterion("create_serial between", value1, value2, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotBetween(String value1, String value2) { + addCriterion("create_serial not between", value1, value2, "createSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIsNull() { + addCriterion("update_serial is null"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIsNotNull() { + addCriterion("update_serial is not null"); + return (Criteria) this; + } + + public Criteria andUpdateSerialEqualTo(String value) { + addCriterion("update_serial =", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotEqualTo(String value) { + addCriterion("update_serial <>", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialGreaterThan(String value) { + addCriterion("update_serial >", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialGreaterThanOrEqualTo(String value) { + addCriterion("update_serial >=", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLessThan(String value) { + addCriterion("update_serial <", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLessThanOrEqualTo(String value) { + addCriterion("update_serial <=", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLike(String value) { + addCriterion("update_serial like", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotLike(String value) { + addCriterion("update_serial not like", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIn(List values) { + addCriterion("update_serial in", values, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotIn(List values) { + addCriterion("update_serial not in", values, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialBetween(String value1, String value2) { + addCriterion("update_serial between", value1, value2, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotBetween(String value1, String value2) { + addCriterion("update_serial not between", value1, value2, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStock.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStock.java new file mode 100644 index 00000000..52b39e2b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStock.java @@ -0,0 +1,36 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class MaterialInitialStock { + @TableId(type = IdType.AUTO) + private Long id; + + private Long materialId; + + private Long depotId; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + + private BigDecimal number = BigDecimal.ZERO; + + @ApiModelProperty("总金额") + private BigDecimal totalPrice = BigDecimal.ZERO; + + private Long tenantId; + + @TableLogic + private String deleteFlag; + + + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStockExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStockExample.java new file mode 100644 index 00000000..73b82ed0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStockExample.java @@ -0,0 +1,690 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialInitialStockExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialInitialStockExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(BigDecimal value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(BigDecimal value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(BigDecimal value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(BigDecimal value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIsNull() { + addCriterion("low_safe_stock is null"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIsNotNull() { + addCriterion("low_safe_stock is not null"); + return (Criteria) this; + } + + public Criteria andLowSafeStockEqualTo(BigDecimal value) { + addCriterion("low_safe_stock =", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotEqualTo(BigDecimal value) { + addCriterion("low_safe_stock <>", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockGreaterThan(BigDecimal value) { + addCriterion("low_safe_stock >", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("low_safe_stock >=", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockLessThan(BigDecimal value) { + addCriterion("low_safe_stock <", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockLessThanOrEqualTo(BigDecimal value) { + addCriterion("low_safe_stock <=", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIn(List values) { + addCriterion("low_safe_stock in", values, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotIn(List values) { + addCriterion("low_safe_stock not in", values, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_safe_stock between", value1, value2, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_safe_stock not between", value1, value2, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIsNull() { + addCriterion("high_safe_stock is null"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIsNotNull() { + addCriterion("high_safe_stock is not null"); + return (Criteria) this; + } + + public Criteria andHighSafeStockEqualTo(BigDecimal value) { + addCriterion("high_safe_stock =", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotEqualTo(BigDecimal value) { + addCriterion("high_safe_stock <>", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockGreaterThan(BigDecimal value) { + addCriterion("high_safe_stock >", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("high_safe_stock >=", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockLessThan(BigDecimal value) { + addCriterion("high_safe_stock <", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockLessThanOrEqualTo(BigDecimal value) { + addCriterion("high_safe_stock <=", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIn(List values) { + addCriterion("high_safe_stock in", values, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotIn(List values) { + addCriterion("high_safe_stock not in", values, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("high_safe_stock between", value1, value2, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("high_safe_stock not between", value1, value2, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialProperty.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialProperty.java new file mode 100644 index 00000000..0d72aa0b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialProperty.java @@ -0,0 +1,66 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class MaterialProperty { + @TableId(type = IdType.AUTO) + private Long id; + + private String nativeName; + + private Boolean enabled; + + private String sort; + + private String anotherName; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNativeName() { + return nativeName; + } + + public void setNativeName(String nativeName) { + this.nativeName = nativeName == null ? null : nativeName.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getAnotherName() { + return anotherName; + } + + public void setAnotherName(String anotherName) { + this.anotherName = anotherName == null ? null : anotherName.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialPropertyExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialPropertyExample.java new file mode 100644 index 00000000..1f1900e9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialPropertyExample.java @@ -0,0 +1,599 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class MaterialPropertyExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialPropertyExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNativeNameIsNull() { + addCriterion("native_name is null"); + return (Criteria) this; + } + + public Criteria andNativeNameIsNotNull() { + addCriterion("native_name is not null"); + return (Criteria) this; + } + + public Criteria andNativeNameEqualTo(String value) { + addCriterion("native_name =", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotEqualTo(String value) { + addCriterion("native_name <>", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameGreaterThan(String value) { + addCriterion("native_name >", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameGreaterThanOrEqualTo(String value) { + addCriterion("native_name >=", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLessThan(String value) { + addCriterion("native_name <", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLessThanOrEqualTo(String value) { + addCriterion("native_name <=", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLike(String value) { + addCriterion("native_name like", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotLike(String value) { + addCriterion("native_name not like", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameIn(List values) { + addCriterion("native_name in", values, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotIn(List values) { + addCriterion("native_name not in", values, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameBetween(String value1, String value2) { + addCriterion("native_name between", value1, value2, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotBetween(String value1, String value2) { + addCriterion("native_name not between", value1, value2, "nativeName"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andAnotherNameIsNull() { + addCriterion("another_name is null"); + return (Criteria) this; + } + + public Criteria andAnotherNameIsNotNull() { + addCriterion("another_name is not null"); + return (Criteria) this; + } + + public Criteria andAnotherNameEqualTo(String value) { + addCriterion("another_name =", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotEqualTo(String value) { + addCriterion("another_name <>", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameGreaterThan(String value) { + addCriterion("another_name >", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameGreaterThanOrEqualTo(String value) { + addCriterion("another_name >=", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLessThan(String value) { + addCriterion("another_name <", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLessThanOrEqualTo(String value) { + addCriterion("another_name <=", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLike(String value) { + addCriterion("another_name like", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotLike(String value) { + addCriterion("another_name not like", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameIn(List values) { + addCriterion("another_name in", values, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotIn(List values) { + addCriterion("another_name not in", values, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameBetween(String value1, String value2) { + addCriterion("another_name between", value1, value2, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotBetween(String value1, String value2) { + addCriterion("another_name not between", value1, value2, "anotherName"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialVo4Unit.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialVo4Unit.java new file mode 100644 index 00000000..fa4577e9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialVo4Unit.java @@ -0,0 +1,83 @@ +package com.zsw.erp.datasource.entities; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; + +@Data +@Slf4j +public class MaterialVo4Unit extends Material{ + + private String unitName; + + private String categoryName; + + private String materialOther; + + private BigDecimal stock; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal purchaseDecimal; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal commodityDecimal; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wholesaleDecimal; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal lowDecimal; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal billPrice; + + @JsonProperty("mBarCode") + private String mBarCode; + + private String commodityUnit; + + private Long meId; + + private BigDecimal initialStock; + + private BigDecimal initialPrice; + + private BigDecimal currentStock; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal currentStockPrice; + + @ApiModelProperty("多规格?") + private String sku; + + private Long depotId; + + @ApiModelProperty("加权单价") + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal weightPrice; + + @ApiModelProperty("加权总金额") + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal totalPrice; + + @ApiModelProperty("入库数量") + private BigDecimal intoStock; + + @ApiModelProperty("出库数量") + private BigDecimal outStock; + + @ApiModelProperty("入库金额") + private BigDecimal intoPrice; + + @ApiModelProperty("出库金额") + private BigDecimal outPrice; + + + + + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialWithInitStock.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialWithInitStock.java new file mode 100644 index 00000000..53ddcd47 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialWithInitStock.java @@ -0,0 +1,17 @@ +package com.zsw.erp.datasource.entities; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.dto.StockInitDto; +import lombok.Data; + +import java.util.Map; + +@Data +public class MaterialWithInitStock extends Material { + + private Map stockMap; + + private JSONObject materialExObj; + + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Msg.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Msg.java new file mode 100644 index 00000000..ae2149cb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Msg.java @@ -0,0 +1,264 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Msg { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.id + * + * @mbggenerated + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.msg_title + * + * @mbggenerated + */ + private String msgTitle; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.msg_content + * + * @mbggenerated + */ + private String msgContent; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.create_time + * + * @mbggenerated + */ + private Date createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.type + * + * @mbggenerated + */ + private String type; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.status + * + * @mbggenerated + */ + private String status; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.tenant_id + * + * @mbggenerated + */ + private Long tenantId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_msg.delete_Flag + * + * @mbggenerated + */ + private String deleteFlag; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.id + * + * @return the value of jsh_msg.id + * + * @mbggenerated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.id + * + * @param id the value for jsh_msg.id + * + * @mbggenerated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.msg_title + * + * @return the value of jsh_msg.msg_title + * + * @mbggenerated + */ + public String getMsgTitle() { + return msgTitle; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.msg_title + * + * @param msgTitle the value for jsh_msg.msg_title + * + * @mbggenerated + */ + public void setMsgTitle(String msgTitle) { + this.msgTitle = msgTitle == null ? null : msgTitle.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.msg_content + * + * @return the value of jsh_msg.msg_content + * + * @mbggenerated + */ + public String getMsgContent() { + return msgContent; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.msg_content + * + * @param msgContent the value for jsh_msg.msg_content + * + * @mbggenerated + */ + public void setMsgContent(String msgContent) { + this.msgContent = msgContent == null ? null : msgContent.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.create_time + * + * @return the value of jsh_msg.create_time + * + * @mbggenerated + */ + public Date getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.create_time + * + * @param createTime the value for jsh_msg.create_time + * + * @mbggenerated + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.type + * + * @return the value of jsh_msg.type + * + * @mbggenerated + */ + public String getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.type + * + * @param type the value for jsh_msg.type + * + * @mbggenerated + */ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.status + * + * @return the value of jsh_msg.status + * + * @mbggenerated + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.status + * + * @param status the value for jsh_msg.status + * + * @mbggenerated + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.tenant_id + * + * @return the value of jsh_msg.tenant_id + * + * @mbggenerated + */ + public Long getTenantId() { + return tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.tenant_id + * + * @param tenantId the value for jsh_msg.tenant_id + * + * @mbggenerated + */ + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_msg.delete_Flag + * + * @return the value of jsh_msg.delete_Flag + * + * @mbggenerated + */ + public String getDeleteFlag() { + return deleteFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_msg.delete_Flag + * + * @param deleteFlag the value for jsh_msg.delete_Flag + * + * @mbggenerated + */ + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgEx.java new file mode 100644 index 00000000..a1d56984 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgEx.java @@ -0,0 +1,14 @@ +package com.zsw.erp.datasource.entities; + +public class MsgEx extends Msg{ + + private String createTimeStr; + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgExample.java new file mode 100644 index 00000000..577c681f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MsgExample.java @@ -0,0 +1,833 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MsgExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_msg + * + * @mbggenerated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_msg + * + * @mbggenerated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_msg + * + * @mbggenerated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public MsgExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_msg + * + * @mbggenerated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMsgTitleIsNull() { + addCriterion("msg_title is null"); + return (Criteria) this; + } + + public Criteria andMsgTitleIsNotNull() { + addCriterion("msg_title is not null"); + return (Criteria) this; + } + + public Criteria andMsgTitleEqualTo(String value) { + addCriterion("msg_title =", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotEqualTo(String value) { + addCriterion("msg_title <>", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleGreaterThan(String value) { + addCriterion("msg_title >", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleGreaterThanOrEqualTo(String value) { + addCriterion("msg_title >=", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLessThan(String value) { + addCriterion("msg_title <", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLessThanOrEqualTo(String value) { + addCriterion("msg_title <=", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLike(String value) { + addCriterion("msg_title like", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotLike(String value) { + addCriterion("msg_title not like", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleIn(List values) { + addCriterion("msg_title in", values, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotIn(List values) { + addCriterion("msg_title not in", values, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleBetween(String value1, String value2) { + addCriterion("msg_title between", value1, value2, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotBetween(String value1, String value2) { + addCriterion("msg_title not between", value1, value2, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgContentIsNull() { + addCriterion("msg_content is null"); + return (Criteria) this; + } + + public Criteria andMsgContentIsNotNull() { + addCriterion("msg_content is not null"); + return (Criteria) this; + } + + public Criteria andMsgContentEqualTo(String value) { + addCriterion("msg_content =", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotEqualTo(String value) { + addCriterion("msg_content <>", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentGreaterThan(String value) { + addCriterion("msg_content >", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentGreaterThanOrEqualTo(String value) { + addCriterion("msg_content >=", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLessThan(String value) { + addCriterion("msg_content <", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLessThanOrEqualTo(String value) { + addCriterion("msg_content <=", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLike(String value) { + addCriterion("msg_content like", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotLike(String value) { + addCriterion("msg_content not like", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentIn(List values) { + addCriterion("msg_content in", values, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotIn(List values) { + addCriterion("msg_content not in", values, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentBetween(String value1, String value2) { + addCriterion("msg_content between", value1, value2, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotBetween(String value1, String value2) { + addCriterion("msg_content not between", value1, value2, "msgContent"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_msg + * + * @mbggenerated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_msg + * + * @mbggenerated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRel.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRel.java new file mode 100644 index 00000000..f4194069 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRel.java @@ -0,0 +1,328 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class OrgaUserRel { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.id + * + * @mbggenerated + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + private Long orgaId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + private Long userId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + private String userBlngOrgaDsplSeq; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + private String deleteFlag; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + private Date createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.creator + * + * @mbggenerated + */ + private Long creator; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + private Date updateTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.updater + * + * @mbggenerated + */ + private Long updater; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + private Long tenantId; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.id + * + * @return the value of jsh_orga_user_rel.id + * + * @mbggenerated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.id + * + * @param id the value for jsh_orga_user_rel.id + * + * @mbggenerated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.orga_id + * + * @return the value of jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + public Long getOrgaId() { + return orgaId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.orga_id + * + * @param orgaId the value for jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + public void setOrgaId(Long orgaId) { + this.orgaId = orgaId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.user_id + * + * @return the value of jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.user_id + * + * @param userId the value for jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @return the value of jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + public String getUserBlngOrgaDsplSeq() { + return userBlngOrgaDsplSeq; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @param userBlngOrgaDsplSeq the value for jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + public void setUserBlngOrgaDsplSeq(String userBlngOrgaDsplSeq) { + this.userBlngOrgaDsplSeq = userBlngOrgaDsplSeq == null ? null : userBlngOrgaDsplSeq.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.delete_flag + * + * @return the value of jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + public String getDeleteFlag() { + return deleteFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.delete_flag + * + * @param deleteFlag the value for jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.create_time + * + * @return the value of jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + public Date getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.create_time + * + * @param createTime the value for jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.creator + * + * @return the value of jsh_orga_user_rel.creator + * + * @mbggenerated + */ + public Long getCreator() { + return creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.creator + * + * @param creator the value for jsh_orga_user_rel.creator + * + * @mbggenerated + */ + public void setCreator(Long creator) { + this.creator = creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.update_time + * + * @return the value of jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + public Date getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.update_time + * + * @param updateTime the value for jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.updater + * + * @return the value of jsh_orga_user_rel.updater + * + * @mbggenerated + */ + public Long getUpdater() { + return updater; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.updater + * + * @param updater the value for jsh_orga_user_rel.updater + * + * @mbggenerated + */ + public void setUpdater(Long updater) { + this.updater = updater; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.tenant_id + * + * @return the value of jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + public Long getTenantId() { + return tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.tenant_id + * + * @param tenantId the value for jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelEx.java new file mode 100644 index 00000000..c76701ad --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelEx.java @@ -0,0 +1,10 @@ +package com.zsw.erp.datasource.entities; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/12 10:09 + */ +public class OrgaUserRelEx extends OrgaUserRel { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelExample.java new file mode 100644 index 00000000..4e38cdd7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrgaUserRelExample.java @@ -0,0 +1,923 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class OrgaUserRelExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public OrgaUserRelExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrgaIdIsNull() { + addCriterion("orga_id is null"); + return (Criteria) this; + } + + public Criteria andOrgaIdIsNotNull() { + addCriterion("orga_id is not null"); + return (Criteria) this; + } + + public Criteria andOrgaIdEqualTo(Long value) { + addCriterion("orga_id =", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotEqualTo(Long value) { + addCriterion("orga_id <>", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdGreaterThan(Long value) { + addCriterion("orga_id >", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdGreaterThanOrEqualTo(Long value) { + addCriterion("orga_id >=", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdLessThan(Long value) { + addCriterion("orga_id <", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdLessThanOrEqualTo(Long value) { + addCriterion("orga_id <=", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdIn(List values) { + addCriterion("orga_id in", values, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotIn(List values) { + addCriterion("orga_id not in", values, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdBetween(Long value1, Long value2) { + addCriterion("orga_id between", value1, value2, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotBetween(Long value1, Long value2) { + addCriterion("orga_id not between", value1, value2, "orgaId"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIsNull() { + addCriterion("user_blng_orga_dspl_seq is null"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIsNotNull() { + addCriterion("user_blng_orga_dspl_seq is not null"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq =", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq <>", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqGreaterThan(String value) { + addCriterion("user_blng_orga_dspl_seq >", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqGreaterThanOrEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq >=", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLessThan(String value) { + addCriterion("user_blng_orga_dspl_seq <", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLessThanOrEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq <=", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLike(String value) { + addCriterion("user_blng_orga_dspl_seq like", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotLike(String value) { + addCriterion("user_blng_orga_dspl_seq not like", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIn(List values) { + addCriterion("user_blng_orga_dspl_seq in", values, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotIn(List values) { + addCriterion("user_blng_orga_dspl_seq not in", values, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqBetween(String value1, String value2) { + addCriterion("user_blng_orga_dspl_seq between", value1, value2, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotBetween(String value1, String value2) { + addCriterion("user_blng_orga_dspl_seq not between", value1, value2, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(Long value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(Long value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(Long value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(Long value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(Long value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(Long value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(Long value1, Long value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(Long value1, Long value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Organization.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Organization.java new file mode 100644 index 00000000..1fd27f3e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Organization.java @@ -0,0 +1,108 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Organization { + @TableId(type = IdType.AUTO) + private Long id; + + private String orgNo; + + private String orgAbr; + + private Long parentId; + + private String sort; + + private String remark; + + private Date createTime; + + private Date updateTime; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrgNo() { + return orgNo; + } + + public void setOrgNo(String orgNo) { + this.orgNo = orgNo == null ? null : orgNo.trim(); + } + + public String getOrgAbr() { + return orgAbr; + } + + public void setOrgAbr(String orgAbr) { + this.orgAbr = orgAbr == null ? null : orgAbr.trim(); + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrganizationExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrganizationExample.java new file mode 100644 index 00000000..19eb3647 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/OrganizationExample.java @@ -0,0 +1,850 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class OrganizationExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public OrganizationExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrgNoIsNull() { + addCriterion("org_no is null"); + return (Criteria) this; + } + + public Criteria andOrgNoIsNotNull() { + addCriterion("org_no is not null"); + return (Criteria) this; + } + + public Criteria andOrgNoEqualTo(String value) { + addCriterion("org_no =", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotEqualTo(String value) { + addCriterion("org_no <>", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoGreaterThan(String value) { + addCriterion("org_no >", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoGreaterThanOrEqualTo(String value) { + addCriterion("org_no >=", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLessThan(String value) { + addCriterion("org_no <", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLessThanOrEqualTo(String value) { + addCriterion("org_no <=", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLike(String value) { + addCriterion("org_no like", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotLike(String value) { + addCriterion("org_no not like", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoIn(List values) { + addCriterion("org_no in", values, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotIn(List values) { + addCriterion("org_no not in", values, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoBetween(String value1, String value2) { + addCriterion("org_no between", value1, value2, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotBetween(String value1, String value2) { + addCriterion("org_no not between", value1, value2, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgAbrIsNull() { + addCriterion("org_abr is null"); + return (Criteria) this; + } + + public Criteria andOrgAbrIsNotNull() { + addCriterion("org_abr is not null"); + return (Criteria) this; + } + + public Criteria andOrgAbrEqualTo(String value) { + addCriterion("org_abr =", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotEqualTo(String value) { + addCriterion("org_abr <>", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrGreaterThan(String value) { + addCriterion("org_abr >", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrGreaterThanOrEqualTo(String value) { + addCriterion("org_abr >=", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLessThan(String value) { + addCriterion("org_abr <", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLessThanOrEqualTo(String value) { + addCriterion("org_abr <=", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLike(String value) { + addCriterion("org_abr like", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotLike(String value) { + addCriterion("org_abr not like", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrIn(List values) { + addCriterion("org_abr in", values, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotIn(List values) { + addCriterion("org_abr not in", values, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrBetween(String value1, String value2) { + addCriterion("org_abr between", value1, value2, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotBetween(String value1, String value2) { + addCriterion("org_abr not between", value1, value2, "orgAbr"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Person.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Person.java new file mode 100644 index 00000000..e90fd4d2 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Person.java @@ -0,0 +1,57 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Person { + @TableId(type = IdType.AUTO) + private Long id; + + private String type; + + private String name; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PersonExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PersonExample.java new file mode 100644 index 00000000..b1df7023 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PersonExample.java @@ -0,0 +1,529 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class PersonExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PersonExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfig.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfig.java new file mode 100644 index 00000000..1d9ac0a1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfig.java @@ -0,0 +1,46 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class PlatformConfig { + @TableId(type = IdType.AUTO) + private Long id; + + private String platformKey; + + private String platformKeyInfo; + + private String platformValue; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPlatformKey() { + return platformKey; + } + + public void setPlatformKey(String platformKey) { + this.platformKey = platformKey == null ? null : platformKey.trim(); + } + + public String getPlatformKeyInfo() { + return platformKeyInfo; + } + + public void setPlatformKeyInfo(String platformKeyInfo) { + this.platformKeyInfo = platformKeyInfo == null ? null : platformKeyInfo.trim(); + } + + public String getPlatformValue() { + return platformValue; + } + + public void setPlatformValue(String platformValue) { + this.platformValue = platformValue == null ? null : platformValue.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfigExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfigExample.java new file mode 100644 index 00000000..c7b6958b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/PlatformConfigExample.java @@ -0,0 +1,469 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class PlatformConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PlatformConfigExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIsNull() { + addCriterion("platform_key is null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIsNotNull() { + addCriterion("platform_key is not null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyEqualTo(String value) { + addCriterion("platform_key =", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotEqualTo(String value) { + addCriterion("platform_key <>", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyGreaterThan(String value) { + addCriterion("platform_key >", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyGreaterThanOrEqualTo(String value) { + addCriterion("platform_key >=", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLessThan(String value) { + addCriterion("platform_key <", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLessThanOrEqualTo(String value) { + addCriterion("platform_key <=", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLike(String value) { + addCriterion("platform_key like", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotLike(String value) { + addCriterion("platform_key not like", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIn(List values) { + addCriterion("platform_key in", values, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotIn(List values) { + addCriterion("platform_key not in", values, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyBetween(String value1, String value2) { + addCriterion("platform_key between", value1, value2, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotBetween(String value1, String value2) { + addCriterion("platform_key not between", value1, value2, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIsNull() { + addCriterion("platform_key_info is null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIsNotNull() { + addCriterion("platform_key_info is not null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoEqualTo(String value) { + addCriterion("platform_key_info =", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotEqualTo(String value) { + addCriterion("platform_key_info <>", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoGreaterThan(String value) { + addCriterion("platform_key_info >", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoGreaterThanOrEqualTo(String value) { + addCriterion("platform_key_info >=", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLessThan(String value) { + addCriterion("platform_key_info <", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLessThanOrEqualTo(String value) { + addCriterion("platform_key_info <=", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLike(String value) { + addCriterion("platform_key_info like", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotLike(String value) { + addCriterion("platform_key_info not like", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIn(List values) { + addCriterion("platform_key_info in", values, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotIn(List values) { + addCriterion("platform_key_info not in", values, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoBetween(String value1, String value2) { + addCriterion("platform_key_info between", value1, value2, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotBetween(String value1, String value2) { + addCriterion("platform_key_info not between", value1, value2, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformValueIsNull() { + addCriterion("platform_value is null"); + return (Criteria) this; + } + + public Criteria andPlatformValueIsNotNull() { + addCriterion("platform_value is not null"); + return (Criteria) this; + } + + public Criteria andPlatformValueEqualTo(String value) { + addCriterion("platform_value =", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotEqualTo(String value) { + addCriterion("platform_value <>", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueGreaterThan(String value) { + addCriterion("platform_value >", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueGreaterThanOrEqualTo(String value) { + addCriterion("platform_value >=", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLessThan(String value) { + addCriterion("platform_value <", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLessThanOrEqualTo(String value) { + addCriterion("platform_value <=", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLike(String value) { + addCriterion("platform_value like", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotLike(String value) { + addCriterion("platform_value not like", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueIn(List values) { + addCriterion("platform_value in", values, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotIn(List values) { + addCriterion("platform_value not in", values, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueBetween(String value1, String value2) { + addCriterion("platform_value between", value1, value2, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotBetween(String value1, String value2) { + addCriterion("platform_value not between", value1, value2, "platformValue"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java new file mode 100644 index 00000000..7d0f16a9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Role.java @@ -0,0 +1,76 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Role { + @TableId(type = IdType.AUTO) + private Long id; + + private String name; + + private String type; + + private String value; + + private String description; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java new file mode 100644 index 00000000..f2ca2c03 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/RoleExample.java @@ -0,0 +1,669 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class RoleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public RoleExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("value is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("value is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("value =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("value <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("value >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("value >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("value <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("value <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("value like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("value not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("value in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("value not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("value between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("value not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumber.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumber.java new file mode 100644 index 00000000..73831356 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumber.java @@ -0,0 +1,148 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class SerialNumber { + @TableId(type = IdType.AUTO) + private Long id; + + private Long materialId; + + private Long depotId; + + private String serialNumber; + + private String isSell; + + private String remark; + + private String deleteFlag; + + private Date createTime; + + private Long creator; + + private Date updateTime; + + private Long updater; + + private String inBillNo; + + private String outBillNo; + + private Long tenantId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber == null ? null : serialNumber.trim(); + } + + public String getIsSell() { + return isSell; + } + + public void setIsSell(String isSell) { + this.isSell = isSell == null ? null : isSell.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdater() { + return updater; + } + + public void setUpdater(Long updater) { + this.updater = updater; + } + + public String getInBillNo() { + return inBillNo; + } + + public void setInBillNo(String inBillNo) { + this.inBillNo = inBillNo == null ? null : inBillNo.trim(); + } + + public String getOutBillNo() { + return outBillNo; + } + + public void setOutBillNo(String outBillNo) { + this.outBillNo = outBillNo == null ? null : outBillNo.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberEx.java new file mode 100644 index 00000000..2d5b268f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberEx.java @@ -0,0 +1,88 @@ +package com.zsw.erp.datasource.entities; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 17:32 + */ +public class SerialNumberEx extends SerialNumber{ + /** + * 商品条码 + * */ + private String materialCode; + /** + * 商品名称 + * */ + private String materialName; + /** + * 创建者名称 + * */ + private String creatorName; + /** + * 更新者名称 + * */ + private String updaterName; + /**单据编号*/ + private String depotHeadNumber; + /**单据类型(出库入库)*/ + private String depotHeadType; + + private String depotName; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getUpdaterName() { + return updaterName; + } + + public void setUpdaterName(String updaterName) { + this.updaterName = updaterName; + } + + public String getDepotHeadNumber() { + return depotHeadNumber; + } + + public void setDepotHeadNumber(String depotHeadNumber) { + this.depotHeadNumber = depotHeadNumber; + } + + public String getDepotHeadType() { + return depotHeadType; + } + + public void setDepotHeadType(String depotHeadType) { + this.depotHeadType = depotHeadType; + } + + public String getDepotName() { + return depotName; + } + + public void setDepotName(String depotName) { + this.depotName = depotName; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberExample.java new file mode 100644 index 00000000..63a5f472 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SerialNumberExample.java @@ -0,0 +1,1100 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SerialNumberExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SerialNumberExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNull() { + addCriterion("serial_number is null"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNotNull() { + addCriterion("serial_number is not null"); + return (Criteria) this; + } + + public Criteria andSerialNumberEqualTo(String value) { + addCriterion("serial_number =", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotEqualTo(String value) { + addCriterion("serial_number <>", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThan(String value) { + addCriterion("serial_number >", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("serial_number >=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThan(String value) { + addCriterion("serial_number <", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThanOrEqualTo(String value) { + addCriterion("serial_number <=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLike(String value) { + addCriterion("serial_number like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotLike(String value) { + addCriterion("serial_number not like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberIn(List values) { + addCriterion("serial_number in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotIn(List values) { + addCriterion("serial_number not in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberBetween(String value1, String value2) { + addCriterion("serial_number between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotBetween(String value1, String value2) { + addCriterion("serial_number not between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andIsSellIsNull() { + addCriterion("is_sell is null"); + return (Criteria) this; + } + + public Criteria andIsSellIsNotNull() { + addCriterion("is_sell is not null"); + return (Criteria) this; + } + + public Criteria andIsSellEqualTo(String value) { + addCriterion("is_sell =", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotEqualTo(String value) { + addCriterion("is_sell <>", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellGreaterThan(String value) { + addCriterion("is_sell >", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellGreaterThanOrEqualTo(String value) { + addCriterion("is_sell >=", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLessThan(String value) { + addCriterion("is_sell <", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLessThanOrEqualTo(String value) { + addCriterion("is_sell <=", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLike(String value) { + addCriterion("is_sell like", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotLike(String value) { + addCriterion("is_sell not like", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellIn(List values) { + addCriterion("is_sell in", values, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotIn(List values) { + addCriterion("is_sell not in", values, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellBetween(String value1, String value2) { + addCriterion("is_sell between", value1, value2, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotBetween(String value1, String value2) { + addCriterion("is_sell not between", value1, value2, "isSell"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(Long value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(Long value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(Long value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(Long value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(Long value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(Long value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(Long value1, Long value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(Long value1, Long value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andInBillNoIsNull() { + addCriterion("in_bill_no is null"); + return (Criteria) this; + } + + public Criteria andInBillNoIsNotNull() { + addCriterion("in_bill_no is not null"); + return (Criteria) this; + } + + public Criteria andInBillNoEqualTo(String value) { + addCriterion("in_bill_no =", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotEqualTo(String value) { + addCriterion("in_bill_no <>", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoGreaterThan(String value) { + addCriterion("in_bill_no >", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoGreaterThanOrEqualTo(String value) { + addCriterion("in_bill_no >=", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLessThan(String value) { + addCriterion("in_bill_no <", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLessThanOrEqualTo(String value) { + addCriterion("in_bill_no <=", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLike(String value) { + addCriterion("in_bill_no like", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotLike(String value) { + addCriterion("in_bill_no not like", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoIn(List values) { + addCriterion("in_bill_no in", values, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotIn(List values) { + addCriterion("in_bill_no not in", values, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoBetween(String value1, String value2) { + addCriterion("in_bill_no between", value1, value2, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotBetween(String value1, String value2) { + addCriterion("in_bill_no not between", value1, value2, "inBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoIsNull() { + addCriterion("out_bill_no is null"); + return (Criteria) this; + } + + public Criteria andOutBillNoIsNotNull() { + addCriterion("out_bill_no is not null"); + return (Criteria) this; + } + + public Criteria andOutBillNoEqualTo(String value) { + addCriterion("out_bill_no =", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotEqualTo(String value) { + addCriterion("out_bill_no <>", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoGreaterThan(String value) { + addCriterion("out_bill_no >", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoGreaterThanOrEqualTo(String value) { + addCriterion("out_bill_no >=", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLessThan(String value) { + addCriterion("out_bill_no <", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLessThanOrEqualTo(String value) { + addCriterion("out_bill_no <=", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLike(String value) { + addCriterion("out_bill_no like", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotLike(String value) { + addCriterion("out_bill_no not like", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoIn(List values) { + addCriterion("out_bill_no in", values, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotIn(List values) { + addCriterion("out_bill_no not in", values, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoBetween(String value1, String value2) { + addCriterion("out_bill_no between", value1, value2, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotBetween(String value1, String value2) { + addCriterion("out_bill_no not between", value1, value2, "outBillNo"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Supplier.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Supplier.java new file mode 100644 index 00000000..2cf9c192 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Supplier.java @@ -0,0 +1,238 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Supplier { + @TableId(type = IdType.AUTO) + private Long id; + + private String supplier; + + private String contacts; + + private String phoneNum; + + private String email; + + private String description; + + private Byte isystem; + + private String type; + + private Boolean enabled; + + private BigDecimal advanceIn; + + private BigDecimal beginNeedGet; + + private BigDecimal beginNeedPay; + + private BigDecimal allNeedGet; + + private BigDecimal allNeedPay; + + private String fax; + + private String telephone; + + private String address; + + private String taxNum; + + private String bankName; + + private String accountNumber; + + private BigDecimal taxRate; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier == null ? null : supplier.trim(); + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts == null ? null : contacts.trim(); + } + + public String getPhoneNum() { + return phoneNum; + } + + public void setPhoneNum(String phoneNum) { + this.phoneNum = phoneNum == null ? null : phoneNum.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public Byte getIsystem() { + return isystem; + } + + public void setIsystem(Byte isystem) { + this.isystem = isystem; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public BigDecimal getAdvanceIn() { + return advanceIn; + } + + public void setAdvanceIn(BigDecimal advanceIn) { + this.advanceIn = advanceIn; + } + + public BigDecimal getBeginNeedGet() { + return beginNeedGet; + } + + public void setBeginNeedGet(BigDecimal beginNeedGet) { + this.beginNeedGet = beginNeedGet; + } + + public BigDecimal getBeginNeedPay() { + return beginNeedPay; + } + + public void setBeginNeedPay(BigDecimal beginNeedPay) { + this.beginNeedPay = beginNeedPay; + } + + public BigDecimal getAllNeedGet() { + return allNeedGet; + } + + public void setAllNeedGet(BigDecimal allNeedGet) { + this.allNeedGet = allNeedGet; + } + + public BigDecimal getAllNeedPay() { + return allNeedPay; + } + + public void setAllNeedPay(BigDecimal allNeedPay) { + this.allNeedPay = allNeedPay; + } + + public String getFax() { + return fax; + } + + public void setFax(String fax) { + this.fax = fax == null ? null : fax.trim(); + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getTaxNum() { + return taxNum; + } + + public void setTaxNum(String taxNum) { + this.taxNum = taxNum == null ? null : taxNum.trim(); + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName == null ? null : bankName.trim(); + } + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber == null ? null : accountNumber.trim(); + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SupplierExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SupplierExample.java new file mode 100644 index 00000000..9315d4d6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SupplierExample.java @@ -0,0 +1,1710 @@ +package com.zsw.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class SupplierExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SupplierExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSupplierIsNull() { + addCriterion("supplier is null"); + return (Criteria) this; + } + + public Criteria andSupplierIsNotNull() { + addCriterion("supplier is not null"); + return (Criteria) this; + } + + public Criteria andSupplierEqualTo(String value) { + addCriterion("supplier =", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotEqualTo(String value) { + addCriterion("supplier <>", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierGreaterThan(String value) { + addCriterion("supplier >", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierGreaterThanOrEqualTo(String value) { + addCriterion("supplier >=", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLessThan(String value) { + addCriterion("supplier <", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLessThanOrEqualTo(String value) { + addCriterion("supplier <=", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLike(String value) { + addCriterion("supplier like", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotLike(String value) { + addCriterion("supplier not like", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierIn(List values) { + addCriterion("supplier in", values, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotIn(List values) { + addCriterion("supplier not in", values, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierBetween(String value1, String value2) { + addCriterion("supplier between", value1, value2, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotBetween(String value1, String value2) { + addCriterion("supplier not between", value1, value2, "supplier"); + return (Criteria) this; + } + + public Criteria andContactsIsNull() { + addCriterion("contacts is null"); + return (Criteria) this; + } + + public Criteria andContactsIsNotNull() { + addCriterion("contacts is not null"); + return (Criteria) this; + } + + public Criteria andContactsEqualTo(String value) { + addCriterion("contacts =", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotEqualTo(String value) { + addCriterion("contacts <>", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsGreaterThan(String value) { + addCriterion("contacts >", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsGreaterThanOrEqualTo(String value) { + addCriterion("contacts >=", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLessThan(String value) { + addCriterion("contacts <", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLessThanOrEqualTo(String value) { + addCriterion("contacts <=", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLike(String value) { + addCriterion("contacts like", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotLike(String value) { + addCriterion("contacts not like", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsIn(List values) { + addCriterion("contacts in", values, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotIn(List values) { + addCriterion("contacts not in", values, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsBetween(String value1, String value2) { + addCriterion("contacts between", value1, value2, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotBetween(String value1, String value2) { + addCriterion("contacts not between", value1, value2, "contacts"); + return (Criteria) this; + } + + public Criteria andPhoneNumIsNull() { + addCriterion("phone_num is null"); + return (Criteria) this; + } + + public Criteria andPhoneNumIsNotNull() { + addCriterion("phone_num is not null"); + return (Criteria) this; + } + + public Criteria andPhoneNumEqualTo(String value) { + addCriterion("phone_num =", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotEqualTo(String value) { + addCriterion("phone_num <>", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumGreaterThan(String value) { + addCriterion("phone_num >", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumGreaterThanOrEqualTo(String value) { + addCriterion("phone_num >=", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLessThan(String value) { + addCriterion("phone_num <", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLessThanOrEqualTo(String value) { + addCriterion("phone_num <=", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLike(String value) { + addCriterion("phone_num like", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotLike(String value) { + addCriterion("phone_num not like", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumIn(List values) { + addCriterion("phone_num in", values, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotIn(List values) { + addCriterion("phone_num not in", values, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumBetween(String value1, String value2) { + addCriterion("phone_num between", value1, value2, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotBetween(String value1, String value2) { + addCriterion("phone_num not between", value1, value2, "phoneNum"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andIsystemIsNull() { + addCriterion("isystem is null"); + return (Criteria) this; + } + + public Criteria andIsystemIsNotNull() { + addCriterion("isystem is not null"); + return (Criteria) this; + } + + public Criteria andIsystemEqualTo(Byte value) { + addCriterion("isystem =", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotEqualTo(Byte value) { + addCriterion("isystem <>", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThan(Byte value) { + addCriterion("isystem >", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThanOrEqualTo(Byte value) { + addCriterion("isystem >=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThan(Byte value) { + addCriterion("isystem <", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThanOrEqualTo(Byte value) { + addCriterion("isystem <=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemIn(List values) { + addCriterion("isystem in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotIn(List values) { + addCriterion("isystem not in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemBetween(Byte value1, Byte value2) { + addCriterion("isystem between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotBetween(Byte value1, Byte value2) { + addCriterion("isystem not between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andAdvanceInIsNull() { + addCriterion("advance_in is null"); + return (Criteria) this; + } + + public Criteria andAdvanceInIsNotNull() { + addCriterion("advance_in is not null"); + return (Criteria) this; + } + + public Criteria andAdvanceInEqualTo(BigDecimal value) { + addCriterion("advance_in =", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotEqualTo(BigDecimal value) { + addCriterion("advance_in <>", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInGreaterThan(BigDecimal value) { + addCriterion("advance_in >", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("advance_in >=", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInLessThan(BigDecimal value) { + addCriterion("advance_in <", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInLessThanOrEqualTo(BigDecimal value) { + addCriterion("advance_in <=", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInIn(List values) { + addCriterion("advance_in in", values, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotIn(List values) { + addCriterion("advance_in not in", values, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("advance_in between", value1, value2, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("advance_in not between", value1, value2, "advanceIn"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIsNull() { + addCriterion("begin_need_get is null"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIsNotNull() { + addCriterion("begin_need_get is not null"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetEqualTo(BigDecimal value) { + addCriterion("begin_need_get =", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotEqualTo(BigDecimal value) { + addCriterion("begin_need_get <>", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetGreaterThan(BigDecimal value) { + addCriterion("begin_need_get >", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_get >=", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetLessThan(BigDecimal value) { + addCriterion("begin_need_get <", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetLessThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_get <=", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIn(List values) { + addCriterion("begin_need_get in", values, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotIn(List values) { + addCriterion("begin_need_get not in", values, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_get between", value1, value2, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_get not between", value1, value2, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIsNull() { + addCriterion("begin_need_pay is null"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIsNotNull() { + addCriterion("begin_need_pay is not null"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayEqualTo(BigDecimal value) { + addCriterion("begin_need_pay =", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotEqualTo(BigDecimal value) { + addCriterion("begin_need_pay <>", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayGreaterThan(BigDecimal value) { + addCriterion("begin_need_pay >", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_pay >=", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayLessThan(BigDecimal value) { + addCriterion("begin_need_pay <", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayLessThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_pay <=", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIn(List values) { + addCriterion("begin_need_pay in", values, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotIn(List values) { + addCriterion("begin_need_pay not in", values, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_pay between", value1, value2, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_pay not between", value1, value2, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIsNull() { + addCriterion("all_need_get is null"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIsNotNull() { + addCriterion("all_need_get is not null"); + return (Criteria) this; + } + + public Criteria andAllNeedGetEqualTo(BigDecimal value) { + addCriterion("all_need_get =", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotEqualTo(BigDecimal value) { + addCriterion("all_need_get <>", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetGreaterThan(BigDecimal value) { + addCriterion("all_need_get >", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_get >=", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetLessThan(BigDecimal value) { + addCriterion("all_need_get <", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_get <=", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIn(List values) { + addCriterion("all_need_get in", values, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotIn(List values) { + addCriterion("all_need_get not in", values, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_get between", value1, value2, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_get not between", value1, value2, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIsNull() { + addCriterion("all_need_pay is null"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIsNotNull() { + addCriterion("all_need_pay is not null"); + return (Criteria) this; + } + + public Criteria andAllNeedPayEqualTo(BigDecimal value) { + addCriterion("all_need_pay =", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotEqualTo(BigDecimal value) { + addCriterion("all_need_pay <>", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayGreaterThan(BigDecimal value) { + addCriterion("all_need_pay >", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_pay >=", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayLessThan(BigDecimal value) { + addCriterion("all_need_pay <", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_pay <=", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIn(List values) { + addCriterion("all_need_pay in", values, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotIn(List values) { + addCriterion("all_need_pay not in", values, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_pay between", value1, value2, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_pay not between", value1, value2, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andFaxIsNull() { + addCriterion("fax is null"); + return (Criteria) this; + } + + public Criteria andFaxIsNotNull() { + addCriterion("fax is not null"); + return (Criteria) this; + } + + public Criteria andFaxEqualTo(String value) { + addCriterion("fax =", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotEqualTo(String value) { + addCriterion("fax <>", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxGreaterThan(String value) { + addCriterion("fax >", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxGreaterThanOrEqualTo(String value) { + addCriterion("fax >=", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLessThan(String value) { + addCriterion("fax <", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLessThanOrEqualTo(String value) { + addCriterion("fax <=", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLike(String value) { + addCriterion("fax like", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotLike(String value) { + addCriterion("fax not like", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxIn(List values) { + addCriterion("fax in", values, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotIn(List values) { + addCriterion("fax not in", values, "fax"); + return (Criteria) this; + } + + public Criteria andFaxBetween(String value1, String value2) { + addCriterion("fax between", value1, value2, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotBetween(String value1, String value2) { + addCriterion("fax not between", value1, value2, "fax"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNull() { + addCriterion("telephone is null"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNotNull() { + addCriterion("telephone is not null"); + return (Criteria) this; + } + + public Criteria andTelephoneEqualTo(String value) { + addCriterion("telephone =", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotEqualTo(String value) { + addCriterion("telephone <>", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThan(String value) { + addCriterion("telephone >", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThanOrEqualTo(String value) { + addCriterion("telephone >=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThan(String value) { + addCriterion("telephone <", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThanOrEqualTo(String value) { + addCriterion("telephone <=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLike(String value) { + addCriterion("telephone like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotLike(String value) { + addCriterion("telephone not like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneIn(List values) { + addCriterion("telephone in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotIn(List values) { + addCriterion("telephone not in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneBetween(String value1, String value2) { + addCriterion("telephone between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotBetween(String value1, String value2) { + addCriterion("telephone not between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andTaxNumIsNull() { + addCriterion("tax_num is null"); + return (Criteria) this; + } + + public Criteria andTaxNumIsNotNull() { + addCriterion("tax_num is not null"); + return (Criteria) this; + } + + public Criteria andTaxNumEqualTo(String value) { + addCriterion("tax_num =", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotEqualTo(String value) { + addCriterion("tax_num <>", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumGreaterThan(String value) { + addCriterion("tax_num >", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumGreaterThanOrEqualTo(String value) { + addCriterion("tax_num >=", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLessThan(String value) { + addCriterion("tax_num <", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLessThanOrEqualTo(String value) { + addCriterion("tax_num <=", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLike(String value) { + addCriterion("tax_num like", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotLike(String value) { + addCriterion("tax_num not like", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumIn(List values) { + addCriterion("tax_num in", values, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotIn(List values) { + addCriterion("tax_num not in", values, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumBetween(String value1, String value2) { + addCriterion("tax_num between", value1, value2, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotBetween(String value1, String value2) { + addCriterion("tax_num not between", value1, value2, "taxNum"); + return (Criteria) this; + } + + public Criteria andBankNameIsNull() { + addCriterion("bank_name is null"); + return (Criteria) this; + } + + public Criteria andBankNameIsNotNull() { + addCriterion("bank_name is not null"); + return (Criteria) this; + } + + public Criteria andBankNameEqualTo(String value) { + addCriterion("bank_name =", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotEqualTo(String value) { + addCriterion("bank_name <>", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameGreaterThan(String value) { + addCriterion("bank_name >", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameGreaterThanOrEqualTo(String value) { + addCriterion("bank_name >=", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLessThan(String value) { + addCriterion("bank_name <", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLessThanOrEqualTo(String value) { + addCriterion("bank_name <=", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLike(String value) { + addCriterion("bank_name like", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotLike(String value) { + addCriterion("bank_name not like", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameIn(List values) { + addCriterion("bank_name in", values, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotIn(List values) { + addCriterion("bank_name not in", values, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameBetween(String value1, String value2) { + addCriterion("bank_name between", value1, value2, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotBetween(String value1, String value2) { + addCriterion("bank_name not between", value1, value2, "bankName"); + return (Criteria) this; + } + + public Criteria andAccountNumberIsNull() { + addCriterion("account_number is null"); + return (Criteria) this; + } + + public Criteria andAccountNumberIsNotNull() { + addCriterion("account_number is not null"); + return (Criteria) this; + } + + public Criteria andAccountNumberEqualTo(String value) { + addCriterion("account_number =", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotEqualTo(String value) { + addCriterion("account_number <>", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberGreaterThan(String value) { + addCriterion("account_number >", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberGreaterThanOrEqualTo(String value) { + addCriterion("account_number >=", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLessThan(String value) { + addCriterion("account_number <", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLessThanOrEqualTo(String value) { + addCriterion("account_number <=", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLike(String value) { + addCriterion("account_number like", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotLike(String value) { + addCriterion("account_number not like", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberIn(List values) { + addCriterion("account_number in", values, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotIn(List values) { + addCriterion("account_number not in", values, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberBetween(String value1, String value2) { + addCriterion("account_number between", value1, value2, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotBetween(String value1, String value2) { + addCriterion("account_number not between", value1, value2, "accountNumber"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNull() { + addCriterion("tax_rate is null"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNotNull() { + addCriterion("tax_rate is not null"); + return (Criteria) this; + } + + public Criteria andTaxRateEqualTo(BigDecimal value) { + addCriterion("tax_rate =", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotEqualTo(BigDecimal value) { + addCriterion("tax_rate <>", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThan(BigDecimal value) { + addCriterion("tax_rate >", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate >=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThan(BigDecimal value) { + addCriterion("tax_rate <", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate <=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateIn(List values) { + addCriterion("tax_rate in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotIn(List values) { + addCriterion("tax_rate not in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate not between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SysLoginModel.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SysLoginModel.java new file mode 100644 index 00000000..dd716002 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SysLoginModel.java @@ -0,0 +1,55 @@ +package com.zsw.erp.datasource.entities; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 登录表单 + * + * @Author scott + * @since 2019-01-18 + */ +@ApiModel(value="登录对象", description="登录对象") +public class SysLoginModel { + @ApiModelProperty(value = "账号") + private String username; + @ApiModelProperty(value = "密码") + private String password; + @ApiModelProperty(value = "验证码") + private String captcha; + @ApiModelProperty(value = "验证码key") + private String checkKey; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getCaptcha() { + return captcha; + } + + public void setCaptcha(String captcha) { + this.captcha = captcha; + } + + public String getCheckKey() { + return checkKey; + } + + public void setCheckKey(String checkKey) { + this.checkKey = checkKey; + } + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfig.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfig.java new file mode 100644 index 00000000..9d2fc0aa --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfig.java @@ -0,0 +1,35 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; + +@Data +public class SystemConfig { + @TableId(type = IdType.AUTO) + private Long id; + + private String companyName; + + private String companyContacts; + + private String companyAddress; + + private String companyTel; + + private String companyFax; + + private String companyPostCode; + + private String depotFlag; + + private String customerFlag; + + private String minusStockFlag; + + private Long tenantId; + + @TableLogic(delval = "1",value = "0") + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfigExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfigExample.java new file mode 100644 index 00000000..7d13d893 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfigExample.java @@ -0,0 +1,1019 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class SystemConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SystemConfigExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIsNull() { + addCriterion("company_contacts is null"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIsNotNull() { + addCriterion("company_contacts is not null"); + return (Criteria) this; + } + + public Criteria andCompanyContactsEqualTo(String value) { + addCriterion("company_contacts =", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotEqualTo(String value) { + addCriterion("company_contacts <>", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsGreaterThan(String value) { + addCriterion("company_contacts >", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsGreaterThanOrEqualTo(String value) { + addCriterion("company_contacts >=", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLessThan(String value) { + addCriterion("company_contacts <", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLessThanOrEqualTo(String value) { + addCriterion("company_contacts <=", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLike(String value) { + addCriterion("company_contacts like", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotLike(String value) { + addCriterion("company_contacts not like", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIn(List values) { + addCriterion("company_contacts in", values, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotIn(List values) { + addCriterion("company_contacts not in", values, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsBetween(String value1, String value2) { + addCriterion("company_contacts between", value1, value2, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotBetween(String value1, String value2) { + addCriterion("company_contacts not between", value1, value2, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIsNull() { + addCriterion("company_address is null"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIsNotNull() { + addCriterion("company_address is not null"); + return (Criteria) this; + } + + public Criteria andCompanyAddressEqualTo(String value) { + addCriterion("company_address =", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotEqualTo(String value) { + addCriterion("company_address <>", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressGreaterThan(String value) { + addCriterion("company_address >", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressGreaterThanOrEqualTo(String value) { + addCriterion("company_address >=", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLessThan(String value) { + addCriterion("company_address <", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLessThanOrEqualTo(String value) { + addCriterion("company_address <=", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLike(String value) { + addCriterion("company_address like", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotLike(String value) { + addCriterion("company_address not like", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIn(List values) { + addCriterion("company_address in", values, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotIn(List values) { + addCriterion("company_address not in", values, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressBetween(String value1, String value2) { + addCriterion("company_address between", value1, value2, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotBetween(String value1, String value2) { + addCriterion("company_address not between", value1, value2, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyTelIsNull() { + addCriterion("company_tel is null"); + return (Criteria) this; + } + + public Criteria andCompanyTelIsNotNull() { + addCriterion("company_tel is not null"); + return (Criteria) this; + } + + public Criteria andCompanyTelEqualTo(String value) { + addCriterion("company_tel =", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotEqualTo(String value) { + addCriterion("company_tel <>", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelGreaterThan(String value) { + addCriterion("company_tel >", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelGreaterThanOrEqualTo(String value) { + addCriterion("company_tel >=", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLessThan(String value) { + addCriterion("company_tel <", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLessThanOrEqualTo(String value) { + addCriterion("company_tel <=", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLike(String value) { + addCriterion("company_tel like", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotLike(String value) { + addCriterion("company_tel not like", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelIn(List values) { + addCriterion("company_tel in", values, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotIn(List values) { + addCriterion("company_tel not in", values, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelBetween(String value1, String value2) { + addCriterion("company_tel between", value1, value2, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotBetween(String value1, String value2) { + addCriterion("company_tel not between", value1, value2, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIsNull() { + addCriterion("company_fax is null"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIsNotNull() { + addCriterion("company_fax is not null"); + return (Criteria) this; + } + + public Criteria andCompanyFaxEqualTo(String value) { + addCriterion("company_fax =", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotEqualTo(String value) { + addCriterion("company_fax <>", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxGreaterThan(String value) { + addCriterion("company_fax >", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxGreaterThanOrEqualTo(String value) { + addCriterion("company_fax >=", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLessThan(String value) { + addCriterion("company_fax <", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLessThanOrEqualTo(String value) { + addCriterion("company_fax <=", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLike(String value) { + addCriterion("company_fax like", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotLike(String value) { + addCriterion("company_fax not like", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIn(List values) { + addCriterion("company_fax in", values, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotIn(List values) { + addCriterion("company_fax not in", values, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxBetween(String value1, String value2) { + addCriterion("company_fax between", value1, value2, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotBetween(String value1, String value2) { + addCriterion("company_fax not between", value1, value2, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIsNull() { + addCriterion("company_post_code is null"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIsNotNull() { + addCriterion("company_post_code is not null"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeEqualTo(String value) { + addCriterion("company_post_code =", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotEqualTo(String value) { + addCriterion("company_post_code <>", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeGreaterThan(String value) { + addCriterion("company_post_code >", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeGreaterThanOrEqualTo(String value) { + addCriterion("company_post_code >=", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLessThan(String value) { + addCriterion("company_post_code <", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLessThanOrEqualTo(String value) { + addCriterion("company_post_code <=", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLike(String value) { + addCriterion("company_post_code like", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotLike(String value) { + addCriterion("company_post_code not like", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIn(List values) { + addCriterion("company_post_code in", values, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotIn(List values) { + addCriterion("company_post_code not in", values, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeBetween(String value1, String value2) { + addCriterion("company_post_code between", value1, value2, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotBetween(String value1, String value2) { + addCriterion("company_post_code not between", value1, value2, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andDepotFlagIsNull() { + addCriterion("depot_flag is null"); + return (Criteria) this; + } + + public Criteria andDepotFlagIsNotNull() { + addCriterion("depot_flag is not null"); + return (Criteria) this; + } + + public Criteria andDepotFlagEqualTo(String value) { + addCriterion("depot_flag =", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotEqualTo(String value) { + addCriterion("depot_flag <>", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagGreaterThan(String value) { + addCriterion("depot_flag >", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagGreaterThanOrEqualTo(String value) { + addCriterion("depot_flag >=", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLessThan(String value) { + addCriterion("depot_flag <", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLessThanOrEqualTo(String value) { + addCriterion("depot_flag <=", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLike(String value) { + addCriterion("depot_flag like", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotLike(String value) { + addCriterion("depot_flag not like", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagIn(List values) { + addCriterion("depot_flag in", values, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotIn(List values) { + addCriterion("depot_flag not in", values, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagBetween(String value1, String value2) { + addCriterion("depot_flag between", value1, value2, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotBetween(String value1, String value2) { + addCriterion("depot_flag not between", value1, value2, "depotFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIsNull() { + addCriterion("customer_flag is null"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIsNotNull() { + addCriterion("customer_flag is not null"); + return (Criteria) this; + } + + public Criteria andCustomerFlagEqualTo(String value) { + addCriterion("customer_flag =", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotEqualTo(String value) { + addCriterion("customer_flag <>", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagGreaterThan(String value) { + addCriterion("customer_flag >", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagGreaterThanOrEqualTo(String value) { + addCriterion("customer_flag >=", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLessThan(String value) { + addCriterion("customer_flag <", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLessThanOrEqualTo(String value) { + addCriterion("customer_flag <=", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLike(String value) { + addCriterion("customer_flag like", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotLike(String value) { + addCriterion("customer_flag not like", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIn(List values) { + addCriterion("customer_flag in", values, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotIn(List values) { + addCriterion("customer_flag not in", values, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagBetween(String value1, String value2) { + addCriterion("customer_flag between", value1, value2, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotBetween(String value1, String value2) { + addCriterion("customer_flag not between", value1, value2, "customerFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIsNull() { + addCriterion("minus_stock_flag is null"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIsNotNull() { + addCriterion("minus_stock_flag is not null"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagEqualTo(String value) { + addCriterion("minus_stock_flag =", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotEqualTo(String value) { + addCriterion("minus_stock_flag <>", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagGreaterThan(String value) { + addCriterion("minus_stock_flag >", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagGreaterThanOrEqualTo(String value) { + addCriterion("minus_stock_flag >=", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLessThan(String value) { + addCriterion("minus_stock_flag <", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLessThanOrEqualTo(String value) { + addCriterion("minus_stock_flag <=", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLike(String value) { + addCriterion("minus_stock_flag like", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotLike(String value) { + addCriterion("minus_stock_flag not like", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIn(List values) { + addCriterion("minus_stock_flag in", values, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotIn(List values) { + addCriterion("minus_stock_flag not in", values, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagBetween(String value1, String value2) { + addCriterion("minus_stock_flag between", value1, value2, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotBetween(String value1, String value2) { + addCriterion("minus_stock_flag not between", value1, value2, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Tenant.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Tenant.java new file mode 100644 index 00000000..1070a4ad --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Tenant.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.entities; + +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +@Data +public class Tenant { + @TableId(type = IdType.AUTO) + private Long id; + + private Long tenantId; + + private String loginName; + + private Integer userNumLimit; + + private String type; + + private Boolean enabled; + + private Date createTime; + + private Date expireTime; + + private String remark; + + private Long storeId; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantEx.java new file mode 100644 index 00000000..c73f674f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantEx.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.entities; + +public class TenantEx extends Tenant{ + + private String createTimeStr; + + private String expireTimeStr; + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } + + public String getExpireTimeStr() { + return expireTimeStr; + } + + public void setExpireTimeStr(String expireTimeStr) { + this.expireTimeStr = expireTimeStr; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantExample.java new file mode 100644 index 00000000..62c56a73 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/TenantExample.java @@ -0,0 +1,770 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class TenantExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public TenantExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIsNull() { + addCriterion("user_num_limit is null"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIsNotNull() { + addCriterion("user_num_limit is not null"); + return (Criteria) this; + } + + public Criteria andUserNumLimitEqualTo(Integer value) { + addCriterion("user_num_limit =", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotEqualTo(Integer value) { + addCriterion("user_num_limit <>", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitGreaterThan(Integer value) { + addCriterion("user_num_limit >", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitGreaterThanOrEqualTo(Integer value) { + addCriterion("user_num_limit >=", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitLessThan(Integer value) { + addCriterion("user_num_limit <", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitLessThanOrEqualTo(Integer value) { + addCriterion("user_num_limit <=", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIn(List values) { + addCriterion("user_num_limit in", values, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotIn(List values) { + addCriterion("user_num_limit not in", values, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitBetween(Integer value1, Integer value2) { + addCriterion("user_num_limit between", value1, value2, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotBetween(Integer value1, Integer value2) { + addCriterion("user_num_limit not between", value1, value2, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNull() { + addCriterion("expire_time is null"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNotNull() { + addCriterion("expire_time is not null"); + return (Criteria) this; + } + + public Criteria andExpireTimeEqualTo(Date value) { + addCriterion("expire_time =", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotEqualTo(Date value) { + addCriterion("expire_time <>", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThan(Date value) { + addCriterion("expire_time >", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThanOrEqualTo(Date value) { + addCriterion("expire_time >=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThan(Date value) { + addCriterion("expire_time <", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThanOrEqualTo(Date value) { + addCriterion("expire_time <=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeIn(List values) { + addCriterion("expire_time in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotIn(List values) { + addCriterion("expire_time not in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeBetween(Date value1, Date value2) { + addCriterion("expire_time between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotBetween(Date value1, Date value2) { + addCriterion("expire_time not between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Unit.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Unit.java new file mode 100644 index 00000000..7e35cda4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Unit.java @@ -0,0 +1,116 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +public class Unit { + @TableId(type = IdType.AUTO) + private Long id; + + private String name; + + private String basicUnit; + + private String otherUnit; + + private String otherUnitTwo; + + private String otherUnitThree; + + private Integer ratio; + + private Integer ratioTwo; + + private Integer ratioThree; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getBasicUnit() { + return basicUnit; + } + + public void setBasicUnit(String basicUnit) { + this.basicUnit = basicUnit == null ? null : basicUnit.trim(); + } + + public String getOtherUnit() { + return otherUnit; + } + + public void setOtherUnit(String otherUnit) { + this.otherUnit = otherUnit == null ? null : otherUnit.trim(); + } + + public String getOtherUnitTwo() { + return otherUnitTwo; + } + + public void setOtherUnitTwo(String otherUnitTwo) { + this.otherUnitTwo = otherUnitTwo == null ? null : otherUnitTwo.trim(); + } + + public String getOtherUnitThree() { + return otherUnitThree; + } + + public void setOtherUnitThree(String otherUnitThree) { + this.otherUnitThree = otherUnitThree == null ? null : otherUnitThree.trim(); + } + + public Integer getRatio() { + return ratio; + } + + public void setRatio(Integer ratio) { + this.ratio = ratio; + } + + public Integer getRatioTwo() { + return ratioTwo; + } + + public void setRatioTwo(Integer ratioTwo) { + this.ratioTwo = ratioTwo; + } + + public Integer getRatioThree() { + return ratioThree; + } + + public void setRatioThree(Integer ratioThree) { + this.ratioThree = ratioThree; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UnitExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UnitExample.java new file mode 100644 index 00000000..cc27e4bf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UnitExample.java @@ -0,0 +1,919 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class UnitExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UnitExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andBasicUnitIsNull() { + addCriterion("basic_unit is null"); + return (Criteria) this; + } + + public Criteria andBasicUnitIsNotNull() { + addCriterion("basic_unit is not null"); + return (Criteria) this; + } + + public Criteria andBasicUnitEqualTo(String value) { + addCriterion("basic_unit =", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotEqualTo(String value) { + addCriterion("basic_unit <>", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitGreaterThan(String value) { + addCriterion("basic_unit >", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitGreaterThanOrEqualTo(String value) { + addCriterion("basic_unit >=", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLessThan(String value) { + addCriterion("basic_unit <", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLessThanOrEqualTo(String value) { + addCriterion("basic_unit <=", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLike(String value) { + addCriterion("basic_unit like", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotLike(String value) { + addCriterion("basic_unit not like", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitIn(List values) { + addCriterion("basic_unit in", values, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotIn(List values) { + addCriterion("basic_unit not in", values, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitBetween(String value1, String value2) { + addCriterion("basic_unit between", value1, value2, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotBetween(String value1, String value2) { + addCriterion("basic_unit not between", value1, value2, "basicUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitIsNull() { + addCriterion("other_unit is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitIsNotNull() { + addCriterion("other_unit is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitEqualTo(String value) { + addCriterion("other_unit =", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotEqualTo(String value) { + addCriterion("other_unit <>", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitGreaterThan(String value) { + addCriterion("other_unit >", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitGreaterThanOrEqualTo(String value) { + addCriterion("other_unit >=", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLessThan(String value) { + addCriterion("other_unit <", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLessThanOrEqualTo(String value) { + addCriterion("other_unit <=", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLike(String value) { + addCriterion("other_unit like", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotLike(String value) { + addCriterion("other_unit not like", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitIn(List values) { + addCriterion("other_unit in", values, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotIn(List values) { + addCriterion("other_unit not in", values, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitBetween(String value1, String value2) { + addCriterion("other_unit between", value1, value2, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotBetween(String value1, String value2) { + addCriterion("other_unit not between", value1, value2, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIsNull() { + addCriterion("other_unit_two is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIsNotNull() { + addCriterion("other_unit_two is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoEqualTo(String value) { + addCriterion("other_unit_two =", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotEqualTo(String value) { + addCriterion("other_unit_two <>", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoGreaterThan(String value) { + addCriterion("other_unit_two >", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoGreaterThanOrEqualTo(String value) { + addCriterion("other_unit_two >=", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLessThan(String value) { + addCriterion("other_unit_two <", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLessThanOrEqualTo(String value) { + addCriterion("other_unit_two <=", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLike(String value) { + addCriterion("other_unit_two like", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotLike(String value) { + addCriterion("other_unit_two not like", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIn(List values) { + addCriterion("other_unit_two in", values, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotIn(List values) { + addCriterion("other_unit_two not in", values, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoBetween(String value1, String value2) { + addCriterion("other_unit_two between", value1, value2, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotBetween(String value1, String value2) { + addCriterion("other_unit_two not between", value1, value2, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIsNull() { + addCriterion("other_unit_three is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIsNotNull() { + addCriterion("other_unit_three is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeEqualTo(String value) { + addCriterion("other_unit_three =", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotEqualTo(String value) { + addCriterion("other_unit_three <>", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeGreaterThan(String value) { + addCriterion("other_unit_three >", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeGreaterThanOrEqualTo(String value) { + addCriterion("other_unit_three >=", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLessThan(String value) { + addCriterion("other_unit_three <", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLessThanOrEqualTo(String value) { + addCriterion("other_unit_three <=", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLike(String value) { + addCriterion("other_unit_three like", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotLike(String value) { + addCriterion("other_unit_three not like", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIn(List values) { + addCriterion("other_unit_three in", values, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotIn(List values) { + addCriterion("other_unit_three not in", values, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeBetween(String value1, String value2) { + addCriterion("other_unit_three between", value1, value2, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotBetween(String value1, String value2) { + addCriterion("other_unit_three not between", value1, value2, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andRatioIsNull() { + addCriterion("ratio is null"); + return (Criteria) this; + } + + public Criteria andRatioIsNotNull() { + addCriterion("ratio is not null"); + return (Criteria) this; + } + + public Criteria andRatioEqualTo(Integer value) { + addCriterion("ratio =", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotEqualTo(Integer value) { + addCriterion("ratio <>", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioGreaterThan(Integer value) { + addCriterion("ratio >", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioGreaterThanOrEqualTo(Integer value) { + addCriterion("ratio >=", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioLessThan(Integer value) { + addCriterion("ratio <", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioLessThanOrEqualTo(Integer value) { + addCriterion("ratio <=", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioIn(List values) { + addCriterion("ratio in", values, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotIn(List values) { + addCriterion("ratio not in", values, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioBetween(Integer value1, Integer value2) { + addCriterion("ratio between", value1, value2, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotBetween(Integer value1, Integer value2) { + addCriterion("ratio not between", value1, value2, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioTwoIsNull() { + addCriterion("ratio_two is null"); + return (Criteria) this; + } + + public Criteria andRatioTwoIsNotNull() { + addCriterion("ratio_two is not null"); + return (Criteria) this; + } + + public Criteria andRatioTwoEqualTo(Integer value) { + addCriterion("ratio_two =", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotEqualTo(Integer value) { + addCriterion("ratio_two <>", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoGreaterThan(Integer value) { + addCriterion("ratio_two >", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoGreaterThanOrEqualTo(Integer value) { + addCriterion("ratio_two >=", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoLessThan(Integer value) { + addCriterion("ratio_two <", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoLessThanOrEqualTo(Integer value) { + addCriterion("ratio_two <=", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoIn(List values) { + addCriterion("ratio_two in", values, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotIn(List values) { + addCriterion("ratio_two not in", values, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoBetween(Integer value1, Integer value2) { + addCriterion("ratio_two between", value1, value2, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotBetween(Integer value1, Integer value2) { + addCriterion("ratio_two not between", value1, value2, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioThreeIsNull() { + addCriterion("ratio_three is null"); + return (Criteria) this; + } + + public Criteria andRatioThreeIsNotNull() { + addCriterion("ratio_three is not null"); + return (Criteria) this; + } + + public Criteria andRatioThreeEqualTo(Integer value) { + addCriterion("ratio_three =", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotEqualTo(Integer value) { + addCriterion("ratio_three <>", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeGreaterThan(Integer value) { + addCriterion("ratio_three >", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeGreaterThanOrEqualTo(Integer value) { + addCriterion("ratio_three >=", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeLessThan(Integer value) { + addCriterion("ratio_three <", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeLessThanOrEqualTo(Integer value) { + addCriterion("ratio_three <=", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeIn(List values) { + addCriterion("ratio_three in", values, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotIn(List values) { + addCriterion("ratio_three not in", values, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeBetween(Integer value1, Integer value2) { + addCriterion("ratio_three between", value1, value2, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotBetween(Integer value1, Integer value2) { + addCriterion("ratio_three not between", value1, value2, "ratioThree"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java new file mode 100644 index 00000000..e9a77b46 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/User.java @@ -0,0 +1,38 @@ +package com.zsw.erp.datasource.entities; + +import lombok.Data; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +@Data +public class User { + @TableId(type = IdType.AUTO) + private Long id; + + private String username; + + private String loginName; + + private String password; + + private String position; + + private String department; + + private String email; + + private String phonenum; + + private Byte ismanager; + + private Byte isystem; + + private Byte status; + + private String description; + + private String remark; + + private Long tenantId; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java new file mode 100644 index 00000000..dd3328ca --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusiness.java @@ -0,0 +1,33 @@ +package com.zsw.erp.datasource.entities; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.zsw.erp.config.ArrayListTypeHandler; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@TableName(autoResultMap = true) +public class UserBusiness implements Serializable { + @TableId(type = IdType.AUTO) + private Long id; + + private String type; + + private String keyId; + + @TableField(value = "`value`",typeHandler = JacksonTypeHandler.class) + private List value; + + @TableField(value = "`btn_str`",typeHandler = ArrayListTypeHandler.class) + private List btnStr; + + private Long tenantId; + + private String deleteFlag; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java new file mode 100644 index 00000000..3bf3a42d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserBusinessExample.java @@ -0,0 +1,669 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class UserBusinessExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserBusinessExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andKeyIdIsNull() { + addCriterion("key_id is null"); + return (Criteria) this; + } + + public Criteria andKeyIdIsNotNull() { + addCriterion("key_id is not null"); + return (Criteria) this; + } + + public Criteria andKeyIdEqualTo(String value) { + addCriterion("key_id =", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotEqualTo(String value) { + addCriterion("key_id <>", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdGreaterThan(String value) { + addCriterion("key_id >", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdGreaterThanOrEqualTo(String value) { + addCriterion("key_id >=", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLessThan(String value) { + addCriterion("key_id <", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLessThanOrEqualTo(String value) { + addCriterion("key_id <=", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLike(String value) { + addCriterion("key_id like", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotLike(String value) { + addCriterion("key_id not like", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdIn(List values) { + addCriterion("key_id in", values, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotIn(List values) { + addCriterion("key_id not in", values, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdBetween(String value1, String value2) { + addCriterion("key_id between", value1, value2, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotBetween(String value1, String value2) { + addCriterion("key_id not between", value1, value2, "keyId"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("value is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("value is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("value =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("value <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("value >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("value >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("value <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("value <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("value like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("value not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("value in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("value not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("value between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("value not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andBtnStrIsNull() { + addCriterion("btn_str is null"); + return (Criteria) this; + } + + public Criteria andBtnStrIsNotNull() { + addCriterion("btn_str is not null"); + return (Criteria) this; + } + + public Criteria andBtnStrEqualTo(String value) { + addCriterion("btn_str =", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotEqualTo(String value) { + addCriterion("btn_str <>", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrGreaterThan(String value) { + addCriterion("btn_str >", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrGreaterThanOrEqualTo(String value) { + addCriterion("btn_str >=", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLessThan(String value) { + addCriterion("btn_str <", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLessThanOrEqualTo(String value) { + addCriterion("btn_str <=", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLike(String value) { + addCriterion("btn_str like", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotLike(String value) { + addCriterion("btn_str not like", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrIn(List values) { + addCriterion("btn_str in", values, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotIn(List values) { + addCriterion("btn_str not in", values, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrBetween(String value1, String value2) { + addCriterion("btn_str between", value1, value2, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotBetween(String value1, String value2) { + addCriterion("btn_str not between", value1, value2, "btnStr"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java new file mode 100644 index 00000000..2446c9a5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserEx.java @@ -0,0 +1,36 @@ +package com.zsw.erp.datasource.entities; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/8 15:12 + */ +@Data +public class UserEx extends User{ + //机构简称 + private String orgAbr; + //机构id + private Long orgaId; + //用户在部门中排序 + private String userBlngOrgaDsplSeq; + //机构用户关联关系id + private Long orgaUserRelId; + + private Long roleId; + + private String roleName; + + private String userType; + + private Integer userNumLimit; + + private String expireTime; + + @TableField(exist = false) + private Long storeId; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java new file mode 100644 index 00000000..7af69dae --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/entities/UserExample.java @@ -0,0 +1,1129 @@ +package com.zsw.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.List; + +public class UserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andPasswordIsNull() { + addCriterion("password is null"); + return (Criteria) this; + } + + public Criteria andPasswordIsNotNull() { + addCriterion("password is not null"); + return (Criteria) this; + } + + public Criteria andPasswordEqualTo(String value) { + addCriterion("password =", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotEqualTo(String value) { + addCriterion("password <>", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThan(String value) { + addCriterion("password >", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThanOrEqualTo(String value) { + addCriterion("password >=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThan(String value) { + addCriterion("password <", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThanOrEqualTo(String value) { + addCriterion("password <=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLike(String value) { + addCriterion("password like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotLike(String value) { + addCriterion("password not like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordIn(List values) { + addCriterion("password in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotIn(List values) { + addCriterion("password not in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordBetween(String value1, String value2) { + addCriterion("password between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotBetween(String value1, String value2) { + addCriterion("password not between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPositionIsNull() { + addCriterion("position is null"); + return (Criteria) this; + } + + public Criteria andPositionIsNotNull() { + addCriterion("position is not null"); + return (Criteria) this; + } + + public Criteria andPositionEqualTo(String value) { + addCriterion("position =", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotEqualTo(String value) { + addCriterion("position <>", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThan(String value) { + addCriterion("position >", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThanOrEqualTo(String value) { + addCriterion("position >=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThan(String value) { + addCriterion("position <", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThanOrEqualTo(String value) { + addCriterion("position <=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLike(String value) { + addCriterion("position like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotLike(String value) { + addCriterion("position not like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionIn(List values) { + addCriterion("position in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotIn(List values) { + addCriterion("position not in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionBetween(String value1, String value2) { + addCriterion("position between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotBetween(String value1, String value2) { + addCriterion("position not between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andDepartmentIsNull() { + addCriterion("department is null"); + return (Criteria) this; + } + + public Criteria andDepartmentIsNotNull() { + addCriterion("department is not null"); + return (Criteria) this; + } + + public Criteria andDepartmentEqualTo(String value) { + addCriterion("department =", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotEqualTo(String value) { + addCriterion("department <>", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentGreaterThan(String value) { + addCriterion("department >", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentGreaterThanOrEqualTo(String value) { + addCriterion("department >=", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLessThan(String value) { + addCriterion("department <", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLessThanOrEqualTo(String value) { + addCriterion("department <=", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLike(String value) { + addCriterion("department like", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotLike(String value) { + addCriterion("department not like", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentIn(List values) { + addCriterion("department in", values, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotIn(List values) { + addCriterion("department not in", values, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentBetween(String value1, String value2) { + addCriterion("department between", value1, value2, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotBetween(String value1, String value2) { + addCriterion("department not between", value1, value2, "department"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andPhonenumIsNull() { + addCriterion("phonenum is null"); + return (Criteria) this; + } + + public Criteria andPhonenumIsNotNull() { + addCriterion("phonenum is not null"); + return (Criteria) this; + } + + public Criteria andPhonenumEqualTo(String value) { + addCriterion("phonenum =", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotEqualTo(String value) { + addCriterion("phonenum <>", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumGreaterThan(String value) { + addCriterion("phonenum >", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumGreaterThanOrEqualTo(String value) { + addCriterion("phonenum >=", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLessThan(String value) { + addCriterion("phonenum <", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLessThanOrEqualTo(String value) { + addCriterion("phonenum <=", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLike(String value) { + addCriterion("phonenum like", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotLike(String value) { + addCriterion("phonenum not like", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumIn(List values) { + addCriterion("phonenum in", values, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotIn(List values) { + addCriterion("phonenum not in", values, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumBetween(String value1, String value2) { + addCriterion("phonenum between", value1, value2, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotBetween(String value1, String value2) { + addCriterion("phonenum not between", value1, value2, "phonenum"); + return (Criteria) this; + } + + public Criteria andIsmanagerIsNull() { + addCriterion("ismanager is null"); + return (Criteria) this; + } + + public Criteria andIsmanagerIsNotNull() { + addCriterion("ismanager is not null"); + return (Criteria) this; + } + + public Criteria andIsmanagerEqualTo(Byte value) { + addCriterion("ismanager =", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotEqualTo(Byte value) { + addCriterion("ismanager <>", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerGreaterThan(Byte value) { + addCriterion("ismanager >", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerGreaterThanOrEqualTo(Byte value) { + addCriterion("ismanager >=", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerLessThan(Byte value) { + addCriterion("ismanager <", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerLessThanOrEqualTo(Byte value) { + addCriterion("ismanager <=", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerIn(List values) { + addCriterion("ismanager in", values, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotIn(List values) { + addCriterion("ismanager not in", values, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerBetween(Byte value1, Byte value2) { + addCriterion("ismanager between", value1, value2, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotBetween(Byte value1, Byte value2) { + addCriterion("ismanager not between", value1, value2, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsystemIsNull() { + addCriterion("isystem is null"); + return (Criteria) this; + } + + public Criteria andIsystemIsNotNull() { + addCriterion("isystem is not null"); + return (Criteria) this; + } + + public Criteria andIsystemEqualTo(Byte value) { + addCriterion("isystem =", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotEqualTo(Byte value) { + addCriterion("isystem <>", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThan(Byte value) { + addCriterion("isystem >", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThanOrEqualTo(Byte value) { + addCriterion("isystem >=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThan(Byte value) { + addCriterion("isystem <", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThanOrEqualTo(Byte value) { + addCriterion("isystem <=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemIn(List values) { + addCriterion("isystem in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotIn(List values) { + addCriterion("isystem not in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemBetween(Byte value1, Byte value2) { + addCriterion("isystem between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotBetween(Byte value1, Byte value2) { + addCriterion("isystem not between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("Status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("Status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Byte value) { + addCriterion("Status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Byte value) { + addCriterion("Status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Byte value) { + addCriterion("Status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("Status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Byte value) { + addCriterion("Status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Byte value) { + addCriterion("Status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("Status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("Status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Byte value1, Byte value2) { + addCriterion("Status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Byte value1, Byte value2) { + addCriterion("Status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapper.java new file mode 100644 index 00000000..0afb9e78 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.AccountHead; +import com.zsw.erp.datasource.entities.AccountHeadExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface AccountHeadMapper { + long countByExample(AccountHeadExample example); + + int deleteByExample(AccountHeadExample example); + + int deleteByPrimaryKey(Long id); + + int insert(AccountHead record); + + int insertSelective(AccountHead record); + + List selectByExample(AccountHeadExample example); + + AccountHead selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") AccountHead record, @Param("example") AccountHeadExample example); + + int updateByExample(@Param("record") AccountHead record, @Param("example") AccountHeadExample example); + + int updateByPrimaryKeySelective(AccountHead record); + + int updateByPrimaryKey(AccountHead record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapperEx.java new file mode 100644 index 00000000..e648d3e8 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountHeadMapperEx.java @@ -0,0 +1,51 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.AccountHead; +import com.zsw.erp.datasource.entities.AccountHeadVo4ListEx; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public interface AccountHeadMapperEx { + + List selectByConditionAccountHead( + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("billNo") String billNo, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("handsPersonId") Long handsPersonId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccountHead( + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("billNo") String billNo, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("handsPersonId") Long handsPersonId); + + BigDecimal findAllMoney( + @Param("supplierId") Integer supplierId, + @Param("type") String type, + @Param("modeName") String modeName, + @Param("endTime") String endTime); + + List getDetailByNumber( + @Param("billNo") String billNo); + + int batchDeleteAccountHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + List getAccountHeadListByAccountIds(@Param("accountIds") String[] accountIds); + + List getAccountHeadListByOrganIds(@Param("organIds") String[] organIds); + + List getAccountHeadListByHandsPersonIds(@Param("handsPersonIds") String[] handsPersonIds); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapper.java new file mode 100644 index 00000000..b39da609 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.AccountItem; +import com.zsw.erp.datasource.entities.AccountItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface AccountItemMapper { + long countByExample(AccountItemExample example); + + int deleteByExample(AccountItemExample example); + + int deleteByPrimaryKey(Long id); + + int insert(AccountItem record); + + int insertSelective(AccountItem record); + + List selectByExample(AccountItemExample example); + + AccountItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") AccountItem record, @Param("example") AccountItemExample example); + + int updateByExample(@Param("record") AccountItem record, @Param("example") AccountItemExample example); + + int updateByPrimaryKeySelective(AccountItem record); + + int updateByPrimaryKey(AccountItem record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapperEx.java new file mode 100644 index 00000000..b7819e99 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountItemMapperEx.java @@ -0,0 +1,39 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.AccountItem; +import com.zsw.erp.datasource.vo.AccountItemVo4List; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public interface AccountItemMapperEx { + + List selectByConditionAccountItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccountItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + List getDetailList( + @Param("headerId") Long headerId); + + int batchDeleteAccountItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + List getAccountItemListByAccountIds(@Param("accountIds") String[] accountIds); + + List getAccountItemListByHeaderIds(@Param("headerIds") String[] headerIds); + + List getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds); + + int batchDeleteAccountItemByHeadIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + BigDecimal getEachAmountByBillId(@Param("billId") Long billId); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapper.java new file mode 100644 index 00000000..5c8c87d3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Account; +import com.zsw.erp.datasource.entities.AccountExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface AccountMapper { + long countByExample(AccountExample example); + + int deleteByExample(AccountExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Account record); + + int insertSelective(Account record); + + List selectByExample(AccountExample example); + + Account selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Account record, @Param("example") AccountExample example); + + int updateByExample(@Param("record") Account record, @Param("example") AccountExample example); + + int updateByPrimaryKeySelective(Account record); + + int updateByPrimaryKey(Account record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapperEx.java new file mode 100644 index 00000000..db7e404c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/AccountMapperEx.java @@ -0,0 +1,39 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Account; +import com.zsw.erp.datasource.vo.AccountVo4InOutList; +import com.zsw.erp.datasource.vo.AccountVo4List; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface AccountMapperEx { + + List getAccountByParam( + @Param("name") String name, + @Param("serialNo") String serialNo); + + List selectByConditionAccount( + @Param("name") String name, + @Param("serialNo") String serialNo, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccount( + @Param("name") String name, + @Param("serialNo") String serialNo, + @Param("remark") String remark); + + List findAccountInOutList( + @Param("accountId") Long accountId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findAccountInOutListCount( + @Param("accountId") Long accountId); + + int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/BomMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/BomMapper.java new file mode 100644 index 00000000..e77770a0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/BomMapper.java @@ -0,0 +1,9 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.Bom; +import org.springframework.stereotype.Repository; + +@Repository +public interface BomMapper extends BaseMapper { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapper.java new file mode 100644 index 00000000..2158f7e7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapper.java @@ -0,0 +1,28 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.DepotHead; +import com.zsw.erp.datasource.entities.DepotHeadExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface DepotHeadMapper extends BaseMapper { + long countByExample(DepotHeadExample example); + + int deleteByExample(DepotHeadExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(DepotHeadExample example); + + DepotHead selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example); + + int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example); + + int updateByPrimaryKeySelective(DepotHead record); + + int updateByPrimaryKey(DepotHead record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapperEx.java new file mode 100644 index 00000000..2bc82bcf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotHeadMapperEx.java @@ -0,0 +1,198 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.DepotHead; +import com.zsw.erp.datasource.vo.DepotHeadVo4InDetail; +import com.zsw.erp.datasource.vo.DepotHeadVo4InOutMCount; +import com.zsw.erp.datasource.vo.DepotHeadVo4List; +import com.zsw.erp.datasource.vo.DepotHeadVo4StatementAccount; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/25 14:50 + */ +public interface DepotHeadMapperEx { + + /** + * 增加批次处理。 + * @param type + * @param subType + * @param creatorArray + * @param statusArray + * @param number + * @param linkNumber + * @param beginTime + * @param endTime + * @param materialParam + * @param organId + * @param creator + * @param depotId + * @param depotArray + * @param offset + * @param rows + * @param startTime + * @return + */ + List selectByConditionDepotHead( + @Param("type") String type, + @Param("subType") String subType, + @Param("creatorArray") String[] creatorArray, + @Param("statusArray") String[] statusArray, + @Param("number") String number, + @Param("linkNumber") String linkNumber, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("depotId") Long depotId, + @Param("depotArray") String[] depotArray, + @Param("offset") Integer offset, + @Param("rows") Integer rows, + @Param("startTime") String startTime); + + Long countsByDepotHead( + @Param("type") String type, + @Param("subType") String subType, + @Param("creatorArray") String[] creatorArray, + @Param("statusArray") String[] statusArray, + @Param("number") String number, + @Param("linkNumber") String linkNumber, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("depotId") Long depotId, + @Param("depotArray") String[] depotArray); + + String findMaterialsListByHeaderId( + @Param("id") Long id); + + List findByAll( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("number") String number, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findByAllCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("number") String number); + + List findInOutMaterialCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findInOutMaterialCountTotal( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId); + + List findAllocationDetail( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("subType") String subType, + @Param("number") String number, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("depotFList") List depotFList, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findAllocationDetailCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("subType") String subType, + @Param("number") String number, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("depotFList") List depotFList); + + List findStatementAccount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Integer organId, + @Param("supType") String supType, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findStatementAccountCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Integer organId, + @Param("supType") String supType); + + BigDecimal findAllMoney( + @Param("supplierId") Integer supplierId, + @Param("type") String type, + @Param("subType") String subType, + @Param("modeName") String modeName, + @Param("endTime") String endTime); + + BigDecimal findAllOtherMoney( + @Param("supplierId") Integer supplierId, + @Param("type") String type, + @Param("subType") String subType, + @Param("endTime") String endTime); + + List getDetailByNumber( + @Param("number") String number); + + int batchDeleteDepotHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getDepotHeadListByAccountIds(@Param("accountIds") String[] accountIds); + + List getDepotHeadListByOrganIds(@Param("organIds") String[] organIds); + + List getDepotHeadListByCreator(@Param("creatorArray") String[] creatorArray); + + BigDecimal getBuyAndSaleStatistics( + @Param("type") String type, + @Param("subType") String subType, + @Param("hasSupplier") Integer hasSupplier, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + BigDecimal getBuyAndSaleRetailStatistics( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + List debtList( + @Param("organId") Long organId, + @Param("type") String type, + @Param("subType") String subType, + @Param("creatorArray") String[] creatorArray, + @Param("status") String status, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("depotArray") String[] depotArray); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapper.java new file mode 100644 index 00000000..31d5aae1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapper.java @@ -0,0 +1,34 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.DepotItem; +import com.zsw.erp.datasource.entities.DepotItemExample; +import java.util.List; + +import com.zsw.erp.dto.depotItem.BatchStockDto; +import com.zsw.erp.dto.depotItem.BatchStockPageVo; +import org.apache.ibatis.annotations.Param; + +public interface DepotItemMapper extends BaseMapper { + long countByExample(DepotItemExample example); + + int deleteByExample(DepotItemExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(DepotItemExample example); + + DepotItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") DepotItem record, @Param("example") DepotItemExample example); + + int updateByExample(@Param("record") DepotItem record, @Param("example") DepotItemExample example); + + int updateByPrimaryKeySelective(DepotItem record); + + int updateByPrimaryKey(DepotItem record); + + int batchStockCount(BatchStockDto dto); + + List batchStockPage(BatchStockDto dto); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapperEx.java new file mode 100644 index 00000000..88aaf0db --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotItemMapperEx.java @@ -0,0 +1,142 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.vo.DepotItemStockWarningCount; +import com.zsw.erp.datasource.vo.DepotItemVo4Stock; +import com.zsw.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.zsw.erp.datasource.entities.DepotItem; +import com.zsw.erp.datasource.entities.DepotItemVo4DetailByTypeAndMId; +import com.zsw.erp.datasource.entities.DepotItemVo4WithInfoEx; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/24 16:59 + */ +public interface DepotItemMapperEx { + List selectByConditionDepotItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByDepotItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + List findDetailByTypeAndMaterialIdList( + @Param("mId") Long mId, + @Param("startTime") String startTime, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long findDetailByTypeAndMaterialIdCounts( + @Param("mId") Long mId); + + List getDetailList( + @Param("headerId") Long headerId); + + List findByAll( + @Param("materialParam") String materialParam, + @Param("endTime") String endTime, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findByAllCount( + @Param("materialParam") String materialParam, + @Param("endTime") String endTime); + + BigDecimal buyOrSaleNumber( + @Param("type") String type, + @Param("subType") String subType, + @Param("MId") Long MId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("sumType") String sumType); + + BigDecimal buyOrSalePrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("MId") Long MId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("sumType") String sumType); + + BigDecimal inOrOutPrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + BigDecimal inOrOutRetailPrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + BigDecimal getStockCheckSumByDepotList( + @Param("depotList") List depotList, + @Param("mId") Long mId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + DepotItemVo4Stock getSkuStockByParam( + @Param("depotId") Long depotId, + @Param("meId") Long meId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + DepotItemVo4Stock getStockByParamWithDepotList( + @Param("depotList") List depotList, + @Param("mId") Long mId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + /** + * 通过单据主表id查询所有单据子表数据 + * @param depotheadId + * @param enableSerialNumber + * @return + */ + List findDepotItemListBydepotheadId(@Param("depotheadId")Long depotheadId, + @Param("enableSerialNumber")String enableSerialNumber); + /** + * 根据单据主表id删除单据子表数据 + * */ + int batchDeleteDepotItemByDepotHeadIds(@Param("depotheadIds")Long []depotHeadIds); + + int batchDeleteDepotItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getDepotItemListListByDepotIds(@Param("depotIds") String[] depotIds); + + List getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds); + + List findStockWarningCount( + @Param("offset") Integer offset, + @Param("rows") Integer rows, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList); + + int findStockWarningCountTotal( + @Param("materialParam") String materialParam, + @Param("depotList") List depotList); + + BigDecimal getFinishNumber( + @Param("mId") Long mId, + @Param("linkNumber") String linkNumber, + @Param("goToType") String goToType); + + List getBatchNumberList( + @Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode, + @Param("batchNumber") String batchNumber + ); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapper.java new file mode 100644 index 00000000..cfbc36b5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapper.java @@ -0,0 +1,82 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.Depot; +import com.zsw.erp.datasource.entities.DepotExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface DepotMapper extends BaseMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int countByExample(DepotExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int deleteByExample(DepotExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + List selectByExample(DepotExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + Depot selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int updateByExampleSelective(@Param("record") Depot record, @Param("example") DepotExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int updateByExample(@Param("record") Depot record, @Param("example") DepotExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int updateByPrimaryKeySelective(Depot record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_depot + * + * @mbggenerated + */ + int updateByPrimaryKey(Depot record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapperEx.java new file mode 100644 index 00000000..08b09f00 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/DepotMapperEx.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.DepotEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface DepotMapperEx { + + List selectByConditionDepot( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByDepot( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + int batchDeleteDepotByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapper.java new file mode 100644 index 00000000..b3dedf0a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapper.java @@ -0,0 +1,28 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.Function; +import com.zsw.erp.datasource.entities.FunctionExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface FunctionMapper extends BaseMapper { + long countByExample(FunctionExample example); + + int deleteByExample(FunctionExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(FunctionExample example); + + Function selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Function record, @Param("example") FunctionExample example); + + int updateByExample(@Param("record") Function record, @Param("example") FunctionExample example); + + int updateByPrimaryKeySelective(Function record); + + int updateByPrimaryKey(Function record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapperEx.java new file mode 100644 index 00000000..678e23b6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/FunctionMapperEx.java @@ -0,0 +1,22 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Function; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface FunctionMapperEx { + + List selectByConditionFunction( + @Param("name") String name, + @Param("type") String type, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByFunction( + @Param("name") String name, + @Param("type") String type); + + int batchDeleteFunctionByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapper.java new file mode 100644 index 00000000..222035fc --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.InOutItem; +import com.zsw.erp.datasource.entities.InOutItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface InOutItemMapper { + long countByExample(InOutItemExample example); + + int deleteByExample(InOutItemExample example); + + int deleteByPrimaryKey(Long id); + + int insert(InOutItem record); + + int insertSelective(InOutItem record); + + List selectByExample(InOutItemExample example); + + InOutItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") InOutItem record, @Param("example") InOutItemExample example); + + int updateByExample(@Param("record") InOutItem record, @Param("example") InOutItemExample example); + + int updateByPrimaryKeySelective(InOutItem record); + + int updateByPrimaryKey(InOutItem record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapperEx.java new file mode 100644 index 00000000..56572dad --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InOutItemMapperEx.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.InOutItem; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface InOutItemMapperEx { + + List selectByConditionInOutItem( + @Param("name") String name, + @Param("type") String type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByInOutItem( + @Param("name") String name, + @Param("type") String type, + @Param("remark") String remark); + + int batchDeleteInOutItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InventorySeasonMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InventorySeasonMapper.java new file mode 100644 index 00000000..5bf5546f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/InventorySeasonMapper.java @@ -0,0 +1,9 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.InventorySeason; +import org.springframework.stereotype.Repository; + +@Repository +public interface InventorySeasonMapper extends BaseMapper { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java new file mode 100644 index 00000000..9d5582ac --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapper.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Log; +import com.zsw.erp.datasource.entities.LogExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface LogMapper { + long countByExample(LogExample example); + + int deleteByExample(LogExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Log record); + + int insertSelective(Log record); + + List selectByExample(LogExample example); + + Log selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Log record, @Param("example") LogExample example); + + int updateByExample(@Param("record") Log record, @Param("example") LogExample example); + + int updateByPrimaryKeySelective(Log record); + + int updateByPrimaryKey(Log record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapperEx.java new file mode 100644 index 00000000..09ce6f2e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/LogMapperEx.java @@ -0,0 +1,34 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.vo.LogVo4List; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface LogMapperEx { + + List selectByConditionLog( + @Param("operation") String operation, + @Param("userInfo") String userInfo, + @Param("clientIp") String clientIp, + @Param("status") Integer status, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("content") String content, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByLog( + @Param("operation") String operation, + @Param("userInfo") String userInfo, + @Param("clientIp") String clientIp, + @Param("status") Integer status, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("content") String content); + + Long getCountByIpAndDate( + @Param("moduleName") String moduleName, + @Param("clientIp") String clientIp, + @Param("createTime") String createTime); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapper.java new file mode 100644 index 00000000..e7c964a1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialAttribute; +import com.zsw.erp.datasource.entities.MaterialAttributeExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialAttributeMapper { + long countByExample(MaterialAttributeExample example); + + int deleteByExample(MaterialAttributeExample example); + + int deleteByPrimaryKey(Long id); + + int insert(MaterialAttribute record); + + int insertSelective(MaterialAttribute record); + + List selectByExample(MaterialAttributeExample example); + + MaterialAttribute selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialAttribute record, @Param("example") MaterialAttributeExample example); + + int updateByExample(@Param("record") MaterialAttribute record, @Param("example") MaterialAttributeExample example); + + int updateByPrimaryKeySelective(MaterialAttribute record); + + int updateByPrimaryKey(MaterialAttribute record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapperEx.java new file mode 100644 index 00000000..e7cd61bc --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialAttributeMapperEx.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialAttribute; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MaterialAttributeMapperEx { + + List selectByConditionMaterialAttribute( + @Param("attributeField") String attributeField, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialAttribute( + @Param("attributeField") String attributeField); + + int batchDeleteMaterialAttributeByIds( + @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapper.java new file mode 100644 index 00000000..609c5116 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialCategory; +import com.zsw.erp.datasource.entities.MaterialCategoryExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialCategoryMapper { + long countByExample(MaterialCategoryExample example); + + int deleteByExample(MaterialCategoryExample example); + + int deleteByPrimaryKey(Long id); + + int insert(MaterialCategory record); + + int insertSelective(MaterialCategory record); + + List selectByExample(MaterialCategoryExample example); + + MaterialCategory selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + int updateByExample(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + int updateByPrimaryKeySelective(MaterialCategory record); + + int updateByPrimaryKey(MaterialCategory record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapperEx.java new file mode 100644 index 00000000..0a456442 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCategoryMapperEx.java @@ -0,0 +1,42 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialCategory; +import com.zsw.erp.datasource.vo.TreeNode; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/2/18 17:23 + */ +public interface MaterialCategoryMapperEx { + List selectByConditionMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId); + + List getNodeTree(@Param("currentId")Long currentId); + List getNextNodeTree(Map parameterMap); + + int addMaterialCategory(MaterialCategory mc); + + int batchDeleteMaterialCategoryByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + int editMaterialCategory(MaterialCategory mc); + + List getMaterialCategoryBySerialNo(@Param("serialNo") String serialNo, @Param("id") Long id); + + List getMaterialCategoryListByCategoryIds(@Param("parentIds") String[] categoryIds); + + List getListByParentId(@Param("parentId") Long parentId); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCurrentStockMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCurrentStockMapper.java new file mode 100644 index 00000000..fffa8921 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialCurrentStockMapper.java @@ -0,0 +1,32 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.MaterialCurrentStock; +import com.zsw.erp.datasource.entities.MaterialCurrentStockExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface MaterialCurrentStockMapper extends BaseMapper { + long countByExample(MaterialCurrentStockExample example); + + int deleteByExample(MaterialCurrentStockExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(MaterialCurrentStockExample example); + + MaterialCurrentStock selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialCurrentStock record, @Param("example") MaterialCurrentStockExample example); + + int updateByExample(@Param("record") MaterialCurrentStock record, @Param("example") MaterialCurrentStockExample example); + + int updateByPrimaryKeySelective(MaterialCurrentStock record); + + int updateByPrimaryKey(MaterialCurrentStock record); + + MaterialCurrentStock getOneByBarcodeAndDept(String barCode ,Long depotId); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapper.java new file mode 100644 index 00000000..80daed4a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapper.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.MaterialExtend; +import com.zsw.erp.datasource.entities.MaterialExtendExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialExtendMapper extends BaseMapper { + long countByExample(MaterialExtendExample example); + + int deleteByExample(MaterialExtendExample example); + + int deleteByPrimaryKey(Long id); + + int insertSelective(MaterialExtend record); + + List selectByExample(MaterialExtendExample example); + + MaterialExtend selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialExtend record, @Param("example") MaterialExtendExample example); + + int updateByExample(@Param("record") MaterialExtend record, @Param("example") MaterialExtendExample example); + + int updateByPrimaryKeySelective(MaterialExtend record); + + int updateByPrimaryKey(MaterialExtend record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapperEx.java new file mode 100644 index 00000000..88a67bde --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialExtendMapperEx.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialExtend; +import com.zsw.erp.datasource.vo.MaterialExtendVo4List; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MaterialExtendMapperEx { + + int batchDeleteMaterialExtendByIds(@Param("ids") String ids[]); + + List getDetailList( + @Param("materialId") Long materialId); + + Long getMaxTimeByTenantAndTime( + @Param("tenantId") Long tenantId, + @Param("lastTime") Long lastTime, + @Param("syncNum") Long syncNum); + + List getListByMId(@Param("ids") Long ids[]); + + int batchDeleteMaterialExtendByMIds(@Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialInitialStockMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialInitialStockMapper.java new file mode 100644 index 00000000..c24cf8e9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialInitialStockMapper.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.MaterialInitialStock; +import com.zsw.erp.datasource.entities.MaterialInitialStockExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface MaterialInitialStockMapper extends BaseMapper { + long countByExample(MaterialInitialStockExample example); + + int deleteByExample(MaterialInitialStockExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(MaterialInitialStockExample example); + + MaterialInitialStock selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialInitialStock record, @Param("example") MaterialInitialStockExample example); + + int updateByExample(@Param("record") MaterialInitialStock record, @Param("example") MaterialInitialStockExample example); + + int updateByPrimaryKeySelective(MaterialInitialStock record); + + int updateByPrimaryKey(MaterialInitialStock record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapper.java new file mode 100644 index 00000000..23d2e9df --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapper.java @@ -0,0 +1,34 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.Material; +import com.zsw.erp.datasource.entities.MaterialExample; +import java.util.List; + +import com.zsw.erp.dto.material.MaterialDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface MaterialMapper extends BaseMapper { + + long countByExample(MaterialExample example); + + int deleteByExample(MaterialExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(MaterialExample example); + + Material selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Material record, @Param("example") MaterialExample example); + + int updateByExample(@Param("record") Material record, @Param("example") MaterialExample example); + + int updateByPrimaryKeySelective(Material record); + + int updateByPrimaryKey(Material record); + + List getMaterialListByNameOrCode(@Param("keyWord") String keyWord); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapperEx.java new file mode 100644 index 00000000..9d0ae4a7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialMapperEx.java @@ -0,0 +1,126 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Material; +import com.zsw.erp.datasource.entities.MaterialVo4Unit; +import com.zsw.erp.datasource.entities.Unit; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/22 14:54 + */ +public interface MaterialMapperEx { + + List selectByConditionMaterial( + @Param("barCode") String barCode, + @Param("name") String name, + @Param("standard") String standard, + @Param("model") String model, + @Param("idList") List idList, + @Param("mpList") String mpList, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterial( + @Param("barCode") String barCode, + @Param("name") String name, + @Param("standard") String standard, + @Param("model") String model, + @Param("idList") List idList, + @Param("mpList") String mpList); + + List findUnitList(@Param("mId") Long mId); + + List findById(@Param("id") Long id); + + List findByIdWithBarCode(@Param("meId") Long meId); + + List findBySelectWithBarCode(@Param("idList") List idList, + @Param("q") String q, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findBySelectWithBarCodeCount(@Param("idList") List idList, + @Param("q") String q); + + List findByAll( + @Param("barCode") String barCode, + @Param("name") String name, + @Param("standard") String standard, + @Param("model") String model, + @Param("idList") List idList); + /** + * 通过商品名称查询商品信息 + * */ + List findByMaterialName(@Param("name") String name); + /** + * 获取开启序列号并且状态正常的商品列表 + * */ + List getMaterialEnableSerialNumberList(@Param("q") String q, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long getMaterialEnableSerialNumberCount(@Param("q") String q); + + int batchDeleteMaterialByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getMaterialListByCategoryIds(@Param("categoryIds") String[] categoryIds); + + List getMaterialListByUnitIds(@Param("unitIds") String[] unitIds); + + String getMaxBarCode(); + + List getMaterialByMeId( + @Param("meId") Long meId); + + List getMaterialNameList(); + + int setUnitIdToNull(@Param("id") Long id); + + int setExpiryNumToNull(@Param("id") Long id); + + List getMaterialByBarCode(@Param("barCodeArray") String [] barCodeArray); + + List getListWithStock( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("materialParam") String materialParam, + @Param("zeroStock") Integer zeroStock, + @Param("startTime")String startTime, + @Param("column") String column, + @Param("order") String order, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int getListWithStockCount( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("materialParam") String materialParam, + @Param("zeroStock") Integer zeroStock, + @Param("startTime")String startTime + ); + + MaterialVo4Unit getTotalStockAndPrice( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("materialParam") String materialParam, + @Param("startTime")String startTime); + + int checkIsExist( + @Param("id") Long id, + @Param("name") String name, + @Param("model") String model, + @Param("color") String color, + @Param("standard") String standard, + @Param("mfrs") String mfrs, + @Param("otherField1") String otherField1, + @Param("otherField2") String otherField2, + @Param("otherField3") String otherField3, + @Param("unit") String unit, + @Param("unitId") Long unitId); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapper.java new file mode 100644 index 00000000..3af36fbf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialProperty; +import com.zsw.erp.datasource.entities.MaterialPropertyExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialPropertyMapper { + long countByExample(MaterialPropertyExample example); + + int deleteByExample(MaterialPropertyExample example); + + int deleteByPrimaryKey(Long id); + + int insert(MaterialProperty record); + + int insertSelective(MaterialProperty record); + + List selectByExample(MaterialPropertyExample example); + + MaterialProperty selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialProperty record, @Param("example") MaterialPropertyExample example); + + int updateByExample(@Param("record") MaterialProperty record, @Param("example") MaterialPropertyExample example); + + int updateByPrimaryKeySelective(MaterialProperty record); + + int updateByPrimaryKey(MaterialProperty record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapperEx.java new file mode 100644 index 00000000..c4f6311b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MaterialPropertyMapperEx.java @@ -0,0 +1,19 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.MaterialProperty; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface MaterialPropertyMapperEx { + + List selectByConditionMaterialProperty( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialProperty(@Param("name") String name); + + int batchDeleteMaterialPropertyByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapper.java new file mode 100644 index 00000000..cbbed684 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapper.java @@ -0,0 +1,97 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Msg; +import com.zsw.erp.datasource.entities.MsgExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MsgMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int countByExample(MsgExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int deleteByExample(MsgExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int insert(Msg record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int insertSelective(Msg record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + List selectByExample(MsgExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + Msg selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int updateByExampleSelective(@Param("record") Msg record, @Param("example") MsgExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int updateByExample(@Param("record") Msg record, @Param("example") MsgExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int updateByPrimaryKeySelective(Msg record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_msg + * + * @mbggenerated + */ + int updateByPrimaryKey(Msg record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapperEx.java new file mode 100644 index 00000000..9efa366f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/MsgMapperEx.java @@ -0,0 +1,28 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Msg; +import com.zsw.erp.datasource.entities.MsgEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MsgMapperEx { + + List selectByConditionMsg( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMsg( + @Param("name") String name); + + int batchDeleteMsgByIds(@Param("ids") String ids[]); + + int insertSelectiveByTask(Msg record); + + int checkIsNameExistByTask(@Param("msgTitle") String msgTitle); + + Long getMsgCountByStatus( + @Param("status") String status, + @Param("userId") Long userId); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapper.java new file mode 100644 index 00000000..91aca3b3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapper.java @@ -0,0 +1,97 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.OrgaUserRel; +import com.zsw.erp.datasource.entities.OrgaUserRelExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface OrgaUserRelMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int countByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int deleteByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int insert(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int insertSelective(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + List selectByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + OrgaUserRel selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByExampleSelective(@Param("record") OrgaUserRel record, @Param("example") OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByExample(@Param("record") OrgaUserRel record, @Param("example") OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByPrimaryKeySelective(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByPrimaryKey(OrgaUserRel record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapperEx.java new file mode 100644 index 00000000..b78e83f6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrgaUserRelMapperEx.java @@ -0,0 +1,16 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.OrgaUserRel; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/12 9:13 + */ +public interface OrgaUserRelMapperEx { + + int addOrgaUserRel(OrgaUserRel orgaUserRel); + + int updateOrgaUserRel(OrgaUserRel orgaUserRel); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapper.java new file mode 100644 index 00000000..145b59a0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Organization; +import com.zsw.erp.datasource.entities.OrganizationExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface OrganizationMapper { + long countByExample(OrganizationExample example); + + int deleteByExample(OrganizationExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Organization record); + + int insertSelective(Organization record); + + List selectByExample(OrganizationExample example); + + Organization selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example); + + int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example); + + int updateByPrimaryKeySelective(Organization record); + + int updateByPrimaryKey(Organization record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapperEx.java new file mode 100644 index 00000000..da0e9aca --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/OrganizationMapperEx.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Organization; +import com.zsw.erp.datasource.vo.TreeNode; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:51 + */ +public interface OrganizationMapperEx { + + + List getNodeTree(@Param("currentId")Long currentId); + List getNextNodeTree(Map parameterMap); + + int addOrganization(Organization org); + + List getOrganizationByParentIds(@Param("ids") String ids[]); + + int batchDeleteOrganizationByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + int editOrganization(Organization org); + List getOrganizationRootByIds(@Param("ids") String ids[]); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapper.java new file mode 100644 index 00000000..c4e274cc --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Person; +import com.zsw.erp.datasource.entities.PersonExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface PersonMapper { + long countByExample(PersonExample example); + + int deleteByExample(PersonExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Person record); + + int insertSelective(Person record); + + List selectByExample(PersonExample example); + + Person selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Person record, @Param("example") PersonExample example); + + int updateByExample(@Param("record") Person record, @Param("example") PersonExample example); + + int updateByPrimaryKeySelective(Person record); + + int updateByPrimaryKey(Person record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapperEx.java new file mode 100644 index 00000000..93198988 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PersonMapperEx.java @@ -0,0 +1,21 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Person; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PersonMapperEx { + + List selectByConditionPerson( + @Param("name") String name, + @Param("type") String type, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByPerson( + @Param("name") String name, + @Param("type") String type); + + int batchDeletePersonByIds(@Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapper.java new file mode 100644 index 00000000..ea395e91 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.PlatformConfig; +import com.zsw.erp.datasource.entities.PlatformConfigExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface PlatformConfigMapper { + long countByExample(PlatformConfigExample example); + + int deleteByExample(PlatformConfigExample example); + + int deleteByPrimaryKey(Long id); + + int insert(PlatformConfig record); + + int insertSelective(PlatformConfig record); + + List selectByExample(PlatformConfigExample example); + + PlatformConfig selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") PlatformConfig record, @Param("example") PlatformConfigExample example); + + int updateByExample(@Param("record") PlatformConfig record, @Param("example") PlatformConfigExample example); + + int updateByPrimaryKeySelective(PlatformConfig record); + + int updateByPrimaryKey(PlatformConfig record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapperEx.java new file mode 100644 index 00000000..58bb84a2 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/PlatformConfigMapperEx.java @@ -0,0 +1,18 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.PlatformConfig; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PlatformConfigMapperEx { + + List selectByConditionPlatformConfig( + @Param("platformKey") String platformKey, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByPlatformConfig( + @Param("platformKey") String platformKey); + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java new file mode 100644 index 00000000..70dda1b4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapper.java @@ -0,0 +1,32 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.zsw.erp.datasource.entities.Role; +import com.zsw.erp.datasource.entities.RoleExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface RoleMapper { + long countByExample(RoleExample example); + + int deleteByExample(RoleExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Role record); + + int insertSelective(Role record); + + List selectByExample(RoleExample example); + + @InterceptorIgnore + Role selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example); + + int updateByExample(@Param("record") Role record, @Param("example") RoleExample example); + + int updateByPrimaryKeySelective(Role record); + + int updateByPrimaryKey(Role record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java new file mode 100644 index 00000000..e647218d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/RoleMapperEx.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Role; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface RoleMapperEx { + + List selectByConditionRole( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByRole( + @Param("name") String name); + + int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SequenceMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SequenceMapperEx.java new file mode 100644 index 00000000..0364eb0e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SequenceMapperEx.java @@ -0,0 +1,13 @@ +package com.zsw.erp.datasource.mappers; + +import org.apache.ibatis.annotations.Param; + +public interface SequenceMapperEx { + + void updateBuildOnlyNumber(); + + /** + * 获得一个全局唯一的数作为订单号的追加 + * */ + Long getBuildOnlyNumber(@Param("seq_name") String seq_name); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapper.java new file mode 100644 index 00000000..b75d8086 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.SerialNumber; +import com.zsw.erp.datasource.entities.SerialNumberExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SerialNumberMapper { + long countByExample(SerialNumberExample example); + + int deleteByExample(SerialNumberExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SerialNumber record); + + int insertSelective(SerialNumber record); + + List selectByExample(SerialNumberExample example); + + SerialNumber selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); + + int updateByExample(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); + + int updateByPrimaryKeySelective(SerialNumber record); + + int updateByPrimaryKey(SerialNumber record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapperEx.java new file mode 100644 index 00000000..48ab8903 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SerialNumberMapperEx.java @@ -0,0 +1,55 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.SerialNumber; +import com.zsw.erp.datasource.entities.SerialNumberEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 17:09 + */ +public interface SerialNumberMapperEx { + /** + * 新增序列号信息 + * */ + int addSerialNumber(SerialNumberEx serialNumberEx); + /** + * 修改序列号信息 + * */ + int updateSerialNumber(SerialNumberEx serialNumberEx); + /** + * 查询指定商品下有效的序列号数量 + * 未删除为卖出的视为有效 + * */ + int findSerialNumberByMaterialId(@Param("materialId") Long materialId); + /** + * 卖出: update jsh_serial_number set is_Sell='1' ,depothead_Id='depotheadId' where 1=1 and material_Id='materialId' + * and is_Sell !='1' and delete_Flag !='1' {limit 0,count} + * */ + int sellSerialNumber(@Param("materialId")Long materialId, @Param("outBillNo")String outBillNo, @Param("snArray") String snArray[], @Param("updateTime") Date updateTime,@Param("updater") Long updater); + /** + * 赎回:update jsh_serial_number set is_Sell='0',depothead_Id=null where 1=1 and material_Id='materialId' + * and depothead_Id='depotheadId' and is_Sell !='0' and delete_Flag !='1' {limit 0,count} + * */ + int cancelSerialNumber(@Param("materialId")Long materialId, @Param("outBillNo")String outBillNo, @Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater); + /** + * 批量添加序列号 + * */ + int batAddSerialNumber(@Param("list") List list); + + int batchDeleteSerialNumberByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getEnableSerialNumberList(@Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode, + @Param("offset") Integer offset, @Param("rows") Integer rows); + + Long getEnableSerialNumberCount(@Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode); +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapper.java new file mode 100644 index 00000000..9d14850c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Supplier; +import com.zsw.erp.datasource.entities.SupplierExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SupplierMapper { + long countByExample(SupplierExample example); + + int deleteByExample(SupplierExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Supplier record); + + int insertSelective(Supplier record); + + List selectByExample(SupplierExample example); + + Supplier selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Supplier record, @Param("example") SupplierExample example); + + int updateByExample(@Param("record") Supplier record, @Param("example") SupplierExample example); + + int updateByPrimaryKeySelective(Supplier record); + + int updateByPrimaryKey(Supplier record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapperEx.java new file mode 100644 index 00000000..f34d3993 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SupplierMapperEx.java @@ -0,0 +1,36 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Supplier; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface SupplierMapperEx { + + List selectByConditionSupplier( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsBySupplier( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone); + + List findByAll( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone); + + int batchDeleteSupplierByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + Supplier getSupplierByNameAndType( + @Param("supplier") String supplier, + @Param("type") String type); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java new file mode 100644 index 00000000..aeb4ce52 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapper.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.SystemConfig; +import com.zsw.erp.datasource.entities.SystemConfigExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SystemConfigMapper extends BaseMapper { + long countByExample(SystemConfigExample example); + + int deleteByExample(SystemConfigExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(SystemConfigExample example); + + int updateByExampleSelective(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example); + + int updateByExample(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example); + + int updateByPrimaryKeySelective(SystemConfig record); + + int updateByPrimaryKey(SystemConfig record); + + @InterceptorIgnore(tenantLine = "true") + SystemConfig selectByTenantId(@Param("tenantId") Long tenantId); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapperEx.java new file mode 100644 index 00000000..0353119c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/SystemConfigMapperEx.java @@ -0,0 +1,20 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.SystemConfig; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface SystemConfigMapperEx { + + List selectByConditionSystemConfig( + @Param("companyName") String companyName, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsBySystemConfig( + @Param("companyName") String companyName); + + int batchDeleteSystemConfigByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java new file mode 100644 index 00000000..ae5a1450 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapper.java @@ -0,0 +1,32 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.Tenant; +import com.zsw.erp.datasource.entities.TenantExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface TenantMapper extends BaseMapper { + long countByExample(TenantExample example); + + int deleteByExample(TenantExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(TenantExample example); + + @InterceptorIgnore(tenantLine = "true") + Tenant selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Tenant record, @Param("example") TenantExample example); + + int updateByExample(@Param("record") Tenant record, @Param("example") TenantExample example); + + int updateByPrimaryKeySelective(Tenant record); + + int updateByPrimaryKey(Tenant record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java new file mode 100644 index 00000000..34ad1e96 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/TenantMapperEx.java @@ -0,0 +1,21 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.TenantEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TenantMapperEx { + + List selectByConditionTenant( + @Param("loginName") String loginName, + @Param("type") String type, + @Param("enabled") String enabled, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByTenant( + @Param("loginName") String loginName, + @Param("type") String type, + @Param("enabled") String enabled); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapper.java new file mode 100644 index 00000000..81b5bc03 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapper.java @@ -0,0 +1,31 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Unit; +import com.zsw.erp.datasource.entities.UnitExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface UnitMapper { + long countByExample(UnitExample example); + + int deleteByExample(UnitExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Unit record); + + int insertSelective(Unit record); + + List selectByExample(UnitExample example); + + Unit selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Unit record, @Param("example") UnitExample example); + + int updateByExample(@Param("record") Unit record, @Param("example") UnitExample example); + + int updateByPrimaryKeySelective(Unit record); + + int updateByPrimaryKey(Unit record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapperEx.java new file mode 100644 index 00000000..a5f5b41c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UnitMapperEx.java @@ -0,0 +1,24 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.Unit; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface UnitMapperEx { + + List selectByConditionUnit( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByUnit( + @Param("name") String name); + + int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + void updateRatioTwoById(@Param("id") Long id); + + void updateRatioThreeById(@Param("id") Long id); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java new file mode 100644 index 00000000..c2a556c0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapper.java @@ -0,0 +1,13 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.UserBusiness; +import com.zsw.erp.datasource.entities.UserBusinessExample; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserBusinessMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java new file mode 100644 index 00000000..d1e97067 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserBusinessMapperEx.java @@ -0,0 +1,17 @@ +package com.zsw.erp.datasource.mappers; + +import org.apache.ibatis.annotations.Param; + +import java.util.Date; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/29 15:09 + */ +public interface UserBusinessMapperEx { + + int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java new file mode 100644 index 00000000..239ae92a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapper.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.entities.UserExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserMapper extends BaseMapper { + long countByExample(UserExample example); + + int deleteByExample(UserExample example); + + int deleteByPrimaryKey(Long id); + + List selectByExample(UserExample example); + + User selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + int updateByPrimaryKeySelective(User record); + + int updateByPrimaryKey(User record); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java new file mode 100644 index 00000000..99d9f688 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/mappers/UserMapperEx.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.mappers; + +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.entities.UserEx; +import com.zsw.erp.datasource.vo.TreeNodeEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +public interface UserMapperEx { + + List selectByConditionUser( + @Param("userName") String userName, + @Param("loginName") String loginName, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByUser( + @Param("userName") String userName, + @Param("loginName") String loginName); + + List getUserListByUserNameOrLoginName(@Param("userName") String userName, + @Param("loginName") String loginName); + + int batDeleteOrUpdateUser(@Param("ids") String ids[], @Param("status") byte status); + + List getNodeTree(); + List getNextNodeTree(Map parameterMap); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountItemVo4List.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountItemVo4List.java new file mode 100644 index 00000000..7001c5f1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountItemVo4List.java @@ -0,0 +1,36 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.AccountItem; + +public class AccountItemVo4List extends AccountItem { + + private String accountName; + + private String inOutItemName; + + private String billNumber; + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getInOutItemName() { + return inOutItemName; + } + + public void setInOutItemName(String inOutItemName) { + this.inOutItemName = inOutItemName; + } + + public String getBillNumber() { + return billNumber; + } + + public void setBillNumber(String billNumber) { + this.billNumber = billNumber; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4InOutList.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4InOutList.java new file mode 100644 index 00000000..3fd75d7f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4InOutList.java @@ -0,0 +1,116 @@ +package com.zsw.erp.datasource.vo; + +import java.math.BigDecimal; + +public class AccountVo4InOutList { + + private Long accountId; + + private String number; + + private String type; + + private String fromType; + + private String supplierName; + + private BigDecimal changeAmount; + + private BigDecimal balance; + + private String operTime; + + private String aList; + + private String amList; + + private Long tenantId; + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFromType() { + return fromType; + } + + public void setFromType(String fromType) { + this.fromType = fromType; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public String getOperTime() { + return operTime; + } + + public void setOperTime(String operTime) { + this.operTime = operTime; + } + + public String getaList() { + return aList; + } + + public void setaList(String aList) { + this.aList = aList; + } + + public String getAmList() { + return amList; + } + + public void setAmList(String amList) { + this.amList = amList; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4List.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4List.java new file mode 100644 index 00000000..6b9e16dd --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/AccountVo4List.java @@ -0,0 +1,16 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.Account; + +public class AccountVo4List extends Account { + + private String thisMonthAmount; + + public String getThisMonthAmount() { + return thisMonthAmount; + } + + public void setThisMonthAmount(String thisMonthAmount) { + this.thisMonthAmount = thisMonthAmount; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InDetail.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InDetail.java new file mode 100644 index 00000000..f7e179c4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InDetail.java @@ -0,0 +1,157 @@ +package com.zsw.erp.datasource.vo; + + +import java.math.BigDecimal; + +public class DepotHeadVo4InDetail { + + private String Number; + + private String barCode; + + private String MName; + + private String Model; + + private String standard; + + private BigDecimal UnitPrice; + + private String mUnit; + + private String newRemark; + + private BigDecimal OperNumber; + + private BigDecimal AllPrice; + + private String SName; + + private String DName; + + private String OperTime; + + private String NewType; + + private Long tenantId; + + public String getNumber() { + return Number; + } + + public void setNumber(String number) { + Number = number; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getMName() { + return MName; + } + + public void setMName(String MName) { + this.MName = MName; + } + + public String getModel() { + return Model; + } + + public void setModel(String model) { + Model = model; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public BigDecimal getUnitPrice() { + return UnitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + UnitPrice = unitPrice; + } + + public String getmUnit() { + return mUnit; + } + + public void setmUnit(String mUnit) { + this.mUnit = mUnit; + } + + public String getNewRemark() { + return newRemark; + } + + public void setNewRemark(String newRemark) { + this.newRemark = newRemark; + } + + public BigDecimal getOperNumber() { + return OperNumber; + } + + public void setOperNumber(BigDecimal operNumber) { + OperNumber = operNumber; + } + + public BigDecimal getAllPrice() { + return AllPrice; + } + + public void setAllPrice(BigDecimal allPrice) { + AllPrice = allPrice; + } + + public String getSName() { + return SName; + } + + public void setSName(String SName) { + this.SName = SName; + } + + public String getDName() { + return DName; + } + + public void setDName(String DName) { + this.DName = DName; + } + + public String getOperTime() { + return OperTime; + } + + public void setOperTime(String operTime) { + OperTime = operTime; + } + + public String getNewType() { + return NewType; + } + + public void setNewType(String newType) { + NewType = newType; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InOutMCount.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InOutMCount.java new file mode 100644 index 00000000..4c81a2e4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4InOutMCount.java @@ -0,0 +1,107 @@ +package com.zsw.erp.datasource.vo; + + +import java.math.BigDecimal; + +public class DepotHeadVo4InOutMCount { + + private Long MaterialId; + + private String barCode; + + private String mName; + + private String Model; + + private String standard; + + private String categoryName; + + private String materialUnit; + + private BigDecimal numSum; + + private BigDecimal priceSum; + + private Long tenantId; + + public Long getMaterialId() { + return MaterialId; + } + + public void setMaterialId(Long materialId) { + MaterialId = materialId; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getmName() { + return mName; + } + + public void setmName(String mName) { + this.mName = mName; + } + + public String getModel() { + return Model; + } + + public void setModel(String model) { + Model = model; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getMaterialUnit() { + return materialUnit; + } + + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit; + } + + public BigDecimal getNumSum() { + return numSum; + } + + public void setNumSum(BigDecimal numSum) { + this.numSum = numSum; + } + + public BigDecimal getPriceSum() { + return priceSum; + } + + public void setPriceSum(BigDecimal priceSum) { + this.priceSum = priceSum; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4List.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4List.java new file mode 100644 index 00000000..8a93526a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4List.java @@ -0,0 +1,148 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.DepotHead; + +import java.math.BigDecimal; + +public class DepotHeadVo4List extends DepotHead { + + private String projectName; + + private String organName; + + private String userName; + + private String accountName; + + private String allocationProjectName; + + private String materialsList; + + private String salesManStr; + + private String operTimeStr; + + private BigDecimal finishDebt; + + private String depotHeadType; + + private String creatorName; + + private String contacts; + + private String telephone; + + private String address; + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getOrganName() { + return organName; + } + + public void setOrganName(String organName) { + this.organName = organName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getAllocationProjectName() { + return allocationProjectName; + } + + public void setAllocationProjectName(String allocationProjectName) { + this.allocationProjectName = allocationProjectName; + } + + public String getMaterialsList() { + return materialsList; + } + + public void setMaterialsList(String materialsList) { + this.materialsList = materialsList; + } + + public String getSalesManStr() { + return salesManStr; + } + + public void setSalesManStr(String salesManStr) { + this.salesManStr = salesManStr; + } + + public String getOperTimeStr() { + return operTimeStr; + } + + public void setOperTimeStr(String operTimeStr) { + this.operTimeStr = operTimeStr; + } + + public BigDecimal getFinishDebt() { + return finishDebt; + } + + public void setFinishDebt(BigDecimal finishDebt) { + this.finishDebt = finishDebt; + } + + public String getDepotHeadType() { + return depotHeadType; + } + + public void setDepotHeadType(String depotHeadType) { + this.depotHeadType = depotHeadType; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4StatementAccount.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4StatementAccount.java new file mode 100644 index 00000000..9269017b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotHeadVo4StatementAccount.java @@ -0,0 +1,107 @@ +package com.zsw.erp.datasource.vo; + + +import java.math.BigDecimal; + +public class DepotHeadVo4StatementAccount { + + private String number; + + private String type; + + private BigDecimal discountLastMoney; + + private BigDecimal otherMoney; + + private BigDecimal billMoney; + + private BigDecimal changeAmount; + + private BigDecimal allPrice; + + private String supplierName; + + private String oTime; + + private Long tenantId; + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public BigDecimal getDiscountLastMoney() { + return discountLastMoney; + } + + public void setDiscountLastMoney(BigDecimal discountLastMoney) { + this.discountLastMoney = discountLastMoney; + } + + public BigDecimal getOtherMoney() { + return otherMoney; + } + + public void setOtherMoney(BigDecimal otherMoney) { + this.otherMoney = otherMoney; + } + + public BigDecimal getBillMoney() { + return billMoney; + } + + public void setBillMoney(BigDecimal billMoney) { + this.billMoney = billMoney; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getAllPrice() { + return allPrice; + } + + public void setAllPrice(BigDecimal allPrice) { + this.allPrice = allPrice; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public String getoTime() { + return oTime; + } + + public void setoTime(String oTime) { + this.oTime = oTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemStockWarningCount.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemStockWarningCount.java new file mode 100644 index 00000000..d2d76ba2 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemStockWarningCount.java @@ -0,0 +1,49 @@ +package com.zsw.erp.datasource.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotItemStockWarningCount { + + private Long MId; + + private String barCode; + + private String MName; + + private String MModel; + + private String MaterialUnit; + + private String MColor; + + private String MStandard; + + private String MMfrs; + + private String unitName; + + private String MaterialOther; + + private String MOtherField1; + + private String MOtherField2; + + private String MOtherField3; + + private String depotName; + + private BigDecimal currentNumber; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + + private BigDecimal lowCritical; + + private BigDecimal highCritical; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVo4Stock.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVo4Stock.java new file mode 100644 index 00000000..dc57dbb8 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVo4Stock.java @@ -0,0 +1,48 @@ +package com.zsw.erp.datasource.vo; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 这个类注释 不一定准确 是根据数据表字段转译 + */ +@Data +public class DepotItemVo4Stock { + + @ApiModelProperty("入库数量") + private BigDecimal inTotal = BigDecimal.ZERO; + + @ApiModelProperty("出库数量") + private BigDecimal outTotal = BigDecimal.ZERO; + + @ApiModelProperty("调拨入库") + private BigDecimal transfInTotal = BigDecimal.ZERO; + + @ApiModelProperty("调拨出库") + private BigDecimal transfOutTotal = BigDecimal.ZERO; + + @ApiModelProperty("组装入库") + private BigDecimal assemInTotal = BigDecimal.ZERO; + + @ApiModelProperty("组装入库") + private BigDecimal assemOutTotal = BigDecimal.ZERO; + + @ApiModelProperty("拆卸入库") + private BigDecimal disAssemInTotal = BigDecimal.ZERO; + + @ApiModelProperty("拆卸入库") + private BigDecimal disAssemOutTotal = BigDecimal.ZERO; + + @ApiModelProperty("入库金额") + private BigDecimal inPrice = BigDecimal.ZERO; + + @ApiModelProperty("出库金额") + private BigDecimal outPrice = BigDecimal.ZERO; + + @ApiModelProperty("出库加权金额") + private BigDecimal weightOutPrice = BigDecimal.ZERO; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVoBatchNumberList.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVoBatchNumberList.java new file mode 100644 index 00000000..d038b407 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/DepotItemVoBatchNumberList.java @@ -0,0 +1,90 @@ +package com.zsw.erp.datasource.vo; + + +import java.math.BigDecimal; +import java.util.Date; + +public class DepotItemVoBatchNumberList { + + private String id; + private String barCode; + private String name; + private String standard; + private String model; + private String batchNumber; + private Date expirationDate; + private String expirationDateStr; + private BigDecimal totalNum; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber; + } + + public Date getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + public String getExpirationDateStr() { + return expirationDateStr; + } + + public void setExpirationDateStr(String expirationDateStr) { + this.expirationDateStr = expirationDateStr; + } + + public BigDecimal getTotalNum() { + return totalNum; + } + + public void setTotalNum(BigDecimal totalNum) { + this.totalNum = totalNum; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/InventorySeasonVo.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/InventorySeasonVo.java new file mode 100644 index 00000000..06768762 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/InventorySeasonVo.java @@ -0,0 +1,10 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.InventorySeason; +import lombok.Data; +import lombok.ToString; + +@Data +@ToString(callSuper = true) +public class InventorySeasonVo extends InventorySeason { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/LogVo4List.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/LogVo4List.java new file mode 100644 index 00000000..6243e812 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/LogVo4List.java @@ -0,0 +1,36 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.Log; + +public class LogVo4List extends Log { + + private String loginName; + + private String userName; + + private String createTimeStr; + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/MaterialExtendVo4List.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/MaterialExtendVo4List.java new file mode 100644 index 00000000..23819505 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/MaterialExtendVo4List.java @@ -0,0 +1,68 @@ +package com.zsw.erp.datasource.vo; + +import com.zsw.erp.datasource.entities.MaterialExtend; + +import java.math.BigDecimal; + +public class MaterialExtendVo4List extends MaterialExtend { + + private String supplier; + + private String originPlace; + + private String unit; + + private String brandName; + + private BigDecimal guaranteePeriod; + + private BigDecimal memberDecimal; + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getOriginPlace() { + return originPlace; + } + + public void setOriginPlace(String originPlace) { + this.originPlace = originPlace; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getBrandName() { + return brandName; + } + + public void setBrandName(String brandName) { + this.brandName = brandName; + } + + public BigDecimal getGuaranteePeriod() { + return guaranteePeriod; + } + + public void setGuaranteePeriod(BigDecimal guaranteePeriod) { + this.guaranteePeriod = guaranteePeriod; + } + + public BigDecimal getMemberDecimal() { + return memberDecimal; + } + + public void setMemberDecimal(BigDecimal memberDecimal) { + this.memberDecimal = memberDecimal; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/NodeAttributes.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/NodeAttributes.java new file mode 100644 index 00000000..ed48badb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/NodeAttributes.java @@ -0,0 +1,30 @@ +package com.zsw.erp.datasource.vo; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/13 18:11 + */ +public class NodeAttributes { + //编号 + private String no; + //类型 + private Integer type; + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNode.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNode.java new file mode 100644 index 00000000..4c56880f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNode.java @@ -0,0 +1,114 @@ +package com.zsw.erp.datasource.vo; + +import java.util.List; + +/** + * Description + * 树形结构基本元素 + * @Author: cjl + * @Date: 2019/2/19 11:27 + */ +public class TreeNode { + /** + * id主键 + * */ + private Long id; + private Long key; + private Long value; + /** + * title显示的文本 + * */ + private String title; + /** + *state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。 + * */ + private String state="open"; + /** + *iconCls 节点图标id + * */ + private String iconCls; + /** + * checked 是否被选中 + * */ + private boolean checked; + /** + *attributes 自定义属性 + * */ + private String attributes; + /** + * children 子节点 + * */ + private List children; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getKey() { + return key; + } + + public void setKey(Long key) { + this.key = key; + } + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public String getAttributes() { + return attributes; + } + + public void setAttributes(String attributes) { + this.attributes = attributes; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNodeEx.java b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNodeEx.java new file mode 100644 index 00000000..8852c9ef --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/datasource/vo/TreeNodeEx.java @@ -0,0 +1,96 @@ +package com.zsw.erp.datasource.vo; + +import java.util.List; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/13 18:10 + */ +public class TreeNodeEx { + /** + * id主键 + * */ + private Long id; + /** + * text显示的文本 + * */ + private String text; + /** + *state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。 + * */ + private String state="open"; + /** + *iconCls 节点图标id + * */ + private String iconCls; + /** + * checked 是否被选中 + * */ + private boolean checked; + /** + *attributes 自定义属性 + * */ + private NodeAttributes attributes; + /** + * children 子节点 + * */ + private List children; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public NodeAttributes getAttributes() { + return attributes; + } + + public void setAttributes(NodeAttributes attributes) { + this.attributes = attributes; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/depot/RecordVo.java b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/RecordVo.java new file mode 100644 index 00000000..6c7d23de --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/RecordVo.java @@ -0,0 +1,28 @@ +package com.zsw.erp.dto.depot; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel("进出库记录") +public class RecordVo { + + private String number; + + private String barCode; + + private String materialName; + + private String type; + + private String depotName; + + private BigDecimal basicNumber; + + private Date operTime; + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/depot/StockVo.java b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/StockVo.java new file mode 100644 index 00000000..48893a86 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/depot/StockVo.java @@ -0,0 +1,21 @@ +package com.zsw.erp.dto.depot; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@ApiModel("库存") +@Data +public class StockVo { + + @ApiModelProperty("库存") + private BigDecimal stock; + + @ApiModelProperty("加权金额") + private BigDecimal weightPrice = BigDecimal.ZERO; + + @ApiModelProperty("总金额") + private BigDecimal totalPrice = BigDecimal.ZERO; +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockDto.java b/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockDto.java new file mode 100644 index 00000000..dcc14540 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockDto.java @@ -0,0 +1,36 @@ +package com.zsw.erp.dto.depotItem; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 批库存查询 + * + * @author xggz + * @since 2022/5/19 19:00 + */ +@Data +@ApiModel(value = "BatchStockDto", description = "批库存查询") +public class BatchStockDto implements Serializable { + + @ApiModelProperty("仓库ID") + private Long depotId; + + @ApiModelProperty("批号") + private String batchNumber; + + @ApiModelProperty("商品信息") + private String materialInfo; + + @ApiModelProperty("当前页") + private Integer currentPage; + + @ApiModelProperty("每页显示多少条") + private Integer pageSize; + + @ApiModelProperty(value = "分页偏移量", hidden = true) + private Integer pageOffset; +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockPageVo.java b/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockPageVo.java new file mode 100644 index 00000000..ce3dd974 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/depotItem/BatchStockPageVo.java @@ -0,0 +1,43 @@ +package com.zsw.erp.dto.depotItem; + +import cn.hutool.core.date.DatePattern; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 批库存结果分页 + * + * @author xggz + * @since 2022/5/19 19:00 + */ +@Data +@ApiModel(value = "BatchStockDto", description = "批库存结果分页") +public class BatchStockPageVo implements Serializable { + + private Long materialId; + + private String depotName; + + private String materialName; + + private String standard; + + private String model; + + private String materialUnit; + + private String batchNumber; + + private Long depotId; + + @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN) + private Date expirationDate; + + private BigDecimal stock; +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/material/MaterialDto.java b/zsw-erp/src/main/java/com/zsw/erp/dto/material/MaterialDto.java new file mode 100644 index 00000000..6021f7a8 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/material/MaterialDto.java @@ -0,0 +1,26 @@ +package com.zsw.erp.dto.material; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MaterialDto implements Serializable { + + private Long materialId; + + private String name = ""; + + private String barCode = ""; + + private Long unitId; + + private String unit; + + private Long depotId; + + private String depotName; + + private String keyWord; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/dto/supplier/SupplierVo.java b/zsw-erp/src/main/java/com/zsw/erp/dto/supplier/SupplierVo.java new file mode 100644 index 00000000..8bb25f33 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/dto/supplier/SupplierVo.java @@ -0,0 +1,16 @@ +package com.zsw.erp.dto.supplier; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class SupplierVo { + + private Long id; + + private String supplier; + + @ApiModelProperty("外部供应商=true ,供应链内企业=false") + private Boolean targetType; + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/exception/BoomException.java b/zsw-erp/src/main/java/com/zsw/erp/exception/BoomException.java new file mode 100644 index 00000000..ce5d4c4d --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/exception/BoomException.java @@ -0,0 +1,27 @@ +package com.zsw.erp.exception; + +import com.zsw.erp.constants.ExceptionConstants; +import lombok.extern.slf4j.Slf4j; + +/** + * 封装日志打印,收集日志 + */ +@Slf4j +public class BoomException { + + public static void readFail(Exception e) { + log.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG, e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + + public static void writeFail(Exception e) { + log.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG, e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessParamCheckingException.java b/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessParamCheckingException.java new file mode 100644 index 00000000..e0086b10 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessParamCheckingException.java @@ -0,0 +1,22 @@ +package com.zsw.erp.exception; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Getter +public class BusinessParamCheckingException extends Exception { + + private static final long serialVersionUID = 1L; + private int code; + + public BusinessParamCheckingException(int code, String reason) { + super(reason); + this.code = code; + } + + public BusinessParamCheckingException(int code, String reason, Throwable throwable) { + super(reason, throwable); + this.code = code; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessRunTimeException.java b/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessRunTimeException.java new file mode 100644 index 00000000..85d04dd6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/exception/BusinessRunTimeException.java @@ -0,0 +1,22 @@ +package com.zsw.erp.exception; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Getter +public class BusinessRunTimeException extends RuntimeException { + + private static final long serialVersionUID = 1L; + private int code; + + public BusinessRunTimeException(int code, String reason) { + super(reason); + this.code = code; + } + + public BusinessRunTimeException(int code, String reason, Throwable throwable) { + super(reason, throwable); + this.code = code; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/exception/GlobalExceptionHandler.java b/zsw-erp/src/main/java/com/zsw/erp/exception/GlobalExceptionHandler.java new file mode 100644 index 00000000..9196ce8a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/exception/GlobalExceptionHandler.java @@ -0,0 +1,55 @@ +package com.zsw.erp.exception; + +import com.zsw.base.R; +import com.zsw.erp.constants.ExceptionConstants; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import java.util.Set; + +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(value = Exception.class) + @ResponseBody + public Object handleException(Exception e, HttpServletRequest request) { + // e.printStackTrace(); + // 针对业务参数异常的处理 + if (e instanceof BusinessParamCheckingException) { + return R.fail(((BusinessParamCheckingException) e).getCode(),e.getMessage()) + .setPath(request.getRequestURI()); + } + + //针对业务运行时异常的处理 + if (e instanceof BusinessRunTimeException) { + log.error("error:「{}」",((BusinessRunTimeException) e).getMessage()); + return R.fail(((BusinessRunTimeException) e).getCode(),e.getMessage()).setPath(request.getRequestURI()); + } + + if (e instanceof ConstraintViolationException) { + Set> c = ((ConstraintViolationException) e).getConstraintViolations(); + StringBuilder builder = new StringBuilder(); + c.forEach(constraintViolation -> { + builder.append(constraintViolation.getPropertyPath()) + .append("-") + .append(constraintViolation.getMessage()) + .append(";"); + }); + return R.fail(400,builder.toString()).setPath(request.getRequestURI()); + } + +// if (e instanceof MissingServletRequestParameterException){ +// status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, 400); +// status.put(ExceptionConstants.GLOBAL_RETURNS_DATA,((MissingServletRequestParameterException)e).getParameterName()) +// } + e.printStackTrace(); + log.error("Global Exception Occured => url : {}, msg : {}", request.getRequestURL(), e.getMessage()); + return R.fail(ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE,ExceptionConstants.SERVICE_SYSTEM_ERROR_MSG).setPath(request.getRequestURI()); + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/helper/QueryHelp.java b/zsw-erp/src/main/java/com/zsw/erp/helper/QueryHelp.java new file mode 100644 index 00000000..229dd4de --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/helper/QueryHelp.java @@ -0,0 +1,171 @@ +package com.zsw.erp.helper; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zsw.erp.annotation.Query; +import com.zsw.erp.datasource.entities.Depot; +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Field; +import java.text.SimpleDateFormat; +import java.util.*; + +@Slf4j +public class QueryHelp { + + public static QueryWrapper getPredicate(R obj, Q query) { + QueryWrapper queryWrapper = new QueryWrapper(); + if (query == null) { + return queryWrapper; + } + try { + List fields = getAllFields(query.getClass(), new ArrayList<>()); + for (Field field : fields) { + boolean accessible = field.isAccessible(); + field.setAccessible(true); + Query q = field.getAnnotation(Query.class); + if (q != null) { + String propName = q.propName(); + String blurry = q.blurry(); + String attributeName = isBlank(propName) ? field.getName() : propName; + attributeName = humpToUnderline(attributeName); + Class fieldType = field.getType(); + Object val = field.get(query); + if (ObjectUtil.isNull(val) || "".equals(val)) { + continue; + } + // 模糊多字段 + if (ObjectUtil.isNotEmpty(blurry)) { + String[] blurrys = blurry.split(","); + //queryWrapper.or(); + queryWrapper.and(wrapper -> { + for (String s : blurrys) { + String column = humpToUnderline(s); + //if(i!=0){ + wrapper.or(); + //} + wrapper.like(column, val.toString()); + } + }); + continue; + } + String finalAttributeName = attributeName; + switch (q.type()) { + case EQUAL: + //queryWrapper.and(wrapper -> wrapper.eq(finalAttributeName, val)); + queryWrapper.eq(attributeName, val); + break; + case GREATER_THAN: + queryWrapper.ge(finalAttributeName, val); + break; + case GREATER_THAN_NQ: + queryWrapper.gt(finalAttributeName, val); + break; + case LESS_THAN: + queryWrapper.le(finalAttributeName, val); + break; + case LESS_THAN_NQ: + queryWrapper.lt(finalAttributeName, val); + break; + case INNER_LIKE: + queryWrapper.like(finalAttributeName, val); + break; + case LEFT_LIKE: + queryWrapper.likeLeft(finalAttributeName, val); + break; + case RIGHT_LIKE: + queryWrapper.likeRight(finalAttributeName, val); + break; + case IN: + if (val instanceof Collection) { + List value = Collections.singletonList(val); + if (CollUtil.isNotEmpty(value)) { + queryWrapper.in(finalAttributeName, value); + } + } + break; + case NOT_EQUAL: + queryWrapper.ne(finalAttributeName, val); + break; + case NOT_NULL: + queryWrapper.isNotNull(finalAttributeName); + break; + case BETWEEN: + List between = Collections.singletonList(val); + queryWrapper.between(finalAttributeName, between.get(0), between.get(1)); + break; + case UNIX_TIMESTAMP: + List UNIX_TIMESTAMP = Collections.singletonList(val); + SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date time1 = fm.parse(UNIX_TIMESTAMP.get(0).toString()); + Date time2 = fm.parse(UNIX_TIMESTAMP.get(1).toString()); + queryWrapper.between(finalAttributeName, time1, time2); + break; + default: + break; + } + } + field.setAccessible(accessible); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + return queryWrapper; + } + + + private static boolean isBlank(final CharSequence cs) { + int strLen; + if (cs == null || (strLen = cs.length()) == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if (!Character.isWhitespace(cs.charAt(i))) { + return false; + } + } + return true; + } + + private static List getAllFields(Class clazz, List fields) { + if (clazz != null) { + fields.addAll(Arrays.asList(clazz.getDeclaredFields())); + getAllFields(clazz.getSuperclass(), fields); + } + return fields; + } + + /*** + * 驼峰命名转为下划线命名 + * + * @param para + * 驼峰命名的字符串 + */ + + public static String humpToUnderline(String para) { + StringBuilder sb = new StringBuilder(para); + int temp = 0;//定位 + if (!para.contains("_")) { + for (int i = 0; i < para.length(); i++) { + if (Character.isUpperCase(para.charAt(i))) { + sb.insert(i + temp, "_"); + temp += 1; + } + } + } + return sb.toString(); + } + + public static void main(String[] args) { + QueryWrapper query = new QueryWrapper(); + //query.or(); + //query.like("a",1); + //query.or(); + //query.like("b",2); + //query.and(wrapper->wrapper.eq("c",1)); + query.eq("1", 1); + System.out.println(query.getSqlSegment()); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/CommonQueryManager.java b/zsw-erp/src/main/java/com/zsw/erp/service/CommonQueryManager.java new file mode 100644 index 00000000..ef03ffd1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/CommonQueryManager.java @@ -0,0 +1,135 @@ +package com.zsw.erp.service; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + + +@Service +public class CommonQueryManager { + + @Resource + private InterfaceContainer container; + + @Resource + private LogService logService; + + /** + * 查询单条 + * + * @param apiName 接口名称 + * @param id ID + */ + public Object selectOne(String apiName, Long id) throws Exception { + if (StringUtil.isNotEmpty(apiName) && id!=null) { + return container.getCommonQuery(apiName).selectOne(id); + } + return null; + } + + /** + * 查询 + * @param apiName + * @param parameterMap + * @return + */ + public List select(String apiName, Map parameterMap)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).select(parameterMap); + } + return new ArrayList(); + } + + /** + * 计数 + * @param apiName + * @param parameterMap + * @return + */ + public Long counts(String apiName, Map parameterMap)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).counts(parameterMap); + } + return BusinessConstants.DEFAULT_LIST_NULL_NUMBER; + } + + /** + * 插入 + * @param apiName + * @param obj + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insert(String apiName, JSONObject obj, HttpServletRequest request) throws Exception{ + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).insert(obj, request); + } + return 0; + } + + /** + * 更新 + * @param apiName + * @param obj + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int update(String apiName, JSONObject obj, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).update(obj, request); + } + return 0; + } + + /** + * 删除 + * @param apiName + * @param id + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int delete(String apiName, Long id, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).delete(id, request); + } + return 0; + } + + /** + * 批量删除 + * @param apiName + * @param ids + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteBatch(String apiName, String ids, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).deleteBatch(ids, request); + } + return 0; + } + + /** + * 判断是否存在 + * @param apiName + * @param id + * @param name + * @return + */ + public int checkIsNameExist(String apiName, Long id, String name) throws Exception{ + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).checkIsNameExist(id, name); + } + return 0; + } + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/ErpServiceImpl.java b/zsw-erp/src/main/java/com/zsw/erp/service/ErpServiceImpl.java new file mode 100644 index 00000000..b3385bde --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/ErpServiceImpl.java @@ -0,0 +1,61 @@ +package com.zsw.erp.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zsw.erp.ErpService; +import com.zsw.erp.datasource.entities.Depot; +import com.zsw.erp.datasource.entities.Material; +import com.zsw.erp.datasource.entities.Unit; +import com.zsw.erp.datasource.mappers.DepotMapper; +import com.zsw.erp.datasource.mappers.MaterialMapper; +import com.zsw.erp.dto.material.MaterialDto; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.materialCurrentStock.MaterialCurrentStockService; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +@DubboService +@Transactional +@Slf4j +public class ErpServiceImpl implements ErpService { + + @Resource + private MaterialService materialService; + + @Resource + private MaterialMapper materialMapper; + + @Resource + private MaterialCurrentStockService currentStockService; + + @Resource + private DepotMapper depotMapper; + + + /** + * 根据查询条件搜索物料 返回list~ + * + * @param dto + * @return + */ + public List findMaterial(MaterialDto dto) { + log.info("dto:{}", dto); + return materialMapper.getMaterialListByNameOrCode(dto.getKeyWord()); + } + + + public List findDepot() { + return depotMapper.selectList(Wrappers.lambdaQuery() + .eq(Depot::getDeleteFlag, "0")); + } + + @Override + public List findUnit() { + return null; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/ICommonQuery.java b/zsw-erp/src/main/java/com/zsw/erp/service/ICommonQuery.java new file mode 100644 index 00000000..649b68a4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/ICommonQuery.java @@ -0,0 +1,79 @@ +package com.zsw.erp.service; + +import com.alibaba.fastjson.JSONObject; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * 通用查询接口 + * 功能:1、单条查询 2、分页+搜索 3、查询数量 + * + * @version 1.0 + */ +public interface ICommonQuery { + /** + * 根据id查询明细。 + * + * @param id 资源id + * @return 资源 + */ + Object selectOne(Long id) throws Exception; + + /** + * 自定义查询 + * + * @param parameterMap 查询参数 + * @return 查询结果 + */ + List select(Map parameterMap) throws Exception; + + /** + * 查询数量 + * + * @param parameterMap 查询参数 + * @return 查询结果 + */ + Long counts(Map parameterMap) throws Exception; + + /** + * 新增数据 + * + * @param obj + * @return + */ + int insert(JSONObject obj, HttpServletRequest request) throws Exception; + + /** + * 更新数据 + * + * @param obj + * @return + */ + int update(JSONObject obj, HttpServletRequest request) throws Exception; + + /** + * 删除数据 + * + * @param id + * @return + */ + int delete(Long id, HttpServletRequest request) throws Exception; + + /** + * 批量删除数据 + * + * @param ids + * @return + */ + int deleteBatch(String ids, HttpServletRequest request) throws Exception; + + /** + * 查询名称是否存在 + * + * @param id + * @return + */ + int checkIsNameExist(Long id, String name) throws Exception; +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/InterfaceContainer.java b/zsw-erp/src/main/java/com/zsw/erp/service/InterfaceContainer.java new file mode 100644 index 00000000..ce33a218 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/InterfaceContainer.java @@ -0,0 +1,28 @@ +package com.zsw.erp.service; + +import com.zsw.erp.utils.AnnotationUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + + +@Service +public class InterfaceContainer { + private final Map configComponentMap = new HashMap<>(); + + @Autowired(required = false) + private synchronized void init(ICommonQuery[] configComponents) { + for (ICommonQuery configComponent : configComponents) { + ResourceInfo info = AnnotationUtils.getAnnotation(configComponent, ResourceInfo.class); + if (info != null) { + configComponentMap.put(info.value(), configComponent); + } + } + } + + public ICommonQuery getCommonQuery(String apiName) { + return configComponentMap.get(apiName); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/ResourceInfo.java b/zsw-erp/src/main/java/com/zsw/erp/service/ResourceInfo.java new file mode 100644 index 00000000..eaa80239 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/ResourceInfo.java @@ -0,0 +1,12 @@ +package com.zsw.erp.service; + +import java.lang.annotation.*; + + +@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +@Documented +public @interface ResourceInfo { + String value(); +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java new file mode 100644 index 00000000..5143c5af --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountComponent.java @@ -0,0 +1,75 @@ +package com.zsw.erp.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "account_component") +@AccountResource +public class AccountComponent implements ICommonQuery { + + @Resource + private AccountService accountService; + + @Override + public Object selectOne(Long id) throws Exception { + return accountService.getAccount(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountList(map); + } + + private List getAccountList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String serialNo = StringUtil.getInfo(search, "serialNo"); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return accountService.select(name, serialNo, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String serialNo = StringUtil.getInfo(search, "serialNo"); + String remark = StringUtil.getInfo(search, "remark"); + return accountService.countAccount(name, serialNo, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountService.insertAccount(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountService.updateAccount(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountService.deleteAccount(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountService.batchDeleteAccount(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return accountService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java new file mode 100644 index 00000000..3dea5a6f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.account; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "account") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java new file mode 100644 index 00000000..37608904 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/account/AccountService.java @@ -0,0 +1,575 @@ +package com.zsw.erp.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.vo.AccountVo4InOutList; +import com.zsw.erp.datasource.vo.AccountVo4List; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.*; + +@Service +public class AccountService { + private Logger logger = LoggerFactory.getLogger(AccountService.class); + + @Resource + private AccountMapper accountMapper; + + @Resource + private AccountMapperEx accountMapperEx; + + @Resource + private DepotHeadMapper depotHeadMapper; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + + @Resource + private AccountHeadMapper accountHeadMapper; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + + @Resource + private AccountItemMapper accountItemMapper; + @Resource + private AccountItemMapperEx accountItemMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + + public Account getAccount(long id) throws Exception{ + return accountMapper.selectByPrimaryKey(id); + } + + public List getAccountListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + AccountExample example = new AccountExample(); + example.createCriteria().andIdIn(idList); + list = accountMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getAccount() throws Exception{ + AccountExample example = new AccountExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=accountMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getAccountByParam(String name, String serialNo) { + List list=null; + try{ + list=accountMapperEx.getAccountByParam(name, serialNo); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, String serialNo, String remark, int offset, int rows) throws Exception{ + List resList = new ArrayList(); + List list=null; + try{ + list = accountMapperEx.selectByConditionAccount(name, serialNo, remark, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + String timeStr = Tools.getCurrentMonth(); + if (null != list && null !=timeStr) { + for (AccountVo4List al : list) { + DecimalFormat df = new DecimalFormat(".##"); + BigDecimal thisMonthAmount = getAccountSum(al.getId(), timeStr, "month").add(getAccountSumByHead(al.getId(), timeStr, "month")).add(getAccountSumByDetail(al.getId(), timeStr, "month")).add(getManyAccountSum(al.getId(), timeStr, "month")); + String thisMonthAmountFmt = "0"; + if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) { + thisMonthAmountFmt = df.format(thisMonthAmount); + } + al.setThisMonthAmount(thisMonthAmountFmt); //本月发生额 + BigDecimal currentAmount = getAccountSum(al.getId(), "", "month").add(getAccountSumByHead(al.getId(), "", "month")).add(getAccountSumByDetail(al.getId(), "", "month")).add(getManyAccountSum(al.getId(), "", "month")) .add(al.getInitialAmount()) ; + al.setCurrentAmount(currentAmount); + resList.add(al); + } + } + return resList; + } + + public Long countAccount(String name, String serialNo, String remark)throws Exception { + Long result=null; + try{ + result=accountMapperEx.countsByAccount(name, serialNo, remark); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccount(JSONObject obj, HttpServletRequest request)throws Exception { + Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); + if(account.getInitialAmount() == null) { + account.setInitialAmount(BigDecimal.ZERO); + } + account.setIsDefault(false); + int result=0; + try{ + result = accountMapper.insertSelective(account); + logService.insertLog("账户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(account.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccount(JSONObject obj, HttpServletRequest request)throws Exception { + Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); + int result=0; + try{ + result = accountMapper.updateByPrimaryKeySelective(account); + logService.insertLog("账户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(account.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccount(Long id, HttpServletRequest request) throws Exception{ + return batchDeleteAccountByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccount(String ids, HttpServletRequest request)throws Exception { + return batchDeleteAccountByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountByIds(String ids) throws Exception{ + int result=0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList=null; + try{ + accountHeadList = accountHeadMapperEx.getAccountHeadListByAccountIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(accountHeadList!=null&&accountHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验财务子表 jsh_accountitem + List accountItemList=null; + try{ + accountItemList = accountItemMapperEx.getAccountItemListByAccountIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(accountItemList!=null&&accountItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList =null; + try{ + depotHeadList = depotHeadMapperEx.getDepotHeadListByAccountIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(depotHeadList!=null&&depotHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getAccountListByIds(ids); + for(Account account: list){ + sb.append("[").append(account.getName()).append("]"); + } + logService.insertLog("账户", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = accountMapperEx.batchDeleteAccountByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + AccountExample example = new AccountExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list = accountMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public List findBySelect()throws Exception { + AccountExample example = new AccountExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = accountMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + /** + * 单个账户的金额求和-入库和出库 + * + * @param id + * @return + */ + public BigDecimal getAccountSum(Long id, String timeStr, String type) throws Exception{ + BigDecimal accountSum = BigDecimal.ZERO; + try { + DepotHeadExample example = new DepotHeadExample(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andOperTimeLessThanOrEqualTo(mTime).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + dataList = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + if (dataList != null) { + for (DepotHead depotHead : dataList) { + if(depotHead.getChangeAmount()!=null) { + accountSum = accountSum .add(depotHead.getChangeAmount()) ; + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-收入、支出、转账的单据表头的合计 + * + * @param id + * @return + */ + public BigDecimal getAccountSumByHead(Long id, String timeStr, String type) throws Exception{ + BigDecimal accountSum = BigDecimal.ZERO; + try { + AccountHeadExample example = new AccountHeadExample(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + example.createCriteria().andAccountIdEqualTo(id) + .andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + example.createCriteria().andAccountIdEqualTo(id) + .andBillTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + example.createCriteria().andAccountIdEqualTo(id) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + dataList = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + if (dataList != null) { + for (AccountHead accountHead : dataList) { + if(accountHead.getChangeAmount()!=null) { + accountSum = accountSum.add(accountHead.getChangeAmount()); + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计 + * + * @param id + * @return + */ + public BigDecimal getAccountSumByDetail(Long id, String timeStr, String type)throws Exception { + BigDecimal accountSum =BigDecimal.ZERO ; + try { + AccountHeadExample example = new AccountHeadExample(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + example.createCriteria().andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + example.createCriteria().andBillTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } + List dataList=null; + try{ + dataList = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + if (dataList != null) { + String ids = ""; + for (AccountHead accountHead : dataList) { + ids = ids + accountHead.getId() + ","; + } + if (!ids.equals("")) { + ids = ids.substring(0, ids.length() - 1); + } + AccountItemExample exampleAi = new AccountItemExample(); + if (!ids.equals("")) { + List idList = StringUtil.strToLongList(ids); + exampleAi.createCriteria().andAccountIdEqualTo(id).andHeaderIdIn(idList) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List dataListOne = accountItemMapper.selectByExample(exampleAi); + if (dataListOne != null) { + for (AccountItem accountItem : dataListOne) { + if(accountItem.getEachAmount()!=null) { + accountSum = accountSum.add(accountItem.getEachAmount()); + } + } + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } catch (Exception e) { + logger.error(">>>>>>>>>异常信息:", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-多账户的明细合计 + * + * @param id + * @return + */ + public BigDecimal getManyAccountSum(Long id, String timeStr, String type)throws Exception { + BigDecimal accountSum = BigDecimal.ZERO; + try { + DepotHeadExample example = new DepotHeadExample(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") + .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") + .andOperTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + dataList = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + if (dataList != null) { + for (DepotHead depotHead : dataList) { + String accountIdList = depotHead.getAccountIdList(); + String accountMoneyList = depotHead.getAccountMoneyList(); + if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) { + accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", ""); + accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", ""); + String[] aList = accountIdList.split(","); + String[] amList = accountMoneyList.split(","); + for (int i = 0; i < aList.length; i++) { + if (aList[i].toString().equals(id.toString())) { + if(amList!=null && amList.length>0) { + accountSum = accountSum.add(new BigDecimal(amList[i])); + } + } + } + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找信息异常", e); + } + return accountSum; + } + + public List findAccountInOutList(Long accountId, Integer offset, Integer rows) throws Exception{ + List list=null; + try{ + list = accountMapperEx.findAccountInOutList(accountId, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public int findAccountInOutListCount(Long accountId) throws Exception{ + int result=0; + try{ + result = accountMapperEx.findAccountInOutListCount(accountId); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateIsDefault(Long accountId) throws Exception{ + int result=0; + try{ + //全部取消默认 + Account allAccount = new Account(); + allAccount.setIsDefault(false); + AccountExample allExample = new AccountExample(); + allExample.createCriteria(); + accountMapper.updateByExampleSelective(allAccount, allExample); + //给指定账户设为默认 + Account account = new Account(); + account.setIsDefault(true); + AccountExample example = new AccountExample(); + example.createCriteria().andIdEqualTo(accountId); + accountMapper.updateByExampleSelective(account, example); + logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + result = 1; + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public Map getAccountMap() throws Exception { + List accountList = getAccount(); + Map accountMap = new HashMap<>(); + for(Account account : accountList){ + accountMap.put(account.getId(), account.getName()); + } + return accountMap; + } + + public String getAccountStrByIdAndMoney(Map accountMap, String accountIdList, String accountMoneyList){ + StringBuffer sb = new StringBuffer(); + List idList = StringUtil.strToLongList(accountIdList); + List moneyList = StringUtil.strToLongList(accountMoneyList); + for (int i = 0; i < idList.size(); i++) { + Long id = idList.get(i); + BigDecimal money = BigDecimal.valueOf(moneyList.get(i)).abs(); + sb.append(accountMap.get(id) + "(" + money + "元) "); + } + return sb.toString(); + } + + public Map getStatistics(String name, String serialNo) { + Map map = new HashMap<>(); + try { + List list = getAccountByParam(name, serialNo); + String timeStr = Tools.getCurrentMonth(); + BigDecimal allMonthAmount = BigDecimal.ZERO; + BigDecimal allCurrentAmount = BigDecimal.ZERO; + if (null != list && null !=timeStr) { + for (Account a : list) { + BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month").add(getAccountSumByHead(a.getId(), timeStr, "month")) + .add(getAccountSumByDetail(a.getId(), timeStr, "month")).add(getManyAccountSum(a.getId(), timeStr, "month")); + BigDecimal currentAmount = getAccountSum(a.getId(), "", "month").add(getAccountSumByHead(a.getId(), "", "month")) + .add(getAccountSumByDetail(a.getId(), "", "month")).add(getManyAccountSum(a.getId(), "", "month")).add(a.getInitialAmount()); + allMonthAmount = allMonthAmount.add(monthAmount); + allCurrentAmount = allCurrentAmount.add(currentAmount); + } + } + map.put("allCurrentAmount", priceFormat(allCurrentAmount)); //当前总金额 + map.put("allMonthAmount", priceFormat(allMonthAmount)); //本月发生额 + } catch (Exception e) { + BoomException.readFail(e); + } + return map; + } + + /** + * 价格格式化 + * @param price + * @return + */ + private String priceFormat(BigDecimal price) { + String priceFmt = "0"; + DecimalFormat df = new DecimalFormat(".##"); + if ((price.compareTo(BigDecimal.ZERO))!=0) { + priceFmt = df.format(price); + } + return priceFmt; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadComponent.java new file mode 100644 index 00000000..4a43e0b0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadComponent.java @@ -0,0 +1,84 @@ +package com.zsw.erp.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "accountHead_component") +@AccountHeadResource +public class AccountHeadComponent implements ICommonQuery { + + @Resource + private AccountHeadService accountHeadService; + + @Override + public Object selectOne(Long id) throws Exception { + return accountHeadService.getAccountHead(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountHeadList(map); + } + + private List getAccountHeadList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String roleType = StringUtil.getInfo(search, "roleType"); + String billNo = StringUtil.getInfo(search, "billNo"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId")); + return accountHeadService.select(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String roleType = StringUtil.getInfo(search, "roleType"); + String billNo = StringUtil.getInfo(search, "billNo"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId")); + return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountHeadService.insertAccountHead(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountHeadService.updateAccountHead(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountHeadService.deleteAccountHead(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountHeadService.batchDeleteAccountHead(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return accountHeadService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadResource.java new file mode 100644 index 00000000..a6a9757b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.accountHead; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "accountHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountHeadResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java new file mode 100644 index 00000000..c1582ba0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountHead/AccountHeadService.java @@ -0,0 +1,392 @@ +package com.zsw.erp.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.AccountHeadMapper; +import com.zsw.erp.datasource.mappers.AccountHeadMapperEx; +import com.zsw.erp.datasource.mappers.AccountItemMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.accountItem.AccountItemService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.orgaUserRel.OrgaUserRelService; +import com.zsw.erp.service.supplier.SupplierService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import com.zsw.erp.datasource.entities.AccountHead; +import com.zsw.erp.datasource.entities.AccountHeadExample; +import com.zsw.erp.datasource.entities.AccountHeadVo4ListEx; +import com.zsw.erp.datasource.entities.User; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static com.zsw.erp.utils.Tools.getCenternTime; + +@Service +public class AccountHeadService { + private Logger logger = LoggerFactory.getLogger(AccountHeadService.class); + @Resource + private AccountHeadMapper accountHeadMapper; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private OrgaUserRelService orgaUserRelService; + @Resource + private AccountItemService accountItemService; + @Resource + private UserService userService; + @Resource + private SupplierService supplierService; + @Resource + private LogService logService; + @Resource + private AccountItemMapperEx accountItemMapperEx; + + public AccountHead getAccountHead(long id) throws Exception { + AccountHead result=null; + try{ + result=accountHeadMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getAccountHeadListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdIn(idList); + list = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getAccountHead() throws Exception{ + AccountHeadExample example = new AccountHeadExample(); + List list=null; + try{ + list=accountHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId, int offset, int rows) throws Exception{ + List resList = new ArrayList<>(); + try{ + String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, beginTime, endTime, organId, creator, handsPersonId, offset, rows); + if (null != list) { + for (AccountHeadVo4ListEx ah : list) { + if(ah.getChangeAmount() != null) { + ah.setChangeAmount(ah.getChangeAmount().abs()); + } + if(ah.getTotalPrice() != null) { + ah.setTotalPrice(ah.getTotalPrice().abs()); + } + if(ah.getBillTime() !=null) { + ah.setBillTimeStr(getCenternTime(ah.getBillTime())); + } + resList.add(ah); + } + } + }catch(Exception e){ + BoomException.readFail(e); + } + return resList; + } + + public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId) throws Exception{ + Long result=null; + try{ + String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, beginTime, endTime, organId, creator, handsPersonId); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + /** + * 根据角色类型获取操作员数组 + * @param roleType + * @return + * @throws Exception + */ + private String[] getCreatorArray(String roleType) throws Exception { + String creator = ""; + User user = userService.getCurrentUser(); + if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { + creator = user.getId().toString(); + } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { + creator = orgaUserRelService.getUserIdListByUserId(user.getId()); + } + String [] creatorArray=null; + if(StringUtil.isNotEmpty(creator)){ + creatorArray = creator.split(","); + } + return creatorArray; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountHead(JSONObject obj, HttpServletRequest request) throws Exception{ + AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); + int result=0; + try{ + User userInfo=userService.getCurrentUser(); + accountHead.setCreator(userInfo==null?null:userInfo.getId()); + result = accountHeadMapper.insertSelective(accountHead); + logService.insertLog("财务", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountHead(JSONObject obj, HttpServletRequest request)throws Exception { + AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); + int result=0; + try{ + result = accountHeadMapper.updateByPrimaryKeySelective(accountHead); + logService.insertLog("财务", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountHead.getBillNo()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountHead(Long id, HttpServletRequest request)throws Exception { + return batchDeleteAccountHeadByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHead(String ids, HttpServletRequest request)throws Exception { + return batchDeleteAccountHeadByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHeadByIds(String ids)throws Exception { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getAccountHeadListByIds(ids); + for(AccountHead accountHead: list){ + sb.append("[").append(accountHead.getBillNo()).append("]"); + if("1".equals(accountHead.getStatus())) { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); + } + } + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + //删除主表 + accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + //删除子表 + accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + logService.insertLog("财务", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(String status, String accountHeadIds)throws Exception { + int result = 0; + try{ + List ahIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(accountHeadIds); + for(Long id: ids) { + AccountHead accountHead = getAccountHead(id); + if("0".equals(status)){ + if("1".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } else if("1".equals(status)){ + if("0".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } + } + if(ahIds.size()>0) { + AccountHead accountHead = new AccountHead(); + accountHead.setStatus(status); + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdIn(ahIds); + result = accountHeadMapper.updateByExampleSelective(accountHead, example); + } else { + return 1; + } + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) throws Exception { + AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); + User userInfo=userService.getCurrentUser(); + accountHead.setCreator(userInfo==null?null:userInfo.getId()); + accountHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + accountHeadMapper.insertSelective(accountHead); + //根据单据编号查询单据id + AccountHeadExample dhExample = new AccountHeadExample(); + dhExample.createCriteria().andBillNoEqualTo(accountHead.getBillNo()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = accountHeadMapper.selectByExample(dhExample); + if(list!=null) { + Long headId = list.get(0).getId(); + String type = list.get(0).getType(); + /**处理单据子表信息*/ + accountItemService.saveDetials(rows, headId, type, request); + } + if("收预付款".equals(accountHead.getType())){ + supplierService.updateAdvanceIn(accountHead.getOrganId(), accountHead.getTotalPrice()); + } + logService.insertLog("财务单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) throws Exception { + AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); + //获取之前的金额数据 + BigDecimal preTotalPrice = getAccountHead(accountHead.getId()).getTotalPrice().abs(); + accountHeadMapper.updateByPrimaryKeySelective(accountHead); + //根据单据编号查询单据id + AccountHeadExample dhExample = new AccountHeadExample(); + dhExample.createCriteria().andBillNoEqualTo(accountHead.getBillNo()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = accountHeadMapper.selectByExample(dhExample); + if(list!=null) { + Long headId = list.get(0).getId(); + String type = list.get(0).getType(); + /**处理单据子表信息*/ + accountItemService.saveDetials(rows, headId, type, request); + } + if("收预付款".equals(accountHead.getType())){ + supplierService.updateAdvanceIn(accountHead.getOrganId(), accountHead.getTotalPrice().subtract(preTotalPrice)); + } + logService.insertLog("财务单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountHead.getBillNo()).toString(), request); + } + + public BigDecimal findAllMoney(Integer supplierId, String type, String mode, String endTime) { + String modeName = ""; + if (mode.equals("实际")) { + modeName = "change_amount"; + } else if (mode.equals("合计")) { + modeName = "total_price"; + } + BigDecimal result = null; + try{ + result = accountHeadMapperEx.findAllMoney(supplierId, type, modeName, endTime); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + /** + * 统计总金额 + * @param getS + * @param type + * @param mode 合计或者金额 + * @param endTime + * @return + */ + public BigDecimal allMoney(String getS, String type, String mode, String endTime) { + BigDecimal allMoney = BigDecimal.ZERO; + try { + Integer supplierId = Integer.valueOf(getS); + BigDecimal sum = findAllMoney(supplierId, type, mode, endTime); + if(sum != null) { + allMoney = sum; + } + } catch (Exception e) { + e.printStackTrace(); + } + //返回正数,如果负数也转为正数 + if ((allMoney.compareTo(BigDecimal.ZERO))==-1) { + allMoney = allMoney.abs(); + } + return allMoney; + } + + /** + * 查询往来单位的累计应收和累计应付,只计入收款或付款 + * @param supplierId + * @param endTime + * @param supType + * @return + */ + public BigDecimal findTotalPay(Integer supplierId, String endTime, String supType) { + BigDecimal sum = BigDecimal.ZERO; + String getS = supplierId.toString(); + if (("客户").equals(supType)) { //客户 + sum = allMoney(getS, "收款", "合计",endTime); + } else if (("供应商").equals(supType)) { //供应商 + sum = allMoney(getS, "付款", "合计",endTime); + } + return sum; + } + + public List getDetailByNumber(String billNo)throws Exception { + List resList = new ArrayList(); + List list = null; + try{ + list = accountHeadMapperEx.getDetailByNumber(billNo); + }catch(Exception e){ + BoomException.readFail(e); + } + if (null != list) { + for (AccountHeadVo4ListEx ah : list) { + if(ah.getChangeAmount() != null) { + ah.setChangeAmount(ah.getChangeAmount().abs()); + } + if(ah.getTotalPrice() != null) { + ah.setTotalPrice(ah.getTotalPrice().abs()); + } + ah.setBillTimeStr(getCenternTime(ah.getBillTime())); + resList.add(ah); + } + } + return resList; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemComponent.java new file mode 100644 index 00000000..25a89603 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemComponent.java @@ -0,0 +1,75 @@ +package com.zsw.erp.service.accountItem; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "accountItem_component") +@AccountItemResource +public class AccountItemComponent implements ICommonQuery { + + @Resource + private AccountItemService accountItemService; + + @Override + public Object selectOne(Long id) throws Exception { + return accountItemService.getAccountItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountItemList(map); + } + + private List getAccountItemList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return accountItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return accountItemService.countAccountItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountItemService.insertAccountItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountItemService.updateAccountItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountItemService.deleteAccountItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountItemService.batchDeleteAccountItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return accountItemService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemResource.java new file mode 100644 index 00000000..b1acc9a9 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.accountItem; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "accountItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountItemResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java new file mode 100644 index 00000000..d676acb7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/accountItem/AccountItemService.java @@ -0,0 +1,262 @@ +package com.zsw.erp.service.accountItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.AccountItem; +import com.zsw.erp.datasource.entities.AccountItemExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.AccountItemMapper; +import com.zsw.erp.datasource.mappers.AccountItemMapperEx; +import com.zsw.erp.datasource.vo.AccountItemVo4List; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.depotHead.DepotHeadService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service +public class AccountItemService { + private Logger logger = LoggerFactory.getLogger(AccountItemService.class); + + @Resource + private AccountItemMapper accountItemMapper; + @Resource + private AccountItemMapperEx accountItemMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private DepotHeadService depotHeadService; + + public AccountItem getAccountItem(long id)throws Exception { + AccountItem result=null; + try{ + result=accountItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getAccountItem()throws Exception { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=accountItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows)throws Exception { + List list=null; + try{ + list = accountItemMapperEx.selectByConditionAccountItem(name, type, remark, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countAccountItem(String name, Integer type, String remark)throws Exception { + Long result=null; + try{ + result = accountItemMapperEx.countsByAccountItem(name, type, remark); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountItem(JSONObject obj, HttpServletRequest request) throws Exception{ + AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class); + int result=0; + try{ + result = accountItemMapper.insertSelective(accountItem); + logService.insertLog("财务明细", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountItem(JSONObject obj, HttpServletRequest request)throws Exception { + AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class); + int result=0; + try{ + result = accountItemMapper.updateByPrimaryKeySelective(accountItem); + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountItem.getId()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountItem(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result = accountItemMapper.deleteByPrimaryKey(id); + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountItem(String ids, HttpServletRequest request)throws Exception { + List idList = StringUtil.strToLongList(ids); + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result = accountItemMapper.deleteByExample(example); + logService.insertLog("财务明细", "批量删除,id集:" + ids, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list = accountItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountItemWithObj(AccountItem accountItem)throws Exception { + int result=0; + try{ + result = accountItemMapper.insertSelective(accountItem); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountItemWithObj(AccountItem accountItem)throws Exception { + int result=0; + try{ + result = accountItemMapper.updateByPrimaryKeySelective(accountItem); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public List getDetailList(Long headerId) { + List list=null; + try{ + list = accountItemMapperEx.getDetailList(headerId); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void saveDetials(String rows, Long headerId, String type, HttpServletRequest request) throws Exception { + //删除单据的明细 + deleteAccountItemHeadId(headerId); + JSONArray rowArr = JSONArray.parseArray(rows); + if (null != rowArr && rowArr.size()>0) { + for (int i = 0; i < rowArr.size(); i++) { + AccountItem accountItem = new AccountItem(); + JSONObject tempInsertedJson = JSONObject.parseObject(rowArr.getString(i)); + accountItem.setHeaderId(headerId); + if (tempInsertedJson.get("accountId") != null && !tempInsertedJson.get("accountId").equals("")) { + accountItem.setAccountId(tempInsertedJson.getLong("accountId")); + } + if (tempInsertedJson.get("inOutItemId") != null && !tempInsertedJson.get("inOutItemId").equals("")) { + accountItem.setInOutItemId(tempInsertedJson.getLong("inOutItemId")); + } + if (tempInsertedJson.get("billNumber") != null && !tempInsertedJson.get("billNumber").equals("")) { + String billNo = tempInsertedJson.getString("billNumber"); + accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId()); + } + if (tempInsertedJson.get("needDebt") != null && !tempInsertedJson.get("needDebt").equals("")) { + accountItem.setNeedDebt(tempInsertedJson.getBigDecimal("needDebt")); + } + if (tempInsertedJson.get("finishDebt") != null && !tempInsertedJson.get("finishDebt").equals("")) { + accountItem.setFinishDebt(tempInsertedJson.getBigDecimal("finishDebt")); + } + if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) { + BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount"); + if (type.equals("付款")) { + eachAmount = BigDecimal.ZERO.subtract(eachAmount); + } + accountItem.setEachAmount(eachAmount); + } else { + accountItem.setEachAmount(BigDecimal.ZERO); + } + accountItem.setRemark(tempInsertedJson.getString("remark")); + this.insertAccountItemWithObj(accountItem); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_MSG)); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteAccountItemHeadId(Long headerId)throws Exception { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId); + try{ + accountItemMapper.deleteByExample(example); + }catch(Exception e){ + BoomException.writeFail(e); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountItemByIds(String ids) throws Exception{ + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public BigDecimal getEachAmountByBillId(Long billId) { + return accountItemMapperEx.getEachAmountByBillId(billId).abs(); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotComponent.java new file mode 100644 index 00000000..b4600742 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotComponent.java @@ -0,0 +1,75 @@ +package com.zsw.erp.service.depot; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depot_component") +@DepotResource +public class DepotComponent implements ICommonQuery { + + @Resource + private DepotService depotService; + + @Override + public Object selectOne(Long id) throws Exception { + return depotService.getDepot(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotList(map); + } + + private List getDepotList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return depotService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return depotService.countDepot(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return depotService.insertDepot(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotService.updateDepot(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotService.deleteDepot(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotService.batchDeleteDepot(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return depotService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotResource.java new file mode 100644 index 00000000..56d2709c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.depot; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "depot") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java new file mode 100644 index 00000000..d6df8225 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depot/DepotService.java @@ -0,0 +1,311 @@ +package com.zsw.erp.service.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.DepotHeadMapperEx; +import com.zsw.erp.datasource.mappers.DepotItemMapperEx; +import com.zsw.erp.datasource.mappers.DepotMapper; +import com.zsw.erp.datasource.mappers.DepotMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.systemConfig.SystemConfigService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class DepotService extends ServiceImpl { + private Logger logger = LoggerFactory.getLogger(DepotService.class); + @Resource + private DepotMapper depotMapper; + @Resource + private DepotMapperEx depotMapperEx; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private UserBusinessService userBusinessService; + @Resource + private LogService logService; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + @Resource + private DepotItemMapperEx depotItemMapperEx; + + public Depot getDepot(long id)throws Exception { + Depot result=null; + try{ + result=depotMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getDepotListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + DepotExample example = new DepotExample(); + example.createCriteria().andIdIn(idList); + list = depotMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getDepot() { + DepotExample example = new DepotExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return depotMapper.selectByExample(example); + } + + public List getAllList() { + DepotExample example = new DepotExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort"); + List list=null; + try{ + list=depotMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows)throws Exception { + List list=null; + try{ + list=depotMapperEx.selectByConditionDepot(name, type, remark, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countDepot(String name, Integer type, String remark)throws Exception { + Long result=null; + try{ + result=depotMapperEx.countsByDepot(name, type, remark); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepot(JSONObject obj, HttpServletRequest request)throws Exception { + Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class); + int result=0; + try{ + depot.setType(0); + depot.setIsDefault(false); + result=depotMapper.insert(depot); + //新增仓库时给当前用户自动授权 + Long userId = userService.getUserId(request); + Long depotId = getIdByName(depot.getName()); + //String ubKey = "[" + depotId + "]"; + UserBusiness ubInfo = userBusinessService.getBasicData(userId, "UserDepot"); + if(ubInfo == null) { + ubInfo = new UserBusiness(); + ubInfo.setType("UserDepot"); + ubInfo.setKeyId(userId.toString()); + ArrayList l = Lists.newArrayList(); + l.add(depotId); + ubInfo.setValue(l); + userBusinessService.insertUserBusiness(ubInfo, request); + } else { + ubInfo.getValue().add(depotId); + userBusinessService.updateUserBusiness(ubInfo, request); + } + logService.insertLog("仓库", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depot.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepot(JSONObject obj, HttpServletRequest request) throws Exception{ + Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class); + int result=0; + try{ + result= depotMapper.updateByPrimaryKeySelective(depot); + logService.insertLog("仓库", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depot.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepot(Long id, HttpServletRequest request)throws Exception { + return batchDeleteDepotByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepot(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteDepotByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotByIds(String ids)throws Exception { + int result=0; + String [] idArray=ids.split(","); + //校验单据子表 jsh_depot_item + List depotItemList=null; + try{ + depotItemList = depotItemMapperEx.getDepotItemListListByDepotIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(depotItemList!=null&&depotItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,DepotIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getDepotListByIds(ids); + for(Depot depot: list){ + sb.append("[").append(depot.getName()).append("]"); + } + logService.insertLog("仓库", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = depotMapperEx.batchDeleteDepotByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + DepotExample example = new DepotExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= depotMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public List findUserDepot()throws Exception{ + DepotExample example = new DepotExample(); + example.createCriteria().andTypeEqualTo(0).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort"); + List list=null; + try{ + list= depotMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateIsDefault(Long depotId) throws Exception{ + int result=0; + try{ + //全部取消默认 + Depot allDepot = new Depot(); + allDepot.setIsDefault(false); + DepotExample allExample = new DepotExample(); + allExample.createCriteria(); + depotMapper.updateByExampleSelective(allDepot, allExample); + //给指定仓库设为默认 + Depot depot = new Depot(); + depot.setIsDefault(true); + DepotExample example = new DepotExample(); + example.createCriteria().andIdEqualTo(depotId); + depotMapper.updateByExampleSelective(depot, example); + logService.insertLog("仓库",BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotId, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + result = 1; + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + /** + * 根据名称获取id + * @param name + */ + public Long getIdByName(String name){ + Long id = 0L; + DepotExample example = new DepotExample(); + example.createCriteria().andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotMapper.selectByExample(example); + if(list!=null && list.size()>0) { + id = list.get(0).getId(); + } + return id; + } + + public JSONArray findDepotByCurrentUser() throws Exception { + JSONArray arr = new JSONArray(); + String type = "UserDepot"; + Long userId = userService.getCurrentUser().getId(); + List dataList = findUserDepot(); + //开始拼接json数据 + if (null != dataList) { + // boolean depotFlag = systemConfigService.getDepotFlag(); + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + return arr; + } + + /** + * 当前用户有权限使用的仓库列表的id,用逗号隔开 + * @return + * @throws Exception + */ + public String findDepotStrByCurrentUser() throws Exception { + JSONArray arr = findDepotByCurrentUser(); + StringBuffer sb = new StringBuffer(); + for(Object object: arr) { + JSONObject obj = (JSONObject)object; + sb.append(obj.getLong("id")).append(","); + } + String depotStr = sb.toString(); + if(StringUtil.isNotEmpty(depotStr)){ + depotStr = depotStr.substring(0, depotStr.length()-1); + } + return depotStr; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadComponent.java new file mode 100644 index 00000000..c66454e6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadComponent.java @@ -0,0 +1,102 @@ +package com.zsw.erp.service.depotHead; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.LocalDateTimeUtil; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depotHead_component") +@DepotHeadResource +@Slf4j +public class DepotHeadComponent implements ICommonQuery { + + @Resource + private DepotHeadService depotHeadService; + + @Override + public Object selectOne(Long id) throws Exception { + return depotHeadService.getDepotHead(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotHeadList(map); + } + + private List getDepotHeadList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); + String status = StringUtil.getInfo(search, "status"); + String number = StringUtil.getInfo(search, "number"); + String linkNumber = StringUtil.getInfo(search, "linkNumber"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + String targetType = StringUtil.getInfo(search,"targetType"); + + String startTime = map.get("startTime"); + // log.info("start:{}",startTime); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId")); + return depotHeadService.select(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam, + organId, creator, depotId, QueryUtils.offset(map), QueryUtils.rows(map),startTime); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); + String status = StringUtil.getInfo(search, "status"); + String number = StringUtil.getInfo(search, "number"); + String linkNumber = StringUtil.getInfo(search, "linkNumber"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId")); + return depotHeadService.countDepotHead(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam, + organId, creator, depotId); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return depotHeadService.insertDepotHead(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotHeadService.updateDepotHead(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotHeadService.deleteDepotHead(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotHeadService.batchDeleteDepotHead(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return depotHeadService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadResource.java new file mode 100644 index 00000000..a02166f3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.depotHead; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "depotHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotHeadResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java new file mode 100644 index 00000000..811a5c9e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotHead/DepotHeadService.java @@ -0,0 +1,882 @@ +package com.zsw.erp.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.DepotHeadMapper; +import com.zsw.erp.datasource.mappers.DepotHeadMapperEx; +import com.zsw.erp.datasource.mappers.DepotItemMapperEx; +import com.zsw.erp.datasource.vo.DepotHeadVo4InDetail; +import com.zsw.erp.datasource.vo.DepotHeadVo4InOutMCount; +import com.zsw.erp.datasource.vo.DepotHeadVo4List; +import com.zsw.erp.datasource.vo.DepotHeadVo4StatementAccount; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.account.AccountService; +import com.zsw.erp.service.accountItem.AccountItemService; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.depotItem.DepotItemService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.orgaUserRel.OrgaUserRelService; +import com.zsw.erp.service.person.PersonService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.serialNumber.SerialNumberService; +import com.zsw.erp.service.supplier.SupplierService; +import com.zsw.erp.service.tenant.TenantService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.Tools.getCenternTime; + +@Service +public class DepotHeadService extends ServiceImpl { + private Logger logger = LoggerFactory.getLogger(DepotHeadService.class); + + @Resource + private DepotHeadMapper depotHeadMapper; + + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + + @Resource + private UserService userService; + + @Resource + private DepotService depotService; + + @Resource + DepotItemService depotItemService; + + @Resource + private SupplierService supplierService; + + @Resource + private SerialNumberService serialNumberService; + + @Resource + private OrgaUserRelService orgaUserRelService; + + @Resource + private PersonService personService; + + @Resource + private AccountService accountService; + + @Resource + @Lazy + private AccountItemService accountItemService; + + @Resource + private DepotItemMapperEx depotItemMapperEx; + + @Resource + private LogService logService; + + @Resource + private RedisService redisService; + + @Resource + private TenantService tenantService; + + public DepotHead getDepotHead(long id) throws Exception { + DepotHead result = null; + try { + result = depotHeadMapper.selectByPrimaryKey(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List getDepotHead() throws Exception { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = depotHeadMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List select(String type, String subType, String roleType, String status, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, + Long depotId, int offset, int rows, String startTime) throws Exception { + List resList = new ArrayList<>(); + List list = new ArrayList<>(); + try { + String[] depotArray = getDepotArray(subType); + String[] creatorArray = getCreatorArray(roleType); + String[] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null; + Map personMap = personService.getPersonMap(); + Map accountMap = accountService.getAccountMap(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime, BusinessConstants.DAY_LAST_TIME); + list = depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime, + materialParam, organId, creator, depotId, depotArray, offset, rows,startTime); + if (null != list) { + for (DepotHeadVo4List dh : list) { + if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { + String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); + dh.setAccountName(accountStr); + } + if (dh.getAccountIdList() != null) { + String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountIdList(accountidlistStr); + } + if (dh.getAccountMoneyList() != null) { + String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountMoneyList(accountmoneylistStr); + } + if (dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if (dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if (StringUtil.isNotEmpty(dh.getSalesMan())) { + dh.setSalesManStr(personService.getPersonByMapAndIds(personMap, dh.getSalesMan())); + } + if (dh.getOperTime() != null) { + dh.setOperTimeStr(getCenternTime(dh.getOperTime())); + } + dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId())); + resList.add(dh); + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return resList; + } + + public Long countDepotHead(String type, String subType, String roleType, String status, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId) throws Exception { + Long result = null; + try { + String[] depotArray = getDepotArray(subType); + String[] creatorArray = getCreatorArray(roleType); + String[] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null; + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime, BusinessConstants.DAY_LAST_TIME); + result = depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime, + materialParam, organId, creator, depotId, depotArray); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + /** + * 根据单据类型获取仓库数组 + * + * @param subType + * @return + * @throws Exception + */ + public String[] getDepotArray(String subType) throws Exception { + String[] depotArray = null; + if (!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(subType) && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(subType)) { + String depotIds = depotService.findDepotStrByCurrentUser(); + depotArray = StringUtil.isNotEmpty(depotIds) ? depotIds.split(",") : null; + } + return depotArray; + } + + /** + * 根据角色类型获取操作员数组 + * + * @param roleType + * @return + * @throws Exception + */ + public String[] getCreatorArray(String roleType) throws Exception { + String creator = getCreatorByRoleType(roleType); + String[] creatorArray = null; + if (StringUtil.isNotEmpty(creator)) { + creatorArray = creator.split(","); + } + return creatorArray; + } + + /** + * 根据角色类型获取操作员 + * + * @param roleType + * @return + * @throws Exception + */ + public String getCreatorByRoleType(String roleType) { + String creator = ""; + User user = userService.getCurrentUser(); + if (BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { + creator = user.getId().toString(); + } else if (BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { + creator = orgaUserRelService.getUserIdListByUserId(user.getId()); + } + return creator; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepotHead(JSONObject obj, HttpServletRequest request) throws Exception { + DepotHead depotHead = JSONObject.parseObject(obj.toJSONString(), DepotHead.class); + depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); + depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + int result = 0; + try { + result = depotHeadMapper.insert(depotHead); + logService.insertLog("单据", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotHead(JSONObject obj, HttpServletRequest request) throws Exception { + DepotHead depotHead = JSONObject.parseObject(obj.toJSONString(), DepotHead.class); + DepotHead dh = null; + try { + dh = depotHeadMapper.selectByPrimaryKey(depotHead.getId()); + } catch (Exception e) { + BoomException.readFail(e); + } + depotHead.setStatus(dh.getStatus()); + depotHead.setCreateTime(dh.getCreateTime()); + int result = 0; + try { + result = depotHeadMapper.updateByPrimaryKey(depotHead); + logService.insertLog("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getId()).toString(), request); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepotHead(Long id, HttpServletRequest request) throws Exception { + return batchDeleteBillByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotHead(String ids, HttpServletRequest request) throws Exception { + return batchDeleteBillByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteBillByIds(String ids) throws Exception { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List dhList = getDepotHeadListByIds(ids); + for (DepotHead depotHead : dhList) { + sb.append("[").append(depotHead.getNumber()).append("]"); + //只有未审核的单据才能被删除 + if ("0".equals(depotHead.getStatus())) { + User userInfo = userService.getCurrentUser(); + //删除出库数据回收序列号 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && !BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + //查询单据子表列表 + List depotItemList = null; + try { + depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(depotHead.getId(), BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED); + } catch (Exception e) { + BoomException.readFail(e); + } + + /**回收序列号*/ + if (depotItemList != null && depotItemList.size() > 0) { + for (DepotItem depotItem : depotItemList) { + //BasicNumber=OperNumber*ratio + serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotHead.getNumber(), (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); + } + } + } + //对于零售出库单据,更新会员的预收款信息 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && BusinessConstants.SUB_TYPE_RETAIL.equals(depotHead.getSubType())) { + if (BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { + if (depotHead.getOrganId() != null) { + supplierService.updateAdvanceIn(depotHead.getOrganId(), depotHead.getTotalPrice().abs()); + } + } + } + //删除单据子表数据 + depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long[]{depotHead.getId()}); + //删除单据主表信息 + batchDeleteDepotHeadByIds(depotHead.getId().toString()); + //将关联的单据置为审核状态-针对采购入库、销售出库和盘点复盘 + if (StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + if ((BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType())) + || (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) + || (BusinessConstants.DEPOTHEAD_TYPE_OTHER.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType()))) { + DepotHead dh = new DepotHead(); + dh.setStatus(BusinessConstants.BILLS_STATUS_AUDIT); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(depotHead.getLinkNumber()); + depotHeadMapper.updateByExampleSelective(dh, example); + } + } + //更新当前库存 + List list = depotItemService.getListByHeaderId(depotHead.getId()); + for (DepotItem depotItem : list) { + depotItemService.updateCurrentStock(depotItem); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); + } + } + logService.insertLog("单据", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; + } + + /** + * 删除单据主表信息 + * + * @param ids + * @return + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotHeadByIds(String ids) throws Exception { + User userInfo = userService.getCurrentUser(); + String[] idArray = ids.split(","); + int result = 0; + try { + result = depotHeadMapperEx.batchDeleteDepotHeadByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + public List getDepotHeadListByIds(String ids) throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdIn(idList); + list = depotHeadMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int checkIsNameExist(Long id, String name) throws Exception { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = depotHeadMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list == null ? 0 : list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(String status, String depotHeadIDs) throws Exception { + int result = 0; + List dhIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(depotHeadIDs); + for (Long id : ids) { + DepotHead depotHead = getDepotHead(id); + if ("0".equals(status)) { + if ("1".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG)); + } + } else if ("1".equals(status)) { + if ("0".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG)); + } + } + } + if (dhIds.size() > 0) { + DepotHead depotHead = new DepotHead(); + depotHead.setStatus(status); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdIn(dhIds); + result = depotHeadMapper.updateByExampleSelective(depotHead, example); + } + return result; + } + + public String findMaterialsListByHeaderId(Long id) throws Exception { + String result = null; + try { + result = depotHeadMapperEx.findMaterialsListByHeaderId(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List findByAll(String beginTime, String endTime, String type, String materialParam, + List depotList, Integer oId, String number, Integer offset, Integer rows) throws Exception { + List list = null; + try { + list = depotHeadMapperEx.findByAll(beginTime, endTime, type, materialParam, depotList, oId, number, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findByAllCount(String beginTime, String endTime, String type, String materialParam, List depotList, Integer oId, String number) throws Exception { + int result = 0; + try { + result = depotHeadMapperEx.findByAllCount(beginTime, endTime, type, materialParam, depotList, oId, number); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List findInOutMaterialCount(String beginTime, String endTime, String type, String materialParam, List depotList, Integer oId, Integer offset, Integer rows) throws Exception { + List list = null; + try { + list = depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, materialParam, depotList, oId, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, String materialParam, List depotList, Integer oId) throws Exception { + int result = 0; + try { + result = depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, depotList, oId); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List findAllocationDetail(String beginTime, String endTime, String subType, String number, + String materialParam, List depotList, List depotFList, Integer offset, Integer rows) throws Exception { + List list = null; + try { + list = depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, materialParam, depotList, depotFList, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, + String materialParam, List depotList, List depotFList) throws Exception { + int result = 0; + try { + result = depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, materialParam, depotList, depotFList); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List findStatementAccount(String beginTime, String endTime, Integer organId, String supType, Integer offset, Integer rows) throws Exception { + List list = null; + try { + int j = 1; + if (supType.equals("客户")) { //客户 + j = 1; + } else if (supType.equals("供应商")) { //供应商 + j = -1; + } + list = depotHeadMapperEx.findStatementAccount(beginTime, endTime, organId, supType, offset, rows); + if (null != list) { + for (DepotHeadVo4StatementAccount dha : list) { + dha.setNumber(dha.getNumber()); //单据编号 + dha.setType(dha.getType()); //类型 + String type = dha.getType(); + BigDecimal p1 = BigDecimal.ZERO; + BigDecimal p2 = BigDecimal.ZERO; + if (dha.getDiscountLastMoney() != null) { + p1 = dha.getDiscountLastMoney(); + } + if (dha.getChangeAmount() != null) { + p2 = dha.getChangeAmount(); + } + BigDecimal allPrice = BigDecimal.ZERO; + if ((p1.compareTo(BigDecimal.ZERO)) == -1) { + p1 = p1.abs(); + } + if (dha.getOtherMoney() != null) { + p1 = p1.add(dha.getOtherMoney()); //与其它费用相加 + } + if ((p2.compareTo(BigDecimal.ZERO)) == -1) { + p2 = p2.abs(); + } + if (type.equals("采购入库")) { + allPrice = p2.subtract(p1); + } else if (type.equals("销售退货入库")) { + allPrice = p2.subtract(p1); + } else if (type.equals("销售出库")) { + allPrice = p1.subtract(p2); + } else if (type.equals("采购退货出库")) { + allPrice = p1.subtract(p2); + } else if (type.equals("收款")) { + allPrice = BigDecimal.ZERO.subtract(p1); + } else if (type.equals("付款")) { + allPrice = p1; + } else if (type.equals("收入")) { + allPrice = p1.subtract(p2); + } else if (type.equals("支出")) { + allPrice = p2.subtract(p1); + } + dha.setBillMoney(p1); //单据金额 + dha.setChangeAmount(p2); //实际支付 + DecimalFormat df = new DecimalFormat(".##"); + dha.setAllPrice(new BigDecimal(df.format(allPrice.multiply(new BigDecimal(j))))); //本期变化 + dha.setSupplierName(dha.getSupplierName()); //单位名称 + dha.setoTime(dha.getoTime()); //单据日期 + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findStatementAccountCount(String beginTime, String endTime, Integer organId, String supType) throws Exception { + int result = 0; + try { + result = depotHeadMapperEx.findStatementAccountCount(beginTime, endTime, organId, supType); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public BigDecimal findAllMoney(Integer supplierId, String type, String subType, String mode, String endTime) throws Exception { + String modeName = ""; + BigDecimal allOtherMoney = BigDecimal.ZERO; + if (mode.equals("实际")) { + modeName = "change_amount"; + } else if (mode.equals("合计")) { + modeName = "discount_last_money"; + allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime); + } + BigDecimal result = BigDecimal.ZERO; + try { + result = depotHeadMapperEx.findAllMoney(supplierId, type, subType, modeName, endTime); + } catch (Exception e) { + BoomException.readFail(e); + } + if (allOtherMoney != null) { + result = result.add(allOtherMoney); + } + return result; + } + + /** + * 统计总金额 + * + * @param getS + * @param type + * @param subType + * @param mode 合计或者金额 + * @return + */ + public BigDecimal allMoney(String getS, String type, String subType, String mode, String endTime) { + BigDecimal allMoney = BigDecimal.ZERO; + try { + Integer supplierId = Integer.valueOf(getS); + BigDecimal sum = findAllMoney(supplierId, type, subType, mode, endTime); + if (sum != null) { + allMoney = sum; + } + } catch (Exception e) { + e.printStackTrace(); + } + //返回正数,如果负数也转为正数 + if ((allMoney.compareTo(BigDecimal.ZERO)) == -1) { + allMoney = allMoney.abs(); + } + return allMoney; + } + + /** + * 查询单位的累计应收和累计应付,零售不能计入 + * + * @param supplierId + * @param endTime + * @param supType + * @return + */ + public BigDecimal findTotalPay(Integer supplierId, String endTime, String supType) { + BigDecimal sum = BigDecimal.ZERO; + String getS = supplierId.toString(); + if (("客户").equals(supType)) { //客户 + sum = allMoney(getS, "出库", "销售", "合计", endTime).subtract(allMoney(getS, "出库", "销售", "实际", endTime)); + } else if (("供应商").equals(supType)) { //供应商 + sum = allMoney(getS, "入库", "采购", "合计", endTime).subtract(allMoney(getS, "入库", "采购", "实际", endTime)); + } + return sum; + } + + public List getDetailByNumber(String number) throws Exception { + List resList = new ArrayList(); + List list = null; + try { + Map personMap = personService.getPersonMap(); + Map accountMap = accountService.getAccountMap(); + list = depotHeadMapperEx.getDetailByNumber(number); + if (null != list) { + for (DepotHeadVo4List dh : list) { + if (accountMap != null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { + String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); + dh.setAccountName(accountStr); + } + if (dh.getAccountIdList() != null) { + String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountIdList(accountidlistStr); + } + if (dh.getAccountMoneyList() != null) { + String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountMoneyList(accountmoneylistStr); + } + if (dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if (dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if (StringUtil.isNotEmpty(dh.getSalesMan())) { + dh.setSalesManStr(personService.getPersonByMapAndIds(personMap, dh.getSalesMan())); + } + dh.setOperTimeStr(getCenternTime(dh.getOperTime())); + dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId())); + dh.setCreatorName(userService.getUser(dh.getCreator()).getUsername()); + resList.add(dh); + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return resList; + } + + /** + * 新增单据主表及单据子表信息 + * + * @param body + * @param request + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addDepotHeadAndDetail(DepotHeadVo4Body body, + HttpServletRequest request) throws Exception { + /**处理单据主表数据*/ + DepotHead depotHead = body.getInfo(); + String subType = depotHead.getSubType(); + //结算账户校验 + if ("采购".equals(subType) || "采购退货".equals(subType) || "销售".equals(subType) || "销售退货".equals(subType)) { + if (StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId() == null) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG)); + } + } + //欠款校验 + if ("采购退货".equals(subType) || "销售退货".equals(subType)) { + if (depotHead.getChangeAmount().abs().compareTo(depotHead.getDiscountLastMoney().add(depotHead.getOtherMoney())) != 0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG)); + } + } + //判断用户是否已经登录过,登录过不再处理 + User userInfo = userService.getCurrentUser(); + depotHead.setCreator(userInfo == null ? null : userInfo.getId()); + depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); + depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + depotHead.setPayType(depotHead.getPayType() == null ? "现付" : depotHead.getPayType()); + if (StringUtil.isNotEmpty(depotHead.getAccountIdList())) { + depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", "")); + } + if (StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) { + //校验多账户的结算金额 + String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + int sum = StringUtil.getArrSum(accountMoneyList.split(",")); + BigDecimal manyAccountSum = BigDecimal.valueOf(sum).abs(); + if (manyAccountSum.compareTo(depotHead.getChangeAmount().abs()) != 0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG)); + } + depotHead.setAccountMoneyList(accountMoneyList); + } + + // 租户供应链订单 + if (depotHead.getTargetType()){ + // 将发起人设置为 租户编号 + Tenant tenant = tenantService.getTenant(depotHead.getOrganId()); + depotHead.setOrganId(tenant.getTenantId()); + } + + try { + depotHeadMapper.insert(depotHead); + } catch (Exception e) { + BoomException.writeFail(e); + } + /**入库和出库处理预付款信息*/ + if (BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { + if (depotHead.getOrganId() != null) { + supplierService.updateAdvanceIn(depotHead.getOrganId(), BigDecimal.ZERO.subtract(depotHead.getTotalPrice())); + } + } + + depotItemService.saveDetials(body.getRows(), depotHead.getId(), request); + + logService.insertLog("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + + /** + * 更新单据主表及单据子表信息 + * + * @param body + * @param request + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateDepotHeadAndDetail(DepotHeadVo4Body body, HttpServletRequest request) throws Exception { + /**更新单据主表信息*/ + DepotHead depotHead = body.getInfo(); + //获取之前的金额数据 + BigDecimal preTotalPrice = getDepotHead(depotHead.getId()).getTotalPrice().abs(); + String subType = depotHead.getSubType(); + //结算账户校验 + if ("采购".equals(subType) || "采购退货".equals(subType) || "销售".equals(subType) || "销售退货".equals(subType)) { + if (StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId() == null) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG)); + } + } + //欠款校验 + if ("采购退货".equals(subType) || "销售退货".equals(subType)) { + if (depotHead.getChangeAmount().abs().compareTo(depotHead.getDiscountLastMoney().add(depotHead.getOtherMoney())) != 0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG)); + } + } + if (StringUtil.isNotEmpty(depotHead.getAccountIdList())) { + depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", "")); + } + if (StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) { + //校验多账户的结算金额 + String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + int sum = StringUtil.getArrSum(accountMoneyList.split(",")); + BigDecimal manyAccountSum = BigDecimal.valueOf(sum).abs(); + if (manyAccountSum.compareTo(depotHead.getChangeAmount().abs()) != 0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG)); + } + depotHead.setAccountMoneyList(accountMoneyList); + } + try { + depotHeadMapper.updateByPrimaryKeySelective(depotHead); + } catch (Exception e) { + BoomException.writeFail(e); + } + /**入库和出库处理预付款信息*/ + if (BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { + if (depotHead.getOrganId() != null) { + supplierService.updateAdvanceIn(depotHead.getOrganId(), BigDecimal.ZERO.subtract(depotHead.getTotalPrice().subtract(preTotalPrice))); + } + } + /**入库和出库处理单据子表信息*/ + depotItemService.saveDetials(body.getRows(), depotHead.getId(), request); + logService.insertLog("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + + public BigDecimal getBuyAndSaleStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) { + return depotHeadMapperEx.getBuyAndSaleStatistics(type, subType, hasSupplier, beginTime, endTime); + } + + public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, String beginTime, String endTime) { + return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime).abs(); + } + + public DepotHead getDepotHead(String number) { + DepotHead depotHead = new DepotHead(); + try { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotHeadMapper.selectByExample(example); + if (null != list && list.size() > 0) { + depotHead = list.get(0); + } + } catch (Exception e) { + BoomException.readFail(e); + } + return depotHead; + } + + public List debtList(Long organId, String materialParam, String number, String beginTime, String endTime, + String type, String subType, String roleType, String status) { + List resList = new ArrayList<>(); + try { + String depotIds = depotService.findDepotStrByCurrentUser(); + String[] depotArray = depotIds.split(","); + String[] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime, BusinessConstants.DAY_LAST_TIME); + List list = depotHeadMapperEx.debtList(organId, type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotArray); + if (null != list) { + for (DepotHeadVo4List dh : list) { + if (dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if (dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if (dh.getOperTime() != null) { + dh.setOperTimeStr(getCenternTime(dh.getOperTime())); + } + dh.setFinishDebt(accountItemService.getEachAmountByBillId(dh.getId())); + dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId())); + resList.add(dh); + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return resList; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemComponent.java new file mode 100644 index 00000000..9ae6a5df --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemComponent.java @@ -0,0 +1,75 @@ +package com.zsw.erp.service.depotItem; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depotItem_component") +@DepotItemResource +public class DepotItemComponent implements ICommonQuery { + + @Resource + private DepotItemService depotItemService; + + @Override + public Object selectOne(Long id) throws Exception { + return depotItemService.getDepotItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotItemList(map); + } + + private List getDepotItemList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return depotItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return depotItemService.countDepotItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return depotItemService.insertDepotItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotItemService.updateDepotItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotItemService.deleteDepotItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotItemService.batchDeleteDepotItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return depotItemService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemResource.java new file mode 100644 index 00000000..3a193751 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.depotItem; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "depotItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotItemResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java new file mode 100644 index 00000000..fa00f4e6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/depotItem/DepotItemService.java @@ -0,0 +1,834 @@ +package com.zsw.erp.service.depotItem; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.dto.DepotItemDto; +import com.zsw.erp.datasource.vo.DepotItemStockWarningCount; +import com.zsw.erp.datasource.vo.DepotItemVo4Stock; +import com.zsw.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.zsw.erp.dto.depot.StockVo; +import com.zsw.erp.dto.depotItem.BatchStockDto; +import com.zsw.erp.dto.depotItem.BatchStockPageVo; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.materialExtend.MaterialExtendService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.serialNumber.SerialNumberService; +import com.zsw.erp.service.systemConfig.SystemConfigService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; + +@Service +public class DepotItemService { + private Logger logger = LoggerFactory.getLogger(DepotItemService.class); + + private final static String TYPE = "入库"; + private final static String SUM_TYPE = "number"; + private final static String IN = "in"; + private final static String OUT = "out"; + + @Resource + private DepotItemMapper depotItemMapper; + @Resource + private DepotItemMapperEx depotItemMapperEx; + @Resource + private MaterialService materialService; + @Resource + private MaterialExtendService materialExtendService; + @Resource + SerialNumberMapperEx serialNumberMapperEx; + @Resource + private DepotHeadMapper depotHeadMapper; + @Resource + SerialNumberService serialNumberService; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private MaterialCurrentStockMapper materialCurrentStockMapper; + @Resource + private LogService logService; + + public DepotItem getDepotItem(long id) throws Exception { + DepotItem result = null; + try { + result = depotItemMapper.selectByPrimaryKey(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List getDepotItem() throws Exception { + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = depotItemMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows) throws Exception { + List list = null; + try { + list = depotItemMapperEx.selectByConditionDepotItem(name, type, remark, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public Long countDepotItem(String name, Integer type, String remark) throws Exception { + Long result = null; + try { + result = depotItemMapperEx.countsByDepotItem(name, type, remark); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepotItem(JSONObject obj, HttpServletRequest request) throws Exception { + DepotItem depotItem = JSONObject.parseObject(obj.toJSONString(), DepotItem.class); + int result = 0; + try { + result = depotItemMapper.insert(depotItem); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotItem(JSONObject obj, HttpServletRequest request) throws Exception { + DepotItem depotItem = JSONObject.parseObject(obj.toJSONString(), DepotItem.class); + int result = 0; + try { + result = depotItemMapper.updateByPrimaryKeySelective(depotItem); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepotItem(Long id, HttpServletRequest request) throws Exception { + int result = 0; + try { + result = depotItemMapper.deleteByPrimaryKey(id); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotItem(String ids, HttpServletRequest request) throws Exception { + List idList = StringUtil.strToLongList(ids); + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andIdIn(idList); + int result = 0; + try { + result = depotItemMapper.deleteByExample(example); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) throws Exception { + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = depotItemMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list == null ? 0 : list.size(); + } + + public List findDetailByTypeAndMaterialIdList(Map map) throws Exception { + String mIdStr = map.get("mId"); + Long mId = null; + if (!StringUtil.isEmpty(mIdStr)) { + mId = Long.parseLong(mIdStr); + } + List list = null; + String startTime = map.get("startTime"); + try { + list = depotItemMapperEx.findDetailByTypeAndMaterialIdList(mId,startTime, QueryUtils.offset(map), QueryUtils.rows(map)); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public Long findDetailByTypeAndMaterialIdCounts(Map map) throws Exception { + String mIdStr = map.get("mId"); + Long mId = null; + if (!StringUtil.isEmpty(mIdStr)) { + mId = Long.parseLong(mIdStr); + } + Long result = null; + try { + result = depotItemMapperEx.findDetailByTypeAndMaterialIdCounts(mId); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotItemWithObj(DepotItem depotItem) throws Exception { + int result = 0; + try { + result = depotItemMapper.updateByPrimaryKeySelective(depotItem); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + public List getListByHeaderId(Long headerId){ + List list = null; + try { + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId); + list = depotItemMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List getDetailList(Long headerId) throws Exception { + List list = null; + try { + list = depotItemMapperEx.getDetailList(headerId); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List findByAll(String materialParam, String endTime, Integer offset, Integer rows) throws Exception { + List list = null; + try { + list = depotItemMapperEx.findByAll(materialParam, endTime, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findByAllCount(String materialParam, String endTime) throws Exception { + int result = 0; + try { + result = depotItemMapperEx.findByAllCount(materialParam, endTime); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public BigDecimal buyOrSale(String type, String subType, Long MId, String monthTime, String sumType) throws Exception { + BigDecimal result = BigDecimal.ZERO; + try { + String beginTime = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + if (SUM_TYPE.equals(sumType)) { + result = depotItemMapperEx.buyOrSaleNumber(type, subType, MId, beginTime, endTime, sumType); + } else { + result = depotItemMapperEx.buyOrSalePrice(type, subType, MId, beginTime, endTime, sumType); + } + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + + } + + /** + * 统计采购或销售的总金额 + * + * @param type + * @param subType + * @param month + * @return + * @throws Exception + */ + public BigDecimal inOrOutPrice(String type, String subType, String month) throws Exception { + BigDecimal result = BigDecimal.ZERO; + try { + String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME; + result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + /** + * 统计零售的总金额 + * + * @param type + * @param subType + * @param month + * @return + * @throws Exception + */ + public BigDecimal inOrOutRetailPrice(String type, String subType, String month) throws Exception { + BigDecimal result = BigDecimal.ZERO; + try { + String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME; + result = depotItemMapperEx.inOrOutRetailPrice(type, subType, beginTime, endTime); + result = result.abs(); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void saveDetials(List items, Long headerId, HttpServletRequest request) throws Exception { + //查询单据主表信息 + DepotHead depotHead = depotHeadMapper.selectByPrimaryKey(headerId); + //获得当前操作人 + User userInfo = userService.getCurrentUser(); + //首先回收序列号,如果是调拨,不用处理序列号 + // 如果是出库 计算当前出库的加权金额 用于后续统计和扣除金额 。 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && !BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + List depotItemList = getListByHeaderId(headerId); + for (DepotItem depotItem : depotItemList) { + Material material = materialService.getMaterial(depotItem.getMaterialId()); + if (material == null) { + continue; + } + if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) { + serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotHead.getNumber(), + (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); + } + } + } + //删除单据的明细 + deleteDepotItemHeadId(headerId); + //单据状态:是否全部完成 2-全部完成 3-部分完成(针对订单的分批出入库) + String billStatus = BusinessConstants.BILLS_STATUS_SKIPED; + if (null != items && items.size() > 0) { + for (DepotItemDto item : items){ + DepotItem depotItem = new DepotItem(); + depotItem.setHeaderId(headerId); + String barCode = item.getBarCode(); + MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode); + depotItem.setMaterialId(materialExtend.getMaterialId()); + depotItem.setMaterialExtendId(materialExtend.getId()); + depotItem.setMaterialUnit(item.getUnit()); + if (StringUtil.isExist(item.getSnList())) { + depotItem.setSnList(item.getSnList()); + if (StringUtil.isExist(item.getDepotId())) { + Long depotId = item.getDepotId(); + if (BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType()) || + BusinessConstants.SUB_TYPE_SALES_RETURN.equals(depotHead.getSubType())) { + serialNumberService.addSerialNumberByBill(depotHead.getNumber(), materialExtend.getMaterialId(), depotId, depotItem.getSnList()); + } + } + } + if (StringUtil.isExist(item.getBatchNumber())) { + depotItem.setBatchNumber(item.getBatchNumber()); + } + if (StringUtil.isExist(item.getExpirationDate())) { + depotItem.setExpirationDate(item.getExpirationDate()); + } + if (StringUtil.isExist(item.getSku())) { + depotItem.setSku(item.getSku()); + } + if (StringUtil.isExist(item.getOperNumber())) { + depotItem.setOperNumber(item.getOperNumber()); + String unit = item.getUnit(); + BigDecimal oNumber = item.getOperNumber(); + //以下进行单位换算 + Unit unitInfo = materialService.findUnit(materialExtend.getMaterialId()); //查询计量单位信息 + if (StringUtil.isNotEmpty(unitInfo.getName())) { + String basicUnit = unitInfo.getBasicUnit(); //基本单位 + if (unit.equals(basicUnit)) { //如果等于基本单位 + depotItem.setBasicNumber(oNumber); //数量一致 + } else if (unit.equals(unitInfo.getOtherUnit())) { //如果等于副单位 + depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatio()))); //数量乘以比例 + } else if (unit.equals(unitInfo.getOtherUnitTwo())) { //如果等于副单位2 + depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatioTwo()))); //数量乘以比例 + } else if (unit.equals(unitInfo.getOtherUnitThree())) { //如果等于副单位3 + depotItem.setBasicNumber(oNumber.multiply(new BigDecimal(unitInfo.getRatioThree()))); //数量乘以比例 + } + } else { + depotItem.setBasicNumber(oNumber); //其他情况 + } + } + //如果数量+已完成数量<原订单数量,代表该单据状态为未全部完成出入库(判断前提是存在关联订单) + if (StringUtil.isNotEmpty(depotHead.getLinkNumber()) + && StringUtil.isExist(item.getPreNumber()) && StringUtil.isExist(item.getFinishNumber())) { + BigDecimal preNumber = item.getPreNumber(); + BigDecimal finishNumber = item.getFinishNumber(); + // 操作数 + 最终数 小于 原来数 + if (depotItem.getOperNumber().add(finishNumber).compareTo(preNumber) < 0) { + billStatus = BusinessConstants.BILLS_STATUS_SKIPING; + } else if (depotItem.getOperNumber().add(finishNumber).compareTo(preNumber) > 0) { + // 操作数 + 最终数 大于 原来数 + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode)); + } + } + if (StringUtil.isExist(item.getUnitPrice())) { + depotItem.setUnitPrice(item.getUnitPrice()); + } + if (StringUtil.isExist(item.getTaxUnitPrice())) { + depotItem.setTaxUnitPrice(item.getTaxUnitPrice()); + } + if (StringUtil.isExist(item.getAllPrice())) { + depotItem.setAllPrice(item.getAllPrice()); + } + + if (StringUtil.isExist(item.getDepotId())) { + depotItem.setDepotId(item.getDepotId()); + } else { + if (!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType()) + && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_MSG)); + } + } + if (BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + if (StringUtil.isExist(item.getAnotherDepotId())) { + if (item.getAnotherDepotId().equals(item.getDepotId())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG)); + } else { + depotItem.setAnotherDepotId(item.getAnotherDepotId()); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG)); + } + } + if (StringUtil.isExist(item.getTaxRate())) { + depotItem.setTaxRate(item.getTaxRate()); + } + if (StringUtil.isExist(item.getTaxMoney())) { + depotItem.setTaxMoney(item.getTaxMoney()); + } + if (StringUtil.isExist(item.getTaxLastMoney())) { + depotItem.setTaxLastMoney(item.getTaxLastMoney()); + } + if (StringUtil.isExist(item.getMType())) { + depotItem.setMaterialType(item.getMType()); + } + if (StringUtil.isExist(item.getRemark())) { + depotItem.setRemark(item.getRemark()); + } + //出库时判断库存是否充足 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) { + if (depotItem == null) { + continue; + } + Material material = materialService.getMaterial(depotItem.getMaterialId()); + if (material == null) { + continue; + } + BigDecimal stock = getStockByParam(depotItem.getDepotId(), depotItem.getMaterialId(), null, null).getStock(); + BigDecimal thisBasicNumber = depotItem.getBasicNumber() == null ? BigDecimal.ZERO : depotItem.getBasicNumber(); + if (systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber) < 0) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE, + String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG, material == null ? "" : material.getName())); + } + //出库时处理序列号 + if (!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + //判断商品是否开启序列号,开启的收回序列号,未开启的跳过 + if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) { + //查询单据子表中开启序列号的数据列表 + serialNumberService.checkAndUpdateSerialNumber(depotItem, depotHead.getNumber(), userInfo, StringUtil.toNull(depotItem.getSnList())); + } + } + } + //计算当前出入库的加权金额 + MaterialCurrentStock stock = materialCurrentStockMapper.selectOne(Wrappers.lambdaQuery() + .eq(MaterialCurrentStock::getDepotId, item.getDepotId()) + .eq(MaterialCurrentStock::getMaterialId, materialExtend.getMaterialId()) + ); + //如果入库时,商品没有库存 和加权金额 按照当前入库价格处理 + logger.error("stock:{}",stock); + if (stock == null){ + stock = new MaterialCurrentStock(); + } + // 当前变更金额 = 当前库存的加权金额 * 本次变动数值 + // 加权单价 = (之前库存价格 + 当前变更金额) /(之前库存数量 + 当前新增库存) + // 加权金额 等于 = 加权单价 * 当前新增库存 +// BigDecimal 变更金额 = BigDecimal.ZERO; +// if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){ +// //出库 变更金额 = 库存加权金额 * 变更数 +// 变更金额 = stock.getWeightPrice().multiply(item.getOperNumber()); +// }else{ +// // 入库 变更金额 = 入库的全部 allPrice字段没有问题。 +// 变更金额 = item.getAllPrice(); +// } +// logger.error("当前加权单价:{}",stock.getWeightPrice()); +// logger.error("加权单价计算公式:({}+{})/({}+{})",stock.getTotalPrice(),变更金额,stock.getCurrentNumber(),item.getOperNumber()); +// BigDecimal 加权单价 = (stock.getTotalPrice().add(变更金额)) +// .divide(stock.getCurrentNumber().add(item.getOperNumber()),6,RoundingMode.HALF_UP); +// BigDecimal 加权金额 = 加权单价.multiply(item.getOperNumber()); +// logger.error("本次新增单据变更加权金额:{},单价:{}",加权金额,加权单价); +// materialExtendService.updateMaterialExtendPurchasePrice(materialExtend.getMaterialId(),加权单价); + // 本次改动的加权金额. +// depotItem.setWeightPrice(加权金额); + depotItemMapper.insert(depotItem); + //更新当前库存 + updateCurrentStock(depotItem); + } + //如果关联单据号非空则更新订单的状态,单据类型:采购入库单或销售出库单 + if (BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType()) + || BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) { + if (StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + changeBillStatus(depotHead, billStatus); + } + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_MSG)); + } + } + + /** + * 更新单据状态 + * + * @param depotHead + * @param billStatus + */ + public void changeBillStatus(DepotHead depotHead, String billStatus) { + DepotHead depotHeadOrders = new DepotHead(); + depotHeadOrders.setStatus(billStatus); + DepotHeadExample example = new DepotHeadExample(); + List linkNumberList = StringUtil.strToStringList(depotHead.getLinkNumber()); + example.createCriteria().andNumberIn(linkNumberList); + try { + depotHeadMapper.updateByExampleSelective(depotHeadOrders, example); + } catch (Exception e) { + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG, e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteDepotItemHeadId(Long headerId) throws Exception { + try { + //1、查询删除前的单据明细 + List depotItemList = getListByHeaderId(headerId); + //2、删除单据明细 + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId); + depotItemMapper.deleteByExample(example); + //3、计算删除之后单据明细中商品的库存 + for (DepotItem depotItem : depotItemList) { + updateCurrentStock(depotItem); + } + } catch (Exception e) { + BoomException.writeFail(e); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public List findStockWarningCount(Integer offset, Integer rows, String materialParam, List depotList) { + List list = null; + try { + list = depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int findStockWarningCountTotal(String materialParam, List depotList) { + int result = 0; + try { + result = depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + /** + * 库存统计-sku + * + * @param depotId + * @param meId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime) { + DepotItemVo4Stock stockObj = depotItemMapperEx.getSkuStockByParam(depotId, meId, beginTime, endTime); + BigDecimal stockSum = BigDecimal.ZERO; + if (stockObj != null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + stockSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal) + .subtract(outTotal).subtract(transfOutTotal).subtract(assemOutTotal).subtract(disAssemOutTotal); + } + return stockSum; + } + + /** + * 库存统计-单仓库 + * + * @param depotId + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public StockVo getStockByParam(Long depotId, Long mId, String beginTime, String endTime) { + BigDecimal stock = getStockByParamWithDepotList(Lists.newArrayList(depotId), mId, beginTime, endTime); + StockVo vo = new StockVo(); + vo.setStock(stock); + MaterialCurrentStock current = materialCurrentStockMapper.selectOne(Wrappers.lambdaQuery() + .eq(MaterialCurrentStock::getMaterialId, mId) + .eq(MaterialCurrentStock::getDepotId, depotId) + .ne(MaterialCurrentStock::getDeleteFlag, BusinessConstants.DELETE_FLAG_DELETED)); + return vo; + } + + /** + * 库存统计-多仓库 + * + * @param depotList + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getStockByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime) { + //初始库存 + BigDecimal initStock = materialService.getInitStockByMidAndDepotList(depotList, mId); + logger.info("期初库存:{},{}",mId,initStock); + //盘点复盘后数量的变动 + BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, beginTime, endTime); + logger.info("盘点变动:{},mid:{}",stockCheckSum,mId); + DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, beginTime, endTime); + + BigDecimal stockSum = BigDecimal.ZERO; + if (stockObj != null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + //总库存改变 + stockSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal) + .subtract(outTotal).subtract(transfOutTotal).subtract(assemOutTotal).subtract(disAssemOutTotal); + } + BigDecimal rs = initStock.add(stockCheckSum).add(stockSum); + logger.info("最终库存:{}",rs); + return rs; + } + + /** + * 库存金额计算 + * + * @param depotId + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getStockPriceParam(Long depotId, Long mId, String beginTime, String endTime) { + //初始库存 + MaterialInitialStock initStock = materialService.getInitStock(mId, depotId); + DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(Lists.newArrayList(depotId), mId, beginTime, endTime); + logger.error("库存数据:{}",stockObj); + if (stockObj == null) { + stockObj = new DepotItemVo4Stock(); + } + if (initStock == null) { + initStock = new MaterialInitialStock(); + } + logger.error("库存金额计算:初始金额{}+入库金额{}-出库金额{}",initStock.getTotalPrice(),stockObj.getInPrice(),stockObj.getWeightOutPrice()); + return initStock.getTotalPrice().add(stockObj.getInPrice()).subtract(stockObj.getWeightOutPrice()); + } + + + /** + * 统计时间段内的入库和出库数量-多仓库 + * + * @param depotList + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public Map getIntervalMapByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime) { + Map intervalMap = new HashMap<>(); + BigDecimal inSum = BigDecimal.ZERO; + BigDecimal outSum = BigDecimal.ZERO; + //盘点复盘后数量的变动 + BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, beginTime, endTime); + DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, beginTime, endTime); + if (stockObj != null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + inSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + outSum = outTotal.add(transfOutTotal).add(assemOutTotal).add(disAssemOutTotal); + } + if (stockCheckSum.compareTo(BigDecimal.ZERO) > 0) { + inSum = inSum.add(stockCheckSum); + } else { + //盘点复盘数量为负数代表出库 + outSum = outSum.subtract(stockCheckSum); + } + intervalMap.put("inSum", inSum); + intervalMap.put("outSum", outSum); + return intervalMap; + } + + /** + * 根据单据明细来批量更新当前库存 + * + * @param depotItem + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateCurrentStock(DepotItem depotItem) { + // 出入库操作 + updateCurrentStockFun(depotItem.getMaterialId(), depotItem.getDepotId()); + // 调拨单 + if (depotItem.getAnotherDepotId() != null) { + updateCurrentStockFun(depotItem.getMaterialId(), depotItem.getAnotherDepotId()); + } + } + + /** + * 根据商品和仓库来更新当前库存 + * todo 这一步骤更新了加权单价和金额 如果其他处没有通过本方法更改库存,需要额外处理 + * + * @param mId + * @param dId 仓库id + */ + public void updateCurrentStockFun(Long mId, Long dId) { + if (mId != null && dId != null) { + LambdaQueryWrapper wrap = Wrappers.lambdaQuery() + .eq(MaterialCurrentStock::getMaterialId, mId) + .eq(MaterialCurrentStock::getDepotId, dId) + .ne(MaterialCurrentStock::getDeleteFlag,BusinessConstants.DELETE_FLAG_DELETED); + //当前库存 + MaterialCurrentStock materialCurrentStock = materialCurrentStockMapper.selectOne(wrap); + if (ObjectUtil.isNull(materialCurrentStock)) { + materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setDepotId(dId); + } + // 新的库存量 + BigDecimal newStockNumber = getStockByParam(dId, mId, null, null).getStock(); + materialCurrentStock.setCurrentNumber(newStockNumber); +// BigDecimal newStockPrice = BigDecimal.ZERO; // 总价 +// BigDecimal weightPrice = BigDecimal.ZERO; +// // todo 库存不为0的时候 才能重新计算加权单价 否则将出错 +// // 库存为0的时候,加权单价应该是之前的,库存为0,单价x0 = 加权总价 = 0 +// if (newStockNumber.compareTo(BigDecimal.ZERO) > 0) { +// // 库存金额 +// newStockPrice = getStockPriceParam(dId, mId, null, null); +// // 库存总价基数总价 + 入库总价 +// // 权重金额 = 总金额 / 库存 +// weightPrice = newStockNumber.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : +// newStockPrice.divide(newStockNumber, 6, RoundingMode.HALF_UP); +// logger.error("加权单价计算公式:{}/{}",newStockPrice,newStockNumber); +// // 30 * 5 / 30 +// // 29 * 5 / 29 +// } +// logger.error("重新计算加权单价:「{}」",weightPrice); +// // 重新计算当前库存时 可以重新计算金额加权 +// materialCurrentStock.setTotalPrice(newStockPrice); +// materialCurrentStock.setWeightPrice(weightPrice); + + if (ObjectUtil.isNotNull(materialCurrentStock.getId())) { + materialCurrentStock.setId(materialCurrentStock.getId()); + materialCurrentStockMapper.updateById(materialCurrentStock); + } else { + materialCurrentStockMapper.insert(materialCurrentStock); + } + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BigDecimal getFinishNumber(Long mId, Long headerId) { + String goToType = ""; + DepotHead depotHead = depotHeadMapper.selectByPrimaryKey(headerId); + String linkNumber = depotHead.getNumber(); //订单号 + if (BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_PURCHASE; + } + if (BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_SALES; + } + BigDecimal count = depotItemMapperEx.getFinishNumber(mId, linkNumber, goToType); + return count; + } + + public List getBatchNumberList(String name, Long depotId, String barCode, String batchNumber) { + return depotItemMapperEx.getBatchNumberList(name, depotId, barCode, batchNumber); + } + + public Integer batchStockCount(BatchStockDto dto) { + return depotItemMapper.batchStockCount(dto); + } + + public List batchStockPage(BatchStockDto dto) { + Integer pageOffset = (dto.getCurrentPage() - 1) * dto.getPageSize(); + dto.setPageOffset(pageOffset); + + return depotItemMapper.batchStockPage(dto); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java new file mode 100644 index 00000000..3831ef78 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionComponent.java @@ -0,0 +1,73 @@ +package com.zsw.erp.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "function_component") +@FunctionResource +public class FunctionComponent implements ICommonQuery { + + @Resource + private FunctionService functionService; + + @Override + public Object selectOne(Long id) throws Exception { + return functionService.getFunction(id); + } + + @Override + public List select(Map map)throws Exception { + return getFunctionsList(map); + } + + private List getFunctionsList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String order = QueryUtils.order(map); + return functionService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + return functionService.countFunction(name, type); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return functionService.insertFunction(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return functionService.updateFunction(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return functionService.deleteFunction(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return functionService.batchDeleteFunction(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return functionService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java new file mode 100644 index 00000000..dfc956eb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.functions; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "function") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface FunctionResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java new file mode 100644 index 00000000..4a56765b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/functions/FunctionService.java @@ -0,0 +1,211 @@ +package com.zsw.erp.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.Function; +import com.zsw.erp.datasource.entities.FunctionExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.FunctionMapper; +import com.zsw.erp.datasource.mappers.FunctionMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class FunctionService { + private Logger logger = LoggerFactory.getLogger(FunctionService.class); + + @Resource + private FunctionMapper functionsMapper; + + @Resource + private FunctionMapperEx functionMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + + public Function getFunction(long id)throws Exception { + Function result=null; + try{ + result=functionsMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getFunctionListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + FunctionExample example = new FunctionExample(); + example.createCriteria().andIdIn(idList); + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getFunction()throws Exception { + FunctionExample example = new FunctionExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, String type, int offset, int rows)throws Exception { + List list=null; + try{ + list= functionMapperEx.selectByConditionFunction(name, type, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countFunction(String name, String type)throws Exception { + Long result=null; + try{ + result= functionMapperEx.countsByFunction(name, type); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertFunction(JSONObject obj, HttpServletRequest request)throws Exception { + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + result=functionsMapper.insert(functions); + logService.insertLog("功能", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(functions.getName()).toString(),request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateFunction(JSONObject obj, HttpServletRequest request) throws Exception{ + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + result=functionsMapper.updateByPrimaryKeySelective(functions); + logService.insertLog("功能", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(functions.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteFunction(Long id, HttpServletRequest request)throws Exception { + return batchDeleteFunctionByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunction(String ids, HttpServletRequest request)throws Exception { + return batchDeleteFunctionByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunctionByIds(String ids)throws Exception { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getFunctionListByIds(ids); + for(Function functions: list){ + sb.append("[").append(functions.getName()).append("]"); + } + logService.insertLog("功能", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = functionMapperEx.batchDeleteFunctionByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + FunctionExample example = new FunctionExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + // 菜单到下级菜单 + public List getRoleFunction(String pNumber)throws Exception { + FunctionExample example = new FunctionExample(); + example.createCriteria() + .andEnabledEqualTo(true) + .andParentNumberEqualTo(pNumber) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("Sort"); + List list=null; + try{ + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findRoleFunction(String pnumber)throws Exception{ + FunctionExample example = new FunctionExample(); + example.createCriteria().andEnabledEqualTo(true).andParentNumberEqualTo(pnumber) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("Sort"); + List list=null; + try{ + list =functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findByIds(List functionsIds)throws Exception{ + FunctionExample example = new FunctionExample(); + example.createCriteria().andEnabledEqualTo(true).andIdIn(functionsIds).andPushBtnIsNotNull().andPushBtnNotEqualTo("") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("Sort asc"); + List list=null; + try{ + list =functionsMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemComponent.java new file mode 100644 index 00000000..1a5ed974 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemComponent.java @@ -0,0 +1,75 @@ +package com.zsw.erp.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "inOutItem_component") +@InOutItemResource +public class InOutItemComponent implements ICommonQuery { + + @Resource + private InOutItemService inOutItemService; + + @Override + public Object selectOne(Long id) throws Exception { + return inOutItemService.getInOutItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getFunctionsList(map); + } + + private List getFunctionsList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return inOutItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String remark = StringUtil.getInfo(search, "remark"); + return inOutItemService.countInOutItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return inOutItemService.insertInOutItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return inOutItemService.updateInOutItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return inOutItemService.deleteInOutItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return inOutItemService.batchDeleteInOutItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return inOutItemService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemResource.java new file mode 100644 index 00000000..a705a812 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.inOutItem; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "inOutItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface InOutItemResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java new file mode 100644 index 00000000..980ff6de --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inOutItem/InOutItemService.java @@ -0,0 +1,204 @@ +package com.zsw.erp.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.AccountItemMapperEx; +import com.zsw.erp.datasource.mappers.InOutItemMapper; +import com.zsw.erp.datasource.mappers.InOutItemMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.AccountItem; +import com.zsw.erp.datasource.entities.InOutItem; +import com.zsw.erp.datasource.entities.InOutItemExample; +import com.zsw.erp.datasource.entities.User; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class InOutItemService { + private Logger logger = LoggerFactory.getLogger(InOutItemService.class); + + @Resource + private InOutItemMapper inOutItemMapper; + + @Resource + private InOutItemMapperEx inOutItemMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private AccountItemMapperEx accountItemMapperEx; + + public InOutItem getInOutItem(long id)throws Exception { + InOutItem result=null; + try{ + result=inOutItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getInOutItemListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andIdIn(idList); + list = inOutItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getInOutItem()throws Exception { + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, String type, String remark, int offset, int rows)throws Exception { + List list=null; + try{ + list=inOutItemMapperEx.selectByConditionInOutItem(name, type, remark, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countInOutItem(String name, String type, String remark)throws Exception { + Long result=null; + try{ + result=inOutItemMapperEx.countsByInOutItem(name, type, remark); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertInOutItem(JSONObject obj, HttpServletRequest request)throws Exception { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + result=inOutItemMapper.insertSelective(inOutItem); + logService.insertLog("收支项目", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(inOutItem.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateInOutItem(JSONObject obj, HttpServletRequest request)throws Exception { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + result=inOutItemMapper.updateByPrimaryKeySelective(inOutItem); + logService.insertLog("收支项目", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(inOutItem.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteInOutItem(Long id, HttpServletRequest request)throws Exception { + return batchDeleteInOutItemByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItem(String ids, HttpServletRequest request)throws Exception { + return batchDeleteInOutItemByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItemByIds(String ids)throws Exception { + int result = 0; + String [] idArray=ids.split(","); + //校验财务子表 jsh_accountitem + List accountItemList=null; + try{ + accountItemList=accountItemMapperEx.getAccountItemListByInOutItemIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(accountItemList!=null&&accountItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,InOutItemIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验通过执行删除操作 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getInOutItemListByIds(ids); + for(InOutItem inOutItem: list){ + sb.append("[").append(inOutItem.getName()).append("]"); + } + logService.insertLog("收支项目", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + try{ + result=inOutItemMapperEx.batchDeleteInOutItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + + return list==null?0:list.size(); + } + + public List findBySelect(String type)throws Exception { + InOutItemExample example = new InOutItemExample(); + if (type.equals("in")) { + example.createCriteria().andTypeEqualTo("收入").andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("out")) { + example.createCriteria().andTypeEqualTo("支出").andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + example.setOrderByClause("id desc"); + List list = null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java b/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java new file mode 100644 index 00000000..d5041c89 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/inventorySeason/InventorySeasonService.java @@ -0,0 +1,112 @@ +package com.zsw.erp.service.inventorySeason; + +import cn.hutool.core.date.LocalDateTimeUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.InventorySeason; +import com.zsw.erp.datasource.entities.MaterialCurrentStock; +import com.zsw.erp.datasource.entities.MaterialInitialStock; +import com.zsw.erp.datasource.mappers.InventorySeasonMapper; +import com.zsw.erp.datasource.mappers.MaterialInitialStockMapper; +import com.zsw.erp.service.materialCurrentStock.MaterialCurrentStockService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.LocalUser; +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +@Service +@ApiOperation("结转操作") +@Transactional(rollbackFor = RuntimeException.class) +public class InventorySeasonService extends ServiceImpl { + + @Autowired + MaterialInitialStockMapper materialInitialStockMapper; + + @Autowired + MaterialCurrentStockService materialCurrentStockService; + + @Autowired + UserService userService; + + // 获取当前期次 + public InventorySeason getNow(){ + // ? + LambdaQueryWrapper wrap = Wrappers.lambdaQuery() + .orderBy(true, false, InventorySeason::getId) + .last("limit 1"); + + InventorySeason seasion = this.getOne(wrap,false); + if (seasion == null){ + seasion = new InventorySeason(); + seasion.setCreator(LocalUser.getUserId()); + seasion.setBatch("系统期初"); + seasion.setStartTime(LocalDateTimeUtil.parse("2020-01-01 00:00:00","yyyy-MM-dd HH:mm:ss")); + seasion.setDeleteFlag("0"); + seasion.setMark("系统期初"); + this.save(seasion); + } + return seasion; + } + + public List getList(){ + LambdaQueryWrapper wrap = Wrappers.lambdaQuery() + .orderBy(true, false, InventorySeason::getId); + return this.list(wrap); + } + + /** + * 结束当前开始新期次 + * @return + */ + public InventorySeason endNow() { + InventorySeason season = this.getNow(); + // 处理本期全部库存 将库存转入期初 当前库存不变 + List currentStocks = materialCurrentStockService.list(); + for (MaterialCurrentStock stock:currentStocks){ + // 如果本期有库存,设置为期初 + if (stock.getCurrentNumber().compareTo(BigDecimal.ZERO) > 0){ + MaterialInitialStock init = materialInitialStockMapper.selectOne(Wrappers.lambdaQuery() + .eq(MaterialInitialStock::getMaterialId, stock.getMaterialId()) + .eq(MaterialInitialStock::getDepotId, stock.getDepotId())); + if (init == null){ + init = new MaterialInitialStock(); + init.setDepotId(stock.getDepotId()); + init.setMaterialId(stock.getMaterialId()); +// init.setWeightPrice(stock.getWeightPrice()); +// init.setTotalPrice(stock.getTotalPrice()); + init.setNumber(stock.getCurrentNumber()); + materialInitialStockMapper.insert(init); + }else{ + init.setDepotId(stock.getDepotId()); + init.setMaterialId(stock.getMaterialId()); +// init.setWeightPrice(stock.getWeightPrice()); +// init.setTotalPrice(stock.getTotalPrice()); + init.setNumber(stock.getCurrentNumber()); + materialInitialStockMapper.updateById(init); + } + } + } + season.setEndTime(LocalDateTime.now()); + this.updateById(season); + + long total = this.count(); + //新的期次 + InventorySeason newSeason = new InventorySeason(); + newSeason.setMark(""); + newSeason.setBatch("第"+(total)+"期"); + newSeason.setStartTime(LocalDateTime.now()); + this.save(newSeason); + return newSeason; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/log/LogComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogComponent.java new file mode 100644 index 00000000..bcb9d435 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogComponent.java @@ -0,0 +1,83 @@ +package com.zsw.erp.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "log_component") +@LogResource +public class LogComponent implements ICommonQuery { + + @Resource + private LogService logService; + + @Override + public Object selectOne(Long id) throws Exception { + return logService.getLog(id); + } + + @Override + public List select(Map map)throws Exception { + return getLogList(map); + } + + private List getLogList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String operation = StringUtil.getInfo(search, "operation"); + String userInfo = StringUtil.getInfo(search, "userInfo"); + String clientIp = StringUtil.getInfo(search, "clientIp"); + Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String content = StringUtil.getInfo(search, "content"); + return logService.select(operation, userInfo, clientIp, status, beginTime, endTime, content, + QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String operation = StringUtil.getInfo(search, "operation"); + String userInfo = StringUtil.getInfo(search, "userInfo"); + String clientIp = StringUtil.getInfo(search, "clientIp"); + Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String content = StringUtil.getInfo(search, "content"); + return logService.countLog(operation, userInfo, clientIp, status, beginTime, endTime, content); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return logService.insertLog(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return logService.updateLog(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return logService.deleteLog(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return logService.batchDeleteLog(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/log/LogResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogResource.java new file mode 100644 index 00000000..9e444592 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.log; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "log") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface LogResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/log/LogService.java b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogService.java new file mode 100644 index 00000000..73731758 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/log/LogService.java @@ -0,0 +1,191 @@ +package com.zsw.erp.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.Log; +import com.zsw.erp.datasource.entities.LogExample; +import com.zsw.erp.datasource.mappers.LogMapper; +import com.zsw.erp.datasource.mappers.LogMapperEx; +import com.zsw.erp.datasource.vo.LogVo4List; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +import static com.zsw.erp.utils.Tools.getLocalIp; + +@Service +public class LogService { + private Logger logger = LoggerFactory.getLogger(LogService.class); + @Resource + private LogMapper logMapper; + + @Resource + private LogMapperEx logMapperEx; + + @Resource + @Lazy + private UserService userService; + + @Resource + private RedisService redisService; + + public Log getLog(long id)throws Exception { + Log result=null; + try{ + result=logMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getLog()throws Exception { + LogExample example = new LogExample(); + List list=null; + try{ + list=logMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content, int offset, int rows)throws Exception { + List list=null; + try{ + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + list=logMapperEx.selectByConditionLog(operation, userInfo, clientIp, status, beginTime, endTime, + content, offset, rows); + if (null != list) { + for (LogVo4List log : list) { + log.setCreateTimeStr(Tools.getCenternTime(log.getCreateTime())); + } + } + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countLog(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content)throws Exception { + Long result=null; + try{ + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + result=logMapperEx.countsByLog(operation, userInfo, clientIp, status, beginTime, endTime, content); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertLog(JSONObject obj, HttpServletRequest request) throws Exception{ + Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); + int result=0; + try{ + result=logMapper.insertSelective(log); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateLog(JSONObject obj, HttpServletRequest request)throws Exception { + Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); + int result=0; + try{ + result=logMapper.updateByPrimaryKeySelective(log); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteLog(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result=logMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteLog(String ids, HttpServletRequest request)throws Exception { + List idList = StringUtil.strToLongList(ids); + LogExample example = new LogExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=logMapper.deleteByExample(example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public void insertLog(String moduleName, String content, HttpServletRequest request) { + try{ + Long userId = userService.getUserId(request); + if(userId!=null) { + String clientIp = getLocalIp(request); + String createTime = Tools.getNow3(); + Long count = logMapperEx.getCountByIpAndDate(moduleName, clientIp, createTime); + if(count > 0) { + //如果某1个IP在同1秒内连续操作两遍,此时需要删除该redis记录,使其退出,防止恶意攻击 + redisService.deleteObjectByKeyAndIp("clientIp", clientIp, "userId"); + } else { + Log log = new Log(); + log.setUserId(userId); + log.setOperation(moduleName); + log.setClientIp(getLocalIp(request)); + log.setCreateTime(new Date()); + Byte status = 0; + log.setStatus(status); + log.setContent(content); + logMapper.insertSelective(log); + } + } + }catch(Exception e){ + BoomException.writeFail(e); + } + } + + public void insertLogWithUserId(Long userId, Long tenantId, String moduleName, String content, HttpServletRequest request)throws Exception{ + try{ + if(userId!=null) { + Log log = new Log(); + log.setUserId(userId); + log.setOperation(moduleName); + log.setClientIp(getLocalIp(request)); + log.setCreateTime(new Date()); + Byte status = 0; + log.setStatus(status); + log.setContent(content); + log.setTenantId(tenantId); + logMapper.insertSelective(log); + } + }catch(Exception e){ + BoomException.writeFail(e); + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialComponent.java new file mode 100644 index 00000000..414b97a4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialComponent.java @@ -0,0 +1,80 @@ +package com.zsw.erp.service.material; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "material_component") +@MaterialResource +public class MaterialComponent implements ICommonQuery { + + @Resource + private MaterialService materialService; + + @Override + public Object selectOne(Long id) throws Exception { + return materialService.getMaterial(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String categoryId = StringUtil.getInfo(search, "categoryId"); + String barCode = StringUtil.getInfo(search, "barCode"); + String name = StringUtil.getInfo(search, "name"); + String standard = StringUtil.getInfo(search, "standard"); + String model = StringUtil.getInfo(search, "model"); + String mpList = StringUtil.getInfo(search, "mpList"); + return materialService.select(barCode, name, standard, model,categoryId,mpList, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String categoryId = StringUtil.getInfo(search, "categoryId"); + String barCode = StringUtil.getInfo(search, "barCode"); + String name = StringUtil.getInfo(search, "name"); + String standard = StringUtil.getInfo(search, "standard"); + String model = StringUtil.getInfo(search, "model"); + String mpList = StringUtil.getInfo(search, "mpList"); + return materialService.countMaterial(barCode, name, standard, model,categoryId,mpList); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialService.insertMaterial(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialService.updateMaterial(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialService.deleteMaterial(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialService.batchDeleteMaterial(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialResource.java new file mode 100644 index 00000000..a3ffc81a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.material; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "material") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java new file mode 100644 index 00000000..e259df9b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/material/MaterialService.java @@ -0,0 +1,992 @@ +package com.zsw.erp.service.material; + +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.dto.StockInitDto; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.depotHead.DepotHeadService; +import com.zsw.erp.service.materialExtend.MaterialExtendService; +import com.zsw.erp.service.depot.DepotService; +import com.zsw.erp.service.depotItem.DepotItemService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.materialCategory.MaterialCategoryService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.sequence.SequenceService; +import com.zsw.erp.service.unit.UnitService; +import com.zsw.erp.service.user.UserService; +import com.zsw.base.R; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.*; +import org.apache.ibatis.annotations.Param; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; + +@Service +@Transactional +public class MaterialService { + private Logger logger = LoggerFactory.getLogger(MaterialService.class); + + @Resource + private MaterialMapper materialMapper; + @Resource + private MaterialExtendMapper materialExtendMapper; + @Resource + private MaterialMapperEx materialMapperEx; + @Resource + private MaterialCategoryMapperEx materialCategoryMapperEx; + @Resource + private MaterialExtendMapperEx materialExtendMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private DepotItemMapperEx depotItemMapperEx; + @Resource + @Lazy + private DepotItemService depotItemService; + @Resource + private MaterialCategoryService materialCategoryService; + @Resource + private UnitService unitService; + @Resource + private MaterialInitialStockMapper materialInitialStockMapper; + @Resource + private MaterialCurrentStockMapper materialCurrentStockMapper; + @Resource + private DepotService depotService; + @Resource + private MaterialExtendService materialExtendService; + @Resource + private RedisService redisService; + @Resource + @Lazy + private DepotHeadService depotHeadService; + @Resource + private SequenceService sequenceService; + + public Material getMaterial(long id) throws Exception { + Material result = null; + try { + result = materialMapper.selectByPrimaryKey(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + + public List getMaterialListByIds(String ids) throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try { + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdIn(idList); + list = materialMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List getMaterial() throws Exception { + MaterialExample example = new MaterialExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = materialMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List select(String barCode, String name, String standard, String model, String categoryId, String mpList, int offset, int rows) + throws Exception { + String[] mpArr = new String[]{}; + if (StringUtil.isNotEmpty(mpList)) { + mpArr = mpList.split(","); + } + List resList = new ArrayList<>(); + List list = null; + try { + List idList = new ArrayList<>(); + if (StringUtil.isNotEmpty(categoryId)) { + idList = getListByParentId(Long.parseLong(categoryId)); + } + list = materialMapperEx.selectByConditionMaterial(barCode, name, standard, model, idList, mpList, offset, rows); + if (null != list) { + for (MaterialVo4Unit m : list) { + //扩展信息 + String materialOther = ""; + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + materialOther = materialOther + ((m.getMfrs() == null || m.getMfrs().equals("")) ? "" : "(" + m.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + materialOther = materialOther + ((m.getOtherField1() == null || m.getOtherField1().equals("")) ? "" : "(" + m.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + materialOther = materialOther + ((m.getOtherField2() == null || m.getOtherField2().equals("")) ? "" : "(" + m.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + materialOther = materialOther + ((m.getOtherField3() == null || m.getOtherField3().equals("")) ? "" : "(" + m.getOtherField3() + ")"); + } + } + m.setMaterialOther(materialOther); + m.setStock(depotItemService.getStockByParam(null, m.getId(), null, null).getStock()); + resList.add(m); + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return resList; + } + + public Long countMaterial(String barCode, String name, String standard, String model, String categoryId, String mpList) throws Exception { + Long result = null; + try { + List idList = new ArrayList<>(); + if (StringUtil.isNotEmpty(categoryId)) { + idList = getListByParentId(Long.parseLong(categoryId)); + } + result = materialMapperEx.countsByMaterial(barCode, name, standard, model, idList, mpList); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterial(JSONObject obj, HttpServletRequest request) throws Exception { + Material m = JSONObject.parseObject(obj.toJSONString(), Material.class); + m.setEnabled(true); + try { + materialMapper.insert(m); + materialExtendService.saveDetials(obj, obj.getString("sortList"), m.getId(), "insert"); + if (obj.get("stock") != null) { + JSONArray stockArr = obj.getJSONArray("stock"); + for (int i = 0; i < stockArr.size(); i++) { + JSONObject jsonObj = stockArr.getJSONObject(i); + if (jsonObj.get("id") != null && jsonObj.get("initStock") != null) { + BigDecimal number = jsonObj.getBigDecimal("initStock"); + BigDecimal lowSafeStock = null; + BigDecimal highSafeStock = null; + BigDecimal totalPrice = BigDecimal.ZERO; + BigDecimal weightPrice = null; + if (jsonObj.get("lowSafeStock") != null) { + lowSafeStock = jsonObj.getBigDecimal("lowSafeStock"); + } + if (jsonObj.get("highSafeStock") != null) { + highSafeStock = jsonObj.getBigDecimal("highSafeStock"); + } + if (jsonObj.get("totalPrice") != null) { + totalPrice = jsonObj.getBigDecimal("totalPrice"); + } + + if (number.compareTo(BigDecimal.ZERO) > 0) { + weightPrice = totalPrice.divide(number, 6, RoundingMode.HALF_UP); + } + + Long depotId = jsonObj.getLong("id"); + // json后续处理 + StockInitDto initDto = new StockInitDto(); + initDto.setMaterialId(m.getId()); + initDto.setDepotId(depotId); + initDto.setNumber(number); + initDto.setHighSafeStock(highSafeStock); + initDto.setLowSafeStock(lowSafeStock); + + if (number.doubleValue() > 0 || lowSafeStock != null || highSafeStock != null) { + insertInitialStockByMaterialAndDepot(initDto); + insertCurrentStockByMaterialAndDepot(initDto); + } + } + } + } + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_ADD + m.getName(), request); + return 1; + } catch (BusinessRunTimeException ex) { + throw new BusinessRunTimeException(ex.getCode(), ex.getMessage()); + } catch (Exception e) { + BoomException.writeFail(e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterial(JSONObject obj, HttpServletRequest request) throws Exception { + Material material = JSONObject.parseObject(obj.toJSONString(), Material.class); + try { + materialMapper.updateByPrimaryKeySelective(material); + if (material.getUnitId() == null) { + materialMapperEx.setUnitIdToNull(material.getId()); + } + if (material.getExpiryNum() == null) { + materialMapperEx.setExpiryNumToNull(material.getId()); + } + materialExtendService.saveDetials(obj, obj.getString("sortList"), material.getId(), "update"); + if (obj.get("stock") != null) { + JSONArray stockArr = obj.getJSONArray("stock"); + for (int i = 0; i < stockArr.size(); i++) { + JSONObject jsonObj = stockArr.getJSONObject(i); + if (jsonObj.get("id") != null && jsonObj.get("initStock") != null) { + // 包含修改或者初始化 物料的初始库存 + String number = jsonObj.getString("initStock"); + BigDecimal lowSafeStock = null; + BigDecimal highSafeStock = null; + BigDecimal totalPrice = null; + BigDecimal weightPrice = null; + if (jsonObj.get("lowSafeStock") != null) { + lowSafeStock = jsonObj.getBigDecimal("lowSafeStock"); + } + if (jsonObj.get("highSafeStock") != null) { + highSafeStock = jsonObj.getBigDecimal("highSafeStock"); + } + if (jsonObj.get("totalPrice") != null) { + totalPrice = jsonObj.getBigDecimal("totalPrice"); + } + // todo 这一步是用在哪里的 暂时标注 + if (new BigDecimal(number).compareTo(BigDecimal.ZERO) > 0) { + weightPrice = totalPrice.divide(new BigDecimal(number), 6, RoundingMode.HALF_UP); + } + Long depotId = jsonObj.getLong("id"); + //初始库存-先清除再插入 + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(material.getId()).andDepotIdEqualTo(depotId); + materialInitialStockMapper.deleteByExample(example); + if (StringUtil.isNotEmpty(number) && Double.parseDouble(number) != 0 || lowSafeStock != null || highSafeStock != null) { + StockInitDto dto = new StockInitDto(); + dto.setDepotId(depotId); + dto.setLowSafeStock(lowSafeStock); + dto.setHighSafeStock(highSafeStock); + dto.setMaterialId(material.getId()); + dto.setNumber(parseBigDecimalEx(number)); + insertInitialStockByMaterialAndDepot(dto); + } + //更新当前库存 + depotItemService.updateCurrentStockFun(material.getId(), depotId); + } + } + } + logService.insertLog("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(material.getName()).toString(), request); + return 1; + } catch (Exception e) { + BoomException.writeFail(e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterial(Long id, HttpServletRequest request) throws Exception { + return batchDeleteMaterialByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterial(String ids, HttpServletRequest request) throws Exception { + return batchDeleteMaterialByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialByIds(String ids) throws Exception { + String[] idArray = ids.split(","); + //校验单据子表 jsh_depot_item + List depotItemList = null; + try { + depotItemList = depotItemMapperEx.getDepotItemListListByMaterialIds(idArray); + } catch (Exception e) { + BoomException.readFail(e); + } + if (depotItemList != null && depotItemList.size() > 0) { + logger.error("异常码[{}],异常提示[{}],参数,MaterialIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, ExceptionConstants.DELETE_FORCE_CONFIRM_MSG, ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getMaterialListByIds(ids); + for (Material material : list) { + sb.append("[").append(material.getName()).append("]"); + } + logService.insertLog("商品", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = userService.getCurrentUser(); + //校验通过执行删除操作 + try { + //逻辑删除商品 + materialMapperEx.batchDeleteMaterialByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + //逻辑删除商品价格扩展 + materialExtendMapperEx.batchDeleteMaterialExtendByMIds(idArray); + return 1; + } catch (Exception e) { + BoomException.writeFail(e); + return 0; + } + } + + public int checkIsNameExist(Long id, String name) throws Exception { + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = materialMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list == null ? 0 : list.size(); + } + + public int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs, + String otherField1, String otherField2, String otherField3, String unit, Long unitId) throws Exception { + return materialMapperEx.checkIsExist(id, name, model, color, standard, mfrs, otherField1, + otherField2, otherField3, unit, unitId); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) throws Exception { + logService.insertLog("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List materialIds = StringUtil.strToLongList(ids); + Material material = new Material(); + material.setEnabled(status); + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdIn(materialIds); + int result = 0; + try { + result = materialMapper.updateByExampleSelective(material, example); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public Unit findUnit(Long mId) throws Exception { + Unit unit = new Unit(); + try { + List list = materialMapperEx.findUnitList(mId); + if (list != null && list.size() > 0) { + unit = list.get(0); + } + } catch (Exception e) { + BoomException.readFail(e); + } + return unit; + } + + public List findById(Long id) throws Exception { + List list = null; + try { + list = materialMapperEx.findById(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List findByIdWithBarCode(Long meId) throws Exception { + List list = null; + try { + list = materialMapperEx.findByIdWithBarCode(meId); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List getListByParentId(Long parentId) { + List idList = new ArrayList(); + List list = materialCategoryMapperEx.getListByParentId(parentId); + idList.add(parentId); + if (list != null && list.size() > 0) { + getIdListByParentId(idList, parentId); + } + return idList; + } + + public List getIdListByParentId(List idList, Long parentId) { + List list = materialCategoryMapperEx.getListByParentId(parentId); + if (list != null && list.size() > 0) { + for (MaterialCategory mc : list) { + idList.add(mc.getId()); + getIdListByParentId(idList, mc.getId()); + } + } + return idList; + } + + public List findBySelectWithBarCode(Long categoryId, String q, Integer offset, Integer rows) throws Exception { + List list = null; + try { + List idList = new ArrayList<>(); + if (categoryId != null) { + Long parentId = categoryId; + idList = getListByParentId(parentId); + } + if (StringUtil.isNotEmpty(q)) { + q = q.replace("'", ""); + } + list = materialMapperEx.findBySelectWithBarCode(idList, q, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public int findBySelectWithBarCodeCount(Long categoryId, String q) throws Exception { + int result = 0; + try { + List idList = new ArrayList<>(); + if (categoryId != null) { + Long parentId = categoryId; + idList = getListByParentId(parentId); + } + if (StringUtil.isNotEmpty(q)) { + q = q.replace("'", ""); + } + result = materialMapperEx.findBySelectWithBarCodeCount(idList, q); + } catch (Exception e) { + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG, e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public List findByAll(String barCode, String name, String standard, String model, String categoryId) throws Exception { + List resList = new ArrayList<>(); + List list = null; + try { + List idList = new ArrayList<>(); + if (StringUtil.isNotEmpty(categoryId)) { + idList = getListByParentId(Long.parseLong(categoryId)); + } + list = materialMapperEx.findByAll(barCode, name, standard, model, idList); + } catch (Exception e) { + BoomException.readFail(e); + } + if (null != list) { + for (MaterialVo4Unit m : list) { + resList.add(m); + } + } + return resList; + } + + public R importExcel(List> list, HttpServletRequest request) { + Date start = new Date(); + Set unitsErr = Sets.newHashSet(); + List depotList = depotService.getDepot(); + int depotCount = depotList.size(); + List mList = new ArrayList<>(); + for (int i = 2; i < list.size(); i++) { + + List col = list.get(i); + logger.info("now col :::{}", col); + String barCode = col.get(0).toString(); //基础条码 + if (ObjectUtil.isEmpty(barCode)) { + // 没有条码就结束循环 + break; + } + // 名字 + + String name = col.get(1).toString(); + String standard = col.get(2).toString(); //规格 +// String model = ExcelUtils.getContent(src, i, 2); //型号 +// String color = ExcelUtils.getContent(src, i, 3); //颜色 +// String categoryName = ExcelUtils.getContent(src, i, 4); //类别 +// String expiryNum = ExcelUtils.getContent(src, i, 5); //保质期 + String unit = col.get(3).toString(); //基本单位 + +// String manyUnit = ExcelUtils.getContent(src, i, 7); //副单位 + +// String manyBarCode = ExcelUtils.getContent(src, i, 9); //副条码 +// String ratio = ExcelUtils.getContent(src, i, 10); //比例 + String purchaseDecimal = col.size() > 6 && ObjectUtil.isNotEmpty(col.get(6)) ? col.get(6).toString() : "0"; //采购价 + String commodityDecimal = col.size() > 15 && ObjectUtil.isNotEmpty(col.get(15)) ? col.get(15).toString() : "0"; //零售价 + String wholesaleDecimal = col.size() > 15 && ObjectUtil.isNotEmpty(col.get(15)) ? col.get(15).toString() : "0"; //销售价 + String lowDecimal = col.size() > 15 && ObjectUtil.isNotEmpty(col.get(15)) ? col.get(15).toString() : "0"; //最低售价 + // String stockStr = ObjectUtil.isEmpty(col.get(21)) || !NumberUtil.isNumber(col.get(21).toString()) ? "0" : col.get(21).toString(); // 导入的期初库存 + /** + * 使用期初导入。 不再用期末数据。 + */ + String weightPrice = col.size() > 9 && ObjectUtil.isNotEmpty(col.get(9)) ? col.get(9).toString() : "0"; + String totalPrice = col.size() > 10 && ObjectUtil.isNotEmpty(col.get(10)) ? col.get(10).toString() : "0";// 期末金额 + String stockStr = col.size() > 8 && ObjectUtil.isNotEmpty(col.get(8)) && NumberUtil.isNumber(col.get(8).toString()) + ? col.get(8).toString() : "0"; // 导入的期初库存 + + String enabled = "1"; //状态 + +// String name = ExcelUtils.getContent(src, i, 0); //名称 +// String standard = ExcelUtils.getContent(src, i, 1); //规格 +// String model = ExcelUtils.getContent(src, i, 2); //型号 +// String color = ExcelUtils.getContent(src, i, 3); //颜色 + String categoryName = col.size() > 4 && ObjectUtil.isNotEmpty(col.get(4)) ? col.get(4).toString() : ""; //类别 +// String expiryNum = ExcelUtils.getContent(src, i, 5); //保质期 +// String unit = ExcelUtils.getContent(src, i, 6); //基本单位 + +// String manyUnit = ExcelUtils.getContent(src, i, 7); //副单位 +// String barCode = ExcelUtils.getContent(src, i, 8); //基础条码 +// String manyBarCode = ExcelUtils.getContent(src, i, 9); //副条码 +// String ratio = ExcelUtils.getContent(src, i, 10); //比例 +// String purchaseDecimal = ExcelUtils.getContent(src, i, 11); //采购价 +// String commodityDecimal = ExcelUtils.getContent(src, i, 12); //零售价 +// String wholesaleDecimal = ExcelUtils.getContent(src, i, 13); //销售价 +// String lowDecimal = ExcelUtils.getContent(src, i, 14); //最低售价 +// String enabled = ExcelUtils.getContent(src, i, 15); //状态 + //校验名称、单位是否为空 + if (StringUtil.isNotEmpty(name) && StringUtil.isNotEmpty(unit)) { + MaterialWithInitStock m = new MaterialWithInitStock(); + m.setName(name); + m.setStandard(standard); +// m.setModel(model); +// m.setColor(color); + Long categoryId = materialCategoryService.getCategoryIdByName(categoryName); + if (null != categoryId) { + m.setCategoryId(categoryId); + } +// if(StringUtil.isNotEmpty(expiryNum)) { +// m.setExpiryNum(Integer.parseInt(expiryNum)); +// } + + //校验条码是否存在 + List basicMaterialList = getMaterialByBarCode(barCode); + if (basicMaterialList != null && basicMaterialList.size() > 0) { + // todo 条码存在应该更新 而不是报错。 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG, barCode)); + } +// List otherMaterialList = getMaterialByBarCode(manyBarCode); +// if(otherMaterialList!=null && otherMaterialList.size()>0) { +// throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, +// String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG, manyBarCode)); +// } + JSONObject materialExObj = new JSONObject(); + JSONObject basicObj = new JSONObject(); + basicObj.put("barCode", barCode); + basicObj.put("commodityUnit", unit); + basicObj.put("purchaseDecimal", purchaseDecimal); + basicObj.put("commodityDecimal", commodityDecimal); + basicObj.put("wholesaleDecimal", wholesaleDecimal); + basicObj.put("lowDecimal", lowDecimal); + // 调整到库存计算后 因为每次只能入一个仓库 + //materialExObj.put("basic", basicObj); + + // 基本单位 副单位 比例 + Long unitId = unitService.getUnitIdByParam(unit, null, null); + if (unitId != null) { + m.setUnitId(unitId); + } else { + unitsErr.add(unit); + continue; +// throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_MATE_CODE, +// String.format(ExceptionConstants.MATERIAL_UNIT_MATE_MSG, barCode + ":" + unit)); + } +// JSONObject otherObj = new JSONObject(); +// otherObj.put("barCode", barCode); +// otherObj.put("commodityUnit", unit); +// otherObj.put("purchaseDecimal", parsePrice(purchaseDecimal,ratio)); +// otherObj.put("commodityDecimal", parsePrice(commodityDecimal,ratio)); +// otherObj.put("wholesaleDecimal", parsePrice(wholesaleDecimal,ratio)); +// otherObj.put("lowDecimal", parsePrice(lowDecimal,ratio)); +// materialExObj.put("other", otherObj); + + if (ObjectUtil.isEmpty(totalPrice) || !NumberUtil.isNumber(totalPrice)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ADD_FAILED_CODE, "表格中的期末金额未填写正确"); + } +// basicObj.put("totalPrice",new BigDecimal(totalPrice)); + m.setUnit(unit); + m.setEnabled(true); + //缓存各个仓库的库存信息 + Map stockMap = Maps.newHashMap(); + StockInitDto stockInitDto = new StockInitDto(); + // 多仓库库存代码调整 因为目前表格只有单仓库库存 + String depotName = col.size() > 26 && ObjectUtil.isNotEmpty(col.get(26)) ? col.get(26).toString() : ""; //获取仓库名称 + if (StringUtil.isNotEmpty(depotName)) { + Long depotId = depotService.getIdByName(depotName); + if (depotId != 0L) { + // 库存大于0 计算期初加权单价 + if (new BigDecimal(stockStr).compareTo(BigDecimal.ZERO) > 0) { + stockInitDto.setDepotId(depotId); + stockInitDto.setNumber(parseBigDecimalEx(stockStr)); + stockInitDto.setTotalPrice(NumberUtil.isNumber(totalPrice) ? new BigDecimal(totalPrice) : BigDecimal.ZERO); + } + stockMap.put(depotId, stockInitDto); + } + } + materialExObj.put("basic", basicObj); + m.setMaterialExObj(materialExObj); + m.setStockMap(stockMap); + mList.add(m); + } + } + if (ObjectUtil.isNotEmpty(unitsErr)) { + String str = unitsErr.stream().map(s -> s + ",").reduce(String::concat).get(); + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_MATE_CODE, + String.format(ExceptionConstants.MATERIAL_UNIT_MATE_MSG, str)); + } + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_IMPORT + mList.size() + BusinessConstants.LOG_DATA_UNIT, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + Long mId = 0L; + for (MaterialWithInitStock m : mList) { + //判断该商品是否存在,如果不存在就新增,如果存在就更新 + List materials = getMaterialListByParam(m.getName(), m.getModel(), m.getColor(), m.getStandard(), + m.getMfrs(), m.getUnit(), m.getUnitId()); + if (ObjectUtil.isEmpty(materials)) { + logger.info("m:{}", m); + materialMapper.insert(m); + mId = m.getId(); + } else { + mId = materials.get(0).getId(); + String materialJson = JSON.toJSONString(m); + Material material = JSONObject.parseObject(materialJson, Material.class); + material.setId(mId); + materialMapper.updateByPrimaryKeySelective(material); + } + //给商品新增条码与价格相关信息 + User user = userService.getCurrentUser(); + JSONObject materialExObj = m.getMaterialExObj(); + if (StringUtil.isExist(materialExObj.get("basic"))) { + String basicStr = materialExObj.getString("basic"); + MaterialExtend basicMaterialExtend = JSONObject.parseObject(basicStr, MaterialExtend.class); + basicMaterialExtend.setMaterialId(mId); + basicMaterialExtend.setDefaultFlag("1"); + basicMaterialExtend.setCreateTime(new Date()); + basicMaterialExtend.setUpdateTime(System.currentTimeMillis()); + basicMaterialExtend.setCreateSerial(user.getLoginName()); + basicMaterialExtend.setUpdateSerial(user.getLoginName()); + Long meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, "1"); + if (meId == 0L) { + materialExtendMapper.insertSelective(basicMaterialExtend); + } else { + basicMaterialExtend.setId(meId); + materialExtendMapper.updateByPrimaryKeySelective(basicMaterialExtend); + } + } +// if(StringUtil.isExist(materialExObj.get("other"))) { +// String otherStr = materialExObj.getString("other"); +// MaterialExtend otherMaterialExtend = JSONObject.parseObject(otherStr, MaterialExtend.class); +// otherMaterialExtend.setMaterialId(mId); +// otherMaterialExtend.setDefaultFlag("0"); +// otherMaterialExtend.setCreateTime(new Date()); +// otherMaterialExtend.setUpdateTime(System.currentTimeMillis()); +// otherMaterialExtend.setCreateSerial(user.getLoginName()); +// otherMaterialExtend.setUpdateSerial(user.getLoginName()); +// Long meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, "0"); +// if(meId==0L){ +// materialExtendMapper.insertSelective(otherMaterialExtend); +// } else { +// otherMaterialExtend.setId(meId); +// materialExtendMapper.updateByPrimaryKeySelective(otherMaterialExtend); +// } +// } + //给商品初始化库存getAllListWithStock + Map stockMap = m.getStockMap(); + // logger.info("stockMap:{}", stockMap); + +// String number = sequenceService.buildOnlyNumber(); +// DepotHead depotHead = new DepotHead(); +// depotHead.setNumber("QCRK"+number);//单号 +// depotHead.setType("入库"); +// depotHead.setSubType("期初入库"); +// depotHead.setDefaultNumber("QCRK"+number); +// depotHead.setOperTime(new Date()); +// depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); +// depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); +// // 入库单 +// depotHeadService.save(depotHead); +// logService.insertLog("单据", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + + for (Map.Entry map : stockMap.entrySet()) { + StockInitDto stock = map.getValue(); + stock.setMaterialId(mId); + stock.setDepotId(map.getKey()); + logger.error("stock:{}", stock); + //初始库存-先清除再插入 + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(mId).andDepotIdEqualTo(map.getKey()); + materialInitialStockMapper.deleteByExample(example); + if (stock.getNumber().compareTo(BigDecimal.ZERO) > 0) { + insertInitialStockByMaterialAndDepot(stock); + //更新当前库存 + depotItemService.updateCurrentStockFun(mId, map.getKey()); + } + } + + // 创建一个期初入库单 + } + String rs = "导入成功,耗时:" + DateUtil.between(start, new Date(), DateUnit.SECOND) + "秒"; + return R.success(rs); + } + + /** + * 根据条件返回产品列表 + * + * @param name + * @param model + * @param color + * @param standard + * @param mfrs + * @param unit + * @param unitId + * @return + */ + private List getMaterialListByParam(String name, String model, String color, + String standard, String mfrs, String unit, Long unitId) { + LambdaQueryWrapper wrap = Wrappers.lambdaQuery().eq(Material::getModel, model) + .eq(Material::getColor, color) + .eq(Material::getStandard, standard) + .eq(Material::getMfrs, mfrs) + .eq(Material::getUnit, unit) + .eq(Material::getUnitId, unitId); + + return materialMapper.selectList(wrap); + } + + /** + * 写入初始库存 + * + * @param stock + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void insertInitialStockByMaterialAndDepot(StockInitDto stock) { + MaterialInitialStock materialInitialStock = new MaterialInitialStock(); + materialInitialStock.setDepotId(stock.getDepotId()); + materialInitialStock.setMaterialId(stock.getMaterialId()); + materialInitialStock.setNumber(stock.getNumber()); + materialInitialStock.setLowSafeStock(stock.getLowSafeStock()); + materialInitialStock.setHighSafeStock(stock.getHighSafeStock()); + materialInitialStock.setTotalPrice(stock.getTotalPrice()); + materialInitialStockMapper.insert(materialInitialStock); //存入初始库存 + } + + /** + * 写入当前库存 + * + * @param stock + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void insertCurrentStockByMaterialAndDepot(StockInitDto stock) { + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setDepotId(stock.getDepotId()); + materialCurrentStock.setMaterialId(stock.getMaterialId()); + materialCurrentStock.setCurrentNumber(stock.getNumber()); + materialCurrentStockMapper.insert(materialCurrentStock); //存入初始库存 + } + + public List getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows) throws Exception { + List list = null; + try { + list = materialMapperEx.getMaterialEnableSerialNumberList(q, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public Long getMaterialEnableSerialNumberCount(String q) throws Exception { + Long count = null; + try { + count = materialMapperEx.getMaterialEnableSerialNumberCount(q); + } catch (Exception e) { + BoomException.readFail(e); + } + return count; + } + + public BigDecimal parseBigDecimalEx(String str) { + if (!StringUtil.isEmpty(str) && NumberUtil.isNumber(str)) { + return new BigDecimal(str); + } else { + return BigDecimal.ZERO; + } + } + + public BigDecimal parsePrice(String price, String ratio) throws Exception { + if (StringUtil.isEmpty(price) || StringUtil.isEmpty(ratio)) { + return BigDecimal.ZERO; + } else { + BigDecimal pr = new BigDecimal(price); + BigDecimal r = new BigDecimal(ratio); + return pr.multiply(r); + } + } + + /** + * 根据商品获取初始库存-多仓库 + * + * @param depotList + * @param materialId + * @return + */ + public BigDecimal getInitStockByMidAndDepotList(List depotList, Long materialId) { + BigDecimal stock = BigDecimal.ZERO; + LambdaQueryWrapper wrap = Wrappers.lambdaQuery() + .eq(MaterialInitialStock::getMaterialId, materialId) + .eq(MaterialInitialStock::getDeleteFlag, BusinessConstants.DELETE_FLAG_EXISTS); + if (ObjectUtil.isNotEmpty(depotList) && !depotList.contains(null)) { + wrap.in(MaterialInitialStock::getDepotId, depotList); + } + List list = materialInitialStockMapper.selectList(wrap); + if (list != null && list.size() > 0) { + for (MaterialInitialStock ms : list) { + if (ms != null) { + stock = stock.add(ms.getNumber()); + } + } + } + return stock; + } + + /** + * 根据商品和仓库获取初始库存 + * + * @param materialId + * @param depotId + * @return + */ + public MaterialInitialStock getInitStock(Long materialId, Long depotId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialInitialStockMapper.selectByExample(example); + if (list != null && list.size() > 0) { + return list.get(0); + } + return new MaterialInitialStock(); + } + + /** + * 根据商品和仓库获取当前库存 + * + * @param materialId + * @param depotId + * @return + */ + public BigDecimal getCurrentStock(Long materialId, Long depotId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialCurrentStockExample example = new MaterialCurrentStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCurrentStockMapper.selectByExample(example); + if (list != null && list.size() > 0) { + stock = list.get(0).getCurrentNumber(); + } else { + stock = getInitStock(materialId, depotId).getNumber(); + } + return stock; + } + + /** + * 根据商品和仓库获取安全库存信息 + * + * @param materialId + * @param depotId + * @return + */ + public MaterialInitialStock getSafeStock(Long materialId, Long depotId) { + MaterialInitialStock materialInitialStock = new MaterialInitialStock(); + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialInitialStockMapper.selectByExample(example); + if (list != null && list.size() > 0) { + materialInitialStock = list.get(0); + } + return materialInitialStock; + } + + public List getMaterialByMeId(Long meId) { + List result = new ArrayList(); + try { + if (meId != null) { + result = materialMapperEx.getMaterialByMeId(meId); + } + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public String getMaxBarCode() { + String maxBarCodeOld = materialMapperEx.getMaxBarCode(); + if (StringUtil.isNotEmpty(maxBarCodeOld)) { + return Long.parseLong(maxBarCodeOld) + ""; + } else { + return "1000"; + } + } + + public List getMaterialNameList() { + return materialMapperEx.getMaterialNameList(); + } + + public List getMaterialByBarCode(String barCode) { + String[] barCodeArray = barCode.split(","); + return materialMapperEx.getMaterialByBarCode(barCodeArray); + } + + public List getListWithStock(List depotList, List idList, String materialParam, Integer zeroStock, + String startTime, + String column, String order, Integer offset, Integer rows) { + return materialMapperEx.getListWithStock(depotList, idList, materialParam, zeroStock, startTime, column, order, offset, rows); + } + + public int getListWithStockCount(List depotList, List idList, String materialParam, Integer zeroStock, String startTime) { + return materialMapperEx.getListWithStockCount(depotList, idList, materialParam, zeroStock, startTime); + } + + public MaterialVo4Unit getTotalStockAndPrice(List depotList, List idList, String materialParam, String startTime) { + return materialMapperEx.getTotalStockAndPrice(depotList, idList, materialParam, startTime); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetMaterialCurrentStock(String ids) throws Exception { + int res = 0; + List idList = StringUtil.strToLongList(ids); + // 修正全部仓库中的库存 + List depotList = depotService.getAllList(); + for (Long mId : idList) { + for (Depot depot : depotList) { + logger.error("开始修正仓库:{}", depot.getName()); + depotItemService.updateCurrentStockFun(mId, depot.getId()); + logger.error("结束修正仓库:{}", depot.getName()); + res = 1; + } + } + return res; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeComponent.java new file mode 100644 index 00000000..cc924cb5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeComponent.java @@ -0,0 +1,70 @@ +package com.zsw.erp.service.materialAttribute; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialAttribute_component") +@MaterialAttributeResource +public class MaterialAttributeComponent implements ICommonQuery { + + @Resource + private MaterialAttributeService materialAttributeService; + + @Override + public Object selectOne(Long id) throws Exception { + return materialAttributeService.getMaterialAttribute(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String attributeField = StringUtil.getInfo(search, "attributeField"); + return materialAttributeService.select(attributeField, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String attributeField = StringUtil.getInfo(search, "attributeField"); + return materialAttributeService.countMaterialAttribute(attributeField); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialAttributeService.insertMaterialAttribute(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialAttributeService.updateMaterialAttribute(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialAttributeService.deleteMaterialAttribute(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialAttributeService.batchDeleteMaterialAttribute(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialAttributeService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeResource.java new file mode 100644 index 00000000..1bcb80d0 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.materialAttribute; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "materialAttribute") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialAttributeResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeService.java new file mode 100644 index 00000000..4e24adaf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialAttribute/MaterialAttributeService.java @@ -0,0 +1,232 @@ +package com.zsw.erp.service.materialAttribute; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.MaterialAttribute; +import com.zsw.erp.datasource.entities.MaterialAttributeExample; +import com.zsw.erp.datasource.mappers.MaterialAttributeMapper; +import com.zsw.erp.datasource.mappers.MaterialAttributeMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class MaterialAttributeService { + private Logger logger = LoggerFactory.getLogger(MaterialAttributeService.class); + + @Resource + private LogService logService; + + @Resource + private MaterialAttributeMapper materialAttributeMapper; + + @Resource + private MaterialAttributeMapperEx materialAttributeMapperEx; + + public MaterialAttribute getMaterialAttribute(long id)throws Exception { + MaterialAttribute result=null; + try{ + result=materialAttributeMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getMaterialAttribute() throws Exception{ + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=materialAttributeMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String attributeField, int offset, int rows) + throws Exception{ + String[] arr = {"manyColor","manySize","other1","other2","other3"}; + Map map = new HashMap<>(); + map.put("manyColor", "多颜色"); + map.put("manySize", "多尺寸"); + map.put("other1", "自定义1"); + map.put("other2", "自定义2"); + map.put("other3", "自定义3"); + List list = new ArrayList<>(); + try{ + List maList = materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeField, offset, rows); + for(String field: arr) { + MaterialAttribute materialAttribute = new MaterialAttribute(); + materialAttribute.setAttributeField(field); + materialAttribute.setAttributeName(map.get(field)); + for(MaterialAttribute ma: maList) { + if(field.equals(ma.getAttributeField())){ + materialAttribute.setId(ma.getId()); + materialAttribute.setAttributeName(ma.getAttributeName()); + materialAttribute.setAttributeValue(ma.getAttributeValue()); + } + } + list.add(materialAttribute); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countMaterialAttribute(String attributeField)throws Exception { + Long result =null; + try{ + result= materialAttributeMapperEx.countsByMaterialAttribute(attributeField); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialAttribute(JSONObject obj, HttpServletRequest request)throws Exception { + MaterialAttribute m = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.insertSelective(m); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(m.getAttributeName()).toString(), request); + return 1; + } + catch (BusinessRunTimeException ex) { + throw new BusinessRunTimeException(ex.getCode(), ex.getMessage()); + } + catch(Exception e){ + BoomException.writeFail(e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialAttribute(JSONObject obj, HttpServletRequest request) throws Exception{ + MaterialAttribute materialAttribute = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.updateByPrimaryKeySelective(materialAttribute); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialAttribute.getAttributeName()).toString(), request); + return 1; + }catch(Exception e){ + BoomException.writeFail(e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialAttribute(Long id, HttpServletRequest request)throws Exception { + return batchDeleteMaterialAttributeByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttribute(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialAttributeByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttributeByIds(String ids) throws Exception{ + String [] idArray=ids.split(","); + try{ + return materialAttributeMapperEx.batchDeleteMaterialAttributeByIds(idArray); + }catch(Exception e){ + BoomException.writeFail(e); + return 0; + } + } + + public int checkIsNameExist(Long id, String name)throws Exception { + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andIdNotEqualTo(id).andAttributeNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list = materialAttributeMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public JSONObject getAll() { + JSONObject obj = new JSONObject(); + //属性名 + obj.put("manyColorName", getNameByField("manyColor")); + obj.put("manySizeName", getNameByField("manySize")); + obj.put("other1Name", getNameByField("other1")); + obj.put("other2Name", getNameByField("other2")); + obj.put("other3Name", getNameByField("other3")); + //属性值 + obj.put("manyColorValue", getValueArrByField("manyColor")); + obj.put("manySizeValue", getValueArrByField("manySize")); + obj.put("other1Value", getValueArrByField("other1")); + obj.put("other2Value", getValueArrByField("other2")); + obj.put("other3Value", getValueArrByField("other3")); + return obj; + } + + public MaterialAttribute getInfoByField(String field) { + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andAttributeFieldEqualTo(field).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialAttributeMapper.selectByExample(example); + if(list!=null && list.size()>0) { + return list.get(0); + } else { + return null; + } + } + + public String getNameByField(String field) { + String res = ""; + if("manyColor".equals(field)){ + res = "多颜色"; + } else if("manySize".equals(field)){ + res = "多尺寸"; + } else if("other1".equals(field)){ + res = "自定义1"; + } else if("other2".equals(field)){ + res = "自定义2"; + } else if("other3".equals(field)){ + res = "自定义3"; + } + MaterialAttribute ma = getInfoByField(field); + if(ma!=null && StringUtil.isNotEmpty(ma.getAttributeName())) { + res = ma.getAttributeName(); + } + return res; + } + + public JSONArray getValueArrByField(String field) { + JSONArray valueArr = new JSONArray(); + MaterialAttribute ma = getInfoByField(field); + if(ma!=null) { + String value = ma.getAttributeValue(); + if(StringUtil.isNotEmpty(value)){ + String[] arr = value.split("\\|"); + for(String v: arr) { + JSONObject item = new JSONObject(); + item.put("value",v); + item.put("name",v); + valueArr.add(item); + } + } + } + return valueArr; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryComponent.java new file mode 100644 index 00000000..7f84f67a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryComponent.java @@ -0,0 +1,73 @@ +package com.zsw.erp.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialCategory_component") +@MaterialCategoryResource +public class MaterialCategoryComponent implements ICommonQuery { + + @Resource + private MaterialCategoryService materialCategoryService; + + @Override + public Object selectOne(Long id) throws Exception { + return materialCategoryService.getMaterialCategory(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialCategoryList(map); + } + + private List getMaterialCategoryList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer parentId = StringUtil.parseInteger(StringUtil.getInfo(search, "parentId")); + String order = QueryUtils.order(map); + return materialCategoryService.select(name, parentId, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer parentId = StringUtil.parseInteger(StringUtil.getInfo(search, "parentId")); + return materialCategoryService.countMaterialCategory(name, parentId); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return materialCategoryService.insertMaterialCategory(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialCategoryService.updateMaterialCategory(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialCategoryService.deleteMaterialCategory(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialCategoryService.batchDeleteMaterialCategory(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialCategoryService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryResource.java new file mode 100644 index 00000000..c7e50b2b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.materialCategory; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "materialCategory") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialCategoryResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java new file mode 100644 index 00000000..b85fa6a6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialCategory/MaterialCategoryService.java @@ -0,0 +1,375 @@ +package com.zsw.erp.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.MaterialCategoryMapper; +import com.zsw.erp.datasource.mappers.MaterialCategoryMapperEx; +import com.zsw.erp.datasource.mappers.MaterialMapperEx; +import com.zsw.erp.datasource.vo.TreeNode; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.Material; +import com.zsw.erp.datasource.entities.MaterialCategory; +import com.zsw.erp.datasource.entities.MaterialCategoryExample; +import com.zsw.erp.datasource.entities.User; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialCategoryService { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryService.class); + + @Resource + private MaterialCategoryMapper materialCategoryMapper; + @Resource + private MaterialCategoryMapperEx materialCategoryMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private MaterialMapperEx materialMapperEx; + + public MaterialCategory getMaterialCategory(long id)throws Exception { + MaterialCategory result=null; + try{ + result=materialCategoryMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getMaterialCategoryListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdIn(idList); + list = materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getMaterialCategory()throws Exception { + MaterialCategoryExample example = new MaterialCategoryExample(); + List list=null; + try{ + list=materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getAllList(Long parentId)throws Exception { + List list=null; + try{ + list = getMCList(parentId); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getMCList(Long parentId)throws Exception { + List res= new ArrayList(); + List list=null; + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andParentIdEqualTo(parentId).andIdNotEqualTo(1L); + example.setOrderByClause("id"); + list=materialCategoryMapper.selectByExample(example); + if(list!=null && list.size()>0) { + res.addAll(list); + for(MaterialCategory mc : list) { + List mcList = getMCList(mc.getId()); + if(mcList!=null && mcList.size()>0) { + res.addAll(mcList); + } + } + } + return res; + } + + public List select(String name, Integer parentId, int offset, int rows) throws Exception{ + List list=null; + try{ + list=materialCategoryMapperEx.selectByConditionMaterialCategory(name, parentId, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countMaterialCategory(String name, Integer parentId) throws Exception{ + Long result=null; + try{ + result=materialCategoryMapperEx.countsByMaterialCategory(name, parentId); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialCategory(JSONObject obj, HttpServletRequest request)throws Exception { + MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class); + materialCategory.setCreateTime(new Date()); + materialCategory.setUpdateTime(new Date()); + int result=0; + try{ + result=materialCategoryMapper.insertSelective(materialCategory); + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialCategory.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialCategory(JSONObject obj, HttpServletRequest request) throws Exception{ + MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class); + materialCategory.setUpdateTime(new Date()); + int result=0; + try{ + result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory); + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialCategory.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception { + return batchDeleteMaterialCategoryByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategory(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialCategoryByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategoryByIds(String ids) throws Exception { + int result=0; + String [] idArray=ids.split(","); + //校验产品表 jsh_material + List materialList=null; + try{ + materialList= materialMapperEx.getMaterialListByCategoryIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(materialList!=null&&materialList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,CategoryIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getMaterialCategoryListByIds(ids); + for(MaterialCategory materialCategory: list){ + sb.append("[").append(materialCategory.getName()).append("]"); + } + logService.insertLog("商品类型", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //更新时间 + Date updateDate =new Date(); + //更新人 + User userInfo=userService.getCurrentUser(); + Long updater=userInfo==null?null:userInfo.getId(); + String strArray[]=ids.split(","); + if(strArray.length<1){ + return 0; + } + List mcList = materialCategoryMapperEx.getMaterialCategoryListByCategoryIds(idArray); + if(mcList!=null && mcList.size()>0) { + logger.error("异常码[{}],异常提示[{}]", + ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE,ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG); + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE, + ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG); + } else { + result=materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public List findById(Long id)throws Exception { + List list=null; + if(id!=null) { + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdEqualTo(id); + try{ + list=materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + } + return list; + } + /** + * create by: cjl + * description: + *获取商品类别树数据 + * create time: 2019/2/19 14:30 + * @Param: + * @return java.util.List + */ + public List getMaterialCategoryTree(Long id) throws Exception{ + List list=null; + try{ + list=materialCategoryMapperEx.getNodeTree(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + /** + * create by: cjl + * description: + * 新增商品类别信息 + * create time: 2019/2/19 16:30 + * @Param: mc + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int addMaterialCategory(MaterialCategory mc) throws Exception { + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(mc.getName()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + if(mc==null){ + return 0; + } + if(mc.getParentId()==null){ + //没有给定父级目录的id,默认设置父级目录为根目录的父目录 + mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); + } + //检查商品类型编号是否已存在 + checkMaterialCategorySerialNo(mc); + //数据状态新增时默认设置为启用 + Date date=new Date(); + User userInfo=userService.getCurrentUser(); + //创建时间 + mc.setCreateTime(date); + //更新时间 + mc.setUpdateTime(date); + int result=0; + try{ + result=materialCategoryMapperEx.addMaterialCategory(mc); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int editMaterialCategory(MaterialCategory mc) throws Exception{ + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getName()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + if(mc.getParentId()==null){ + //没有给定父级目录的id,默认设置父级目录为根目录的父目录 + mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); + } + //检查商品类型编号是否已存在 + checkMaterialCategorySerialNo(mc); + //更新时间 + mc.setUpdateTime(new Date()); + //更新人 + User userInfo=userService.getCurrentUser(); + int result=0; + try{ + result= materialCategoryMapperEx.editMaterialCategory(mc); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + /** + * 根据商品类别编号判断商品类别是否已存在 + * */ + public void checkMaterialCategorySerialNo(MaterialCategory mc)throws Exception { + if(mc==null){ + return; + } + if(StringUtil.isEmpty(mc.getSerialNo())){ + return; + } + //根据商品类别编号查询商品类别 + List mList=null; + try{ + mList= materialCategoryMapperEx.getMaterialCategoryBySerialNo(mc.getSerialNo(), mc.getId()); + }catch(Exception e){ + BoomException.readFail(e); + } + if(mList==null||mList.size()<1){ + //未查询到对应数据,编号可用 + return; + } + if(mList.size()>1){ + //查询到的数据条数大于1,编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + if(mc.getId()==null){ + //新增时,编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + /** + * 包装类型用equals来比较 + * */ + if(mc.getId().equals(mList.get(0).getId())){ + //修改时,相同编号,id不同 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + } + + /** + * 根据名称获取类型 + * @param name + */ + public Long getCategoryIdByName(String name){ + Long categoryId = null; + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCategoryMapper.selectByExample(example); + if(list!=null && list.size()>0) { + categoryId = list.get(0).getId(); + } + return categoryId; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialCurrentStock/MaterialCurrentStockService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialCurrentStock/MaterialCurrentStockService.java new file mode 100644 index 00000000..0c77a771 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialCurrentStock/MaterialCurrentStockService.java @@ -0,0 +1,18 @@ +package com.zsw.erp.service.materialCurrentStock; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsw.erp.datasource.entities.MaterialCurrentStock; +import com.zsw.erp.datasource.mappers.MaterialCurrentStockMapper; +import org.springframework.stereotype.Service; + +@Service +public class MaterialCurrentStockService extends ServiceImpl { + + public MaterialCurrentStock getStockByBarAndDept(String barcode,Long deptId){ + return null; +// this.getOne(Wrappers.lambdaQuery().eq(MaterialCurrentStock::getDepotId,deptId) +// .eq(MaterialCurrentStock::get)) + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendComponent.java new file mode 100644 index 00000000..df5026d6 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendComponent.java @@ -0,0 +1,65 @@ +package com.zsw.erp.service.materialExtend; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "material_extend") +@MaterialExtendResource +public class MaterialExtendComponent implements ICommonQuery { + + @Resource + private MaterialExtendService materialExtendService; + + @Override + public Object selectOne(Long id) throws Exception { + return materialExtendService.getMaterialExtend(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + + return null; + } + + @Override + public Long counts(Map map)throws Exception { + + return 0L; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialExtendService.insertMaterialExtend(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialExtendService.updateMaterialExtend(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialExtendService.deleteMaterialExtend(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialExtendService.batchDeleteMaterialExtendByIds(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendResource.java new file mode 100644 index 00000000..e7a5925a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.materialExtend; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "materialExtend") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialExtendResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java new file mode 100644 index 00000000..d5239bf3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialExtend/MaterialExtendService.java @@ -0,0 +1,398 @@ +package com.zsw.erp.service.materialExtend; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.MaterialExtend; +import com.zsw.erp.datasource.entities.MaterialExtendExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.MaterialExtendMapper; +import com.zsw.erp.datasource.mappers.MaterialExtendMapperEx; +import com.zsw.erp.datasource.vo.MaterialExtendVo4List; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +@Service +public class MaterialExtendService { + private Logger logger = LoggerFactory.getLogger(MaterialExtendService.class); + + @Resource + private MaterialExtendMapper materialExtendMapper; + @Resource + private MaterialExtendMapperEx materialExtendMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private RedisService redisService; + + public MaterialExtend getMaterialExtend(long id)throws Exception { + MaterialExtend result=null; + try{ + result=materialExtendMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + public List getDetailList(Long materialId) { + List list=null; + try{ + list = materialExtendMapperEx.getDetailList(materialId); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getListByMIds(List idList) { + List meList = null; + try{ + Long [] idArray= StringUtil.listToLongArray(idList); + if(idArray!=null && idArray.length>0) { + meList = materialExtendMapperEx.getListByMId(idArray); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return meList; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String saveDetials(JSONObject obj, String sortList, Long materialId, String type) throws Exception { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + JSONArray meArr = obj.getJSONArray("meList"); + JSONArray insertedJson = new JSONArray(); + JSONArray updatedJson = new JSONArray(); + JSONArray deletedJson = new JSONArray(); + List barCodeList=new ArrayList<>(); + if (null != meArr) { + if("insert".equals(type)){ + for (int i = 0; i < meArr.size(); i++) { + JSONObject tempJson = meArr.getJSONObject(i); + insertedJson.add(tempJson); + } + } else if("update".equals(type)){ + for (int i = 0; i < meArr.size(); i++) { + JSONObject tempJson = meArr.getJSONObject(i); + String barCode = tempJson.getString("barCode"); + barCodeList.add(barCode); + MaterialExtend materialExtend = getInfoByBarCode(barCode); + if (materialExtend.getBarCode() == null) { + insertedJson.add(tempJson); + } else { + updatedJson.add(tempJson); + } + } + List materialExtendList = getMeListByBarCodeAndMid(barCodeList, materialId); + for (MaterialExtend meObj : materialExtendList) { + JSONObject deleteObj = new JSONObject(); + deleteObj.put("id", meObj.getId()); + deletedJson.add(deleteObj); + } + } + } + JSONArray sortJson = JSONArray.parseArray(sortList); + if (null != insertedJson) { + for (int i = 0; i < insertedJson.size(); i++) { + MaterialExtend materialExtend = new MaterialExtend(); + JSONObject tempInsertedJson = JSONObject.parseObject(insertedJson.getString(i)); + materialExtend.setMaterialId(materialId); + if (StringUtils.isNotEmpty(tempInsertedJson.getString("barCode"))) { + int exist = checkIsBarCodeExist(0L, tempInsertedJson.getString("barCode")); + if(exist>0) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG,tempInsertedJson.getString("barCode"))); + } else { + materialExtend.setBarCode(tempInsertedJson.getString("barCode")); + } + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("commodityUnit"))) { + materialExtend.setCommodityUnit(tempInsertedJson.getString("commodityUnit")); + } + if (tempInsertedJson.get("sku")!=null) { + materialExtend.setSku(tempInsertedJson.getString("sku")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("purchaseDecimal"))) { + materialExtend.setPurchaseDecimal(tempInsertedJson.getBigDecimal("purchaseDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("commodityDecimal"))) { + materialExtend.setCommodityDecimal(tempInsertedJson.getBigDecimal("commodityDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("wholesaleDecimal"))) { + materialExtend.setWholesaleDecimal(tempInsertedJson.getBigDecimal("wholesaleDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("lowDecimal"))) { + materialExtend.setLowDecimal(tempInsertedJson.getBigDecimal("lowDecimal")); + } + this.insertMaterialExtend(materialExtend); + } + } + if (null != deletedJson) { + StringBuffer bf=new StringBuffer(); + for (int i = 0; i < deletedJson.size(); i++) { + JSONObject tempDeletedJson = JSONObject.parseObject(deletedJson.getString(i)); + bf.append(tempDeletedJson.getLong("id")); + if(i<(deletedJson.size()-1)){ + bf.append(","); + } + } + this.batchDeleteMaterialExtendByIds(bf.toString(), request); + } + if (null != updatedJson) { + for (int i = 0; i < updatedJson.size(); i++) { + JSONObject tempUpdatedJson = JSONObject.parseObject(updatedJson.getString(i)); + MaterialExtend materialExtend = new MaterialExtend(); + materialExtend.setId(tempUpdatedJson.getLong("id")); + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("barCode"))) { + int exist = checkIsBarCodeExist(tempUpdatedJson.getLong("id"), tempUpdatedJson.getString("barCode")); + if(exist>0) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG,tempUpdatedJson.getString("barCode"))); + } else { + materialExtend.setBarCode(tempUpdatedJson.getString("barCode")); + } + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("commodityUnit"))) { + materialExtend.setCommodityUnit(tempUpdatedJson.getString("commodityUnit")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("purchaseDecimal"))) { + materialExtend.setPurchaseDecimal(tempUpdatedJson.getBigDecimal("purchaseDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("commodityDecimal"))) { + materialExtend.setCommodityDecimal(tempUpdatedJson.getBigDecimal("commodityDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("wholesaleDecimal"))) { + materialExtend.setWholesaleDecimal(tempUpdatedJson.getBigDecimal("wholesaleDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("lowDecimal"))) { + materialExtend.setLowDecimal(tempUpdatedJson.getBigDecimal("lowDecimal")); + } + this.updateMaterialExtend(materialExtend); + } + } + //处理条码的排序,基本单位排第一个 + if (null != sortJson && sortJson.size()>0) { + //此处为更新的逻辑 + for (int i = 0; i < sortJson.size(); i++) { + JSONObject tempSortJson = JSONObject.parseObject(sortJson.getString(i)); + MaterialExtend materialExtend = new MaterialExtend(); + if(StringUtil.isExist(tempSortJson.get("id"))) { + materialExtend.setId(tempSortJson.getLong("id")); + } + if(StringUtil.isExist(tempSortJson.get("defaultFlag"))) { + materialExtend.setDefaultFlag(tempSortJson.getString("defaultFlag")); + } + this.updateMaterialExtend(materialExtend); + } + } else { + //新增的时候将第一条记录设置为默认基本单位 + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List meList = materialExtendMapper.selectByExample(example); + if(meList!=null) { + for(int i=0; ilambdaUpdate().eq(MaterialExtend::getMaterialId,mid)); + } + + public int checkIsBarCodeExist(Long id, String barCode)throws Exception { + MaterialExtendExample example = new MaterialExtendExample(); + MaterialExtendExample.Criteria criteria = example.createCriteria(); + criteria.andBarCodeEqualTo(barCode); + if (id > 0) { + criteria.andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + criteria.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list =null; + try{ + list = materialExtendMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialExtend(Long id, HttpServletRequest request)throws Exception { + int result =0; + MaterialExtend materialExtend = new MaterialExtend(); + materialExtend.setId(id); + materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_DELETED); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + materialExtend.setUpdateTime(new Date().getTime()); + materialExtend.setUpdateSerial(user.getLoginName()); + try{ + result= materialExtendMapper.updateByPrimaryKeySelective(materialExtend); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialExtendByIds(String ids, HttpServletRequest request) throws Exception{ + String [] idArray=ids.split(","); + int result = 0; + try{ + result = materialExtendMapperEx.batchDeleteMaterialExtendByIds(idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int insertMaterialExtend(JSONObject obj, HttpServletRequest request) throws Exception{ + MaterialExtend materialExtend = JSONObject.parseObject(obj.toJSONString(), MaterialExtend.class); + int result=0; + try{ + result = materialExtendMapper.insertSelective(materialExtend); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int updateMaterialExtend(JSONObject obj, HttpServletRequest request)throws Exception { + MaterialExtend materialExtend = JSONObject.parseObject(obj.toJSONString(), MaterialExtend.class); + int result=0; + try{ + result = materialExtendMapper.insertSelective(materialExtend); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public List getMaterialExtendByTenantAndTime(Long tenantId, Long lastTime, Long syncNum)throws Exception { + List list=new ArrayList(); + try{ + //先获取最大的时间戳,再查两个时间戳之间的数据,这样同步能够防止丢失数据(应为时间戳有重复) + Long maxTime = materialExtendMapperEx.getMaxTimeByTenantAndTime(tenantId, lastTime, syncNum); + if(tenantId!=null && lastTime!=null && maxTime!=null) { + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andTenantIdEqualTo(tenantId) + .andUpdateTimeGreaterThan(lastTime) + .andUpdateTimeLessThanOrEqualTo(maxTime); + list=materialExtendMapper.selectByExample(example); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public Long selectIdByMaterialIdAndDefaultFlag(Long materialId, String defaultFlag) { + Long id = 0L; + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDefaultFlagEqualTo(defaultFlag) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + if(list!=null && list.size()>0) { + id = list.get(0).getId(); + } + return id; + } + + public MaterialExtend getInfoByBarCode(String barCode)throws Exception { + MaterialExtend materialExtend = new MaterialExtend(); + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andBarCodeEqualTo(barCode) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + if(list!=null && list.size()>0) { + materialExtend = list.get(0); + } + return materialExtend; + } + + /** + * 查询某个商品里面被清除的条码信息 + * @param barCodeList + * @param mId + * @return + * @throws Exception + */ + public List getMeListByBarCodeAndMid(List barCodeList, Long mId)throws Exception { + MaterialExtend materialExtend = new MaterialExtend(); + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andBarCodeNotIn(barCodeList).andMaterialIdEqualTo(mId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + return list; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyComponent.java new file mode 100644 index 00000000..d5f4e623 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyComponent.java @@ -0,0 +1,71 @@ +package com.zsw.erp.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialProperty_component") +@MaterialPropertyResource +public class MaterialPropertyComponent implements ICommonQuery { + + @Resource + private MaterialPropertyService materialPropertyService; + + @Override + public Object selectOne(Long id) throws Exception { + return materialPropertyService.getMaterialProperty(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialPropertyList(map); + } + + private List getMaterialPropertyList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + return materialPropertyService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return materialPropertyService.countMaterialProperty(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return materialPropertyService.insertMaterialProperty(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialPropertyService.updateMaterialProperty(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialPropertyService.deleteMaterialProperty(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialPropertyService.batchDeleteMaterialProperty(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialPropertyService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyResource.java new file mode 100644 index 00000000..731754a3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.materialProperty; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "materialProperty") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialPropertyResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java new file mode 100644 index 00000000..85a1dad4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/materialProperty/MaterialPropertyService.java @@ -0,0 +1,138 @@ +package com.zsw.erp.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.MaterialProperty; +import com.zsw.erp.datasource.entities.MaterialPropertyExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.MaterialPropertyMapper; +import com.zsw.erp.datasource.mappers.MaterialPropertyMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialPropertyService { + private Logger logger = LoggerFactory.getLogger(MaterialPropertyService.class); + + @Resource + private MaterialPropertyMapper materialPropertyMapper; + + @Resource + private MaterialPropertyMapperEx materialPropertyMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + + public MaterialProperty getMaterialProperty(long id)throws Exception { + MaterialProperty result=null; + try{ + result=materialPropertyMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getMaterialProperty()throws Exception { + MaterialPropertyExample example = new MaterialPropertyExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=materialPropertyMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, int offset, int rows)throws Exception { + List list=null; + try{ + list=materialPropertyMapperEx.selectByConditionMaterialProperty(name, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countMaterialProperty(String name)throws Exception { + Long result=null; + try{ + result=materialPropertyMapperEx.countsByMaterialProperty(name); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialProperty(JSONObject obj, HttpServletRequest request)throws Exception { + MaterialProperty materialProperty = JSONObject.parseObject(obj.toJSONString(), MaterialProperty.class); + int result=0; + try{ + result=materialPropertyMapper.insertSelective(materialProperty); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialProperty.getNativeName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialProperty(JSONObject obj, HttpServletRequest request)throws Exception { + MaterialProperty materialProperty = JSONObject.parseObject(obj.toJSONString(), MaterialProperty.class); + int result=0; + try{ + result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialProperty.getNativeName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialProperty(Long id, HttpServletRequest request)throws Exception { + return batchDeleteMaterialPropertyByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialProperty(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialPropertyByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialPropertyByIds(String ids) throws Exception{ + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result=materialPropertyMapperEx.batchDeleteMaterialPropertyByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgComponent.java new file mode 100644 index 00000000..0a391556 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgComponent.java @@ -0,0 +1,72 @@ +package com.zsw.erp.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "msg_component") +@MsgResource +public class MsgComponent implements ICommonQuery { + + @Resource + private MsgService msgService; + + @Override + public Object selectOne(Long id) throws Exception { + return msgService.getMsg(id); + } + + @Override + public List select(Map map)throws Exception { + return getMsgList(map); + } + + private List getMsgList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + String filter = QueryUtils.filter(map); + return msgService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return msgService.countMsg(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return msgService.insertMsg(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return msgService.updateMsg(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return msgService.deleteMsg(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return msgService.batchDeleteMsg(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return msgService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgResource.java new file mode 100644 index 00000000..f90fd576 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.msg; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "msg") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MsgResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java new file mode 100644 index 00000000..94355c9c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/msg/MsgService.java @@ -0,0 +1,333 @@ +package com.zsw.erp.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.Msg; +import com.zsw.erp.datasource.entities.MsgEx; +import com.zsw.erp.datasource.entities.MsgExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.MsgMapper; +import com.zsw.erp.datasource.mappers.MsgMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.service.depotHead.DepotHeadService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static com.zsw.erp.utils.Tools.getCenternTime; + +@Service +public class MsgService { + private Logger logger = LoggerFactory.getLogger(MsgService.class); + @Resource + private MsgMapper msgMapper; + + @Resource + private MsgMapperEx msgMapperEx; + + @Resource + private DepotHeadService depotHeadService; + + @Resource + private UserService userService; + + @Resource + private LogService logService; + + public Msg getMsg(long id)throws Exception { + Msg result=null; + try{ + result=msgMapper.selectByPrimaryKey(id); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public List getMsg()throws Exception { + MsgExample example = new MsgExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=msgMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; + } + + public List select(String name, int offset, int rows)throws Exception { + List list=null; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + list = msgMapperEx.selectByConditionMsg(name, offset, rows); + if (null != list) { + for (MsgEx msgEx : list) { + if (msgEx.getCreateTime() != null) { + msgEx.setCreateTimeStr(getCenternTime(msgEx.getCreateTime())); + } + } + } + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; + } + + public Long countMsg(String name)throws Exception { + Long result=null; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + result = msgMapperEx.countsByMsg(name); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMsg(JSONObject obj, HttpServletRequest request)throws Exception { + Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); + int result=0; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + msg.setCreateTime(new Date()); + msg.setStatus("1"); + result=msgMapper.insertSelective(msg); + logService.insertLog("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(msg.getMsgTitle()).toString(), request); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMsg(JSONObject obj, HttpServletRequest request) throws Exception{ + Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); + int result=0; + try{ + result=msgMapper.updateByPrimaryKeySelective(msg); + logService.insertLog("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(msg.getMsgTitle()).toString(), request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMsg(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result=msgMapper.deleteByPrimaryKey(id); + logService.insertLog("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMsg(String ids, HttpServletRequest request) throws Exception{ + List idList = StringUtil.strToLongList(ids); + MsgExample example = new MsgExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=msgMapper.deleteByExample(example); + logService.insertLog("消息", "批量删除,id集:" + ids, request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + MsgExample example = new MsgExample(); + example.createCriteria().andIdNotEqualTo(id).andMsgTitleEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= msgMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list==null?0:list.size(); + } + + /** + * create by: qiankunpingtai + * 逻辑删除角色信息 + * create time: 2019/3/28 15:44 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMsgByIds(String ids) throws Exception{ + logService.insertLog("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + String [] idArray=ids.split(","); + int result=0; + try{ + result=msgMapperEx.batchDeleteMsgByIds(idArray); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + public List getMsgByStatus(String status)throws Exception { + List resList=new ArrayList<>(); + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + MsgExample example = new MsgExample(); + example.createCriteria().andStatusEqualTo(status).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = msgMapper.selectByExample(example); + if (null != list) { + for (Msg msg : list) { + if (msg.getCreateTime() != null) { + MsgEx msgEx = new MsgEx(); + msgEx.setId(msg.getId()); + msgEx.setMsgTitle(msg.getMsgTitle()); + msgEx.setMsgContent(msg.getMsgContent()); + msgEx.setStatus(msg.getStatus()); + msgEx.setType(msg.getType()); + msgEx.setCreateTimeStr(Tools.parseDateToStr(msg.getCreateTime())); + resList.add(msgEx); + } + } + } + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return resList; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void batchUpdateStatus(String ids, String status) throws Exception{ + List idList = StringUtil.strToLongList(ids); + Msg msg = new Msg(); + msg.setStatus(status); + MsgExample example = new MsgExample(); + example.createCriteria().andIdIn(idList); + try{ + msgMapper.updateByExampleSelective(msg, example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } + + public Long getMsgCountByStatus(String status)throws Exception { + Long result=null; + try{ + User userInfo=userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + result = msgMapperEx.getMsgCountByStatus(status, userInfo.getId()); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public Integer getMsgCountByType(String type)throws Exception { + int msgCount = 0; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + MsgExample example = new MsgExample(); + example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = msgMapper.selectByExample(example); + msgCount = list.size(); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return msgCount; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void readAllMsg() throws Exception{ + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + Msg msg = new Msg(); + msg.setStatus("2"); + MsgExample example = new MsgExample(); + example.createCriteria(); + msgMapper.updateByExampleSelective(msg, example); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelComponent.java new file mode 100644 index 00000000..84247924 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelComponent.java @@ -0,0 +1,65 @@ +package com.zsw.erp.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/11 18:10 + */ +@Service(value = "orgaUserRel_component") +@OrgaUserRelResource +public class OrgaUserRelComponent implements ICommonQuery { + @Resource + private OrgaUserRelService orgaUserRelService; + + @Override + public Object selectOne(Long id) throws Exception { + return orgaUserRelService.getOrgaUserRel(id); + } + + @Override + public List select(Map parameterMap)throws Exception { + return getOrgaUserRelList(parameterMap); + } + private List getOrgaUserRelList(Map map)throws Exception { + return null; + } + @Override + public Long counts(Map parameterMap)throws Exception { + return null; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return orgaUserRelService.insertOrgaUserRel(obj,request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return orgaUserRelService.updateOrgaUserRel(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return orgaUserRelService.deleteOrgaUserRel(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return orgaUserRelService.batchDeleteOrgaUserRel(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelResource.java new file mode 100644 index 00000000..a8b64516 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelResource.java @@ -0,0 +1,19 @@ +package com.zsw.erp.service.orgaUserRel; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * 机构用户关系 + * @Author: cjl + * @Date: 2019/3/11 18:11 + */ +@ResourceInfo(value = "orgaUserRel") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrgaUserRelResource { + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java new file mode 100644 index 00000000..cfa4d3ff --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/orgaUserRel/OrgaUserRelService.java @@ -0,0 +1,220 @@ +package com.zsw.erp.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.OrgaUserRel; +import com.zsw.erp.datasource.entities.OrgaUserRelExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.OrgaUserRelMapper; +import com.zsw.erp.datasource.mappers.OrgaUserRelMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.organization.OrganizationService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/11 18:11 + */ +@Service +public class OrgaUserRelService { + private Logger logger = LoggerFactory.getLogger(OrganizationService.class); + + @Resource + private OrgaUserRelMapper orgaUserRelMapper; + @Resource + private OrgaUserRelMapperEx orgaUserRelMapperEx; + @Resource + private UserService userService; + @Resource + private OrganizationService organizationService; + @Resource + private LogService logService; + + public OrgaUserRel getOrgaUserRel(long id) throws Exception{ + return orgaUserRelMapper.selectByPrimaryKey(id); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertOrgaUserRel(JSONObject obj, HttpServletRequest request) throws Exception{ + OrgaUserRel orgaUserRel = JSONObject.parseObject(obj.toJSONString(), OrgaUserRel.class); + int result=0; + try{ + result=orgaUserRelMapper.insertSelective(orgaUserRel); + logService.insertLog("用户与机构关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateOrgaUserRel(JSONObject obj, HttpServletRequest request) throws Exception{ + OrgaUserRel orgaUserRel = JSONObject.parseObject(obj.toJSONString(), OrgaUserRel.class); + int result=0; + try{ + result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel); + logService.insertLog("用户与机构关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(orgaUserRel.getId()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrgaUserRel(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result=orgaUserRelMapper.deleteByPrimaryKey(id); + logService.insertLog("用户与机构关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrgaUserRel(String ids, HttpServletRequest request)throws Exception { + List idList = StringUtil.strToLongList(ids); + OrgaUserRelExample example = new OrgaUserRelExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=orgaUserRelMapper.deleteByExample(example); + logService.insertLog("用户与机构关系", "批量删除,id集:" + ids, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + /** + * create by: cjl + * description: + * 新增机构用户关联关系,反显id + * create time: 2019/3/12 9:40 + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel addOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ + Date date = new Date(); + User userInfo=userService.getCurrentUser(); + //创建时间 + if(orgaUserRel.getCreateTime()==null){ + orgaUserRel.setCreateTime(date); + } + //创建人 + if(orgaUserRel.getCreator()==null){ + orgaUserRel.setCreator(userInfo==null?null:userInfo.getId()); + } + //更新时间 + if(orgaUserRel.getUpdateTime()==null){ + orgaUserRel.setUpdateTime(date); + } + //更新人 + if(orgaUserRel.getUpdater()==null){ + orgaUserRel.setUpdater(userInfo==null?null:userInfo.getId()); + } + orgaUserRel.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS); + int result=0; + try{ + result=orgaUserRelMapperEx.addOrgaUserRel(orgaUserRel); + }catch(Exception e){ + BoomException.writeFail(e); + } + if(result>0){ + return orgaUserRel; + } + return null; + } + /** + * create by: cjl + * description: + * 更新机构用户关联关系 + * create time: 2019/3/12 9:40 + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel updateOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ + User userInfo=userService.getCurrentUser(); + //更新时间 + if(orgaUserRel.getUpdateTime()==null){ + orgaUserRel.setUpdateTime(new Date()); + } + //更新人 + if(orgaUserRel.getUpdater()==null){ + orgaUserRel.setUpdater(userInfo==null?null:userInfo.getId()); + } + int result=0; + try{ + result=orgaUserRelMapperEx.updateOrgaUserRel(orgaUserRel); + }catch(Exception e){ + BoomException.writeFail(e); + } + if(result>0){ + return orgaUserRel; + } + return null; + } + + /** + * 根据用户id获取用户id列表 + * @param userId + * @return + * @throws Exception + */ + public String getUserIdListByUserId(Long userId) { + OrgaUserRel our = new OrgaUserRel(); + OrgaUserRelExample example = new OrgaUserRelExample(); + example.createCriteria().andUserIdEqualTo(userId); + List list = orgaUserRelMapper.selectByExample(example); + if(list!=null && list.size()>0) { + our = list.get(0); + } + List userIdList = getUserIdListByOrgId(our.getOrgaId()); + String users = ""; + for(Long u: userIdList){ + users = users + u + ","; + } + if(users.length()>0){ + users = users.substring(0,users.length()-1); + } + return users; + } + + /** + * 根据组织id获取所属的用户id列表(包含组织的递归) + * @param orgId + * @return + */ + public List getUserIdListByOrgId(Long orgId) { + List orgIdList = organizationService.getOrgIdByParentId(orgId); + List userIdList = new ArrayList(); + OrgaUserRelExample example = new OrgaUserRelExample(); + if(orgIdList!=null && orgIdList.size()>0) { + example.createCriteria().andOrgaIdIn(orgIdList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list = orgaUserRelMapper.selectByExample(example); + if(list!=null && list.size()>0) { + for(OrgaUserRel our: list) { + userIdList.add(our.getUserId()); + } + } + return userIdList; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationComponent.java new file mode 100644 index 00000000..16228917 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationComponent.java @@ -0,0 +1,65 @@ +package com.zsw.erp.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:09 + */ +@Service(value = "organization_component") +@OrganizationResource +public class OrganizationComponent implements ICommonQuery { + @Resource + private OrganizationService organizationService; + + @Override + public Object selectOne(Long id) throws Exception { + return organizationService.getOrganization(id); + } + + @Override + public List select(Map parameterMap)throws Exception { + return getOrganizationList(parameterMap); + } + private List getOrganizationList(Map map)throws Exception { + return null; + } + @Override + public Long counts(Map parameterMap)throws Exception { + return null; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return organizationService.insertOrganization(obj,request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return organizationService.updateOrganization(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return organizationService.deleteOrganization(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return organizationService.batchDeleteOrganization(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return organizationService.checkIsNameExist(id, name); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationResource.java new file mode 100644 index 00000000..9755c3bb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationResource.java @@ -0,0 +1,18 @@ +package com.zsw.erp.service.organization; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * 机构 + * @Author: cjl + * @Date: 2019/3/6 15:10 + */ +@ResourceInfo(value = "organization") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrganizationResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java new file mode 100644 index 00000000..d56a423c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/organization/OrganizationService.java @@ -0,0 +1,321 @@ +package com.zsw.erp.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.Organization; +import com.zsw.erp.datasource.entities.OrganizationExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.OrganizationMapper; +import com.zsw.erp.datasource.mappers.OrganizationMapperEx; +import com.zsw.erp.datasource.vo.TreeNode; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:10 + */ +@Service +public class OrganizationService { + private Logger logger = LoggerFactory.getLogger(OrganizationService.class); + + @Resource + private OrganizationMapper organizationMapper; + @Resource + private OrganizationMapperEx organizationMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + + public Organization getOrganization(long id) throws Exception { + return organizationMapper.selectByPrimaryKey(id); + } + + public List getOrganizationListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdIn(idList); + list = organizationMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertOrganization(JSONObject obj, HttpServletRequest request)throws Exception { + Organization organization = JSONObject.parseObject(obj.toJSONString(), Organization.class); + organization.setCreateTime(new Date()); + organization.setUpdateTime(new Date()); + int result=0; + try{ + result=organizationMapper.insertSelective(organization); + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(organization.getOrgAbr()).toString(),request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateOrganization(JSONObject obj, HttpServletRequest request)throws Exception { + Organization organization = JSONObject.parseObject(obj.toJSONString(), Organization.class); + organization.setUpdateTime(new Date()); + int result=0; + try{ + result=organizationMapper.updateByPrimaryKeySelective(organization); + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(organization.getOrgAbr()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrganization(Long id, HttpServletRequest request)throws Exception { + return batchDeleteOrganizationByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganization(String ids, HttpServletRequest request)throws Exception { + return batchDeleteOrganizationByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganizationByIds(String ids) throws Exception{ + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getOrganizationListByIds(ids); + for(Organization organization: list){ + sb.append("[").append(organization.getOrgAbr()).append("]"); + } + logService.insertLog("机构", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + List organList = organizationMapperEx.getOrganizationByParentIds(idArray); + if(organList!=null && organList.size()>0) { + //如果存在子机构则不能删除 + logger.error("异常码[{}],异常提示[{}]", + ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE,ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE, + ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG); + } else { + result=organizationMapperEx.batchDeleteOrganizationByIds( + new Date(),userInfo==null?null:userInfo.getId(),idArray); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdNotEqualTo(id).andOrgAbrEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= organizationMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int addOrganization(Organization org) throws Exception{ + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(org.getOrgAbr()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //新增时间 + Date date=new Date(); + User userInfo=userService.getCurrentUser(); + org.setCreateTime(date); + //修改时间 + org.setUpdateTime(date); + /** + *添加的时候检测机构编号是否已存在 + * */ + if(StringUtil.isNotEmpty(org.getOrgNo())){ + checkOrgNoIsExists(org.getOrgNo(),null); + } + /** + * 未指定父级机构的时候默认为根机构 + * */ + if(org.getParentId()!=null){ + org.setParentId(null); + } + int result=0; + try{ + result=organizationMapperEx.addOrganization(org); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int editOrganization(Organization org)throws Exception { + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getOrgAbr()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //修改时间 + org.setUpdateTime(new Date()); + User userInfo=userService.getCurrentUser(); + /** + * 修改的时候检测机构编号是否已存在 + * */ + if(StringUtil.isNotEmpty(org.getOrgNo())){ + checkOrgNoIsExists(org.getOrgNo(),org.getId()); + } + /** + * 未指定父级机构的时候默认为根机构 + * */ + if(org.getParentId()!=null){ + org.setParentId(null); + } + int result=0; + try{ + result=organizationMapperEx.editOrganization(org); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public List getOrganizationTree(Long id)throws Exception { + List list=null; + try{ + list=organizationMapperEx.getNodeTree(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findById(Long id) throws Exception{ + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(id); + List list=null; + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findByParentId(Long parentId)throws Exception { + List list=null; + if(parentId!=null){ + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(parentId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + } + return list; + } + + public List findByOrgNo(String orgNo)throws Exception { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andOrgNoEqualTo(orgNo).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + /** + * create by: cjl + * description: + * 检查机构编号是否已经存在 + * create time: 2019/3/7 10:01 + * @Param: orgNo + * @return void + */ + public void checkOrgNoIsExists(String orgNo,Long id)throws Exception { + List orgList=findByOrgNo(orgNo); + if(orgList!=null&&orgList.size()>0){ + if(orgList.size()>1){ + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo); + //获取的数据条数大于1,机构编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + if(id!=null){ + if(!orgList.get(0).getId().equals(id)){ + //数据条数等于1,但是和编辑的数据的id不相同 + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}],id[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo,id); + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + }else{ + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo); + //数据条数等于1,但此时是新增 + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + } + + } + + /** + * 根据父级id递归获取子集组织id + * @return + */ + public List getOrgIdByParentId(Long orgId) { + List idList = new ArrayList<>(); + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(orgId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List orgList = organizationMapper.selectByExample(example); + if(orgList!=null && orgList.size()>0) { + idList.add(orgId); + getOrgIdByParentNo(idList, orgList.get(0).getId()); + } + return idList; + } + + /** + * 根据组织编号递归获取下级编号 + * @param id + * @return + */ + public void getOrgIdByParentNo(List idList,Long id) { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andParentIdEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List orgList = organizationMapper.selectByExample(example); + if(orgList!=null && orgList.size()>0) { + for(Organization o: orgList) { + idList.add(o.getId()); + getOrgIdByParentNo(idList, o.getId()); + } + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonComponent.java new file mode 100644 index 00000000..449f1088 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonComponent.java @@ -0,0 +1,73 @@ +package com.zsw.erp.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "person_component") +@PersonResource +public class PersonComponent implements ICommonQuery { + + @Resource + private PersonService personService; + + @Override + public Object selectOne(Long id) throws Exception { + return personService.getPerson(id); + } + + @Override + public List select(Map map)throws Exception { + return getPersonList(map); + } + + private List getPersonList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String order = QueryUtils.order(map); + return personService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + return personService.countPerson(name, type); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return personService.insertPerson(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return personService.updatePerson(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return personService.deletePerson(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return personService.batchDeletePerson(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return personService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonResource.java new file mode 100644 index 00000000..c8b4b78e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.person; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "person") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PersonResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java new file mode 100644 index 00000000..03817511 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/person/PersonService.java @@ -0,0 +1,231 @@ +package com.zsw.erp.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.AccountHeadMapperEx; +import com.zsw.erp.datasource.mappers.DepotHeadMapperEx; +import com.zsw.erp.datasource.mappers.PersonMapper; +import com.zsw.erp.datasource.mappers.PersonMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.AccountHead; +import com.zsw.erp.datasource.entities.DepotHead; +import com.zsw.erp.datasource.entities.Person; +import com.zsw.erp.datasource.entities.PersonExample; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class PersonService { + private Logger logger = LoggerFactory.getLogger(PersonService.class); + + @Resource + private PersonMapper personMapper; + + @Resource + private PersonMapperEx personMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + + public Person getPerson(long id)throws Exception { + Person result=null; + try{ + result=personMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getPersonListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + PersonExample example = new PersonExample(); + example.createCriteria().andIdIn(idList); + list = personMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getPerson()throws Exception { + PersonExample example = new PersonExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, String type, int offset, int rows)throws Exception { + List list=null; + try{ + list=personMapperEx.selectByConditionPerson(name, type, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countPerson(String name, String type)throws Exception { + Long result=null; + try{ + result=personMapperEx.countsByPerson(name, type); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertPerson(JSONObject obj, HttpServletRequest request)throws Exception { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + result=personMapper.insertSelective(person); + logService.insertLog("经手人", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(person.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updatePerson(JSONObject obj, HttpServletRequest request)throws Exception { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + result=personMapper.updateByPrimaryKeySelective(person); + logService.insertLog("经手人", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(person.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deletePerson(Long id, HttpServletRequest request)throws Exception { + return batchDeletePersonByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePerson(String ids, HttpServletRequest request) throws Exception{ + return batchDeletePersonByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePersonByIds(String ids)throws Exception { + int result =0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList =null; + try{ + accountHeadList=accountHeadMapperEx.getAccountHeadListByHandsPersonIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(accountHeadList!=null&&accountHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList =null; + try{ + depotHeadList=depotHeadMapperEx.getDepotHeadListByCreator(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(depotHeadList!=null&&depotHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getPersonListByIds(ids); + for(Person person: list){ + sb.append("[").append(person.getName()).append("]"); + } + logService.insertLog("经手人", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //删除经手人 + try{ + result=personMapperEx.batchDeletePersonByIds(idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) throws Exception{ + PersonExample example = new PersonExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public Map getPersonMap() throws Exception { + List personList = getPerson(); + Map personMap = new HashMap<>(); + for(Person person : personList){ + personMap.put(person.getId(), person.getName()); + } + return personMap; + } + + public String getPersonByMapAndIds(Map personMap, String personIds)throws Exception { + List ids = StringUtil.strToLongList(personIds); + StringBuffer sb = new StringBuffer(); + for(Long id: ids){ + sb.append(personMap.get(id) + " "); + } + return sb.toString(); + } + + public List getPersonByType(String type)throws Exception { + PersonExample example = new PersonExample(); + example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id asc"); + List list =null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigComponent.java new file mode 100644 index 00000000..4369976e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigComponent.java @@ -0,0 +1,70 @@ +package com.zsw.erp.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "platformConfig_component") +@PlatformConfigResource +public class PlatformConfigComponent implements ICommonQuery { + + @Resource + private PlatformConfigService platformConfigService; + + @Override + public Object selectOne(Long id) throws Exception { + return platformConfigService.getPlatformConfig(id); + } + + @Override + public List select(Map map)throws Exception { + return getPlatformConfigList(map); + } + + private List getPlatformConfigList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String platformKey = StringUtil.getInfo(search, "platformKey"); + return platformConfigService.select(platformKey, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String platformKey = StringUtil.getInfo(search, "platformKey"); + return platformConfigService.countPlatformConfig(platformKey); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return platformConfigService.insertPlatformConfig(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return platformConfigService.updatePlatformConfig(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return platformConfigService.deletePlatformConfig(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return platformConfigService.batchDeletePlatformConfig(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigResource.java new file mode 100644 index 00000000..30bb70e5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.platformConfig; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "platformConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PlatformConfigResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigService.java b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigService.java new file mode 100644 index 00000000..4afe31e3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/platformConfig/PlatformConfigService.java @@ -0,0 +1,148 @@ +package com.zsw.erp.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.PlatformConfig; +import com.zsw.erp.datasource.entities.PlatformConfigExample; +import com.zsw.erp.datasource.mappers.PlatformConfigMapper; +import com.zsw.erp.datasource.mappers.PlatformConfigMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@Service +public class PlatformConfigService { + private Logger logger = LoggerFactory.getLogger(PlatformConfigService.class); + + @Resource + private PlatformConfigMapper platformConfigMapper; + + @Resource + private PlatformConfigMapperEx platformConfigMapperEx; + + public PlatformConfig getPlatformConfig(long id)throws Exception { + PlatformConfig result=null; + try{ + result=platformConfigMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getPlatformConfig()throws Exception { + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria(); + List list=null; + try{ + list=platformConfigMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String platformKey, int offset, int rows)throws Exception { + List list=null; + try{ + list=platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countPlatformConfig(String platformKey)throws Exception { + Long result=null; + try{ + result=platformConfigMapperEx.countsByPlatformConfig(platformKey); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertPlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{ + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + result=platformConfigMapper.insertSelective(platformConfig); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updatePlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{ + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + result = platformConfigMapper.updateByPrimaryKeySelective(platformConfig); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deletePlatformConfig(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result=platformConfigMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePlatformConfig(String ids, HttpServletRequest request)throws Exception { + List idList = StringUtil.strToLongList(ids); + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=platformConfigMapper.deleteByExample(example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int updatePlatformConfigByKey(String platformKey, String platformValue)throws Exception { + int result=0; + try{ + PlatformConfig platformConfig = new PlatformConfig(); + platformConfig.setPlatformValue(platformValue); + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + result = platformConfigMapper.updateByExampleSelective(platformConfig, example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public PlatformConfig getPlatformConfigByKey(String platformKey)throws Exception { + PlatformConfig platformConfig = new PlatformConfig(); + try{ + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + List list=platformConfigMapper.selectByExample(example); + if(list!=null && list.size()>0){ + platformConfig = list.get(0); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return platformConfig; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/redis/RedisService.java b/zsw-erp/src/main/java/com/zsw/erp/service/redis/RedisService.java new file mode 100644 index 00000000..98a22d1b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/redis/RedisService.java @@ -0,0 +1,84 @@ +package com.zsw.erp.service.redis; + +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * Description + * + * @author jisheng hua + * @Date: 2021/1/28 18:10 + */ +@Component +public class RedisService { + + @Resource + public RedisTemplate redisTemplate; + + public static final String ACCESS_TOKEN = "X-Access-Token"; + + @Autowired(required = false) + public void setRedisTemplate(RedisTemplate redisTemplate) { + RedisSerializer stringSerializer = new StringRedisSerializer(); + redisTemplate.setKeySerializer(stringSerializer); + redisTemplate.setValueSerializer(stringSerializer); + redisTemplate.setHashKeySerializer(stringSerializer); + redisTemplate.setHashValueSerializer(stringSerializer); + this.redisTemplate = redisTemplate; + } + + + public Object getObjectFromSessionByKey(HttpServletRequest request, String key){ + Object obj=null; + if(request==null){ + return null; + } + String token = request.getHeader(ACCESS_TOKEN); + if(token!=null) { + //开启redis,用户数据放在redis中,从redis中获取 + if(redisTemplate.opsForHash().hasKey(token,key)){ + //redis中存在,拿出来使用 + obj=redisTemplate.opsForHash().get(token,key); + redisTemplate.expire(token, BusinessConstants.MAX_SESSION_IN_SECONDS, TimeUnit.SECONDS); + } + } + return obj; + } + + public void storageObjectBySession(String token, String key, Object obj) { + //开启redis,用户数据放到redis中 + redisTemplate.opsForHash().put(token, key, obj.toString()); + redisTemplate.expire(token, BusinessConstants.MAX_SESSION_IN_SECONDS, TimeUnit.SECONDS); + } + + public void deleteObjectBySession(HttpServletRequest request, String key){ + if(request!=null){ + String token = request.getHeader(ACCESS_TOKEN); + if(StringUtil.isNotEmpty(token)){ + //开启redis,用户数据放在redis中,从redis中删除 + redisTemplate.opsForHash().delete(token, key); + } + } + } + + + public void deleteObjectByKeyAndIp(String key, String ip, String deleteKey){ + Set tokens = redisTemplate.keys("*"); + for(String token : tokens) { + Object value = redisTemplate.opsForHash().get(token, key); + if(value!=null && value.equals(ip)) { + redisTemplate.opsForHash().delete(token, deleteKey); + } + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java new file mode 100644 index 00000000..6ba0a490 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleComponent.java @@ -0,0 +1,70 @@ +package com.zsw.erp.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "role_component") +@RoleResource +public class RoleComponent implements ICommonQuery { + + @Resource + private RoleService roleService; + + @Override + public Object selectOne(Long id) throws Exception { + return roleService.getRole(id); + } + + @Override + public List select(Map map)throws Exception { + return getRoleList(map); + } + + private List getRoleList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return roleService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return roleService.countRole(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return roleService.insertRole(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return roleService.updateRole(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return roleService.deleteRole(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return roleService.batchDeleteRole(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return roleService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java new file mode 100644 index 00000000..3fb6ef82 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.role; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "role") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface RoleResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java new file mode 100644 index 00000000..c1606edb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/role/RoleService.java @@ -0,0 +1,184 @@ +package com.zsw.erp.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.Role; +import com.zsw.erp.datasource.entities.RoleExample; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.RoleMapper; +import com.zsw.erp.datasource.mappers.RoleMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class RoleService { + private Logger logger = LoggerFactory.getLogger(RoleService.class); + @Resource + private RoleMapper roleMapper; + + @Resource + private RoleMapperEx roleMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + + public Role getRole(long id)throws Exception { + Role result=null; + try{ + result=roleMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getRoleListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + RoleExample example = new RoleExample(); + example.createCriteria().andIdIn(idList); + list = roleMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List allList()throws Exception { + RoleExample example = new RoleExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String name, int offset, int rows)throws Exception { + List list=null; + try{ + list=roleMapperEx.selectByConditionRole(name, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countRole(String name)throws Exception { + Long result=null; + try{ + result=roleMapperEx.countsByRole(name); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertRole(JSONObject obj, HttpServletRequest request)throws Exception { + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + result=roleMapper.insertSelective(role); + logService.insertLog("角色", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(role.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateRole(JSONObject obj, HttpServletRequest request) throws Exception{ + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + result=roleMapper.updateByPrimaryKeySelective(role); + logService.insertLog("角色", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(role.getName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteRole(Long id, HttpServletRequest request)throws Exception { + return batchDeleteRoleByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRole(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteRoleByIds(ids); + } + + public int checkIsNameExist(Long id, String name) throws Exception{ + RoleExample example = new RoleExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public List findUserRole()throws Exception{ + RoleExample example = new RoleExample(); + example.setOrderByClause("Id"); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + /** + * create by: qiankunpingtai + * 逻辑删除角色信息 + * create time: 2019/3/28 15:44 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRoleByIds(String ids) throws Exception{ + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getRoleListByIds(ids); + for(Role role: list){ + sb.append("[").append(role.getName()).append("]"); + } + logService.insertLog("角色", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result=roleMapperEx.batchDeleteRoleByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceComponent.java new file mode 100644 index 00000000..45228eb4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceComponent.java @@ -0,0 +1,73 @@ +package com.zsw.erp.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Date: 2021/3/16 16:33 + */ +@Service(value = "sequence_component") +@SequenceResource +public class SequenceComponent implements ICommonQuery { + @Resource + private SequenceService sequenceService; + + @Override + public Object selectOne(Long id) throws Exception { + return sequenceService.getSequence(id); + } + + @Override + public List select(Map map)throws Exception { + return getSequenceList(map); + } + + private List getSequenceList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return sequenceService.select(name,QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return sequenceService.countSequence(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return sequenceService.insertSequence(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return sequenceService.updateSequence(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return sequenceService.deleteSequence(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return sequenceService.batchDeleteSequence(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name) throws Exception{ + return sequenceService.checkIsNameExist(id, name); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceResource.java new file mode 100644 index 00000000..abc4a3b4 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceResource.java @@ -0,0 +1,17 @@ +package com.zsw.erp.service.sequence; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * + * @Date: 2021/3/16 16:33 + */ +@ResourceInfo(value = "sequence") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SequenceResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceService.java b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceService.java new file mode 100644 index 00000000..a7c0b828 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/sequence/SequenceService.java @@ -0,0 +1,88 @@ +package com.zsw.erp.service.sequence; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.datasource.entities.SerialNumber; +import com.zsw.erp.datasource.entities.SerialNumberEx; +import com.zsw.erp.datasource.mappers.SequenceMapperEx; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Date: 2021/3/16 16:33 + */ +@Service +public class SequenceService { + private Logger logger = LoggerFactory.getLogger(SequenceService.class); + + @Resource + private SequenceMapperEx sequenceMapperEx; + + public SerialNumber getSequence(long id) throws Exception { + return null; + } + + public List select(String name, Integer offset, Integer rows) throws Exception { + return null; + } + + public Long countSequence(String name) throws Exception { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSequence(JSONObject obj, HttpServletRequest request) throws Exception { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSequence(JSONObject obj, HttpServletRequest request) throws Exception { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSequence(Long id, HttpServletRequest request) throws Exception { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSequence(String ids, HttpServletRequest request) throws Exception { + return 0; + } + + public int checkIsNameExist(Long id, String serialNumber) throws Exception { + return 0; + } + + /** + * 创建一个唯一的序列号 + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String buildOnlyNumber() throws Exception { + Long buildOnlyNumber = null; + String number; + synchronized (this) { + try { + sequenceMapperEx.updateBuildOnlyNumber(); //编号+1 + buildOnlyNumber = sequenceMapperEx.getBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ); + } catch (Exception e) { + BoomException.writeFail(e); + } + number = String.format("%s%05d", DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN), buildOnlyNumber); + } + return number; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberComponent.java new file mode 100644 index 00000000..799295cc --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberComponent.java @@ -0,0 +1,76 @@ +package com.zsw.erp.service.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 16:33 + */ +@Service(value = "serialNumber_component") +@SerialNumberResource +public class SerialNumberComponent implements ICommonQuery { + @Resource + private SerialNumberService serialNumberService; + + @Override + public Object selectOne(Long id) throws Exception { + return serialNumberService.getSerialNumber(id); + } + + @Override + public List select(Map map)throws Exception { + return getSerialNumberList(map); + } + + private List getSerialNumberList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String serialNumber = StringUtil.getInfo(search, "serialNumber"); + String materialName = StringUtil.getInfo(search, "materialName"); + return serialNumberService.select(serialNumber,materialName,QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String serialNumber = StringUtil.getInfo(search, "serialNumber"); + String materialName = StringUtil.getInfo(search, "materialName"); + return serialNumberService.countSerialNumber(serialNumber, materialName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return serialNumberService.insertSerialNumber(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return serialNumberService.updateSerialNumber(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return serialNumberService.deleteSerialNumber(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return serialNumberService.batchDeleteSerialNumber(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String serialNumber) throws Exception{ + return serialNumberService.checkIsNameExist(id, serialNumber); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberResource.java new file mode 100644 index 00000000..b5389f0e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberResource.java @@ -0,0 +1,17 @@ +package com.zsw.erp.service.serialNumber; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * + * @Date: 2019/1/21 16:33 + */ +@ResourceInfo(value = "serialNumber") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SerialNumberResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java new file mode 100644 index 00000000..a07c29f5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/serialNumber/SerialNumberService.java @@ -0,0 +1,423 @@ +package com.zsw.erp.service.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.material.MaterialService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.MaterialMapper; +import com.zsw.erp.datasource.mappers.MaterialMapperEx; +import com.zsw.erp.datasource.mappers.SerialNumberMapper; +import com.zsw.erp.datasource.mappers.SerialNumberMapperEx; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 16:33 + */ +@Service +public class SerialNumberService { + private Logger logger = LoggerFactory.getLogger(SerialNumberService.class); + + @Resource + private SerialNumberMapper serialNumberMapper; + @Resource + private SerialNumberMapperEx serialNumberMapperEx; + @Resource + private MaterialMapperEx materialMapperEx; + @Resource + private MaterialMapper materialMapper; + @Resource + private MaterialService materialService; + @Resource + private UserService userService; + @Resource + private LogService logService; + + + public SerialNumber getSerialNumber(long id)throws Exception { + SerialNumber result=null; + try{ + result=serialNumberMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getSerialNumberListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andIdIn(idList); + list = serialNumberMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getSerialNumber()throws Exception { + SerialNumberExample example = new SerialNumberExample(); + List list=null; + try{ + list=serialNumberMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String serialNumber, String materialName, Integer offset, Integer rows)throws Exception { + return null; + + } + + public Long countSerialNumber(String serialNumber,String materialName)throws Exception { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSerialNumber(JSONObject obj, HttpServletRequest request)throws Exception { + int result=0; + try{ + SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class); + /**处理商品id*/ + serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode())); + //删除标记,默认未删除 + serialNumberEx.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS); + //已卖出,默认未否 + serialNumberEx.setIsSell(BusinessConstants.IS_SELL_HOLD); + Date date=new Date(); + serialNumberEx.setCreateTime(date); + serialNumberEx.setUpdateTime(date); + User userInfo=userService.getCurrentUser(); + serialNumberEx.setCreator(userInfo==null?null:userInfo.getId()); + serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); + result = serialNumberMapperEx.addSerialNumber(serialNumberEx); + logService.insertLog("序列号",BusinessConstants.LOG_OPERATION_TYPE_ADD, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSerialNumber(JSONObject obj, HttpServletRequest request) throws Exception{ + SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class); + int result=0; + try{ + serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode())); + Date date=new Date(); + serialNumberEx.setUpdateTime(date); + User userInfo=userService.getCurrentUser(); + serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); + result = serialNumberMapperEx.updateSerialNumber(serialNumberEx); + logService.insertLog("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSerialNumber(Long id, HttpServletRequest request)throws Exception { + return batchDeleteSerialNumberByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumber(String ids, HttpServletRequest request)throws Exception { + return batchDeleteSerialNumberByIds(ids); + } + + /** + * create by: qiankunpingtai + * 逻辑删除序列号信息 + * create time: 2019/3/27 17:43 + * @Param: ids + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumberByIds(String ids) throws Exception{ + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getSerialNumberListByIds(ids); + for(SerialNumber serialNumber: list){ + sb.append("[").append(serialNumber.getSerialNumber()).append("]"); + } + logService.insertLog("序列号", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = serialNumberMapperEx.batchDeleteSerialNumberByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String serialNumber)throws Exception { + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=serialNumberMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + /** + * create by: cjl + * description: + * 根据商品名称判断商品名称是否有效 + * create time: 2019/1/23 17:04 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long checkMaterialName(String materialName)throws Exception{ + if(StringUtil.isNotEmpty(materialName)) { + List mlist=null; + try{ + mlist = materialMapperEx.findByMaterialName(materialName); + }catch(Exception e){ + BoomException.readFail(e); + } + if (mlist == null || mlist.size() < 1) { + //商品名称不存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_EXISTS_CODE, + ExceptionConstants.MATERIAL_NOT_EXISTS_MSG); + } + if (mlist.size() > 1) { + //商品信息不唯一 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ONLY_CODE, + ExceptionConstants.MATERIAL_NOT_ONLY_MSG); + + } + //获得唯一商品 + if (BusinessConstants.ENABLE_SERIAL_NUMBER_NOT_ENABLED.equals(mlist.get(0).getEnableSerialNumber())) { + //商品未开启序列号 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE, + ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG); + } + return mlist.get(0).getId(); + } + return null; + } + /** + * create by: cjl + * description: + * 根据商品名称判断给商品添加序列号是否可行 + * 1、根据商品名称必须查询到唯一的商品 + * 2、该商品必须已经启用序列号 + * 3、该商品已绑定序列号数量小于商品现有库存 + * 2019-02-01 + * 用商品的库存去限制序列号的添加有点不合乎道理,去掉此限制 + * create time: 2019/1/23 17:04 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long getSerialNumberMaterialIdByBarCode(String materialCode)throws Exception{ + if(StringUtil.isNotEmpty(materialCode)){ + //计算商品库存和目前占用的可用序列号数量关系 + //库存=入库-出库 + //入库数量 + Long materialId = 0L; + List list = materialService.getMaterialByBarCode(materialCode); + if(list!=null && list.size()>0) { + materialId = list.get(0).getId(); + } + return materialId; + } + return null; + } + + /** + * create by: cjl + * description: + * 出库时判断序列号库存是否足够, + * 同时将对应的序列号绑定单据 + * create time: 2019/1/24 16:24 + * @Param: List + * @return void + */ + public void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo,User userInfo, String snList) throws Exception{ + if(depotItem!=null){ + sellSerialNumber(depotItem.getMaterialId(), outBillNo, snList,userInfo); + } + } + /** + * + * + * */ + /** + * create by: cjl + * description: + * 卖出序列号 + * create time: 2019/1/25 9:17 + * @Param: materialId + * @Param: depotheadId + * @Param: isSell 卖出'1' + * @Param: Count 卖出或者赎回的数量 + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int sellSerialNumber(Long materialId, String outBillNo, String snList, User user) throws Exception{ + int result=0; + try{ + String [] snArray=snList.split(","); + result = serialNumberMapperEx.sellSerialNumber(materialId, outBillNo, snArray, new Date(),user==null?null:user.getId()); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + /** + * create by: cjl + * description: + * 赎回序列号 + * create time: 2019/1/25 9:17 + * @Param: materialId +  * @Param: depotheadId +  * @Param: isSell 赎回'0' +  * @Param: Count 卖出或者赎回的数量 + * @return com.jsh.erp.datasource.entities.SerialNumberEx + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int cancelSerialNumber(Long materialId, String outBillNo,int count,User user) throws Exception{ + int result=0; + try{ + result = serialNumberMapperEx.cancelSerialNumber(materialId,outBillNo,count,new Date(),user==null?null:user.getId()); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + /** + * create by: cjl + * description: + *批量添加序列号,最多500个 + * create time: 2019/1/29 15:11 + * @Param: materialName + * @Param: serialNumberPrefix + * @Param: batAddTotal + * @Param: remark + * @return java.lang.Object + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batAddSerialNumber(String materialCode, String serialNumberPrefix, Integer batAddTotal, String remark)throws Exception { + int result=0; + try { + if (StringUtil.isNotEmpty(materialCode)) { + //查询商品id + Long materialId = getSerialNumberMaterialIdByBarCode(materialCode); + List list = null; + //当前用户 + User userInfo = userService.getCurrentUser(); + Long userId = userInfo == null ? null : userInfo.getId(); + Date date = null; + Long million = null; + synchronized (this) { + date = new Date(); + million = date.getTime(); + } + int insertNum = 0; + StringBuffer prefixBuf = new StringBuffer(serialNumberPrefix).append(million); + list = new ArrayList(); + int forNum = BusinessConstants.BATCH_INSERT_MAX_NUMBER >= batAddTotal ? batAddTotal : BusinessConstants.BATCH_INSERT_MAX_NUMBER; + for (int i = 0; i < forNum; i++) { + insertNum++; + SerialNumberEx each = new SerialNumberEx(); + each.setMaterialId(materialId); + each.setCreator(userId); + each.setCreateTime(date); + each.setUpdater(userId); + each.setUpdateTime(date); + each.setRemark(remark); + each.setSerialNumber(new StringBuffer(prefixBuf.toString()).append(insertNum).toString()); + list.add(each); + } + result = serialNumberMapperEx.batAddSerialNumber(list); + logService.insertLog("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + public List getEnableSerialNumberList(String name, Long depotId, String barCode, Integer offset, Integer rows)throws Exception { + List list =null; + try{ + list = serialNumberMapperEx.getEnableSerialNumberList(StringUtil.toNull(name), depotId, barCode, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long getEnableSerialNumberCount(String name, Long depotId, String barCode)throws Exception { + Long count = 0L; + try{ + count = serialNumberMapperEx.getEnableSerialNumberCount(StringUtil.toNull(name), depotId, barCode); + }catch(Exception e){ + BoomException.readFail(e); + } + return count; + } + + public void addSerialNumberByBill(String inBillNo, Long materialId, Long depotId, String snList) throws Exception { + //将中文的逗号批量替换为英文逗号 + snList = snList.replaceAll(",",","); + List snArr = StringUtil.strToStringList(snList); + for(String sn: snArr) { + List list = new ArrayList<>(); + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andSerialNumberEqualTo(sn) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = serialNumberMapper.selectByExample(example); + //判断如果不存在重复序列号就新增 + if(list == null || list.size() == 0) { + SerialNumber serialNumber = new SerialNumber(); + serialNumber.setMaterialId(materialId); + serialNumber.setDepotId(depotId); + serialNumber.setSerialNumber(sn); + Date date = new Date(); + serialNumber.setCreateTime(date); + serialNumber.setUpdateTime(date); + User userInfo = userService.getCurrentUser(); + serialNumber.setCreator(userInfo == null ? null : userInfo.getId()); + serialNumber.setUpdater(userInfo == null ? null : userInfo.getId()); + serialNumber.setInBillNo(inBillNo); + serialNumberMapper.insertSelective(serialNumber); + } + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierComponent.java new file mode 100644 index 00000000..7fef761a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierComponent.java @@ -0,0 +1,77 @@ +package com.zsw.erp.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "supplier_component") +@SupplierResource +public class SupplierComponent implements ICommonQuery { + + @Resource + private SupplierService supplierService; + + @Override + public Object selectOne(Long id) throws Exception { + return supplierService.getSupplier(id); + } + + @Override + public List select(Map map)throws Exception { + return getSupplierList(map); + } + + private List getSupplierList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String supplier = StringUtil.getInfo(search, "supplier"); + String type = StringUtil.getInfo(search, "type"); + String phonenum = StringUtil.getInfo(search, "phonenum"); + String telephone = StringUtil.getInfo(search, "telephone"); + String order = QueryUtils.order(map); + return supplierService.select(supplier, type, phonenum, telephone, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String supplier = StringUtil.getInfo(search, "supplier"); + String type = StringUtil.getInfo(search, "type"); + String phonenum = StringUtil.getInfo(search, "phonenum"); + String telephone = StringUtil.getInfo(search, "telephone"); + return supplierService.countSupplier(supplier, type, phonenum, telephone); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return supplierService.insertSupplier(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return supplierService.updateSupplier(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return supplierService.deleteSupplier(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return supplierService.batchDeleteSupplier(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return supplierService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierResource.java new file mode 100644 index 00000000..b8724ab3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.supplier; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "supplier") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SupplierResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java new file mode 100644 index 00000000..6e5d6fde --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/supplier/SupplierService.java @@ -0,0 +1,604 @@ +package com.zsw.erp.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.AccountHeadMapperEx; +import com.zsw.erp.datasource.mappers.DepotHeadMapperEx; +import com.zsw.erp.datasource.mappers.SupplierMapper; +import com.zsw.erp.datasource.mappers.SupplierMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.accountHead.AccountHeadService; +import com.zsw.erp.service.depotHead.DepotHeadService; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.systemConfig.SystemConfigService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.base.R; +import com.zsw.erp.utils.ExcelUtils; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.*; +import jxl.Sheet; +import jxl.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + +import static com.zsw.erp.utils.Tools.getNow3; + +@Service +public class SupplierService { + private Logger logger = LoggerFactory.getLogger(SupplierService.class); + + @Resource + private SupplierMapper supplierMapper; + + @Resource + private SupplierMapperEx supplierMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + @Resource + @Lazy + private DepotHeadService depotHeadService; + @Resource + @Lazy + private AccountHeadService accountHeadService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private UserBusinessService userBusinessService; + + public Supplier getSupplier(long id)throws Exception { + Supplier result=null; + try{ + result=supplierMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getSupplierListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdIn(idList); + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getSupplier()throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String supplier, String type, String phonenum, String telephone, int offset, int rows) throws Exception{ + List resList = new ArrayList(); + try{ + List list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, offset, rows); + for(Supplier s : list) { + Integer supplierId = s.getId().intValue(); + String endTime = getNow3(); + String supType = s.getType(); + BigDecimal sum = BigDecimal.ZERO; + BigDecimal beginNeedGet = s.getBeginNeedGet(); + if(beginNeedGet==null) { + beginNeedGet = BigDecimal.ZERO; + } + BigDecimal beginNeedPay = s.getBeginNeedPay(); + if(beginNeedPay==null) { + beginNeedPay = BigDecimal.ZERO; + } + sum = sum.add(depotHeadService.findTotalPay(supplierId, endTime, supType)) + .subtract(accountHeadService.findTotalPay(supplierId, endTime, supType)); + if(("客户").equals(s.getType())) { + sum = sum.add(beginNeedGet); + s.setAllNeedGet(sum); + } else if(("供应商").equals(s.getType())) { + sum = sum.add(beginNeedPay); + s.setAllNeedPay(sum); + } + resList.add(s); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return resList; + } + + public Long countSupplier(String supplier, String type, String phonenum, String telephone) throws Exception{ + Long result=null; + try{ + result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSupplier(JSONObject obj, HttpServletRequest request)throws Exception { + Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class); + int result=0; + try{ + supplier.setEnabled(true); + result=supplierMapper.insertSelective(supplier); + //新增客户时给当前用户自动授权 + if("客户".equals(supplier.getType())) { + Long userId = userService.getUserId(request); + Supplier sInfo = supplierMapperEx.getSupplierByNameAndType(supplier.getSupplier(), supplier.getType()); + UserBusiness ubInfo = userBusinessService.getBasicData(userId, "UserCustomer"); + if(ubInfo ==null ) { + ubInfo = new UserBusiness(); + ubInfo.setType("UserCustomer"); + ubInfo.setKeyId(userId.toString()); + ArrayList l = Lists.newArrayList(); + l.add(sInfo.getId()); + ubInfo.setValue(l); + userBusinessService.insertUserBusiness(ubInfo, request); + } else { + ubInfo.getValue().add(sInfo.getId()); + userBusinessService.updateUserBusiness(ubInfo, request); + } + } + logService.insertLog("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(supplier.getSupplier()).toString(),request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSupplier(JSONObject obj, HttpServletRequest request)throws Exception { + Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class); + if(supplier.getBeginNeedPay() == null) { + supplier.setBeginNeedPay(BigDecimal.ZERO); + } + if(supplier.getBeginNeedGet() == null) { + supplier.setBeginNeedGet(BigDecimal.ZERO); + } + int result=0; + try{ + result=supplierMapper.updateByPrimaryKeySelective(supplier); + logService.insertLog("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplier.getSupplier()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSupplier(Long id, HttpServletRequest request)throws Exception { + return batchDeleteSupplierByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplier(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteSupplierByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplierByIds(String ids)throws Exception { + int result=0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList=null; + try{ + accountHeadList = accountHeadMapperEx.getAccountHeadListByOrganIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(accountHeadList!=null&&accountHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList=null; + try{ + depotHeadList = depotHeadMapperEx.getDepotHeadListByOrganIds(idArray); + }catch(Exception e){ + BoomException.readFail(e); + } + if(depotHeadList!=null&&depotHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getSupplierListByIds(ids); + for(Supplier supplier: list){ + sb.append("[").append(supplier.getSupplier()).append("]"); + } + logService.insertLog("商家", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = supplierMapperEx.batchDeleteSupplierByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public int checkIsNameAndTypeExist(Long id, String name, String type)throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andTypeEqualTo(type) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn)throws Exception{ + Supplier supplier=null; + try{ + supplier = supplierMapper.selectByPrimaryKey(supplierId); + }catch(Exception e){ + BoomException.readFail(e); + } + int result=0; + try{ + if(supplier!=null){ + supplier.setAdvanceIn(supplier.getAdvanceIn().add(advanceIn)); //增加预收款的金额,可能增加的是负值 + result=supplierMapper.updateByPrimaryKeySelective(supplier); + } + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public List findBySelectCus()throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("客户").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findBySelectSup()throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("供应商").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findBySelectRetail()throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("会员").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findById(Long supplierId)throws Exception { + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdEqualTo(supplierId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids)throws Exception { + logService.insertLog("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List supplierIds = StringUtil.strToLongList(ids); + Supplier supplier = new Supplier(); + supplier.setEnabled(status); + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdIn(supplierIds); + int result=0; + try{ + result = supplierMapper.updateByExampleSelective(supplier, example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public List findUserCustomer()throws Exception{ + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeEqualTo("客户") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List findByAll(String supplier, String type, String phonenum, String telephone) throws Exception{ + List list=null; + try{ + list = supplierMapperEx.findByAll(supplier, type, phonenum, telephone); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public void importVendor(MultipartFile file, HttpServletRequest request) throws Exception{ + String type = "供应商"; + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '传真', '期初应付', '纳税人识别号', '税率(%)', '开户行', '账号', '地址', '备注', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(ExcelUtils.getContent(src, i, 0)); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setFax(ExcelUtils.getContent(src, i, 5)); + s.setBeginNeedGet(parseBigDecimalEx(ExcelUtils.getContent(src, i, 6))); + s.setTaxNum(ExcelUtils.getContent(src, i, 7)); + s.setTaxRate(parseBigDecimalEx(ExcelUtils.getContent(src, i, 8))); + s.setBankName(ExcelUtils.getContent(src, i, 9)); + s.setAccountNumber(ExcelUtils.getContent(src, i, 10)); + s.setAddress(ExcelUtils.getContent(src, i, 11)); + s.setDescription(ExcelUtils.getContent(src, i, 12)); + String enabled = ExcelUtils.getContent(src, i, 13); + s.setEnabled(enabled.equals("1")); + sList.add(s); + } + importExcel(sList, type); + } + + public void importCustomer(MultipartFile file, HttpServletRequest request) throws Exception{ + String type = "客户"; + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '传真', '期初应收', '纳税人识别号', '税率(%)', '开户行', '账号', '地址', '备注', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(ExcelUtils.getContent(src, i, 0)); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setFax(ExcelUtils.getContent(src, i, 5)); + s.setBeginNeedGet(parseBigDecimalEx(ExcelUtils.getContent(src, i, 6))); + s.setTaxNum(ExcelUtils.getContent(src, i, 7)); + s.setTaxRate(parseBigDecimalEx(ExcelUtils.getContent(src, i, 8))); + s.setBankName(ExcelUtils.getContent(src, i, 9)); + s.setAccountNumber(ExcelUtils.getContent(src, i, 10)); + s.setAddress(ExcelUtils.getContent(src, i, 11)); + s.setDescription(ExcelUtils.getContent(src, i, 12)); + String enabled = ExcelUtils.getContent(src, i, 13); + s.setEnabled(enabled.equals("1")); + sList.add(s); + } + importExcel(sList, type); + } + + public void importMember(MultipartFile file, HttpServletRequest request) throws Exception{ + String type = "会员"; + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '备注', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(ExcelUtils.getContent(src, i, 0)); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setDescription(ExcelUtils.getContent(src, i, 5)); + String enabled = ExcelUtils.getContent(src, i, 6); + s.setEnabled(enabled.equals("1")); + sList.add(s); + } + importExcel(sList, type); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public R importExcel(List mList, String type) throws Exception { + logService.insertLog(type, + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + Map data = new HashMap<>(); + for(Supplier s: mList) { + SupplierExample example = new SupplierExample(); + example.createCriteria().andSupplierEqualTo(s.getSupplier()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list= supplierMapper.selectByExample(example); + if(list.size() <= 0) { + supplierMapper.insertSelective(s); + } else { + Long id = list.get(0).getId(); + s.setId(id); + supplierMapper.updateByPrimaryKeySelective(s); + } + } + return R.success(); + } + + public BigDecimal parseBigDecimalEx(String str)throws Exception{ + if(!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + public File exportExcel(List dataList, String type) throws Exception { + if("供应商".equals(type)) { + return exportExcelVendorOrCustomer(dataList, type); + } else if("客户".equals(type)) { + return exportExcelVendorOrCustomer(dataList, type); + } else { + //会员 + String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "预付款", "备注", "状态"}; + String title = "信息报表"; + List objects = new ArrayList(); + if (null != dataList) { + for (Supplier s : dataList) { + String[] objs = new String[15]; + objs[0] = s.getSupplier(); + objs[1] = s.getContacts(); + objs[2] = s.getTelephone(); + objs[3] = s.getPhoneNum(); + objs[4] = s.getEmail(); + objs[5] = s.getAdvanceIn() == null? "" : s.getAdvanceIn().toString(); + objs[6] = s.getDescription(); + objs[7] = s.getEnabled() ? "启用" : "禁用"; + objects.add(objs); + } + } + return ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects); + } + } + + private File exportExcelVendorOrCustomer(List dataList, String type) throws Exception { + String beginNeedStr = ""; + String allNeedStr = ""; + if("供应商".equals(type)) { + beginNeedStr = "期初应付"; + allNeedStr = "期末应付"; + } else if("客户".equals(type)) { + beginNeedStr = "期初应收"; + allNeedStr = "期末应收"; + } + String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "传真", beginNeedStr, + allNeedStr, "纳税人识别号", "税率(%)", "开户行", "账号", "地址", "备注", "状态"}; + String title = "信息报表"; + List objects = new ArrayList(); + if (null != dataList) { + for (Supplier s : dataList) { + Integer supplierId = s.getId().intValue(); + String endTime = getNow3(); + String supType = s.getType(); + BigDecimal sum = BigDecimal.ZERO; + BigDecimal beginNeedGet = s.getBeginNeedGet(); + if(beginNeedGet==null) { + beginNeedGet = BigDecimal.ZERO; + } + BigDecimal beginNeedPay = s.getBeginNeedPay(); + if(beginNeedPay==null) { + beginNeedPay = BigDecimal.ZERO; + } + sum = sum.add(depotHeadService.findTotalPay(supplierId, endTime, supType)) + .subtract(accountHeadService.findTotalPay(supplierId, endTime, supType)); + if(("客户").equals(s.getType())) { + sum = sum.add(beginNeedGet); + s.setAllNeedGet(sum); + } else if(("供应商").equals(s.getType())) { + sum = sum.add(beginNeedPay); + s.setAllNeedPay(sum); + } + String[] objs = new String[15]; + objs[0] = s.getSupplier(); + objs[1] = s.getContacts(); + objs[2] = s.getTelephone(); + objs[3] = s.getPhoneNum(); + objs[4] = s.getEmail(); + objs[5] = s.getFax(); + if(("客户").equals(s.getType())) { + objs[6] = s.getBeginNeedGet() == null? "" : s.getBeginNeedGet().toString(); + objs[7] = s.getAllNeedGet() == null? "" : s.getAllNeedGet().toString(); + } else if(("供应商").equals(s.getType())) { + objs[6] = s.getBeginNeedPay() == null? "" : s.getBeginNeedPay().toString(); + objs[7] = s.getAllNeedPay() == null? "" : s.getAllNeedPay().toString(); + } + objs[8] = s.getTaxNum(); + objs[9] = s.getTaxRate() == null? "" : s.getTaxRate().toString(); + objs[10] = s.getBankName(); + objs[11] = s.getAccountNumber(); + objs[12] = s.getAddress(); + objs[13] = s.getDescription(); + objs[14] = s.getEnabled() ? "启用" : "禁用"; + objects.add(objs); + } + } + return ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigComponent.java new file mode 100644 index 00000000..aaad0b54 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigComponent.java @@ -0,0 +1,71 @@ +package com.zsw.erp.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "systemConfig_component") +@SystemConfigResource +public class SystemConfigComponent implements ICommonQuery { + + @Resource + private SystemConfigService systemConfigService; + + @Override + public Object selectOne(Long id) throws Exception { + return systemConfigService.getSystemConfig(id); + } + + @Override + public List select(Map map)throws Exception { + return getSystemConfigList(map); + } + + private List getSystemConfigList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String companyName = StringUtil.getInfo(search, "companyName"); + String order = QueryUtils.order(map); + return systemConfigService.select(companyName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String companyName = StringUtil.getInfo(search, "companyName"); + return systemConfigService.countSystemConfig(companyName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return systemConfigService.insertSystemConfig(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return systemConfigService.updateSystemConfig(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return systemConfigService.deleteSystemConfig(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return systemConfigService.batchDeleteSystemConfig(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return systemConfigService.checkIsNameExist(id, name).intValue(); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigResource.java new file mode 100644 index 00000000..55af780a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.systemConfig; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "systemConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SystemConfigResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java new file mode 100644 index 00000000..fb39cac3 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/systemConfig/SystemConfigService.java @@ -0,0 +1,197 @@ +package com.zsw.erp.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.SystemConfig; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.mappers.SystemConfigMapper; +import com.zsw.erp.datasource.mappers.SystemConfigMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +@Service +@Transactional(value = "transactionManager", rollbackFor = Exception.class) +public class SystemConfigService { + private Logger logger = LoggerFactory.getLogger(SystemConfigService.class); + + @Resource + private SystemConfigMapper systemConfigMapper; + + @Resource + private SystemConfigMapperEx systemConfigMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + + public SystemConfig getSystemConfig(long id){ + return systemConfigMapper.selectById(id); + } + + public SystemConfig getSystemConfigByTenentId(Long tenantId){ + return systemConfigMapper.selectByTenantId(tenantId); + } + + public List getSystemConfig(){ + return systemConfigMapper.selectList(Wrappers.emptyWrapper()); + } + public List select(String companyName, int offset, int rows)throws Exception { + List list=null; + try{ + list=systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countSystemConfig(String companyName)throws Exception { + Long result=null; + try{ + result=systemConfigMapperEx.countsBySystemConfig(companyName); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + + public int insertSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{ + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + if(userService.checkIsTestUser()) { + result=-1; + } else { + result=systemConfigMapper.insert(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(systemConfig.getCompanyName()).toString(), request); + } + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{ + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + if(userService.checkIsTestUser()) { + result=-1; + } else { + result = systemConfigMapper.updateByPrimaryKeySelective(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(systemConfig.getCompanyName()).toString(), request); + } + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSystemConfig(Long id, HttpServletRequest request)throws Exception { + return batchDeleteSystemConfigByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfig(String ids, HttpServletRequest request)throws Exception { + return batchDeleteSystemConfigByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfigByIds(String ids)throws Exception { + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + if(userService.checkIsTestUser()) { + result=-1; + } else { + result = systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + } + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public Long checkIsNameExist(Long id, String name) throws Exception{ + LambdaQueryWrapper wrappers = Wrappers.lambdaQuery() + .eq(SystemConfig::getCompanyName, name) + .ne(SystemConfig::getId, id) + .eq(SystemConfig::getDepotFlag, BusinessConstants.DELETE_FLAG_EXISTS); + return systemConfigMapper.selectCount(wrappers); + } + + /** + * 获取仓库开关 + * @return + * @throws Exception + */ + public boolean getDepotFlag() throws Exception { + boolean depotFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getDepotFlag(); + if(("1").equals(flag)) { + depotFlag = true; + } + } + return depotFlag; + } + + /** + * 获取客户开关 + * @return + * @throws Exception + */ + public boolean getCustomerFlag() throws Exception { + boolean customerFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getCustomerFlag(); + if(("1").equals(flag)) { + customerFlag = true; + } + } + return customerFlag; + } + + /** + * 获取负库存开关 + * @return + * @throws Exception + */ + public boolean getMinusStockFlag() throws Exception { + boolean minusStockFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getMinusStockFlag(); + if(("1").equals(flag)) { + minusStockFlag = true; + } + } + return minusStockFlag; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java new file mode 100644 index 00000000..5ef44c63 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantComponent.java @@ -0,0 +1,78 @@ +package com.zsw.erp.service.tenant; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.datasource.entities.Tenant; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "tenant_component") +@TenantResource +public class TenantComponent implements ICommonQuery { + + @Resource + private TenantService tenantService; + + @Override + public Object selectOne(Long id) throws Exception { + return tenantService.getTenant(id); + } + + @Override + public List select(Map map)throws Exception { + return getTenantList(map); + } + + private List getTenantList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String loginName = StringUtil.getInfo(search, "loginName"); + String type = StringUtil.getInfo(search, "type"); + String enabled = StringUtil.getInfo(search, "enabled"); + return tenantService.select(loginName, type, enabled, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String loginName = StringUtil.getInfo(search, "loginName"); + String type = StringUtil.getInfo(search, "type"); + String enabled = StringUtil.getInfo(search, "enabled"); + return tenantService.countTenant(loginName, type, enabled); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + Tenant tenant = JSONUtil.toBean(obj.toJSONString(), Tenant.class); + return tenantService.insertTenant(tenant, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + Tenant tenant = JSONUtil.toBean(obj.toJSONString(), Tenant.class); + return tenantService.updateTenant(tenant, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return tenantService.deleteTenant(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return tenantService.batchDeleteTenant(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return tenantService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java new file mode 100644 index 00000000..02b58363 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.tenant; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "tenant") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface TenantResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java new file mode 100644 index 00000000..afd0d284 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/tenant/TenantService.java @@ -0,0 +1,182 @@ +package com.zsw.erp.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.mappers.TenantMapper; +import com.zsw.erp.datasource.mappers.TenantMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import com.zsw.erp.datasource.entities.Tenant; +import com.zsw.erp.datasource.entities.TenantEx; +import com.zsw.erp.datasource.entities.TenantExample; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class TenantService { + private Logger logger = LoggerFactory.getLogger(TenantService.class); + + @Resource + private TenantMapper tenantMapper; + + @Resource + private TenantMapperEx tenantMapperEx; + + @Resource + @Lazy + private LogService logService; + + @Value("${tenant.userNumLimit}") + private Integer userNumLimit; + + @Value("${tenant.tryDayLimit}") + private Integer tryDayLimit; + + public Tenant getTenant(long id)throws Exception { + Tenant result=null; + try{ + result=tenantMapper.selectByPrimaryKey(id); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + public List getTenant(){ + TenantExample example = new TenantExample(); + List list=null; + try{ + list=tenantMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String loginName, String type, String enabled, int offset, int rows)throws Exception { + List list= new ArrayList<>(); + try{ + list = tenantMapperEx.selectByConditionTenant(loginName, type, enabled, offset, rows); + if (null != list) { + for (TenantEx tenantEx : list) { + tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime())); + tenantEx.setExpireTimeStr(Tools.getCenternTime(tenantEx.getExpireTime())); + } + } + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countTenant(String loginName, String type, String enabled)throws Exception { + Long result=null; + try{ + result=tenantMapperEx.countsByTenant(loginName, type, enabled); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertTenant(Tenant tenant, HttpServletRequest request)throws Exception { + tenant.setCreateTime(new Date()); + if(tenant.getUserNumLimit()==null) { + tenant.setUserNumLimit(userNumLimit); //默认用户限制数量 + } + if(tenant.getExpireTime()==null) { + tenant.setExpireTime(Tools.addDays(new Date(), tryDayLimit)); //租户允许试用的天数 + } + return tenantMapper.insert(tenant); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateTenant(Tenant tenant, HttpServletRequest request)throws Exception { + return tenantMapper.updateById(tenant); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteTenant(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result= tenantMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteTenant(String ids, HttpServletRequest request)throws Exception { + List idList = StringUtil.strToLongList(ids); + TenantExample example = new TenantExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result= tenantMapper.deleteByExample(example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + TenantExample example = new TenantExample(); + example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name); + List list=null; + try{ + list= tenantMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + + public Tenant getTenantByTenantId(long tenantId) { + Tenant tenant = new Tenant(); + TenantExample example = new TenantExample(); + example.createCriteria().andTenantIdEqualTo(tenantId); + List list = tenantMapper.selectByExample(example); + if(list.size()>0) { + tenant = list.get(0); + } + return tenant; + } + + public int batchSetStatus(Boolean status, String ids)throws Exception { + int result=0; + try{ + String statusStr =""; + if(status) { + statusStr ="批量启用"; + } else { + statusStr ="批量禁用"; + } + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).append("-").append(statusStr).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List idList = StringUtil.strToLongList(ids); + Tenant tenant = new Tenant(); + tenant.setEnabled(status); + TenantExample example = new TenantExample(); + example.createCriteria().andIdIn(idList); + result = tenantMapper.updateByExampleSelective(tenant, example); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitComponent.java new file mode 100644 index 00000000..ee4157ab --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitComponent.java @@ -0,0 +1,71 @@ +package com.zsw.erp.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "unit_component") +@UnitResource +public class UnitComponent implements ICommonQuery { + + @Resource + private UnitService unitService; + + @Override + public Object selectOne(Long id) throws Exception { + return unitService.getUnit(id); + } + + @Override + public List select(Map map)throws Exception { + return getUnitList(map); + } + + private List getUnitList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + return unitService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return unitService.countUnit(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return unitService.insertUnit(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return unitService.updateUnit(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return unitService.deleteUnit(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return unitService.batchDeleteUnit(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return unitService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitResource.java new file mode 100644 index 00000000..d1a9cfad --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.unit; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "unit") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UnitResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java new file mode 100644 index 00000000..8f4507f7 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/unit/UnitService.java @@ -0,0 +1,257 @@ +package com.zsw.erp.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.mappers.MaterialMapperEx; +import com.zsw.erp.datasource.mappers.UnitMapper; +import com.zsw.erp.datasource.mappers.UnitMapperEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.datasource.entities.Material; +import com.zsw.erp.datasource.entities.Unit; +import com.zsw.erp.datasource.entities.UnitExample; +import com.zsw.erp.datasource.entities.User; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class UnitService { + private Logger logger = LoggerFactory.getLogger(UnitService.class); + + @Resource + private UnitMapper unitMapper; + + @Resource + private UnitMapperEx unitMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private MaterialMapperEx materialMapperEx; + + public Unit getUnit(long id) throws Exception { + Unit result = null; + try { + result = unitMapper.selectByPrimaryKey(id); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + public List getUnitListByIds(String ids) throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try { + UnitExample example = new UnitExample(); + example.createCriteria().andIdIn(idList); + list = unitMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List getUnit() throws Exception { + UnitExample example = new UnitExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = unitMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public List select(String name, int offset, int rows) throws Exception { + List list = null; + try { + list = unitMapperEx.selectByConditionUnit(name, offset, rows); + } catch (Exception e) { + BoomException.readFail(e); + } + return list; + } + + public Long countUnit(String name) throws Exception { + Long result = null; + try { + result = unitMapperEx.countsByUnit(name); + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUnit(JSONObject obj, HttpServletRequest request) throws Exception { + Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class); + int result = 0; + try { + parseNameByUnit(unit); + result = unitMapper.insertSelective(unit); + logService.insertLog("计量单位", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(unit.getName()).toString(), request); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUnit(JSONObject obj, HttpServletRequest request) throws Exception { + Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class); + int result = 0; + try { + parseNameByUnit(unit); + result = unitMapper.updateByPrimaryKeySelective(unit); + if (unit.getRatioTwo() == null) { + unitMapperEx.updateRatioTwoById(unit.getId()); + } + if (unit.getRatioThree() == null) { + unitMapperEx.updateRatioThreeById(unit.getId()); + } + logService.insertLog("计量单位", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(unit.getName()).toString(), request); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + /** + * 根据单位信息生成名称的格式 + * + * @param unit + */ + private void parseNameByUnit(Unit unit) { + unit.setName(unit.getBasicUnit()); +// String unitName = unit.getBasicUnit() + "/" + "(" + unit.getOtherUnit() + "=" + unit.getRatio().toString() + unit.getBasicUnit() + ")"; +// if (StringUtil.isNotEmpty(unit.getOtherUnitTwo()) && unit.getRatioTwo() != null) { +// unitName += "/" + "(" + unit.getOtherUnitTwo() + "=" + unit.getRatioTwo().toString() + unit.getBasicUnit() + ")"; +// if (StringUtil.isNotEmpty(unit.getOtherUnitThree()) && unit.getRatioThree() != null) { +// unitName += "/" + "(" + unit.getOtherUnitThree() + "=" + unit.getRatioThree().toString() + unit.getBasicUnit() + ")"; +// } +// } +// unit.setName(unitName); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUnit(Long id, HttpServletRequest request) throws Exception { + return batchDeleteUnitByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnit(String ids, HttpServletRequest request) throws Exception { + return batchDeleteUnitByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnitByIds(String ids) throws Exception { + int result = 0; + String[] idArray = ids.split(","); + //校验产品表 jsh_material + List materialList = null; + try { + materialList = materialMapperEx.getMaterialListByUnitIds(idArray); + } catch (Exception e) { + BoomException.readFail(e); + } + if (materialList != null && materialList.size() > 0) { + logger.error("异常码[{}],异常提示[{}],参数,UnitIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, ExceptionConstants.DELETE_FORCE_CONFIRM_MSG, ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getUnitListByIds(ids); + for (Unit unit : list) { + sb.append("[").append(unit.getName()).append("]"); + } + logService.insertLog("计量单位", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = userService.getCurrentUser(); + //校验通过执行删除操作 + try { + result = unitMapperEx.batchDeleteUnitByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + } catch (Exception e) { + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) throws Exception { + UnitExample example = new UnitExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try { + list = unitMapper.selectByExample(example); + } catch (Exception e) { + BoomException.readFail(e); + } + return list == null ? 0 : list.size(); + } + + /** + * 根据条件查询单位id + * + * @param basicUnit + * @param otherUnit + * @param ratio + * @return + */ + public Long getUnitIdByParam(String basicUnit, String otherUnit, Integer ratio) { + Long unitId = null; + UnitExample example = new UnitExample(); + example.createCriteria() + .andBasicUnitEqualTo(basicUnit) +// .andOtherUnitEqualTo(otherUnit) +// .andRatioEqualTo(ratio) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = unitMapper.selectByExample(example); + if (list != null && list.size() > 0) { + unitId = list.get(0).getId(); + } + return unitId; + } + + /** + * 根据多单位的比例进行库存换算(保留两位小数) + * + * @param stock + * @param unitInfo + * @param materialUnit + * @return + */ + public BigDecimal parseStockByUnit(BigDecimal stock, Unit unitInfo, String materialUnit) { + if (materialUnit.equals(unitInfo.getOtherUnit()) && unitInfo.getRatio() != 0) { + stock = stock.divide(BigDecimal.valueOf(unitInfo.getRatio()), 2, BigDecimal.ROUND_HALF_UP); + } + if (materialUnit.equals(unitInfo.getOtherUnitTwo()) && unitInfo.getRatioTwo() != 0) { + stock = stock.divide(BigDecimal.valueOf(unitInfo.getRatioTwo()), 2, BigDecimal.ROUND_HALF_UP); + } + if (materialUnit.equals(unitInfo.getOtherUnitThree()) && unitInfo.getRatioThree() != 0) { + stock = stock.divide(BigDecimal.valueOf(unitInfo.getRatioThree()), 2, BigDecimal.ROUND_HALF_UP); + } + return stock; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java new file mode 100644 index 00000000..aeaa3994 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserComponent.java @@ -0,0 +1,73 @@ +package com.zsw.erp.service.user; + +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.ICommonQuery; +import com.zsw.erp.utils.Constants; +import com.zsw.erp.utils.QueryUtils; +import com.zsw.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Service(value = "user_component") +@UserResource +public class UserComponent implements ICommonQuery { + + @Resource + private UserService userService; + + @Override + public Object selectOne(Long id) throws Exception { + return userService.getUser(id); + } + + @Override + public List select(Map map)throws Exception { + return getUserList(map); + } + + private List getUserList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String userName = StringUtil.getInfo(search, "userName"); + String loginName = StringUtil.getInfo(search, "loginName"); + String order = QueryUtils.order(map); + String filter = QueryUtils.filter(map); + return userService.select(userName, loginName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String userName = StringUtil.getInfo(search, "userName"); + String loginName = StringUtil.getInfo(search, "loginName"); + return userService.countUser(userName, loginName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return userService.insertUser(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return userService.updateUser(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return userService.deleteUser(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return userService.batchDeleteUser(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return userService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java new file mode 100644 index 00000000..02fabb74 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.user; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "user") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java new file mode 100644 index 00000000..0f7b0b3e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/user/UserService.java @@ -0,0 +1,815 @@ +package com.zsw.erp.service.user; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.crypto.SecureUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.zsw.erp.datasource.entities.BtnDto; +import com.zsw.erp.datasource.dto.UserLoginDto; +import com.zsw.erp.service.redis.RedisService; +import com.zsw.erp.service.role.RoleService; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.constants.ExceptionConstants; +import com.zsw.erp.datasource.entities.*; +import com.zsw.erp.datasource.mappers.UserMapper; +import com.zsw.erp.datasource.mappers.UserMapperEx; +import com.zsw.erp.datasource.vo.TreeNodeEx; +import com.zsw.erp.exception.BusinessRunTimeException; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.orgaUserRel.OrgaUserRelService; +import com.zsw.erp.service.userBusiness.UserBusinessService; +import com.zsw.erp.utils.LocalUser; +import org.springframework.context.annotation.Lazy; +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.tenant.TenantService; +import com.zsw.erp.utils.ExceptionCodeConstants; +import com.zsw.erp.utils.StringUtil; +import com.zsw.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserService { + private Logger logger = LoggerFactory.getLogger(UserService.class); + + private static final String TEST_USER = "jsh"; + + @Value("${demonstrate.open}") + private boolean demonstrateOpen; + + @Resource + private UserMapper userMapper; + + @Resource + private UserMapperEx userMapperEx; + @Resource + @Lazy + private OrgaUserRelService orgaUserRelService; + @Resource + @Lazy + private LogService logService; + @Resource + private TenantService tenantService; + @Resource + private UserBusinessService userBusinessService; + @Resource + @Lazy + private RoleService roleService; + @Resource + private RedisService redisService; + + public User getUser(long id) { + User result=null; + result=userMapper.selectByPrimaryKey(id); + return result; + } + + public List getUserListByIds(String ids)throws Exception { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + UserExample example = new UserExample(); + example.createCriteria().andIdIn(idList); + list = userMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getUser()throws Exception { + UserExample example = new UserExample(); + example.createCriteria().andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list=null; + try{ + list=userMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List select(String userName, String loginName, int offset, int rows)throws Exception { + List list=null; + try{ + list=userMapperEx.selectByConditionUser(userName, loginName, offset, rows); + for(UserEx ue: list){ + String userType = ""; + if(demonstrateOpen && TEST_USER.equals(ue.getLoginName())){ + userType = "演示用户"; + } else { + if (ue.getId().equals(ue.getTenantId())) { + userType = "租户"; + } else if(ue.getTenantId() == null){ + userType = "超管"; + } else { + userType = "普通"; + } + } + ue.setUserType(userType); + } + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public Long countUser(String userName, String loginName) { + Long result=null; + try{ + result=userMapperEx.countsByUser(userName, loginName); + }catch(Exception e){ + BoomException.readFail(e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:30 + * @Param: beanJson +  * @Param: request + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUser(JSONObject obj, HttpServletRequest request)throws Exception { + User user = JSONObject.parseObject(obj.toJSONString(), User.class); + String password = "123456"; + //因密码用MD5加密,需要对密码进行转化 + try { + password = Tools.md5Encryp(password); + user.setPassword(password); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + logger.error(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage()); + } + int result=0; + try{ + result=userMapper.insert(user); + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(user.getLoginName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:31 + * @Param: beanJson +  * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUser(JSONObject obj, HttpServletRequest request) throws Exception{ + User user = JSONObject.parseObject(obj.toJSONString(), User.class); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getLoginName()).toString(), request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:32 + * @Param: user + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUserByObj(User user) throws Exception{ + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:33 + * @Param: md5Pwd +  * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int resetPwd(String md5Pwd, Long id) throws Exception{ + int result=0; + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User u = getUser(id); + String loginName = u.getLoginName(); + if("admin".equals(loginName)){ + logger.info("禁止重置超管密码"); + } else { + User user = new User(); + user.setId(id); + user.setPassword(md5Pwd); + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + BoomException.writeFail(e); + } + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUser(Long id, HttpServletRequest request)throws Exception { + return batDeleteUser(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUser(String ids, HttpServletRequest request)throws Exception { + return batDeleteUser(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batDeleteUser(String ids) throws Exception{ + int result=0; + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getUserListByIds(ids); + for(User user: list){ + if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){ + logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", + ExceptionConstants.USER_LIMIT_DELETE_CODE,ExceptionConstants.USER_LIMIT_DELETE_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_DELETE_CODE, + ExceptionConstants.USER_LIMIT_DELETE_MSG); + } + if(user.getId().equals(user.getTenantId())) { + logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", + ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE,ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE, + ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG); + } + sb.append("[").append(user.getLoginName()).append("]"); + } + logService.insertLog("用户", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + String idsArray[]=ids.split(","); + try{ + result=userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE); + }catch(Exception e){ + BoomException.writeFail(e); + } + if(result<1){ + logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", + ExceptionConstants.USER_DELETE_FAILED_CODE,ExceptionConstants.USER_DELETE_FAILED_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.USER_DELETE_FAILED_CODE, + ExceptionConstants.USER_DELETE_FAILED_MSG); + } + return result; + } + + public UserLoginDto validateUser(String loginName, String password) { + /**默认是可以登录的*/ + try { + User user = userMapper.selectOne(Wrappers.lambdaQuery().eq(User::getLoginName, loginName)); + if (user == null) { + //return UserLoginDto.builder().userStatus(ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST).build(); + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST); + } else { + if(user.getStatus()!=0) { + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.BLACK_USER); + } + Long tenantId = user.getTenantId(); + Tenant tenant = tenantService.getTenantByTenantId(tenantId); + if(tenant!=null) { + if(tenant.getEnabled()!=null && !tenant.getEnabled()) { + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT); + } + if(tenant.getExpireTime()!=null && tenant.getExpireTime().getTime()>>>>>>>访问验证用户姓名是否存在后台信息异常", e); + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION); + } + try { + LambdaQueryWrapper wrap = Wrappers.lambdaQuery().eq(User::getLoginName, loginName) + .eq(User::getPassword, SecureUtil.md5(password)) + .eq(User::getStatus, BusinessConstants.USER_STATUS_NORMAL); + User user = userMapper.selectOne(wrap); + if (null == user) { + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR); + } + UserLoginDto dto = UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT); + dto.setUser(user); + return dto; + } catch (Exception e) { + logger.error(">>>>>>>>>>访问验证用户密码后台信息异常", e); + return UserLoginDto.buildStatus(ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION); + } + } + + public User getUserByLoginName(String loginName)throws Exception { + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + User user =null; + if(list!=null&&list.size()>0){ + user = list.get(0); + } + return user; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + UserExample example = new UserExample(); + List userStatus=new ArrayList(); + userStatus.add(BusinessConstants.USER_STATUS_DELETE); + userStatus.add(BusinessConstants.USER_STATUS_BANNED); + example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name).andStatusNotIn(userStatus); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + BoomException.readFail(e); + } + return list==null?0:list.size(); + } + /** + * create by: cjl + * description: + * 获取当前用户信息 + * create time: 2019/1/24 10:01 + * @Param: + * @return com.jsh.erp.datasource.entities.User + */ + public User getCurrentUser(){ + Long userId = LocalUser.getUserId(); + return getUser(userId); + } + + /** + * 检查当前用户是否是演示用户 + * @return + */ + public Boolean checkIsTestUser() throws Exception{ + Boolean result = false; + try { + if (demonstrateOpen) { + User user = getCurrentUser(); + if (TEST_USER.equals(user.getLoginName())) { + result = true; + } + } + } catch (Exception e) { + BoomException.readFail(e); + } + return result; + } + + /** + * 根据用户名查询id + * @param loginName + * @return + */ + public Long getIdByLoginName(String loginName) { + Long userId = 0L; + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list = userMapper.selectByExample(example); + if(list!=null) { + userId = list.get(0).getId(); + } + return userId; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addUserAndOrgUserRel(UserEx ue, HttpServletRequest request) throws Exception{ + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_ADD, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //检查用户名和登录名 + checkUserNameAndLoginName(ue); + //新增用户信息 + ue= this.addUser(ue); + if(ue==null){ + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.USER_ADD_FAILED_CODE,ExceptionConstants.USER_ADD_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.USER_ADD_FAILED_CODE, + ExceptionConstants.USER_ADD_FAILED_MSG); + } + //用户id,根据用户名查询id + Long userId = getIdByLoginName(ue.getLoginName()); + if(ue.getRoleId()!=null){ + UserBusiness userBusiness = new UserBusiness(); + userBusiness.setType("UserRole"); + userBusiness.setKeyId(userId.toString()); + userBusiness.setValue(Lists.newArrayList(ue.getRoleId())); + userBusinessService.insertUserBusiness(userBusiness, request); + } + if(ue.getOrgaId()==null){ + //如果没有选择机构,就不建机构和用户的关联关系 + return; + } + //新增用户和机构关联关系 + OrgaUserRel oul=new OrgaUserRel(); + //机构id + oul.setOrgaId(ue.getOrgaId()); + oul.setUserId(userId); + //用户在机构中的排序 + oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); + oul=orgaUserRelService.addOrgaUserRel(oul); + if(oul==null){ + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE,ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE, + ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); + } + } + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx addUser(UserEx ue) throws Exception{ + /** + * 新增用户默认设置 + * 1、密码默认123456 + * 2是否系统自带默认为非系统自带 + * 3是否管理者默认为员工 + * 4默认用户状态为正常 + * */ + ue.setPassword(Tools.md5Encryp(BusinessConstants.USER_DEFAULT_PASSWORD)); + ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); + if(ue.getIsmanager()==null){ + ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); + } + ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); + int result=0; + try{ + result= userMapper.insert(ue); + }catch(Exception e){ + BoomException.writeFail(e); + } + if(result>0){ + return ue; + } + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx registerUser(UserEx ue, Integer manageRoleId, HttpServletRequest request) throws Exception{ + /** + * create by: qiankunpingtai + * create time: 2019/4/9 18:00 + * 多次创建事务,事物之间无法协同,应该在入口处创建一个事务以做协调 + */ + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + ue.setPassword(SecureUtil.md5(ue.getPassword())); + ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); + if (ue.getIsmanager() == null) { + ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); + } + ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); + int result=0; + try{ + result= userMapper.insert(ue); + Long userId = getIdByLoginName(ue.getLoginName()); + ue.setId(userId); + }catch(Exception e){ + BoomException.writeFail(e); + } + //更新租户id + User user = new User(); + user.setId(ue.getId()); + user.setTenantId(ue.getTenantId()); + this.updateUserTenant(user); + //新增用户与角色的关系 + UserBusiness userBusiness = new UserBusiness(); + userBusiness.setType("UserRole"); + userBusiness.setKeyId(ue.getId().toString()); + userBusiness.setValue(Lists.newArrayList(manageRoleId)); + userBusiness.setTenantId(ue.getTenantId() != null ? ue.getTenantId() :ue.getId()); + userBusinessService.insertUserBusiness(userBusiness, null); + //创建租户信息 + Tenant tenant = new Tenant(); + tenant.setTenantId(ue.getTenantId() != null ? ue.getTenantId() :ue.getId()); + tenant.setLoginName(ue.getLoginName()); + tenant.setUserNumLimit(ue.getUserNumLimit()); + tenant.setExpireTime(DateUtil.parse(ue.getExpireTime(), DatePattern.NORM_DATETIME_PATTERN)); + tenant.setRemark(ue.getRemark()); + tenantService.insertTenant(tenant, request); + logger.info("===============创建租户信息完成==============="); + if (result > 0) { + return ue; + } + return null; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateUserTenant(User user) throws Exception{ + UserExample example = new UserExample(); + example.createCriteria().andIdEqualTo(user.getId()); + try{ + userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + BoomException.writeFail(e); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateUserAndOrgUserRel(UserEx ue, HttpServletRequest request) throws Exception{ + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + if(demonstrateOpen && ue.getLoginName().equals(TEST_USER)){ + logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]", + ExceptionConstants.USER_LIMIT_UPDATE_CODE,ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER); + throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE, + ExceptionConstants.USER_LIMIT_UPDATE_MSG); + } + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //检查用户名和登录名 + checkUserNameAndLoginName(ue); + //更新用户信息 + ue = this.updateUser(ue); + if (ue == null) { + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.USER_EDIT_FAILED_CODE, ExceptionConstants.USER_EDIT_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.USER_EDIT_FAILED_CODE, + ExceptionConstants.USER_EDIT_FAILED_MSG); + } + if(ue.getRoleId()!=null){ + UserBusiness ub = userBusinessService.getBasicData(ue.getId(), "UserRole"); + Long ubId = userBusinessService.checkIsValueExist("UserRole", ue.getId().toString()); + if(ubId!=null) { + ub.setValue(Lists.newArrayList(ue.getRoleId())); + userBusinessService.updateUserBusiness(ub, request); + } else { + ub = new UserBusiness(); + ub.setType("UserRole"); + ub.setKeyId(ue.getId().toString()); + ub.setValue(Lists.newArrayList(ue.getRoleId())); + userBusinessService.insertUserBusiness(ub, request); + } + } + if (ue.getOrgaId() == null) { + //如果没有选择机构,就不建机构和用户的关联关系 + return; + } + //更新用户和机构关联关系 + OrgaUserRel oul = new OrgaUserRel(); + //机构和用户关联关系id + oul.setId(ue.getOrgaUserRelId()); + //机构id + oul.setOrgaId(ue.getOrgaId()); + //用户id + oul.setUserId(ue.getId()); + //用户在机构中的排序 + oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); + if (oul.getId() != null) { + //已存在机构和用户的关联关系,更新 + oul = orgaUserRelService.updateOrgaUserRel(oul); + } else { + //不存在机构和用户的关联关系,新建 + oul = orgaUserRelService.addOrgaUserRel(oul); + } + if (oul == null) { + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, + ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); + } + } + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx updateUser(UserEx ue)throws Exception{ + int result =0; + try{ + result=userMapper.updateByPrimaryKeySelective(ue); + }catch(Exception e){ + BoomException.writeFail(e); + } + if(result>0){ + return ue; + } + return null; + } + /** + * create by: cjl + * description: + * 检查用户名称和登录名不能重复 + * create time: 2019/3/12 11:36 + * @Param: userEx + * @return void + */ + public void checkUserNameAndLoginName(UserEx userEx)throws Exception{ + List list=null; + if(userEx==null){ + return; + } + Long userId=userEx.getId(); + //检查登录名 + if(!StringUtils.isEmpty(userEx.getLoginName())){ + String loginName=userEx.getLoginName(); + list=this.getUserListByloginName(loginName); + if(list!=null&&list.size()>0){ + if(list.size()>1){ + //超过一条数据存在,该登录名已存在 + logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); + throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); + } + //一条数据,新增时抛出异常,修改时和当前的id不同时抛出异常 + if(list.size()==1){ + if(userId==null||(userId!=null&&!userId.equals(list.get(0).getId()))){ + logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); + throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); + } + } + + } + } + //检查用户名 + if(!StringUtils.isEmpty(userEx.getUsername())){ + String userName=userEx.getUsername(); + list=this.getUserListByUserName(userName); + if(list!=null&&list.size()>0){ + if(list.size()>1){ + //超过一条数据存在,该用户名已存在 + logger.error("异常码[{}],异常提示[{}],参数,userName:[{}]", + ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG,userName); + throw new BusinessRunTimeException(ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG); + } + //一条数据,新增时抛出异常,修改时和当前的id不同时抛出异常 + if(list.size()==1){ + if(userId==null||(userId!=null&&!userId.equals(list.get(0).getId()))){ + logger.error("异常码[{}],异常提示[{}],参数,userName:[{}]", + ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG,userName); + throw new BusinessRunTimeException(ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_USER_NAME_ALREADY_EXISTS_MSG); + } + } + + } + } + + } + /** + * 通过用户名获取用户列表 + * */ + public List getUserListByUserName(String userName)throws Exception{ + List list =null; + try{ + list=userMapperEx.getUserListByUserNameOrLoginName(userName,null); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + /** + * 通过登录名获取用户列表 + * */ + public List getUserListByloginName(String loginName){ + List list =null; + try{ + list=userMapperEx.getUserListByUserNameOrLoginName(null,loginName); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + public List getOrganizationUserTree()throws Exception { + List list =null; + try{ + list=userMapperEx.getNodeTree(); + }catch(Exception e){ + BoomException.readFail(e); + } + return list; + } + + /** + * 根据用户id查询角色类型 + * @param userId + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String getRoleTypeByUserId(long userId) throws Exception { + if (userId == 1L || userId == 2L){ + return "全部数据"; + } + UserBusiness ub = userBusinessService.getBasicData(userId, "UserRole"); + List values = ub.getValue(); + Role role = roleService.getRole(values.get(0).longValue()); + if(role!=null) { + return role.getType(); + } else { + return null; + } + } + + /** + * 获取用户id + * @param request + * @return + */ + public Long getUserId(HttpServletRequest request) throws Exception{ + Object userIdObj = redisService.getObjectFromSessionByKey(request,"userId"); + Long userId = null; + if(userIdObj != null) { + userId = Long.parseLong(userIdObj.toString()); + } + return userId; + } + + /** + * 用户的按钮权限 + * @param userId + * @return + * @throws Exception + */ + public List getBtnStrArrById(Long userId) { + UserBusiness ub = userBusinessService.getBasicData(userId, "UserRole"); + List roleValue = ub.getValue(); + if(ObjectUtil.isNotEmpty(roleValue)){ + UserBusiness fun = userBusinessService.getBasicData(roleValue.get(0).longValue(), "RoleFunctions"); + return fun.getBtnStr(); + } + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Byte status, String ids)throws Exception { + int result=0; + List list = getUserListByIds(ids); + for(User user: list) { + if (demonstrateOpen && user.getLoginName().equals(TEST_USER)) { + logger.error("异常码[{}],异常提示[{}],参数,obj:[{}]", + ExceptionConstants.USER_LIMIT_UPDATE_CODE, ExceptionConstants.USER_LIMIT_UPDATE_MSG, TEST_USER); + throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_UPDATE_CODE, + ExceptionConstants.USER_LIMIT_UPDATE_MSG); + } + } + String statusStr =""; + if(status == 0) { + statusStr ="批量启用"; + } else if(status == 2) { + statusStr ="批量禁用"; + } + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).append("-").append(statusStr).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List idList = StringUtil.strToLongList(ids); + User user = new User(); + user.setStatus(status); + UserExample example = new UserExample(); + example.createCriteria().andIdIn(idList); + result = userMapper.updateByExampleSelective(user, example); + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java new file mode 100644 index 00000000..c7d083bb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessComponent.java @@ -0,0 +1,67 @@ +package com.zsw.erp.service.userBusiness; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.UserBusiness; +import com.zsw.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "userBusiness_component") +@UserBusinessResource +public class UserBusinessComponent implements ICommonQuery { + + @Resource + private UserBusinessService userBusinessService; + + @Override + public Object selectOne(Long id) throws Exception { + return userBusinessService.getUserBusiness(id); + } + + @Override + public List select(Map map)throws Exception { + return getUserBusinessList(map); + } + + private List getUserBusinessList(Map map)throws Exception { + return null; + } + + @Override + public Long counts(Map map)throws Exception { + return BusinessConstants.DEFAULT_LIST_NULL_NUMBER; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception { + return userBusinessService.insertUserBusiness(JSON.parseObject(obj.toJSONString(),UserBusiness.class), request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return userBusinessService.updateUserBusiness(JSON.parseObject(obj.toJSONString(),UserBusiness.class), request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return userBusinessService.deleteUserBusiness(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return userBusinessService.batchDeleteUserBusiness(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return userBusinessService.checkIsNameExist(id, name); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java new file mode 100644 index 00000000..500ab84f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessResource.java @@ -0,0 +1,13 @@ +package com.zsw.erp.service.userBusiness; + +import com.zsw.erp.service.ResourceInfo; + +import java.lang.annotation.*; + + +@ResourceInfo(value = "userBusiness") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserBusinessResource { +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java new file mode 100644 index 00000000..d5b8dba2 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/userBusiness/UserBusinessService.java @@ -0,0 +1,163 @@ +package com.zsw.erp.service.userBusiness; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.zsw.erp.constants.BusinessConstants; +import com.zsw.erp.datasource.entities.BtnDto; +import com.zsw.erp.datasource.mappers.UserBusinessMapper; +import com.zsw.erp.datasource.mappers.UserBusinessMapperEx; +import com.zsw.erp.exception.BoomException; +import com.zsw.erp.service.log.LogService; +import com.zsw.erp.service.user.UserService; +import com.zsw.erp.utils.Tools; +import com.zsw.erp.datasource.entities.User; +import com.zsw.erp.datasource.entities.UserBusiness; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class UserBusinessService { + private Logger logger = LoggerFactory.getLogger(UserBusinessService.class); + + @Resource + private UserBusinessMapper userBusinessMapper; + @Resource + private UserBusinessMapperEx userBusinessMapperEx; + @Resource + private LogService logService; + @Resource + @Lazy + private UserService userService; + + + public UserBusiness getUserBusiness(long id)throws Exception { + return userBusinessMapper.selectById(id); + } + + public List getUserBusiness(){ + return userBusinessMapper.selectList(Wrappers.lambdaQuery() + .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUserBusiness(UserBusiness userBusiness, HttpServletRequest request) throws Exception { + int result=0; + try{ + String token = ""; + if(request!=null) { + token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if(tenantId!=0L) { + userBusiness.setTenantId(tenantId); + } + } + result=userBusinessMapper.insert(userBusiness); + logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUserBusiness(UserBusiness userBusiness, HttpServletRequest request) throws Exception { + int result=0; + try{ + result = userBusinessMapper.updateById(userBusiness); + logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_EDIT, request); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUserBusiness(Long id, HttpServletRequest request)throws Exception { + return batchDeleteUserBusinessByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusiness(String ids, HttpServletRequest request)throws Exception { + return batchDeleteUserBusinessByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusinessByIds(String ids) throws Exception{ + logService.insertLog("关联关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result= userBusinessMapperEx.batchDeleteUserBusinessByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + return 1; + } + + public UserBusiness getBasicData(Long keyId, String type){ + return userBusinessMapper.selectOne(Wrappers.lambdaQuery() + .eq(UserBusiness::getType, type) + .eq(UserBusiness::getKeyId,keyId) + .eq(UserBusiness::getDeleteFlag, BusinessConstants.DELETE_FLAG_EXISTS)); + } + + public List getListBy(String keyId, String type){ + return userBusinessMapper.selectList(Wrappers.lambdaQuery() + .eq(UserBusiness::getKeyId,keyId) + .eq(UserBusiness::getType,type) + .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); + } + + public List getUBValueByTypeAndKeyId(String type, Long keyId) throws Exception { + List list = Lists.newArrayList(); + UserBusiness ubList = getBasicData(keyId, type); + if (ubList == null){ + return null; + } + return ubList.getValue().stream().map(Number::longValue).collect(Collectors.toList()); + } + + public Long checkIsValueExist(String type, String keyId)throws Exception { + UserBusiness business = userBusinessMapper.selectOne(Wrappers.lambdaQuery() + .eq(UserBusiness::getKeyId,keyId) + .eq(UserBusiness::getType,type) + .eq(UserBusiness::getDeleteFlag,BusinessConstants.DELETE_FLAG_EXISTS)); + return business==null ? null : business.getId(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateBtnStr(String keyId, String type, List btnStr) throws Exception{ + logService.insertLog("关联关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append("角色的按钮权限").toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + UserBusiness userBusiness = new UserBusiness(); + userBusiness.setBtnStr(btnStr); + int result=0; + try{ + result= userBusinessMapper.update(userBusiness, + Wrappers.lambdaUpdate() + .eq(UserBusiness::getType,type) + .eq(UserBusiness::getKeyId,keyId)); + }catch(Exception e){ + BoomException.writeFail(e); + } + return result; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/service/zyh/BomService.java b/zsw-erp/src/main/java/com/zsw/erp/service/zyh/BomService.java new file mode 100644 index 00000000..f5ce0932 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/service/zyh/BomService.java @@ -0,0 +1,17 @@ +package com.zsw.erp.service.zyh; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsw.erp.datasource.entities.Bom; +import com.zsw.erp.datasource.mappers.BomMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@Transactional(value = "transactionManager", rollbackFor = Exception.class) +public class BomService extends ServiceImpl { + + + + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/AnnotationUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/AnnotationUtils.java new file mode 100644 index 00000000..c8c7769a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/AnnotationUtils.java @@ -0,0 +1,26 @@ +package com.zsw.erp.utils; + +import java.lang.annotation.Annotation; +import java.lang.annotation.Documented; + + +public class AnnotationUtils { + public static A getAnnotation(Class cls, Class annotationClass) { + A res = cls.getAnnotation(annotationClass); + if (res == null) { + for (Annotation annotation : cls.getAnnotations()) { + if (annotation instanceof Documented) { + break; + } + res = getAnnotation(annotation.annotationType(), annotationClass); + if (res != null) + break; + } + } + return res; + } + + public static A getAnnotation(T obj, Class annotationClass) { + return getAnnotation(obj.getClass(), annotationClass); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ColumnPropertyUtil.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ColumnPropertyUtil.java new file mode 100644 index 00000000..75881b5b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ColumnPropertyUtil.java @@ -0,0 +1,63 @@ +package com.zsw.erp.utils; + + +public class ColumnPropertyUtil { + + /** + * 将数据库字段转换成属性 + */ + public static String columnToProperty(String column) { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (StringUtil.isEmpty(column)) { + // 没必要转换 + return ""; + } else if (!column.contains("_")) { + // 不做转换 + return column; + } else { + // 用下划线将原始字符串分割 + String[] columns = column.split("_"); + for (String columnSplit : columns) { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (StringUtil.isEmpty(columnSplit)) { + continue; + } + // 处理真正的驼峰片段 + if (result.length() == 0) { + // 第一个驼峰片段,全部字母都小写 + result.append(columnSplit.toLowerCase()); + } else { + // 其他的驼峰片段,首字母大写 + result.append(columnSplit.substring(0, 1).toUpperCase()).append(columnSplit.substring(1).toLowerCase()); + } + } + return result.toString(); + } + + } + + + /** + * 驼峰转换下划线 + */ + public static String propertyToColumn(String property) { + if (StringUtil.isEmpty(property)) { + return ""; + } + StringBuilder column = new StringBuilder(); + column.append(property.substring(0, 1).toLowerCase()); + for (int i = 1; i < property.length(); i++) { + String s = property.substring(i, i + 1); + // 在小写字母前添加下划线 + if (!Character.isDigit(s.charAt(0)) && s.equals(s.toUpperCase())) { + column.append("_"); + } + // 其他字符直接转成小写 + column.append(s.toLowerCase()); + } + + return column.toString(); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ComputerInfo.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ComputerInfo.java new file mode 100644 index 00000000..732e4a57 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ComputerInfo.java @@ -0,0 +1,155 @@ +package com.zsw.erp.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/* + * <取网卡物理地址-- + * 1.在Windows,Linux系统下均可用; + * 2.通过ipconifg,ifconfig获得计算机信息; + * 3.再用模式匹配方式查找MAC地址,与操作系统的语言无关> + * + * //* Description: <取计算机名--从环境变量中取> + * abstract 限制继承/创建实例 + */ +public abstract class ComputerInfo { + private static String macAddressStr = null; + private static String computerName = System.getenv().get("COMPUTERNAME"); + + private static final String[] windowsCommand = { "ipconfig", "/all" }; + private static final String[] linuxCommand = { "/sbin/ifconfig", "-a" }; + private static final Pattern macPattern = Pattern.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", + Pattern.CASE_INSENSITIVE); + + /** + * 获取多个网卡地址 + * + * @return + * @throws IOException + */ + private final static List getMacAddressList() throws IOException { + final ArrayList macAddressList = new ArrayList(); + final String os = System.getProperty("os.name"); + final String command[]; + + if (os.startsWith("Windows")) { + command = windowsCommand; + } else if (os.startsWith("Linux")) { + command = linuxCommand; + } else { + throw new IOException("Unknow operating system:" + os); + } + // 执行命令 + final Process process = Runtime.getRuntime().exec(command); + + BufferedReader bufReader = new BufferedReader(new InputStreamReader(process.getInputStream())); + for (String line = null; (line = bufReader.readLine()) != null;) { + Matcher matcher = macPattern.matcher(line); + if (matcher.matches()) { + macAddressList.add(matcher.group(1)); + // macAddressList.add(matcher.group(1).replaceAll("[-:]", + // ""));//去掉MAC中的“-” + } + } + + process.destroy(); + bufReader.close(); + return macAddressList; + } + + /** + * 获取一个网卡地址(多个网卡时从中获取一个) + * + * @return + */ + public static String getMacAddress() { + if (macAddressStr == null || macAddressStr.equals("")) { + StringBuffer sb = new StringBuffer(); // 存放多个网卡地址用,目前只取一个非0000000000E0隧道的值 + try { + List macList = getMacAddressList(); + for (Iterator iter = macList.iterator(); iter.hasNext();) { + String amac = iter.next(); + if (!amac.equals("0000000000E0")) { + sb.append(amac); + break; + } + } + } catch (IOException e) { + e.printStackTrace(); + } + + macAddressStr = sb.toString(); + + } + + return macAddressStr; + } + + /** + * 获取电脑名 + * + * @return + */ + public static String getComputerName() { + if (computerName == null || computerName.equals("")) { + computerName = System.getenv().get("COMPUTERNAME"); + } + return computerName; + } + + /** + * 获取客户端IP地址 + * + * @return + */ + public static String getIpAddrAndName() throws IOException { + return InetAddress.getLocalHost().toString(); + } + + /** + * 获取客户端IP地址 + * + * @return + */ + public static String getIpAddr() throws IOException { + return InetAddress.getLocalHost().getHostAddress().toString(); + } + + /** + * 获取电脑唯一标识 + * + * @return + */ + public static String getComputerID() { + String id = getMacAddress(); + if (id == null || id.equals("")) { + try { + id = getIpAddrAndName(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return computerName; + } + + /** + * 限制创建实例 + */ + private ComputerInfo() { + + } + + public static void main(String[] args) throws IOException { + System.out.println(ComputerInfo.getMacAddress()); + System.out.println(ComputerInfo.getComputerName()); + System.out.println(ComputerInfo.getIpAddr()); + System.out.println(ComputerInfo.getIpAddrAndName()); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/Constants.java b/zsw-erp/src/main/java/com/zsw/erp/utils/Constants.java new file mode 100644 index 00000000..70098e6e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/Constants.java @@ -0,0 +1,29 @@ +package com.zsw.erp.utils; + +public class Constants { + + //查询参数 + public final static String PAGE_SIZE = "pageSize"; + public final static String CURRENT_PAGE = "currentPage"; + public final static String ORDER = "order"; + public final static String FILTER = "filter"; + public final static String SPLIT = ","; + public final static String SEARCH = "search"; + public final static String DEVICE_ID = "deviceId"; + public final static String OFFSET = "offset"; + public final static String ROWS = "rows"; + public final static String IS_RECURSION = "isRecursion"; + public final static String IS_RECURSION_VALUE = "1"; + public final static String IS_QUERYBYNODEID = "isquerybyid"; + public final static String IS_QUERYBYNODEID_VALUE = "1"; + + //级联类别 + public final static String TYPE = "type"; + + //转发 + public final static String TEAM = "team"; + + //增加了角色等级常量 + public final static String LEVEL="level"; + +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java new file mode 100644 index 00000000..41bb9730 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/DozerUtils.java @@ -0,0 +1,37 @@ +package com.zsw.erp.utils; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.extra.spring.EnableSpringUtil; +import com.github.dozermapper.core.Mapper; +import com.github.dozermapper.core.DozerBeanMapperBuilder; +import lombok.experimental.UtilityClass; +import org.springframework.stereotype.Component; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +@Component +public class DozerUtils { + + private final Mapper mapper; + + public DozerUtils() { + mapper = DozerBeanMapperBuilder.buildDefault(); + } + + public T convert(Object source, Class targetClass){ + return mapper.map(source,targetClass); + } + + public List convertList(Collection source, Class targetClass){ + if (ObjectUtil.isEmpty(source)){ + return null; + } + return source.stream() + .filter(ObjectUtil::isNotEmpty) + .map(e -> mapper.map(e, targetClass)) + .collect(Collectors.toList()); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ErpInfo.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ErpInfo.java new file mode 100644 index 00000000..f75afd7b --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ErpInfo.java @@ -0,0 +1,37 @@ +package com.zsw.erp.utils; + +/** + * + */ +public enum ErpInfo { + //通过构造传递参数 + OK(200, "成功"), + BAD_REQUEST(400, "请求错误或参数错误"), + UNAUTHORIZED(401, "未认证用户"), + INVALID_VERIFY_CODE(461, "错误的验证码"), + ERROR(500, "服务内部错误"), + WARING_MSG(201, "提醒信息"), + REDIRECT(301, "session失效,重定向"), + FORWARD_REDIRECT(302, "转发请求session失效"), + FORWARD_FAILED(303, "转发请求失败!"), + TEST_USER(-1, "演示用户禁止操作"); + + public final int code; + public final String name; + + public int getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 定义枚举构造函数 + */ + ErpInfo(int code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ExcelUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ExcelUtils.java new file mode 100644 index 00000000..55d77a96 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ExcelUtils.java @@ -0,0 +1,244 @@ +package com.zsw.erp.utils; + +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.springframework.util.StringUtils; +import jxl.Cell; +import jxl.Sheet; +import jxl.Workbook; +import jxl.format.*; +import jxl.write.Label; +import jxl.write.WritableCellFormat; +import jxl.write.WritableFont; +import jxl.write.WritableSheet; +import jxl.write.WritableWorkbook; + +public class ExcelUtils { + + public static WritableFont arial14font = null; + + public static File exportObjects(String fileName, String[] names, + String title, List objects) throws Exception { + File excelFile = new File("fileName.xls"); + WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); + WritableSheet sheet = wtwb.createSheet(title, 0); + sheet.getSettings().setDefaultColumnWidth(20); + WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15); + WritableCellFormat format = new WritableCellFormat(wfont); + WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + jxl.format.Colour.BLACK); + WritableCellFormat wcfFC = new WritableCellFormat(wfc); + wcfFC.setAlignment(Alignment.CENTRE); + wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE); + // CellView cellView = new CellView(); + // cellView.setAutosize(true); //设置自动大小 + format.setAlignment(Alignment.LEFT); + format.setVerticalAlignment(VerticalAlignment.TOP); + sheet.mergeCells(0, 0, names.length - 1, 0); + sheet.addCell(new Label(0, 0, title, wcfFC)); + int rowNum = 2; + for (int i = 0; i < names.length; i++) { + sheet.addCell(new Label(i, 1, names[i], format)); + } + for (int j = 0; j < objects.size(); j++) { + String[] obj = objects.get(j); + for (int h = 0; h < obj.length; h++) { + sheet.addCell(new Label(h, rowNum, obj[h], format)); + } + rowNum = rowNum + 1; + + } + wtwb.write(); + wtwb.close(); + return excelFile; + } + + /** + * 导出excel,不需要第一行的title + * + * @param fileName + * @param names + * @param title + * @param objects + * @return + * @throws Exception + */ + public static File exportObjectsWithoutTitle(String fileName, + String[] names, String title, List objects) + throws Exception { + File excelFile = new File(fileName); + WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); + WritableSheet sheet = wtwb.createSheet(title, 0); + sheet.getSettings().setDefaultColumnWidth(20); + + // 第一行的格式 + WritableFont wfc = new WritableFont(WritableFont.ARIAL, 15, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + jxl.format.Colour.BLACK); + WritableCellFormat wcfFC = new WritableCellFormat(wfc); + wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE); + + // 设置字体以及单元格格式 + WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15); + WritableCellFormat format = new WritableCellFormat(wfont); + format.setAlignment(Alignment.LEFT); + format.setVerticalAlignment(VerticalAlignment.TOP); + + // 第一行写入标题 + for (int i = 0; i < names.length; i++) { + sheet.addCell(new Label(i, 0, names[i], wcfFC)); + } + + // 其余行依次写入数据 + int rowNum = 1; + for (int j = 0; j < objects.size(); j++) { + String[] obj = objects.get(j); + for (int h = 0; h < obj.length; h++) { + sheet.addCell(new Label(h, rowNum, obj[h], format)); + } + rowNum = rowNum + 1; + } + wtwb.write(); + wtwb.close(); + return excelFile; + } + + public static String createTempFile(String[] names, String title, List objects) throws Exception { + File excelFile = File.createTempFile(System.currentTimeMillis() + "", ".xls"); + WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); + WritableSheet sheet = wtwb.createSheet(title, 0); + sheet.getSettings().setDefaultColumnWidth(20); + WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15); + WritableCellFormat format = new WritableCellFormat(wfont); + WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + jxl.format.Colour.BLACK); + WritableCellFormat wcfFC = new WritableCellFormat(wfc); + wcfFC.setAlignment(Alignment.CENTRE); + wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE); + // CellView cellView = new CellView(); + // cellView.setAutosize(true); //设置自动大小 + format.setAlignment(Alignment.LEFT); + format.setVerticalAlignment(VerticalAlignment.TOP); + sheet.mergeCells(0, 0, names.length - 1, 0); + sheet.addCell(new Label(0, 0, title, wcfFC)); + int rowNum = 2; + for (int i = 0; i < names.length; i++) { + sheet.addCell(new Label(i, 1, names[i], format)); + } + for (int j = 0; j < objects.size(); j++) { + String[] obj = objects.get(j); + for (int h = 0; h < obj.length; h++) { + sheet.addCell(new Label(h, rowNum, obj[h], format)); + } + rowNum = rowNum + 1; + } + wtwb.write(); + wtwb.close(); + return excelFile.getName(); + } + + public static String createCheckRandomTempFile(String[] names, String title, List objects,Map infoMap) throws Exception { + File excelFile = File.createTempFile(System.currentTimeMillis() + "", ".xls"); + WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); + WritableSheet sheet = wtwb.createSheet(title, 0); + sheet.getSettings().setDefaultColumnWidth(20); + WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 14); + + WritableCellFormat format = new WritableCellFormat(wfont); + format.setBorder(Border.ALL, BorderLineStyle.THIN); + format.setAlignment(Alignment.CENTRE); + format.setVerticalAlignment(VerticalAlignment.CENTRE); + + WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + jxl.format.Colour.BLACK); + WritableCellFormat wcfFC = new WritableCellFormat(wfc); + wcfFC.setAlignment(Alignment.LEFT); + wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE); + + WritableFont nameWfc = new WritableFont(WritableFont.ARIAL, 14, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + jxl.format.Colour.BLACK); + WritableCellFormat nameFormat = new WritableCellFormat(nameWfc); + nameFormat.setBorder(Border.ALL, BorderLineStyle.THIN); + nameFormat.setAlignment(Alignment.CENTRE); + nameFormat.setVerticalAlignment(VerticalAlignment.CENTRE); + + WritableCellFormat infoFormat = new WritableCellFormat(wfont); + infoFormat.setAlignment(Alignment.LEFT); + infoFormat.setVerticalAlignment(VerticalAlignment.CENTRE); + + + sheet.mergeCells(0, 0, names.length - 1, 0); + sheet.addCell(new Label(0, 0, infoMap.get("title"), wcfFC)); + + sheet.addCell(new Label(0, 2, infoMap.get("info"), infoFormat)); + sheet.addCell(new Label(2, 2, infoMap.get("dvrnvr"), infoFormat)); + sheet.addCell(new Label(4, 2, infoMap.get("char"), infoFormat)); + sheet.addCell(new Label(0, 3, infoMap.get("infoPercent"), infoFormat)); + sheet.addCell(new Label(2, 3, infoMap.get("dvrnvrPercent"), infoFormat)); + sheet.addCell(new Label(4, 3, infoMap.get("charPercent"), infoFormat)); + + int rowNum = 5; + for (int i = 0; i < names.length; i++) { + sheet.addCell(new Label(i, 4, names[i], nameFormat)); + } + for (int j = 0; j < objects.size(); j++) { + String[] obj = objects.get(j); + for (int h = 0; h < obj.length; h++) { + sheet.addCell(new Label(h, rowNum, obj[h], format)); + } + rowNum = rowNum + 1; + } + wtwb.write(); + wtwb.close(); + return excelFile.getName(); + } + + + + public static String getContent(Sheet src, int rowNum, int colNum) { + if(colNum < src.getRow(rowNum).length) { + return src.getRow(rowNum)[colNum].getContents().trim(); + } else { + return null; + } + } + + /** + * 从第i行开始到最后检测指定列的唯一性 + * + * @param src + * @param colNum + * @param fromRow + * 起始行 + * @return + */ + public static Boolean checkUnique(Sheet src, int colNum, int fromRow) { + Cell[] colCells = src.getColumn(colNum); + Set set = new HashSet(); + for (int i = fromRow; i < colCells.length; i++) { + if (!StringUtils.isEmpty(colCells[i].getContents()) + && !set.add(colCells[i].getContents())) { + return false; + } + } + return true; + } + + public static File getTempFile(String fileName) { + String dir = System.getProperty("java.io.tmpdir"); // 获取系统临时目录 + return new File(dir + File.separator + fileName); + } + + public static void main(String[] args) throws Exception { + String msg = "12345"; + System.out.println(msg.indexOf("@")); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ExceptionCodeConstants.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ExceptionCodeConstants.java new file mode 100644 index 00000000..dc5bf75f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ExceptionCodeConstants.java @@ -0,0 +1,43 @@ +package com.zsw.erp.utils; + +public interface ExceptionCodeConstants { + /** + * 用户错误码定义 + */ + public class UserExceptionCode { + /** + * 用户不存在 + */ + public static final int USER_NOT_EXIST = 1; + + /** + * 用户密码错误 + */ + public static final int USER_PASSWORD_ERROR = 2; + + /** + * 用户被加入黑名单 + */ + public static final int BLACK_USER = 3; + + /** + * 可以登录 + */ + public static final int USER_CONDITION_FIT = 4; + + /** + * 访问数据库异常 + */ + public static final int USER_ACCESS_EXCEPTION = 5; + + /** + * 租户被加入黑名单 + */ + public static final int BLACK_TENANT = 6; + + /** + * 租户已经过期 + */ + public static final int EXPIRE_TENANT = 7; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ExportExecUtil.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ExportExecUtil.java new file mode 100644 index 00000000..0abe44fc --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ExportExecUtil.java @@ -0,0 +1,28 @@ +package com.zsw.erp.utils; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.OutputStream; + +public class ExportExecUtil { + + public static void showExec(File excelFile,String fileName,HttpServletResponse response) throws Exception{ + response.setContentType("application/octet-stream"); + fileName = new String(fileName.getBytes("gbk"),"ISO8859_1"); + response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + ".xls" + "\""); + FileInputStream fis = new FileInputStream(excelFile); + OutputStream out = response.getOutputStream(); + + int SIZE = 1024 * 1024; + byte[] bytes = new byte[SIZE]; + int LENGTH = -1; + while((LENGTH = fis.read(bytes)) != -1){ + out.write(bytes,0,LENGTH); + } + + out.flush(); + fis.close(); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ExtJsonUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ExtJsonUtils.java new file mode 100644 index 00000000..8e5ed67a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ExtJsonUtils.java @@ -0,0 +1,139 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.parser.deserializer.ExtraProcessor; +import com.alibaba.fastjson.parser.deserializer.FieldDeserializer; +import com.alibaba.fastjson.serializer.*; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +public class ExtJsonUtils { + private static class NPFloatCodec extends FloatCodec { + public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { + SerializeWriter out = serializer.getWriter(); + + if (object == null) { + if (serializer.isEnabled(SerializerFeature.WriteNullNumberAsZero)) { + out.write('0'); + } else { + out.writeNull(); + } + return; + } + + float floatValue = (Float) object; + + if (Float.isNaN(floatValue)) { + out.writeNull(); + } else if (Float.isInfinite(floatValue)) { + out.writeNull(); + } else { + String floatText = Float.toString(floatValue); + out.write(floatText); + + if (serializer.isEnabled(SerializerFeature.WriteClassName)) { + out.write('F'); + } + } + } + } + + private static class NPDoubleSerializer extends DoubleSerializer { + public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { + SerializeWriter out = serializer.getWriter(); + + if (object == null) { + if (!serializer.isEnabled(SerializerFeature.WriteNullNumberAsZero)) { + out.writeNull(); + } else { + out.write('0'); + } + return; + } + + double doubleValue = (Double) object; + + if (Double.isNaN(doubleValue)) { + out.writeNull(); + } else if (Double.isInfinite(doubleValue)) { + out.writeNull(); + } else { + String doubleText; + doubleText = Double.toString(doubleValue); + out.append(doubleText); + + if (serializer.isEnabled(SerializerFeature.WriteClassName)) { + out.write('D'); + } + } + } + } + + private static final String EXT_NAME = "ext"; + + static class ExtFilter extends AfterFilter implements PropertyFilter { + static { + SerializeConfig.getGlobalInstance().put(Float.class, new NPFloatCodec()); + SerializeConfig.getGlobalInstance().put(float.class, new NPFloatCodec()); + SerializeConfig.getGlobalInstance().put(Double.class, new NPDoubleSerializer()); + SerializeConfig.getGlobalInstance().put(double.class, new NPDoubleSerializer()); + } + + private Map map = new HashMap<>(); + + private Map> ignoredKey = new HashMap<>(); + + @Override + public boolean apply(Object object, String name, Object value) { + if (name.equals(EXT_NAME) && value instanceof String) { + map.put(object, JSON.parseObject((String) value)); + return false; + } + if (!map.containsKey(object)) { + ignoredKey.put(object, new HashSet()); + } + ignoredKey.get(object).add(name); +// if (value instanceof Float || value instanceof Double) { +// if (!floatMap.containsKey(object)) { +// floatMap.put(object, new HashMap()); +// } +// floatMap.get(object).put(name, value); +// return false; +// } + return true; + } + + @Override + public void writeAfter(Object object) { + if (map.containsKey(object)) { + Set ignoredKeys; + if (ignoredKey.containsKey(object)) { + ignoredKeys = ignoredKey.get(object); + } else { + ignoredKeys = new HashSet<>(); + } + for (Map.Entry entry : map.get(object).entrySet()) { + if (!ignoredKeys.contains(entry.getKey())) { + writeKeyValue(entry.getKey(), entry.getValue()); + } + } + } + } + } + + public static String toJSONString(Object object) { + return JSON.toJSONString(object, new ExtFilter()); + } + + public interface ExtExtractor { + String getExt(Object bean); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/FileUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/FileUtils.java new file mode 100644 index 00000000..572cdcbf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/FileUtils.java @@ -0,0 +1,354 @@ +package com.zsw.erp.utils; + +import java.io.*; +import java.util.*; + +/** + * + * 文件处理工具类 + * + */ +public class FileUtils { + + /** + * 功 能: 创建文件夹 + * + * @param path + * 参 数:要创建的文件夹名称 + * @return 返回值: 如果成功true;否则false 如:FileUtils.mkdir("/usr/apps/upload/"); + */ + public static boolean makedir(String path) { + File file = new File(path); + if (!file.exists()) + return file.mkdirs(); + else + return true; + } + + /** + * 保存文件 + * + * @param stream + * @param path + * 存放路径 + * @param filename + * 文件名 + * @throws IOException + */ + public static void SaveFileFromInputStream(InputStream stream, String path, String filename) + throws IOException { + File file = new File(path); + boolean flag=true; + if(!file.exists()){ + flag=file.mkdirs(); + } + if(flag){ + FileOutputStream fs = new FileOutputStream(new File(path+filename)); + byte[] buffer = new byte[1024 * 1024]; + int byteread = 0; + while ((byteread = stream.read(buffer)) != -1) { + fs.write(buffer, 0, byteread); + fs.flush(); + } + fs.close(); + stream.close(); + } + } + + + /** + * 列出某个目录下的所有文件,子目录不列出 + * @param folderPath:文件夹路径 + * @return + */ + public static List listFile(String folderPath){ + List fileList = new ArrayList(); //FileViewer.getListFiles(destPath, null, false); + File f = new File(folderPath); + File[] t = f.listFiles(); + for(int i = 0; i < t.length; i++){ + fileList.add(t[i].getAbsolutePath()); + } + return fileList; + } + + + /** + * 判断文件是否存在 + * + * @param fileName + * @return + */ + public static boolean exists(String fileName) { + File file = new File(fileName); + if (file.exists()) { + return true; + } else { + return false; + } + } + + /** + * 取当前路径 + * + * @return + */ + public static String getCurrentPath() { + File directory = new File("."); + String nowPath = ""; + try { + nowPath = directory.getCanonicalFile().toString(); + } catch (IOException e) { + e.printStackTrace(); + } + return nowPath; + } + + /** + * 获取文件扩展名 + * + * @param fileName + * @return + * */ + public static String getFileExtendName(String fileName) { + if (fileName == null) { + return ""; + } else { + return fileName.substring(fileName.lastIndexOf(".") + 1, fileName + .length()); + } + } + + /** + * 创建一个新文件,如果存在则报错 + * + * @param filePath + * @param fileName + * @return + */ + public static void createFile(String filePath, String fileName) + throws RuntimeException { + String file = null; + if (filePath == null) { + file = fileName; + } else { + file = filePath + File.separator + fileName; + } + createFile(file); + } + + /** + * 创建一个新文件(含路径),如果存在则报错 + * + * @param fileName + * 含有路径的文件名 + * @return + */ + public static void createFile(String fileName) throws RuntimeException { + File f = new File(fileName); + if (f.exists()) { + throw new RuntimeException("FILE_EXIST_ERROR"); + } else { + try { + File fileFolder = f.getParentFile(); + if (!fileFolder.exists()) + fileFolder.mkdirs(); + f.createNewFile(); + } catch (IOException ie) { + System.out.println("文件" + fileName + "创建失败:" + ie.getMessage()); + throw new RuntimeException("FILE_CREATE_ERROR"); + } + } + } + + + /** + * 创建目录,如果存在则不创建 + * + * @param path + * @return 返回结果null则创建成功,否则返回的是错误信息 + * @return + */ + public static String createDir(String path, boolean isCreateSubPah) { + String msg = null; + File dir = new File(path); + + if (dir == null) { + msg = "不能创建空目录"; + return msg; + } + if (dir.isFile()) { + msg = "已有同名文件存在"; + return msg; + } + if (!dir.exists()) { + if (isCreateSubPah && !dir.mkdirs()) { + msg = "目录创建失败,原因不明"; + } else if (!dir.mkdir()) { + msg = "目录创建失败,原因不明"; + } + } + return msg; + } + + /** + * 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件 + * + * @file:File 目录 + * */ + public static void delFileOrFolder(String fileName) { + if (!exists(fileName)) + return; + File file = new File(fileName); + delFileOrFolder(file); + } + + /** + * 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件 + * + * @file:File 目录 + * */ + public static void delFileOrFolder(File file) { + if (!file.exists()) + return; + if (file.isFile()) { + file.delete(); + } else { + File[] sub = file.listFiles(); + if (sub == null || sub.length <= 0) { + file.delete(); + } else { + for (int i = 0; i < sub.length; i++) { + delFileOrFolder(sub[i]); + } + file.delete(); + } + } + } + + /** + * 从Properties格式配置文件中获取所有参数并保存到HashMap中。 + * 配置中的key值即map表中的key值,如果配置文件保存时用的中文,则返回结果也会转成中文。 + * + * @param file + * @return + * @throws IOException + */ + @SuppressWarnings("unchecked") + public static HashMap readPropertyFile(String file, String charsetName) throws IOException { + if (charsetName==null || charsetName.trim().length()==0){ + charsetName="gbk"; + } + HashMap map = new HashMap(); + InputStream is =null; + if(file.startsWith("file:")) + is=new FileInputStream(new File(file.substring(5))); + else + is=FileUtils.class.getClassLoader().getResourceAsStream(file); + Properties properties = new Properties(); + properties.load(is); + Enumeration en = properties.propertyNames(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String code = new String(properties.getProperty(key).getBytes( + "ISO-8859-1"), charsetName); + map.put(key, code); + } + return map; + } + /** + * + * @param path + * 文件路径 + * @param suffix + * 后缀名 + * @param isdepth + * 是否遍历子目录 + * @return + */ + @SuppressWarnings("unchecked") + public static List getListFiles(String path, String suffix, boolean isdepth) { + File file = new File(path); + return FileUtils.listFile(file, suffix, isdepth); + } + + /** + * @param f + * @param suffix:后缀名 + * @param isdepth:是否遍历子目录 + * @return + */ + @SuppressWarnings("unchecked") + public static List listFile(File f, String suffix, boolean isdepth) { + // 是目录,同时需要遍历子目录 + List fileList = new ArrayList(); + if (f.isDirectory() && isdepth == true) { + File[] t = f.listFiles(); + for (int i = 0; i < t.length; i++) { + listFile(t[i], suffix, isdepth); + } + } else { + String filePath = f.getAbsolutePath(); + + if (suffix != null) { + int begIndex = filePath.lastIndexOf(".");// 最后一个.(即后缀名前面的.)的索引 + String tempsuffix = ""; + + if (begIndex != -1)// 防止是文件但却没有后缀名结束的文件 + { + tempsuffix = filePath.substring(begIndex + 1, filePath + .length()); + } + + if (tempsuffix.equals(suffix)) { + fileList.add(filePath); + } + } else { + // 后缀名为null则为所有文件 + fileList.add(filePath); + } + + } + + return fileList; + } + + /** + * 方法追加文件:使用FileWriter + * + * @param fileName + * @param content + */ + public static void appendMethod(String fileName, String content) { + try { + // 打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件 + FileWriter writer = new FileWriter(fileName, true); + writer.write(content + "\r\n"); + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 判断文件名是否带盘符,重新处理 + * @param fileName + * @return + */ + public static String getFileName(String fileName){ + //判断是否带有盘符信息 + // Check for Unix-style path + int unixSep = fileName.lastIndexOf('/'); + // Check for Windows-style path + int winSep = fileName.lastIndexOf('\\'); + // Cut off at latest possible point + int pos = (winSep > unixSep ? winSep : unixSep); + if (pos != -1) { + // Any sort of path separator found... + fileName = fileName.substring(pos + 1); + } + //替换上传文件名字的特殊字符 + fileName = fileName.replace("=","").replace(",","").replace("&",""); + return fileName; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/HttpClient.java b/zsw-erp/src/main/java/com/zsw/erp/utils/HttpClient.java new file mode 100644 index 00000000..ef4fbdeb --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/HttpClient.java @@ -0,0 +1,88 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.JSONObject; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.EntityBuilder; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.apache.http.HttpStatus.SC_OK; + +public final class HttpClient { + private static Logger logger = LoggerFactory.getLogger(HttpClient.class); + + private static final RequestConfig REQUEST_CONFIG = RequestConfig.custom().setSocketTimeout(15000).setConnectTimeout(10000).build(); + + /** + * 采用Get方式发送请求,获取响应数据 + * @param url + * @return + */ + public static JSONObject httpGet(String url){ + CloseableHttpClient client = HttpClientBuilder.create().build(); + HttpGet httpGet = new HttpGet(url); + httpGet.setConfig(REQUEST_CONFIG); + try { + CloseableHttpResponse chr = client.execute(httpGet); + int statusCode = chr.getStatusLine().getStatusCode(); + if (SC_OK != statusCode) { + throw new RuntimeException(String.format("%s查询出现异常", url)); + } + String entity = EntityUtils.toString(chr.getEntity(), StandardCharsets.UTF_8); + JSONObject object = JSONObject.parseObject(entity); + return object; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(String.format("%s", url) + "查询出现异常"); + } finally { + try { + client.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 采用Post方式发送请求,获取响应数据 + * + * @param url url地址 + * @param param 参数值键值对的字符串 + * @return + */ + public static String httpPost(String url, String param) { + CloseableHttpClient client = HttpClientBuilder.create().build(); + try { + HttpPost post = new HttpPost(url); + EntityBuilder builder = EntityBuilder.create(); + builder.setContentType(ContentType.APPLICATION_JSON); + builder.setText(param); + post.setEntity(builder.build()); + + CloseableHttpResponse response = client.execute(post); + int statusCode = response.getStatusLine().getStatusCode(); + + HttpEntity entity = response.getEntity(); + String data = EntityUtils.toString(entity, StandardCharsets.UTF_8); + logger.info("状态:"+statusCode+"数据:"+data); + return data; + } catch(Exception e){ + throw new RuntimeException(e.getMessage()); + } finally { + try{ + client.close(); + }catch(Exception ex){ } + } + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/JsonUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/JsonUtils.java new file mode 100644 index 00000000..a3286b1f --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/JsonUtils.java @@ -0,0 +1,18 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + + +public class JsonUtils { + + public static JSONObject ok(){ + JSONObject obj = new JSONObject(); + JSONObject tmp = new JSONObject(); + tmp.put("message", "成功"); + obj.put("code", 200); + obj.put("data", tmp); + return obj; + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java b/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java new file mode 100644 index 00000000..4146cd55 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/LocalUser.java @@ -0,0 +1,103 @@ +package com.zsw.erp.utils; + +import com.zsw.erp.datasource.entities.User; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +public class LocalUser { + + private static final ThreadLocal> THREAD_LOCAL = new ThreadLocal<>(); + + public static Map getLocalMap() { + Map map = THREAD_LOCAL.get(); + if (map == null) { + map = new HashMap<>(10); + THREAD_LOCAL.set(map); + } + return map; + } + public static void setUser(User user){ + Map map = getLocalMap(); + map.put("user",user); + } + + public static User getUser(){ + Map map = getLocalMap(); + Object user = map.get("user"); + if (user == null){ + return null; + } + return (User)user; + } + + + + public static void setTenantId(Long tenantId) { + Map map = getLocalMap(); + if (tenantId == null){ + return; + } + map.put("tenantId",tenantId); + } + + public static Long getTenantId(){ + Map map = getLocalMap(); + Object rs = map.get("tenantId"); + if (rs == null){ + return 0L; + }else{ + return Long.valueOf(rs.toString()); + } + } + + public static void setStoreId(Long storeId){ + Map map = getLocalMap(); + if (storeId == null){ + return; + } + map.put("storeId",storeId); + } + + public static Long getStoreId(){ + Map map = getLocalMap(); + Object rs = map.getOrDefault("storeId", 0L); + return Long.valueOf(rs.toString()); + } + + public static void setLoginName(String loginName){ + Map map = getLocalMap(); + map.put("loginName",loginName); + } + + public static String getLoginName(){ + Map map = getLocalMap(); + return map.get("loginName").toString(); + } + + public static void setUserId(Long userId) { + Map map = getLocalMap(); + map.put("userId",userId); + } + + public static Long getUserId(){ + Map map = getLocalMap(); + return Long.valueOf(map.get("userId").toString()); + } + + public static void setSeasonId(Long seasonId) { + Map map = getLocalMap(); + map.put("seasonId",seasonId); + } + + public static Long getSeasonId(){ + Map map = getLocalMap(); + return Long.valueOf(map.get("seasonId").toString()); + } + + public static void remove(){ + THREAD_LOCAL.remove(); + } + +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/OrderUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/OrderUtils.java new file mode 100644 index 00000000..4bf5aaaf --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/OrderUtils.java @@ -0,0 +1,67 @@ +package com.zsw.erp.utils; + + +public class OrderUtils { + + /** + * 将指定字段排序 + * + * @param orders 格式 属性名,排序方式 例如( name,asc或ip,desc) + * @return 排序字符串 例如:(name asc 或 ip desc) + */ + public static String getOrderString(String orders) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + String column = ColumnPropertyUtil.propertyToColumn(splits[0]); + if (column.equals("audit_status")) { + // TODO: 2015/12/24 这么处理不好,得相伴办法调整 + return "IF(`audit_status`=3,-1,`audit_status`) " + splits[1]; + } else if (column.equals("create_time") || column.equals("modify_time")) { + // TODO: 2015/12/24 这么处理不好,得相伴办法调整 + return column + " " + splits[1]; + } else { + return "convert(" + column + " using gbk) " + splits[1]; + } + } + } + return ""; + } + + public static String getJoinTablesOrderString(String orders, String tableName) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + return "convert(" + tableName + "." + ColumnPropertyUtil.propertyToColumn(splits[0]) + " using gbk) " + splits[1]; + } + } + return ""; + } + + + /** + * 将指定字段排序 + * inet_aton:mysql将IP 转成 long类别函数 + * + * @param orders 格式 属性名,排序方式 例如( name,asc或ip,desc) + * @param ipPropertyName 如果需要按IP属性排序,需要将属性名传入(可不传) + * @return 排序字符串 例如:(name asc 或 ip desc) + */ + public static String getOrderString(String orders, String... ipPropertyName) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + String column = ColumnPropertyUtil.propertyToColumn(splits[0]); + if (ipPropertyName != null && ipPropertyName.length > 0) { + for (String ip : ipPropertyName) { + if (ip.equals(column)) { + return "inet_aton(" + column + ") " + splits[1]; + } + } + } + return column + " " + splits[1]; + } + } + return ""; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/PageQueryInfo.java b/zsw-erp/src/main/java/com/zsw/erp/utils/PageQueryInfo.java new file mode 100644 index 00000000..4ee526d1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/PageQueryInfo.java @@ -0,0 +1,29 @@ +package com.zsw.erp.utils; + +import java.util.List; + +/** + * 分页查询结果 + * + */ +public class PageQueryInfo { + + private Long total; + private List rows; + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ParamUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ParamUtils.java new file mode 100644 index 00000000..b3591eb1 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ParamUtils.java @@ -0,0 +1,55 @@ +package com.zsw.erp.utils; + +import javax.servlet.http.HttpServletRequest; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; + + +public class ParamUtils { + public static String getPageOffset(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int offset = (currentPage - 1) * pageSize; + if (offset <= 0) { + return "0"; + } else { + return new StringBuffer().append(offset).toString(); + } + } + return null; + } + public static Integer getNumberPageOffset(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int offset = (currentPage - 1) * pageSize; + if (offset <= 0) { + return 0; + } else { + return offset; + } + } + return null; + } + public static Integer getNumberPageRows(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int rows = (currentPage) * pageSize; + if (rows <= 0) { + return 0; + } else { + return rows; + } + } + return null; + } + + public static HashMap requestToMap(HttpServletRequest request) { + + HashMap parameterMap = new HashMap(); + Enumeration names = request.getParameterNames(); + if (names != null) { + for (String name : Collections.list(names)) { + parameterMap.put(name, request.getParameter(name)); + } + } + return parameterMap; + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/QueryUtils.java b/zsw-erp/src/main/java/com/zsw/erp/utils/QueryUtils.java new file mode 100644 index 00000000..3bf9fcf5 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/QueryUtils.java @@ -0,0 +1,140 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.springframework.util.Assert; + +import java.util.List; +import java.util.Map; + +import static com.zsw.erp.utils.Constants.CURRENT_PAGE; +import static com.zsw.erp.utils.Constants.PAGE_SIZE; + + +public class QueryUtils { + public static String filterSqlSpecialChar(String search) { + return search != null ? search + .replaceAll("_", "\\\\_") + .replaceAll("!", "\\\\!") + .replaceAll("\\[", "\\\\[") + .replaceAll("\\]", "\\\\]") + .replaceAll("\\^", "\\\\^") : null; + } + + public static T list2One(List list, String label) { + Assert.notNull(label); + Assert.notEmpty(list, label + "对应的记录不存在"); + Assert.isTrue(list.size() == 1, label + "对应的记录不止一个"); + return list.get(0); + } + + public static T list2One(List list, String label, T defaultValue) { + Assert.notNull(list); + Assert.notNull(label); + if (list.isEmpty()) + return defaultValue; + else { + Assert.isTrue(list.size() == 1, label + "对应的记录不止一个"); + return list.get(0); + } + } + + public static List search(Map map) { + List search = null; + + String str = map.get(Constants.SEARCH); + if (StringUtil.isNotEmpty(str)) { + search = StringUtil.searchCondition(str); + } + return search; + } + + public static int rows(Map map) { + return Integer.parseInt(map.get(PAGE_SIZE)); + } + + public static int offset(Map map) { + return (currentPage(map) - 1) * pageSize(map); + } + + public static int pageSize(Map map) { + return Integer.parseInt(map.get(PAGE_SIZE)); + } + + public static int currentPage(Map map) { + int val = Integer.parseInt(map.get(CURRENT_PAGE)); + if (val < 1) + throw new RuntimeException("当前页数目:" + val + " 必须大于0"); + return val; + } + + public static String order(Map map) { + String orderString = OrderUtils.getOrderString(map.get(Constants.ORDER)); + return orderString.trim().isEmpty() ? null : orderString; + } + + public static Integer level(Map map) { + String levelString = map.get(Constants.LEVEL); + return StringUtil.isEmpty(levelString) ? null : Integer.parseInt(levelString); + } + + public static boolean isRecursion(Map map) { + String isRecursion = map.get(Constants.IS_RECURSION); + return StringUtil.isNotEmpty(isRecursion) && Constants.IS_RECURSION_VALUE.equals(isRecursion); + } + + public static int type(Map map) { + return Integer.parseInt(map.get(Constants.TYPE)); + } + + public static String filter(Map map) { + if (map.containsKey(Constants.FILTER)) { + JSONArray array = JSON.parseArray(map.get(Constants.FILTER)); + if (array.isEmpty()) { + return null; + } else { + boolean first = true; + StringBuilder builder = new StringBuilder(); + for (int idx = 0; idx < array.size(); ++idx) { + JSONObject object = array.getJSONObject(idx); + if (object.get("value") instanceof JSONArray) { + + JSONArray value = object.getJSONArray("value"); + + if (!value.isEmpty()) { + if (!first) { + builder.append(" AND "); + } else { + first = false; + } + + String key = object.getString("name"); + + builder.append("("); + + builder.append("`").append(key).append("`"); + + builder.append(" IN "); + + builder.append("("); + + for (int vidx = 0; vidx < value.size(); ++vidx) { + if (vidx != 0) { + builder.append(","); + } + builder.append(value.getString(vidx)); + } + builder.append(")"); + + builder.append(")"); + } + } + } + return builder.toString(); + } + } else { + return null; + } + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/RandImageUtil.java b/zsw-erp/src/main/java/com/zsw/erp/utils/RandImageUtil.java new file mode 100644 index 00000000..756da511 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/RandImageUtil.java @@ -0,0 +1,140 @@ +package com.zsw.erp.utils; + +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletResponse; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Base64; +import java.util.Random; + +/** + * 登录验证码工具类 + */ +public class RandImageUtil { + + public static final String key = "JEECG_LOGIN_KEY"; + + /** + * 定义图形大小 + */ + private static final int width = 105; + /** + * 定义图形大小 + */ + private static final int height = 35; + + /** + * 定义干扰线数量 + */ + private static final int count = 200; + + /** + * 干扰线的长度=1.414*lineWidth + */ + private static final int lineWidth = 2; + + /** + * 图片格式 + */ + private static final String IMG_FORMAT = "JPEG"; + + /** + * base64 图片前缀 + */ + private static final String BASE64_PRE = "data:image/jpg;base64,"; + + /** + * 直接通过response 返回图片 + * @param response + * @param resultCode + * @throws IOException + */ + public static void generate(HttpServletResponse response, String resultCode) throws IOException { + BufferedImage image = getImageBuffer(resultCode); + // 输出图象到页面 + ImageIO.write(image, IMG_FORMAT, response.getOutputStream()); + } + + /** + * 生成base64字符串 + * @param resultCode + * @return + * @throws IOException + */ + public static String generate(String resultCode) throws IOException { + BufferedImage image = getImageBuffer(resultCode); + + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); + //写入流中 + ImageIO.write(image, IMG_FORMAT, byteStream); + //转换成字节 + byte[] bytes = byteStream.toByteArray(); + //转换成base64串 + String base64 = Base64.getEncoder().encodeToString(bytes).trim(); + base64 = base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n + + //写到指定位置 + //ImageIO.write(bufferedImage, "png", new File("")); + + return BASE64_PRE+base64; + } + + private static BufferedImage getImageBuffer(String resultCode){ + // 在内存中创建图象 + final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + // 获取图形上下文 + final Graphics2D graphics = (Graphics2D) image.getGraphics(); + // 设定背景颜色 + graphics.setColor(Color.WHITE); // ---1 + graphics.fillRect(0, 0, width, height); + // 设定边框颜色 +// graphics.setColor(getRandColor(100, 200)); // ---2 + graphics.drawRect(0, 0, width - 1, height - 1); + + final Random random = new Random(); + // 随机产生干扰线,使图象中的认证码不易被其它程序探测到 + for (int i = 0; i < count; i++) { + graphics.setColor(getRandColor(150, 200)); // ---3 + + final int x = random.nextInt(width - lineWidth - 1) + 1; // 保证画在边框之内 + final int y = random.nextInt(height - lineWidth - 1) + 1; + final int xl = random.nextInt(lineWidth); + final int yl = random.nextInt(lineWidth); + graphics.drawLine(x, y, x + xl, y + yl); + } + // 取随机产生的认证码 + for (int i = 0; i < resultCode.length(); i++) { + // 将认证码显示到图象中,调用函数出来的颜色相同,可能是因为种子太接近,所以只能直接生成 + // graphics.setColor(new Color(20 + random.nextInt(130), 20 + random + // .nextInt(130), 20 + random.nextInt(130))); + // 设置字体颜色 + graphics.setColor(Color.BLACK); + // 设置字体样式 +// graphics.setFont(new Font("Arial Black", Font.ITALIC, 18)); + graphics.setFont(new Font("Times New Roman", Font.BOLD, 24)); + // 设置字符,字符间距,上边距 + graphics.drawString(String.valueOf(resultCode.charAt(i)), (23 * i) + 8, 26); + } + // 图象生效 + graphics.dispose(); + return image; + } + + private static Color getRandColor(int fc, int bc) { // 取得给定范围随机颜色 + final Random random = new Random(); + if (fc > 255) { + fc = 255; + } + if (bc > 255) { + bc = 255; + } + + final int r = fc + random.nextInt(bc - fc); + final int g = fc + random.nextInt(bc - fc); + final int b = fc + random.nextInt(bc - fc); + + return new Color(r, g, b); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/RegExpTools.java b/zsw-erp/src/main/java/com/zsw/erp/utils/RegExpTools.java new file mode 100644 index 00000000..525ff000 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/RegExpTools.java @@ -0,0 +1,154 @@ +package com.zsw.erp.utils; + +import org.springframework.util.Assert; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Adm on 2015/12/14. + * + * @author yubiao + *

+ * mysql匹配正则表达式 + */ +public class RegExpTools { + /** + * @param search 模糊匹配字符串数组 + */ + public static String regexp(List search) { + if (search == null || search.isEmpty()) + return null; + String regexp = ""; + for (String s : search) { + if (!regexp.isEmpty()) { + regexp = regexp + "|"; + } + regexp = regexp + ".*"; + regexp = regexp + s.replaceAll("\\.", "\\\\."); + regexp = regexp + ".*"; + } + return regexp; + } + + /** + * @param key json字段key + * @param search 模糊匹配字符串数组 + * json的mysql匹配正则表达式 + */ + public static String regexp(String key, List search) { + if (search == null || search.isEmpty()) + return null; + StringBuilder sb = new StringBuilder(); + for (String s : search) { + if (sb.length() == 0) { + sb.append(".*\\\"").append(key).append("\\\":\\\"[a-zA-Z0-9]*("); + } else { + sb.append("|"); + } + sb.append(s); + } + sb.append(")[a-zA-Z0-9]*\\\".*"); + return sb.toString(); + } + + public static class RegExp { + public static final String ANY = ".*"; + public static final String QUOTE = "\\\""; + public static final String LFT_PAREN = "("; + public static final String RHT_PAREN = ")"; + public static final String COLON = ":"; + public static final String OR = "|"; + + private final StringBuilder builder = new StringBuilder(); + + public RegExp any() { + builder.append(ANY); + return this; + } + + public RegExp lftParen() { + builder.append(LFT_PAREN); + return this; + } + + public RegExp rhtParen() { + builder.append(RHT_PAREN); + return this; + } + + public RegExp colon() { + builder.append(COLON); + return this; + + } + + public RegExp quote() { + builder.append(QUOTE); + return this; + } + + public RegExp quote(String str) { + Assert.notNull(str, "str为空"); + builder.append(QUOTE).append(str).append(QUOTE); + return this; + } + + public RegExp value(String str) { + Assert.notNull(str, "str为空"); + builder.append(str); + return this; + } + + public RegExp or() { + builder.append(OR); + return this; + } + + public RegExp or(List values) { + Assert.notEmpty(values, "values必须非空"); + lftParen(); + boolean first = true; + for (String value : values) { + if (first) { + builder.append(value); + first = false; + } else { + builder.append(OR).append(value); + } + } + rhtParen(); + return this; + } + + @Override + public String toString() { + return builder.toString(); + } + + public static void main(String[] args) { + List values = new ArrayList(); + + values.add("310"); + values.add(String.valueOf(2)); + values.add(String.valueOf(3)); + + RegExp exp = new RegExp(); + + exp.any(); + exp.quote("fullKbNum").colon() + .quote() + .value("[a-zA-Z0-9]*").or(values).value("[a-zA-Z0-9]*") + .quote(); + exp.or(); + exp.quote("gbId[a-f0-9-]{36}").colon() + .quote() + .value("[0-9]*").or(values).value("[0-9]*") + .quote(); + exp.any(); + + System.out.println(exp); + } + + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseCode.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseCode.java new file mode 100644 index 00000000..f373e64c --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseCode.java @@ -0,0 +1,22 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.annotation.JSONCreator; +import com.alibaba.fastjson.annotation.JSONField; + + +public class ResponseCode { + + public final int code; + public final Object data; + + /** + * + * @param code + * @param data + */ + @JSONCreator + public ResponseCode(@JSONField(name = "code") int code, @JSONField(name = "data")Object data) { + this.code = code; + this.data = data; + } +} \ No newline at end of file diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseJsonUtil.java b/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseJsonUtil.java new file mode 100644 index 00000000..0e3a878a --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/ResponseJsonUtil.java @@ -0,0 +1,90 @@ +package com.zsw.erp.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson.serializer.ValueFilter; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.TimeZone; + +public class ResponseJsonUtil { + public static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + static { + FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+8")); + } + + /** + * 响应过滤器 + */ + public static final class ResponseFilter extends ExtJsonUtils.ExtFilter implements ValueFilter { + @Override + public Object process(Object object, String name, Object value) { + if (value != null && value instanceof Long) { + return value.toString(); + } + if (name.equals("createTime") || name.equals("modifyTime")||name.equals("updateTime")) { + return value; + } else if (value instanceof Date) { + return FORMAT.format(value); + } else { + return value; + } + } + } + + /** + * + * @param responseCode + * @return + */ + public static String backJson4HttpApi(ResponseCode responseCode) { + if (responseCode != null) { + String result = JSON.toJSONString(responseCode, new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + result = result.replaceFirst("\"data\":\\{", ""); + return result.substring(0, result.length() - 1); + } + return null; + } + + /** + * 验证失败的json串 + * @param code + * @return + */ + public static String backJson4VerifyFailure(int code) { + Map map = new HashMap(); + map.put("message", "未通过验证"); + return JSON.toJSONString(new ResponseCode(code, map), new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + } + + /** + * 成功的json串 + * @param responseCode + * @return + */ + public static String backJson(ResponseCode responseCode) { + if (responseCode != null) { + return JSON.toJSONString(responseCode, new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + } + return null; + } + + public static String returnJson(Map map, String message, int code) { + map.put("message", message); + return backJson(new ResponseCode(code, map)); + } + + public static ResponseCode success(T object){ + return new ResponseCode(200, object); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/StringUtil.java b/zsw-erp/src/main/java/com/zsw/erp/utils/StringUtil.java new file mode 100644 index 00000000..addfe644 --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/StringUtil.java @@ -0,0 +1,289 @@ +package com.zsw.erp.utils; + +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + + +public class StringUtil { + + private StringUtil() { + + } + + private static String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss"; + + public final static String regex = "'|#|%|;|--| and | and|and | or | or|or | not | not|not " + + "| use | use|use | insert | insert|insert | delete | delete|delete | update | update|update " + + "| select | select|select | count | count|count | group | group|group | union | union|union " + + "| create | create|create | drop | drop|drop | truncate | truncate|truncate | alter | alter|alter " + + "| grant | grant|grant | execute | execute|execute | exec | exec|exec | xp_cmdshell | xp_cmdshell|xp_cmdshell " + + "| call | call|call | declare | declare|declare | source | source|source | sql | sql|sql "; + + public static String filterNull(String str) { + if (str == null) { + return ""; + } else { + return str.trim(); + } + } + + public static boolean stringEquels(String source,String target) { + if(isEmpty(source)||isEmpty(target)){ + return false; + }else{ + return source.equals(target); + } + } + + public static boolean isEmpty(String str) { + return str == null || "".equals(str.trim()); + } + + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + public static String getSysDate(String format) { + if (StringUtil.isEmpty(format)) { + format = DEFAULT_FORMAT; + } + SimpleDateFormat df = new SimpleDateFormat(format); + return df.format(new Date()); + } + + public static Date getDateByString(String date, String format) { + if (StringUtil.isEmpty(format)) { + format = DEFAULT_FORMAT; + } + if (StringUtil.isNotEmpty(date)) { + SimpleDateFormat sdf = new SimpleDateFormat(format); + try { + return sdf.parse(date); + } catch (ParseException e) { + throw new RuntimeException("转换为日期类型错误:DATE:" + date + " FORMAT:" + format); + } + } else { + return null; + } + } + + public static Date getDateByLongDate(Long millis) { + if (millis == null) { + return new Date(); + } + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(millis); + return cal.getTime(); + + } + + public static UUID stringToUUID(String id) { + if (StringUtil.isNotEmpty(id)) { + return UUID.fromString(id); + } else { + return null; + } + } + + public static Integer parseInteger(String str) { + if (StringUtil.isNotEmpty(str)) { + return Integer.parseInt(str); + } else { + return null; + } + } + + public static Long parseStrLong(String str) { + if (StringUtil.isNotEmpty(str)) { + return Long.parseLong(str); + } else { + return null; + } + } + + public static List listToUUID(List listStrs) { + if (listStrs != null && listStrs.size() > 0) { + List uuidList = new ArrayList(); + for (String str : listStrs) { + uuidList.add(UUID.fromString(str)); + } + return uuidList; + } else { + return null; + } + } + + public static List arrayToUUIDList(String[] uuids) { + if (uuids != null && uuids.length > 0) { + List uuidList = new ArrayList(); + for (String str : uuids) { + uuidList.add(UUID.fromString(str)); + } + return uuidList; + } else { + return null; + } + } + + //是否是JSON + public static boolean containsAny(String str, String... flag) { + if (str != null) { + if (flag == null || flag.length == 0) { + flag = "[-{-}-]-,".split("-"); + } + for (String s : flag) { + if (str.contains(s)) { + return true; + } + } + } + return false; + } + + public static String getModifyOrgOperateData(UUID resourceId, UUID orgId) { + if (resourceId != null && orgId != null) { + Map map = new HashMap(); + map.put(resourceId, orgId); + return JSON.toJSONString(map); + } + return ""; + } + + public static String[] listToStringArray(List list) { + if (list != null && !list.isEmpty()) { + return list.toArray(new String[list.size()]); + } + return new String[0]; + } + + public static Long[] listToLongArray(List list) { + if (list != null && !list.isEmpty()) { + return list.toArray(new Long[list.size()]); + } + return new Long[0]; + } + + public static List stringToListArray(String[] strings) { + if (strings != null && strings.length > 0) { + return Arrays.asList(strings); + } + return new ArrayList(); + } + + public static int getArrSum(String[] strings) { + int sum = 0; + for(int i=0;i数据格式 + * String str = "1,2,3,4,5,6" -> List listLong [1,2,3,4,5,6]; + * + * @param strArr + * @return + */ + public static List strToLongList(String strArr) { + List idList=new ArrayList(); + String[] d=strArr.split(","); + for (int i = 0, size = d.length; i < size; i++) { + if(d[i]!=null) { + idList.add(Long.parseLong(d[i])); + } + } + return idList; + } + + /** + * String字符串转成List数据格式 + * String str = "1,2,3,4,5,6" -> List listLong [1,2,3,4,5,6]; + * + * @param strArr + * @return + */ + public static List strToStringList(String strArr) { + if(StringUtils.isEmpty(strArr)){ + return null; + } + List idList=new ArrayList(); + String[] d=strArr.split(","); + for (int i = 0, size = d.length; i < size; i++) { + if(d[i]!=null) { + idList.add(d[i].toString()); + } + } + return idList; + } + + public static List searchCondition(String search) { + if (isEmpty(search)) { + return new ArrayList(); + }else{ + //String[] split = search.split(" "); + String[] split = search.split("#"); + return stringToListArray(split); + } + } + + public static String getInfo(String search, String key){ + String value = null; + if(StringUtil.isNotEmpty(search)) { + search = search.replace("{}",""); + if(StringUtil.isNotEmpty(search)) { + JSONObject obj = JSONObject.parseObject(search); + if (obj.get(key) != null) { + value = obj.getString(key).trim(); + if (value.equals("")) { + value = null; + } + } else { + value = null; + } + } + } + return value; + } + + public static String toNull(String value) { + if(("").equals(value)) { + value = null; + } else { + value = value.trim(); + } + return value; + } + + public static boolean isExist(Object value) { + if(value!=null) { + String str = value.toString(); + if("".equals(str.trim())) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * sql注入过滤,保障sql的安全执行 + * @param originStr + * @return + */ + public static String safeSqlParse(String originStr){ + return originStr.replaceAll("(?i)" + regex, ""); + } + + public static void main(String[] args) { + int i = 10/3; + System.out.println(i); + } +} diff --git a/zsw-erp/src/main/java/com/zsw/erp/utils/Tools.java b/zsw-erp/src/main/java/com/zsw/erp/utils/Tools.java new file mode 100644 index 00000000..8e5be42e --- /dev/null +++ b/zsw-erp/src/main/java/com/zsw/erp/utils/Tools.java @@ -0,0 +1,712 @@ +package com.zsw.erp.utils; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.jwt.JWT; +import cn.hutool.jwt.JWTPayload; +import cn.hutool.jwt.JWTUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.net.InetAddress; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.net.UnknownHostException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Pattern; + +/** + * 工具类 + * + */ +@Slf4j +public class Tools { + /** + * 获得32位唯一序列号 + * + * @return 32为ID字符串 + */ + public static String getUUID_32() { + return UUID.randomUUID().toString().replaceAll("-", ""); + } + + /** + * 获得当天时间,格式为yyyy-MM-dd + * + * @return 格式化后的日期格式 + */ + public static String getNow() { + return new SimpleDateFormat("yyyy-MM-dd").format(new Date()); + } + + /** + * 获取当前月 yyyy-MM + * + * @return + */ + public static String getCurrentMonth() { + return new SimpleDateFormat("yyyy-MM").format(new Date()); + } + + /** + * 获取指定日期格式 yyyy-MM-dd + * + * @return + */ + public static String parseDateToStr(Date date) { + if(date!=null) { + return new SimpleDateFormat("yyyy-MM-dd").format(date); + } else { + return ""; + } + } + + /** + * 获得当天时间,格式为yyyyMMddHHmmss + * + * @return 格式化后的日期格式 + */ + public static String getNow2(Date date) { + return new SimpleDateFormat("yyyyMMddHHmmss").format(date); + } + + /** + * 获得当天时间,格式为yyyy-MM-dd HH:mm:ss + * + * @return 格式化后的日期格式 + */ + public static String getNow3() { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + } + + /** + * 获得指定时间,格式为yyyy-MM-dd HH:mm:ss + * + * @return 格式化后的日期格式 + */ + public static String getCenternTime(Date date) { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); + } + + public static String parseDayToTime(String day, String timeStr) { + if(StringUtil.isNotEmpty(day)){ + return day + timeStr; + } else { + return null; + } + } + + /** + * 获得指定时间,格式为mm:ss + * + * @return 格式化后的日期格式 + */ + public static String getTimeInfo(Date date) { + return new SimpleDateFormat("mm:ss").format(date); + } + + /** + * 获取当前日期是星期几 + * return 星期几 + */ + public static String getWeekDay() { + Calendar c = Calendar.getInstance(Locale.CHINA); + c.setTime(new Date()); + int day = c.get(Calendar.DAY_OF_WEEK); + String weekDay = ""; + switch (day) { + case 1: + weekDay = "星期日"; + break; + case 2: + weekDay = "星期一"; + break; + case 3: + weekDay = "星期二"; + break; + case 4: + weekDay = "星期三"; + break; + case 5: + weekDay = "星期四"; + break; + case 6: + weekDay = "星期五"; + break; + case 7: + weekDay = "星期六"; + break; + default: + break; + } + return weekDay; + } + + /** + * 判断字符串是否全部为数字 + * + * @param checkStr + * @return boolean值 + */ + public static boolean checkStrIsNum(String checkStr) { + if (checkStr == null || checkStr.length() == 0) + return false; + return Pattern.compile("^[0-9]*.{1}[0-9]*$").matcher(checkStr).matches(); +// return Pattern.compile(":^[0-9]+(.[0-9])*$").matcher(checkStr).matches(); + } + + /** + * 获得前一天的时间 + * + * @return 前一天日期 + */ + public static String getPreviousDate() { + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, -1); + return new SimpleDateFormat("yyyy-MM").format(cal.getTime()); + } + + /** + * 获取当前月份的前6个月(含当前月) + * @param size 月数 + * @return + */ + public static List getLastMonths(int size) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + List list = new ArrayList(size); + for (int i=0;i cutLeng) + return beforeStr.substring(0, cutLeng) + "..."; + return beforeStr; + } + + /** + * 生成随机字符串,字母和数字混合 + * + * @return 组合后的字符串 ^[0-9a-zA-Z] + */ + public static String getRandomChar() { + //生成一个0、1、2的随机数字 + int rand = (int) Math.round(Math.random() * 1); + long itmp = 0; + char ctmp = '\u0000'; + switch (rand) { + //生成大写字母 + 1000以内数字 + case 1: + itmp = Math.round(Math.random() * 25 + 65); + ctmp = (char) itmp; + return String.valueOf(ctmp) + (int) Math.random() * 1000; + //生成小写字母 + case 2: + itmp = Math.round(Math.random() * 25 + 97); + ctmp = (char) itmp; + return String.valueOf(ctmp) + (int) Math.random() * 1000; + //生成数字 + default: + itmp = Math.round(Math.random() * 1000); + return itmp + ""; + } + } + + /** + * 判断首字母以数字开头,字符串包括数字、字母%以及空格 + * + * @param str 检查字符串 + * @return 是否以数字开头 + */ + public static boolean CheckIsStartWithNum(String str) { + return Pattern.compile("^[0-9][a-zA-Z0-9%,\\s]*$").matcher(str).matches(); + } + + /** + * 判断首字母以","开头,字符串包括数字、字母%以及空格 + * + * @param str 检查字符串 + * @return 是否以数字开头 + */ + public static boolean CheckIsStartWithSpec(String str) { + return Pattern.compile("^[,][a-zA-Z0-9%,\\s]*$").matcher(str).matches(); + } + + /** + * 字符转码 + * + * @param aValue + * @return + * @see 转码后的字符串 + */ + public static String encodeValue(String aValue) { + if (aValue.trim().length() == 0) { + return ""; + } + String valueAfterTransCode = null; + try { + valueAfterTransCode = URLEncoder.encode(aValue, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.getMessage(); + } + return valueAfterTransCode; + } + + /** + * 字符转码 + * + * @param aValue + * @return + * @see 转码后的字符串 + */ + public static String decodeValue(String aValue) { + if (aValue.trim().length() == 0) { + return ""; + } + String valueAfterTransCode = null; + try { + valueAfterTransCode = URLDecoder.decode(aValue, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.getMessage(); + } + return valueAfterTransCode; + } + + /** + * 去除str中的' + * + * @param str + * @return 除去'后的字符串 + * @see [类、类#方法、类#成员] + */ + public static String afterDealStr(String str) { + return str.replace("'", ""); + } + + /** + * 获取用户IP地址(停用) + * + * @return 用户IP + * @see [类、类#方法、类#成员] + */ + public static String getCurrentUserIP() { + try { + return InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + e.printStackTrace(); + return "127.0.0.1"; + } + } + + /** + * 从Request对象中获得客户端IP,处理了HTTP代理服务器和Nginx的反向代理截取了ip + * + * @param request + * @return ip + */ + public static String getLocalIp(HttpServletRequest request) { + String remoteAddr = getIpAddr(request); + String forwarded = request.getHeader("X-Forwarded-For"); + String realIp = request.getHeader("X-Real-IP"); + + String ip = null; + if (realIp == null) { + if (forwarded == null) { + ip = remoteAddr; + } else { + ip = remoteAddr + "/" + forwarded.split(",")[0]; + } + } else { + if (realIp.equals(forwarded)) { + ip = realIp; + } else { + if (forwarded != null) { + forwarded = forwarded.split(",")[0]; + } + ip = realIp + "/" + forwarded; + } + } + return ip; + } + /** + * 获取访问者IP + * + * 在一般情况下使用Request.getRemoteAddr()即可,但是经过nginx等反向代理软件后,这个方法会失效。 + * + * 本方法先从Header中获取X-Real-IP,如果不存在再从X-Forwarded-For获得第一个IP(用,分割), + * 如果还不存在则调用Request .getRemoteAddr()。 + * + * @param request + * @return + */ + public static String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("X-Real-IP"); + if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) { + return ip; + } + ip = request.getHeader("X-Forwarded-For"); + if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) { + // 多次反向代理后会有多个IP值,第一个为真实IP。 + int index = ip.indexOf(','); + if (index != -1) { + return ip.substring(0, index); + } else { + return ip; + } + } else { + return request.getRemoteAddr(); + } + } + + /** + * 转化前台批量传入的ID值 + * + * @param data + * @return 转化后的ID值数组 + */ + public static int[] changeDataForm(String data) { + String[] dataStr = data.split(","); + int[] dataInt = new int[dataStr.length]; + for (int i = 0; i < dataStr.length; i++) + dataInt[i] = Integer.parseInt(dataStr[i]); + return dataInt; + } + + /** + * 解决导出文件中文乱码问题firefox和ie下中文乱码 + */ + public static String changeUnicode(String fileName, String browserType) { + String returnFileName = ""; + try { + if (browserType.equalsIgnoreCase("MSIE")) { + returnFileName = URLEncoder.encode(fileName, "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + if (returnFileName.length() > 150) { + returnFileName = new String(fileName.getBytes("GB2312"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } + } else if (browserType.equalsIgnoreCase("Firefox")) { + returnFileName = new String(fileName.getBytes("ISO8859-1"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } else { + returnFileName = URLEncoder.encode(fileName, "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + if (returnFileName.length() > 150) { + + returnFileName = new String(returnFileName.getBytes("GB2312"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return returnFileName; + } + + /** + * 写理财日志内容转化特殊字符 + * + * @param str 需要转化的字符 + * @return 转化后的字符 + */ + public static String htmlspecialchars(String str) { + str = str.replaceAll("&", "&"); + str = str.replaceAll("<", "<"); + str = str.replaceAll(">", ">"); + str = str.replaceAll("\"", """); + return str; + } + + /** + * 根据消费日期获取消费月 + * + * @param consumeDate 消费日期 + * @return 返回消费月信息 + */ + public static String getConsumeMonth(String consumeDate) { + return consumeDate.substring(0, 7); + } + + /** + * 获取当前日期的前XX个月 + * + * @param beforeMonth + * @return 前XX个月字符串 + */ + public static String getBeforeMonth(int beforeMonth) { + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, -beforeMonth); + return new SimpleDateFormat("yyyy-MM").format(c.getTime()); + } + + /** + * 根据月份获取当月第一天 + * @param monthTime + * @return + * @throws ParseException + */ + public static String firstDayOfMonth(String monthTime) { + return monthTime + "-01"; + } + + /** + * 根据月份获取当月最后一天 + * @param monthTime + * @return + * @throws ParseException + */ + public static String lastDayOfMonth(String monthTime) throws ParseException { + Date date = new SimpleDateFormat("yyyy-MM").parse(monthTime); + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + } + + /** + * 获取email用户姓名 + * + * @param emailAddress + */ + public static String getEmailUserName(String emailAddress) { + return emailAddress.substring(0, emailAddress.lastIndexOf("@")); + } + + /** + * 获取中文编码,邮件附件乱码问题解决 + * + * @param emailAttchmentTitle + * @return + */ + public static String getChineseString(String emailAttchmentTitle) { + if (emailAttchmentTitle != null && !emailAttchmentTitle.equals("")) { + try { + return new String(emailAttchmentTitle.getBytes(), "ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return emailAttchmentTitle; + } + + /** + * 判断userTel是否合法,userTel只能是数字 + * + * @param userTel + * @return true 合法 false不合法 + */ + public static boolean isTelNumber(String userTel) { + String reg_phone = "^(\\(\\d{3,4}\\)|\\d{3,4}-)?\\d{7,8}$"; + String reg_tel = "^(1[0-9][0-9]|1[0-9][0|3|6|8|9])\\d{8}$"; + boolean b_phpne = Pattern.compile(reg_phone).matcher(userTel).matches(); + boolean b_tel = Pattern.compile(reg_tel).matcher(userTel).matches(); + return (b_phpne || b_tel); + } + + /** + * 模糊判断电话号码是否合法,只能是数字 + * + * @param userTel + * @return + */ + public static boolean isTelNumberBySlur(String userTel) { + return Pattern.compile("^([\\s0-9]{0,12}$)").matcher(userTel).matches(); + } + + /** + * 获取当前时间的字符串类型 + * + * @return 处理后的字符串类型 + */ + public static String getNowTime() { + return new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime()); + } + + /** + * 开打指定文件 + * + * @param filePath 文件的绝对路径 + */ + public static void openFile(String filePath) { + String viewFilePath = filePath.replace("\\", "/"); + // Runtime.getRuntime().exec("cmd /c start "+filePath); + // 解决路径中带空格问题 + Runtime r = Runtime.getRuntime(); + String[] cmdArray = new String[]{"cmd.exe", "/c", viewFilePath}; + try { + r.exec(cmdArray); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 判断字符串中是否含有中文 + * + * @param str + * @return + */ + public static boolean isContainsChinese(String str) { + return Pattern.compile("[\u4e00-\u9fa5]").matcher(str).matches(); + } + + /** + * 过滤html文件中的文本 + * + * @param content + * @return过滤后的文本 + */ + public static String filterText(String content) { + return content.replace("/<(?:.|\\s)*?>/g", ""); + } + + /** + * 去掉字符串中所有符号,不论是全角,还是半角的,或是货币符号或者空格等 + * + * @param s + * @return + */ + public static String removeSymbolForString(String s) { + StringBuffer buffer = new StringBuffer(); + char[] chars = s.toCharArray(); + for (int i = 0; i < chars.length; i++) { + if ((chars[i] >= 19968 && chars[i] <= 40869) || (chars[i] >= 97 && chars[i] <= 122) || (chars[i] >= 65 && chars[i] <= 90)) { + buffer.append(chars[i]); + } + } + return buffer.toString(); + } + + /** + * 获取一个字符串的MD5 + * + * @param msg + * @return 加密后的MD5字符串 + * @throws NoSuchAlgorithmException + */ + public static String md5Encryp(String msg) throws NoSuchAlgorithmException { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(msg.getBytes()); + return new BigInteger(1, md.digest()).toString(16); + } + + /** + * 判断是否插件URL + * + * @return + */ + public static boolean isPluginUrl(String url) { + if (url != null && (url.startsWith("/plugin"))) { + return true; + } + return false; + } + + /** + * 处理字符串null值 + * + * @param beforeStr 处理前字符串 + * @return 处理后的字符串 + */ + public static String dealNullStr(String beforeStr) { + if (null == beforeStr || beforeStr.length() == 0) + return ""; + return beforeStr; + } + + /** + * 根据token截取租户id + * @param token + * @return + */ + public static Long getTenantIdByToken(String token) { + long tenantId = 0L; + if (ObjectUtil.isNotEmpty(token)) { + JWT jwt = JWTUtil.parseToken(token); + // log.error("jwt.getPayloads():{}",jwt.getPayloads()); + JWTPayload payload = jwt.getPayload(); + Object tId = payload.getClaim("tenantId"); + tenantId = Long.parseLong(tId.toString()); + } + return tenantId; + } + + /** + * 使用参数Format将字符串转为Date + * + * @param strDate + * @param pattern + * @return + * @throws ParseException + */ + public static Date parse(String strDate, String pattern) + throws ParseException { + return new SimpleDateFormat(pattern).parse(strDate); + } + + public static Date addDays(Date date, int num) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); //需要将date数据转移到Calender对象中操作 + calendar.add(calendar.DATE, num);//把日期往后增加n天.正数往后推,负数往前移动 + date=calendar.getTime(); //这个时间就是日期往后推一天的结果 + return date; + } + + /** + * 生成随机数字和字母组合 + * @param length + * @return + */ + public static String getCharAndNum(int length) { + Random random = new Random(); + StringBuffer valSb = new StringBuffer(); + String charStr = "0123456789abcdefghijklmnopqrstuvwxyz"; + int charLength = charStr.length(); + for (int i = 0; i < length; i++) { + int index = random.nextInt(charLength); + valSb.append(charStr.charAt(index)); + } + return valSb.toString(); + } + +// /** +// * 过滤html文件中的图片文件 +// * @param content +// * @return +// */ +// public static String filterImg(String content) +// { +// return content.matches("//g"); +// } + + public static void main(String[] args) { + JWT jwt = JWTUtil.parseToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.e30.YSWXBjUl8fDcIiicbwbjWg-TB-anqjw8YCU7YLuqD1s"); + JSONObject j = jwt.getPayloads(); + System.out.println(j.toString()); + } +} diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapper.xml b/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapper.xml new file mode 100644 index 00000000..a15543fc --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapper.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, organ_id, hands_person_id, creator, change_amount, discount_money, total_price, + account_id, bill_no, bill_time, remark, file_name, status, tenant_id, delete_flag + + + + + delete from jsh_account_head + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account_head + + + + + + insert into jsh_account_head (id, type, organ_id, + hands_person_id, creator, change_amount, + discount_money, total_price, account_id, + bill_no, bill_time, remark, + file_name, status, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organId,jdbcType=BIGINT}, + #{handsPersonId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, + #{discountMoney,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL}, #{accountId,jdbcType=BIGINT}, + #{billNo,jdbcType=VARCHAR}, #{billTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, + #{fileName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_account_head + + + id, + + + type, + + + organ_id, + + + hands_person_id, + + + creator, + + + change_amount, + + + discount_money, + + + total_price, + + + account_id, + + + bill_no, + + + bill_time, + + + remark, + + + file_name, + + + status, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{organId,jdbcType=BIGINT}, + + + #{handsPersonId,jdbcType=BIGINT}, + + + #{creator,jdbcType=BIGINT}, + + + #{changeAmount,jdbcType=DECIMAL}, + + + #{discountMoney,jdbcType=DECIMAL}, + + + #{totalPrice,jdbcType=DECIMAL}, + + + #{accountId,jdbcType=BIGINT}, + + + #{billNo,jdbcType=VARCHAR}, + + + #{billTime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + #{fileName,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account_head + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + organ_id = #{record.organId,jdbcType=BIGINT}, + + + hands_person_id = #{record.handsPersonId,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + + + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + + + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + bill_no = #{record.billNo,jdbcType=VARCHAR}, + + + bill_time = #{record.billTime,jdbcType=TIMESTAMP}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + file_name = #{record.fileName,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account_head + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + organ_id = #{record.organId,jdbcType=BIGINT}, + hands_person_id = #{record.handsPersonId,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=BIGINT}, + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + account_id = #{record.accountId,jdbcType=BIGINT}, + bill_no = #{record.billNo,jdbcType=VARCHAR}, + bill_time = #{record.billTime,jdbcType=TIMESTAMP}, + remark = #{record.remark,jdbcType=VARCHAR}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + status = #{record.status,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account_head + + + type = #{type,jdbcType=VARCHAR}, + + + organ_id = #{organId,jdbcType=BIGINT}, + + + hands_person_id = #{handsPersonId,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=BIGINT}, + + + change_amount = #{changeAmount,jdbcType=DECIMAL}, + + + discount_money = #{discountMoney,jdbcType=DECIMAL}, + + + total_price = #{totalPrice,jdbcType=DECIMAL}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + bill_no = #{billNo,jdbcType=VARCHAR}, + + + bill_time = #{billTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account_head + set type = #{type,jdbcType=VARCHAR}, + organ_id = #{organId,jdbcType=BIGINT}, + hands_person_id = #{handsPersonId,jdbcType=BIGINT}, + creator = #{creator,jdbcType=BIGINT}, + change_amount = #{changeAmount,jdbcType=DECIMAL}, + discount_money = #{discountMoney,jdbcType=DECIMAL}, + total_price = #{totalPrice,jdbcType=DECIMAL}, + account_id = #{accountId,jdbcType=BIGINT}, + bill_no = #{billNo,jdbcType=VARCHAR}, + bill_time = #{billTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR}, + file_name = #{fileName,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapperEx.xml new file mode 100644 index 00000000..82703191 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountHeadMapperEx.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + update jsh_account_head + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountItemMapper.xml b/zsw-erp/src/main/resources/mappper_xml/AccountItemMapper.xml new file mode 100644 index 00000000..3d0cf31d --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountItemMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, header_id, account_id, in_out_item_id, bill_id, need_debt, finish_debt, each_amount, + remark, tenant_id, delete_flag + + + + + delete from jsh_account_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account_item + + + + + + insert into jsh_account_item (id, header_id, account_id, + in_out_item_id, bill_id, need_debt, + finish_debt, each_amount, remark, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, + #{inOutItemId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT}, #{needDebt,jdbcType=DECIMAL}, + #{finishDebt,jdbcType=DECIMAL}, #{eachAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_account_item + + + id, + + + header_id, + + + account_id, + + + in_out_item_id, + + + bill_id, + + + need_debt, + + + finish_debt, + + + each_amount, + + + remark, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{headerId,jdbcType=BIGINT}, + + + #{accountId,jdbcType=BIGINT}, + + + #{inOutItemId,jdbcType=BIGINT}, + + + #{billId,jdbcType=BIGINT}, + + + #{needDebt,jdbcType=DECIMAL}, + + + #{finishDebt,jdbcType=DECIMAL}, + + + #{eachAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account_item + + + id = #{record.id,jdbcType=BIGINT}, + + + header_id = #{record.headerId,jdbcType=BIGINT}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT}, + + + bill_id = #{record.billId,jdbcType=BIGINT}, + + + need_debt = #{record.needDebt,jdbcType=DECIMAL}, + + + finish_debt = #{record.finishDebt,jdbcType=DECIMAL}, + + + each_amount = #{record.eachAmount,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account_item + set id = #{record.id,jdbcType=BIGINT}, + header_id = #{record.headerId,jdbcType=BIGINT}, + account_id = #{record.accountId,jdbcType=BIGINT}, + in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT}, + bill_id = #{record.billId,jdbcType=BIGINT}, + need_debt = #{record.needDebt,jdbcType=DECIMAL}, + finish_debt = #{record.finishDebt,jdbcType=DECIMAL}, + each_amount = #{record.eachAmount,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account_item + + + header_id = #{headerId,jdbcType=BIGINT}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + in_out_item_id = #{inOutItemId,jdbcType=BIGINT}, + + + bill_id = #{billId,jdbcType=BIGINT}, + + + need_debt = #{needDebt,jdbcType=DECIMAL}, + + + finish_debt = #{finishDebt,jdbcType=DECIMAL}, + + + each_amount = #{eachAmount,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account_item + set header_id = #{headerId,jdbcType=BIGINT}, + account_id = #{accountId,jdbcType=BIGINT}, + in_out_item_id = #{inOutItemId,jdbcType=BIGINT}, + bill_id = #{billId,jdbcType=BIGINT}, + need_debt = #{needDebt,jdbcType=DECIMAL}, + finish_debt = #{finishDebt,jdbcType=DECIMAL}, + each_amount = #{eachAmount,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountItemMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/AccountItemMapperEx.xml new file mode 100644 index 00000000..bddd8109 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountItemMapperEx.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + update jsh_account_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + update jsh_account_item + set delete_flag='1' + where 1=1 + and header_id in ( + + #{id} + + ) + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountMapper.xml b/zsw-erp/src/main/resources/mappper_xml/AccountMapper.xml new file mode 100644 index 00000000..d0d0713f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountMapper.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, serial_no, initial_amount, current_amount, remark, is_default, tenant_id, + delete_flag + + + + + delete from jsh_account + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account + + + + + + insert into jsh_account (id, name, serial_no, + initial_amount, current_amount, remark, + is_default, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR}, + #{initialAmount,jdbcType=DECIMAL}, #{currentAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, + #{isDefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_account + + + id, + + + name, + + + serial_no, + + + initial_amount, + + + current_amount, + + + remark, + + + is_default, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{serialNo,jdbcType=VARCHAR}, + + + #{initialAmount,jdbcType=DECIMAL}, + + + #{currentAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{isDefault,jdbcType=BIT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + + + initial_amount = #{record.initialAmount,jdbcType=DECIMAL}, + + + current_amount = #{record.currentAmount,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + is_default = #{record.isDefault,jdbcType=BIT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + initial_amount = #{record.initialAmount,jdbcType=DECIMAL}, + current_amount = #{record.currentAmount,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + is_default = #{record.isDefault,jdbcType=BIT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account + + + name = #{name,jdbcType=VARCHAR}, + + + serial_no = #{serialNo,jdbcType=VARCHAR}, + + + initial_amount = #{initialAmount,jdbcType=DECIMAL}, + + + current_amount = #{currentAmount,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + is_default = #{isDefault,jdbcType=BIT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account + set name = #{name,jdbcType=VARCHAR}, + serial_no = #{serialNo,jdbcType=VARCHAR}, + initial_amount = #{initialAmount,jdbcType=DECIMAL}, + current_amount = #{currentAmount,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + is_default = #{isDefault,jdbcType=BIT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/AccountMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/AccountMapperEx.xml new file mode 100644 index 00000000..f4faef7e --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/AccountMapperEx.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_account + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapper.xml b/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapper.xml new file mode 100644 index 00000000..244fbaab --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapper.xml @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, sub_type, default_number, number, create_time, oper_time, organ_id, creator, + account_id, change_amount, back_amount, total_price, pay_type, bill_type, remark, + file_name, sales_man, account_id_list, account_money_list, discount, discount_money, + discount_last_money, other_money, status, link_number, tenant_id, delete_flag + + + + + delete from jsh_depot_head + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_depot_head + + + + + + + update jsh_depot_head + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + sub_type = #{record.subType,jdbcType=VARCHAR}, + + + default_number = #{record.defaultNumber,jdbcType=VARCHAR}, + + + number = #{record.number,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + oper_time = #{record.operTime,jdbcType=TIMESTAMP}, + + + organ_id = #{record.organId,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + + + back_amount = #{record.backAmount,jdbcType=DECIMAL}, + + + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + + + pay_type = #{record.payType,jdbcType=VARCHAR}, + + + bill_type = #{record.billType,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + file_name = #{record.fileName,jdbcType=VARCHAR}, + + + sales_man = #{record.salesMan,jdbcType=VARCHAR}, + + + account_id_list = #{record.accountIdList,jdbcType=VARCHAR}, + + + account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR}, + + + discount = #{record.discount,jdbcType=DECIMAL}, + + + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + + + discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL}, + + + other_money = #{record.otherMoney,jdbcType=DECIMAL}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + link_number = #{record.linkNumber,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_depot_head + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + sub_type = #{record.subType,jdbcType=VARCHAR}, + default_number = #{record.defaultNumber,jdbcType=VARCHAR}, + number = #{record.number,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + oper_time = #{record.operTime,jdbcType=TIMESTAMP}, + organ_id = #{record.organId,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=BIGINT}, + account_id = #{record.accountId,jdbcType=BIGINT}, + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + back_amount = #{record.backAmount,jdbcType=DECIMAL}, + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + pay_type = #{record.payType,jdbcType=VARCHAR}, + bill_type = #{record.billType,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + sales_man = #{record.salesMan,jdbcType=VARCHAR}, + account_id_list = #{record.accountIdList,jdbcType=VARCHAR}, + account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR}, + discount = #{record.discount,jdbcType=DECIMAL}, + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL}, + other_money = #{record.otherMoney,jdbcType=DECIMAL}, + status = #{record.status,jdbcType=VARCHAR}, + link_number = #{record.linkNumber,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_depot_head + + + type = #{type,jdbcType=VARCHAR}, + + + sub_type = #{subType,jdbcType=VARCHAR}, + + + default_number = #{defaultNumber,jdbcType=VARCHAR}, + + + number = #{number,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + oper_time = #{operTime,jdbcType=TIMESTAMP}, + + + organ_id = #{organId,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=BIGINT}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + change_amount = #{changeAmount,jdbcType=DECIMAL}, + + + back_amount = #{backAmount,jdbcType=DECIMAL}, + + + total_price = #{totalPrice,jdbcType=DECIMAL}, + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + bill_type = #{billType,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + sales_man = #{salesMan,jdbcType=VARCHAR}, + + + account_id_list = #{accountIdList,jdbcType=VARCHAR}, + + + account_money_list = #{accountMoneyList,jdbcType=VARCHAR}, + + + discount = #{discount,jdbcType=DECIMAL}, + + + discount_money = #{discountMoney,jdbcType=DECIMAL}, + + + discount_last_money = #{discountLastMoney,jdbcType=DECIMAL}, + + + other_money = #{otherMoney,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=VARCHAR}, + + + link_number = #{linkNumber,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_depot_head + set type = #{type,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=VARCHAR}, + default_number = #{defaultNumber,jdbcType=VARCHAR}, + number = #{number,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + oper_time = #{operTime,jdbcType=TIMESTAMP}, + organ_id = #{organId,jdbcType=BIGINT}, + creator = #{creator,jdbcType=BIGINT}, + account_id = #{accountId,jdbcType=BIGINT}, + change_amount = #{changeAmount,jdbcType=DECIMAL}, + back_amount = #{backAmount,jdbcType=DECIMAL}, + total_price = #{totalPrice,jdbcType=DECIMAL}, + pay_type = #{payType,jdbcType=VARCHAR}, + bill_type = #{billType,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + file_name = #{fileName,jdbcType=VARCHAR}, + sales_man = #{salesMan,jdbcType=VARCHAR}, + account_id_list = #{accountIdList,jdbcType=VARCHAR}, + account_money_list = #{accountMoneyList,jdbcType=VARCHAR}, + discount = #{discount,jdbcType=DECIMAL}, + discount_money = #{discountMoney,jdbcType=DECIMAL}, + discount_last_money = #{discountLastMoney,jdbcType=DECIMAL}, + other_money = #{otherMoney,jdbcType=DECIMAL}, + status = #{status,jdbcType=VARCHAR}, + link_number = #{linkNumber,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapperEx.xml new file mode 100644 index 00000000..b820d5b9 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotHeadMapperEx.xml @@ -0,0 +1,658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_depot_head + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotItemMapper.xml b/zsw-erp/src/main/resources/mappper_xml/DepotItemMapper.xml new file mode 100644 index 00000000..dd661a2f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotItemMapper.xml @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, + basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id, + tax_rate, tax_money, tax_last_money, material_type, sn_list, batch_number, expiration_date, + tenant_id, delete_flag + + + + + delete from jsh_depot_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_depot_item + + + + + + + + + update jsh_depot_item + + + id = #{record.id,jdbcType=BIGINT}, + + + header_id = #{record.headerId,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + material_extend_id = #{record.materialExtendId,jdbcType=BIGINT}, + + + material_unit = #{record.materialUnit,jdbcType=VARCHAR}, + + + sku = #{record.sku,jdbcType=VARCHAR}, + + + oper_number = #{record.operNumber,jdbcType=DECIMAL}, + + + basic_number = #{record.basicNumber,jdbcType=DECIMAL}, + + + unit_price = #{record.unitPrice,jdbcType=DECIMAL}, + + + tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL}, + + + all_price = #{record.allPrice,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT}, + + + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + + + tax_money = #{record.taxMoney,jdbcType=DECIMAL}, + + + tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL}, + + + material_type = #{record.materialType,jdbcType=VARCHAR}, + + + sn_list = #{record.snList,jdbcType=VARCHAR}, + + + batch_number = #{record.batchNumber,jdbcType=VARCHAR}, + + + expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_depot_item + set id = #{record.id,jdbcType=BIGINT}, + header_id = #{record.headerId,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + material_extend_id = #{record.materialExtendId,jdbcType=BIGINT}, + material_unit = #{record.materialUnit,jdbcType=VARCHAR}, + sku = #{record.sku,jdbcType=VARCHAR}, + oper_number = #{record.operNumber,jdbcType=DECIMAL}, + basic_number = #{record.basicNumber,jdbcType=DECIMAL}, + unit_price = #{record.unitPrice,jdbcType=DECIMAL}, + tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL}, + all_price = #{record.allPrice,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT}, + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + tax_money = #{record.taxMoney,jdbcType=DECIMAL}, + tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL}, + material_type = #{record.materialType,jdbcType=VARCHAR}, + sn_list = #{record.snList,jdbcType=VARCHAR}, + batch_number = #{record.batchNumber,jdbcType=VARCHAR}, + expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_depot_item + + + header_id = #{headerId,jdbcType=BIGINT}, + + + material_id = #{materialId,jdbcType=BIGINT}, + + + material_extend_id = #{materialExtendId,jdbcType=BIGINT}, + + + material_unit = #{materialUnit,jdbcType=VARCHAR}, + + + sku = #{sku,jdbcType=VARCHAR}, + + + oper_number = #{operNumber,jdbcType=DECIMAL}, + + + basic_number = #{basicNumber,jdbcType=DECIMAL}, + + + unit_price = #{unitPrice,jdbcType=DECIMAL}, + + + tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL}, + + + all_price = #{allPrice,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + another_depot_id = #{anotherDepotId,jdbcType=BIGINT}, + + + tax_rate = #{taxRate,jdbcType=DECIMAL}, + + + tax_money = #{taxMoney,jdbcType=DECIMAL}, + + + tax_last_money = #{taxLastMoney,jdbcType=DECIMAL}, + + + material_type = #{materialType,jdbcType=VARCHAR}, + + + sn_list = #{snList,jdbcType=VARCHAR}, + + + batch_number = #{batchNumber,jdbcType=VARCHAR}, + + + expiration_date = #{expirationDate,jdbcType=TIMESTAMP}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_depot_item + set header_id = #{headerId,jdbcType=BIGINT}, + material_id = #{materialId,jdbcType=BIGINT}, + material_extend_id = #{materialExtendId,jdbcType=BIGINT}, + material_unit = #{materialUnit,jdbcType=VARCHAR}, + sku = #{sku,jdbcType=VARCHAR}, + oper_number = #{operNumber,jdbcType=DECIMAL}, + basic_number = #{basicNumber,jdbcType=DECIMAL}, + unit_price = #{unitPrice,jdbcType=DECIMAL}, + tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL}, + all_price = #{allPrice,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + depot_id = #{depotId,jdbcType=BIGINT}, + another_depot_id = #{anotherDepotId,jdbcType=BIGINT}, + tax_rate = #{taxRate,jdbcType=DECIMAL}, + tax_money = #{taxMoney,jdbcType=DECIMAL}, + tax_last_money = #{taxLastMoney,jdbcType=DECIMAL}, + material_type = #{materialType,jdbcType=VARCHAR}, + sn_list = #{snList,jdbcType=VARCHAR}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + expiration_date = #{expirationDate,jdbcType=TIMESTAMP}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotItemMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/DepotItemMapperEx.xml new file mode 100644 index 00000000..313074ad --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotItemMapperEx.xml @@ -0,0 +1,545 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and di.depot_id in #{item} + + + + + + and di.another_depot_id in #{item} + + + + + + + + + + + update jsh_depot_item + set delete_flag='1' + where 1=1 + and header_id in + ( + + #{depotheadId} + + ) + + + + update jsh_depot_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + + + + + + + + diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotMapper.xml b/zsw-erp/src/main/resources/mappper_xml/DepotMapper.xml new file mode 100644 index 00000000..7a7381fd --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotMapper.xml @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id, + delete_Flag, is_default + + + + + + delete from jsh_depot + where id = #{id,jdbcType=BIGINT} + + + + delete from jsh_depot + + + + + + + + update jsh_depot + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + warehousing = #{record.warehousing,jdbcType=DECIMAL}, + + + truckage = #{record.truckage,jdbcType=DECIMAL}, + + + type = #{record.type,jdbcType=INTEGER}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + principal = #{record.principal,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + is_default = #{record.isDefault,jdbcType=BIT}, + + + + + + + + + update jsh_depot + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + warehousing = #{record.warehousing,jdbcType=DECIMAL}, + truckage = #{record.truckage,jdbcType=DECIMAL}, + type = #{record.type,jdbcType=INTEGER}, + sort = #{record.sort,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + principal = #{record.principal,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + is_default = #{record.isDefault,jdbcType=BIT} + + + + + + + update jsh_depot + + + name = #{name,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + warehousing = #{warehousing,jdbcType=DECIMAL}, + + + truckage = #{truckage,jdbcType=DECIMAL}, + + + type = #{type,jdbcType=INTEGER}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + principal = #{principal,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + is_default = #{isDefault,jdbcType=BIT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update jsh_depot + set name = #{name,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + warehousing = #{warehousing,jdbcType=DECIMAL}, + truckage = #{truckage,jdbcType=DECIMAL}, + type = #{type,jdbcType=INTEGER}, + sort = #{sort,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + principal = #{principal,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + is_default = #{isDefault,jdbcType=BIT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/DepotMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/DepotMapperEx.xml new file mode 100644 index 00000000..a7cde178 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/DepotMapperEx.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + update jsh_depot + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/FunctionMapper.xml b/zsw-erp/src/main/resources/mappper_xml/FunctionMapper.xml new file mode 100644 index 00000000..b95d1f4b --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/FunctionMapper.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, number, name, parent_number, url, component, state, sort, enabled, type, push_btn, + icon, delete_flag + + + + + delete from jsh_function + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_function + + + + + + insert into jsh_function (id, number, name, + parent_number, url, component, + state, sort, enabled, type, + push_btn, icon, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{parentNumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{component,jdbcType=VARCHAR}, + #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, + #{pushBtn,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_function + + + id, + + + number, + + + name, + + + parent_number, + + + url, + + + component, + + + state, + + + sort, + + + enabled, + + + type, + + + push_btn, + + + icon, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{number,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{parentNumber,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{component,jdbcType=VARCHAR}, + + + #{state,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{type,jdbcType=VARCHAR}, + + + #{pushBtn,jdbcType=VARCHAR}, + + + #{icon,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_function + + + id = #{record.id,jdbcType=BIGINT}, + + + number = #{record.number,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + parent_number = #{record.parentNumber,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + component = #{record.component,jdbcType=VARCHAR}, + + + state = #{record.state,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + push_btn = #{record.pushBtn,jdbcType=VARCHAR}, + + + icon = #{record.icon,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_function + set id = #{record.id,jdbcType=BIGINT}, + number = #{record.number,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + parent_number = #{record.parentNumber,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + component = #{record.component,jdbcType=VARCHAR}, + state = #{record.state,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + type = #{record.type,jdbcType=VARCHAR}, + push_btn = #{record.pushBtn,jdbcType=VARCHAR}, + icon = #{record.icon,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_function + + + number = #{number,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + parent_number = #{parentNumber,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + component = #{component,jdbcType=VARCHAR}, + + + state = #{state,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + type = #{type,jdbcType=VARCHAR}, + + + push_btn = #{pushBtn,jdbcType=VARCHAR}, + + + icon = #{icon,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_function + set number = #{number,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + parent_number = #{parentNumber,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + state = #{state,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + type = #{type,jdbcType=VARCHAR}, + push_btn = #{pushBtn,jdbcType=VARCHAR}, + icon = #{icon,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/FunctionMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/FunctionMapperEx.xml new file mode 100644 index 00000000..1ac39810 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/FunctionMapperEx.xml @@ -0,0 +1,45 @@ + + + + + + + update jsh_function + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/InOutItemMapper.xml b/zsw-erp/src/main/resources/mappper_xml/InOutItemMapper.xml new file mode 100644 index 00000000..911edb34 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/InOutItemMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, type, remark, tenant_id, delete_flag + + + + + delete from jsh_in_out_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_in_out_item + + + + + + insert into jsh_in_out_item (id, name, type, + remark, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_in_out_item + + + id, + + + name, + + + type, + + + remark, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_in_out_item + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_in_out_item + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_in_out_item + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_in_out_item + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/InOutItemMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/InOutItemMapperEx.xml new file mode 100644 index 00000000..61cff350 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/InOutItemMapperEx.xml @@ -0,0 +1,52 @@ + + + + + + + update jsh_in_out_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/LogMapper.xml b/zsw-erp/src/main/resources/mappper_xml/LogMapper.xml new file mode 100644 index 00000000..c5ce7e2e --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/LogMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, user_id, operation, client_ip, create_time, status, content, tenant_id + + + + + delete from jsh_log + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_log + + + + + + insert into jsh_log (id, user_id, operation, + client_ip, create_time, status, + content, tenant_id) + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR}, + #{clientIp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, + #{content,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) + + + insert into jsh_log + + + id, + + + user_id, + + + operation, + + + client_ip, + + + create_time, + + + status, + + + content, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{operation,jdbcType=VARCHAR}, + + + #{clientIp,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=TINYINT}, + + + #{content,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + update jsh_log + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + operation = #{record.operation,jdbcType=VARCHAR}, + + + client_ip = #{record.clientIp,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + status = #{record.status,jdbcType=TINYINT}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_log + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + operation = #{record.operation,jdbcType=VARCHAR}, + client_ip = #{record.clientIp,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + status = #{record.status,jdbcType=TINYINT}, + content = #{record.content,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_log + + + user_id = #{userId,jdbcType=BIGINT}, + + + operation = #{operation,jdbcType=VARCHAR}, + + + client_ip = #{clientIp,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + status = #{status,jdbcType=TINYINT}, + + + content = #{content,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_log + set user_id = #{userId,jdbcType=BIGINT}, + operation = #{operation,jdbcType=VARCHAR}, + client_ip = #{clientIp,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + status = #{status,jdbcType=TINYINT}, + content = #{content,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml new file mode 100644 index 00000000..8d81cc5f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/LogMapperEx.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapper.xml new file mode 100644 index 00000000..e6c172e0 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, attribute_field, attribute_name, attribute_value, tenant_id, delete_flag + + + + + delete from jsh_material_attribute + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_attribute + + + + + + insert into jsh_material_attribute (id, attribute_field, attribute_name, + attribute_value, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{attributeField,jdbcType=VARCHAR}, #{attributeName,jdbcType=VARCHAR}, + #{attributeValue,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_material_attribute + + + id, + + + attribute_field, + + + attribute_name, + + + attribute_value, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{attributeField,jdbcType=VARCHAR}, + + + #{attributeName,jdbcType=VARCHAR}, + + + #{attributeValue,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_attribute + + + id = #{record.id,jdbcType=BIGINT}, + + + attribute_field = #{record.attributeField,jdbcType=VARCHAR}, + + + attribute_name = #{record.attributeName,jdbcType=VARCHAR}, + + + attribute_value = #{record.attributeValue,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_attribute + set id = #{record.id,jdbcType=BIGINT}, + attribute_field = #{record.attributeField,jdbcType=VARCHAR}, + attribute_name = #{record.attributeName,jdbcType=VARCHAR}, + attribute_value = #{record.attributeValue,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_attribute + + + attribute_field = #{attributeField,jdbcType=VARCHAR}, + + + attribute_name = #{attributeName,jdbcType=VARCHAR}, + + + attribute_value = #{attributeValue,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_attribute + set attribute_field = #{attributeField,jdbcType=VARCHAR}, + attribute_name = #{attributeName,jdbcType=VARCHAR}, + attribute_value = #{attributeValue,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapperEx.xml new file mode 100644 index 00000000..2fbfdb30 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialAttributeMapperEx.xml @@ -0,0 +1,37 @@ + + + + + + + + + + update jsh_material_attribute + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapper.xml new file mode 100644 index 00000000..26d8a329 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, category_level, parent_id, sort, serial_no, remark, create_time, update_time, + tenant_id, delete_flag + + + + + delete from jsh_material_category + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_category + + + + + + insert into jsh_material_category (id, name, category_level, + parent_id, sort, serial_no, + remark, create_time, update_time, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{categoryLevel,jdbcType=SMALLINT}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_category + + + id, + + + name, + + + category_level, + + + parent_id, + + + sort, + + + serial_no, + + + remark, + + + create_time, + + + update_time, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{categoryLevel,jdbcType=SMALLINT}, + + + #{parentId,jdbcType=BIGINT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{serialNo,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_category + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + category_level = #{record.categoryLevel,jdbcType=SMALLINT}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_category + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + category_level = #{record.categoryLevel,jdbcType=SMALLINT}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + sort = #{record.sort,jdbcType=VARCHAR}, + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_category + + + name = #{name,jdbcType=VARCHAR}, + + + category_level = #{categoryLevel,jdbcType=SMALLINT}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + serial_no = #{serialNo,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_category + set name = #{name,jdbcType=VARCHAR}, + category_level = #{categoryLevel,jdbcType=SMALLINT}, + parent_id = #{parentId,jdbcType=BIGINT}, + sort = #{sort,jdbcType=VARCHAR}, + serial_no = #{serialNo,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapperEx.xml new file mode 100644 index 00000000..db2ad27f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialCategoryMapperEx.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, name + + + + + + + insert into jsh_material_category + (name, category_level, parent_id, sort,status,serial_no,remark, + create_time, update_time) + values + (#{name},#{categoryLevel},#{parentId},#{sort},#{status},#{serialNo},#{remark}, + #{createTime},#{updateTime} + ) + + + update jsh_material_category + set update_time=#{updateTime},delete_flag='1' + where id in ( + + #{id} + + ) + + + update jsh_material_category + set update_time=#{updateTime}, + parent_id=#{parentId},sort=#{sort},serial_no=#{serialNo}, + name=#{name},remark=#{remark} + where id =#{id} + + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialCurrentStockMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialCurrentStockMapper.xml new file mode 100644 index 00000000..9f750114 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialCurrentStockMapper.xml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, depot_id, current_number, tenant_id, delete_flag + + + + + delete from jsh_material_current_stock + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_current_stock + + + + + + + + + update jsh_material_current_stock + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + current_number = #{record.currentNumber,jdbcType=DECIMAL}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_current_stock + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + current_number = #{record.currentNumber,jdbcType=DECIMAL}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_current_stock + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + current_number = #{currentNumber,jdbcType=DECIMAL}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_current_stock + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + current_number = #{currentNumber,jdbcType=DECIMAL}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapper.xml new file mode 100644 index 00000000..2c81f30c --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapper.xml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, bar_code, commodity_unit, sku, purchase_decimal, commodity_decimal, + wholesale_decimal, low_decimal, default_flag, create_time, create_serial, update_serial, + update_time, tenant_id, delete_Flag + + + + + delete from jsh_material_extend + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_extend + + + + + + insert into jsh_material_extend (id, material_id, bar_code, + commodity_unit, sku, purchase_decimal, + commodity_decimal, wholesale_decimal, low_decimal, + default_flag, create_time, create_serial, + update_serial, update_time, tenant_id, + delete_Flag) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR}, + #{commodityUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL}, + #{commodityDecimal,jdbcType=DECIMAL}, #{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL}, + #{defaultFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR}, + #{updateSerial,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_extend + + + id, + + + material_id, + + + bar_code, + + + commodity_unit, + + + sku, + + + purchase_decimal, + + + commodity_decimal, + + + wholesale_decimal, + + + low_decimal, + + + default_flag, + + + create_time, + + + create_serial, + + + update_serial, + + + update_time, + + + tenant_id, + + + delete_Flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{barCode,jdbcType=VARCHAR}, + + + #{commodityUnit,jdbcType=VARCHAR}, + + + #{sku,jdbcType=VARCHAR}, + + + #{purchaseDecimal,jdbcType=DECIMAL}, + + + #{commodityDecimal,jdbcType=DECIMAL}, + + + #{wholesaleDecimal,jdbcType=DECIMAL}, + + + #{lowDecimal,jdbcType=DECIMAL}, + + + #{defaultFlag,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{createSerial,jdbcType=VARCHAR}, + + + #{updateSerial,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_extend + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + bar_code = #{record.barCode,jdbcType=VARCHAR}, + + + commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR}, + + + sku = #{record.sku,jdbcType=VARCHAR}, + + + purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL}, + + + commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL}, + + + wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL}, + + + low_decimal = #{record.lowDecimal,jdbcType=DECIMAL}, + + + default_flag = #{record.defaultFlag,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + create_serial = #{record.createSerial,jdbcType=VARCHAR}, + + + update_serial = #{record.updateSerial,jdbcType=VARCHAR}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_extend + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + bar_code = #{record.barCode,jdbcType=VARCHAR}, + commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR}, + sku = #{record.sku,jdbcType=VARCHAR}, + purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL}, + commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL}, + wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL}, + low_decimal = #{record.lowDecimal,jdbcType=DECIMAL}, + default_flag = #{record.defaultFlag,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + create_serial = #{record.createSerial,jdbcType=VARCHAR}, + update_serial = #{record.updateSerial,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_extend + + + material_id = #{materialId,jdbcType=BIGINT}, + + + bar_code = #{barCode,jdbcType=VARCHAR}, + + + commodity_unit = #{commodityUnit,jdbcType=VARCHAR}, + + + sku = #{sku,jdbcType=VARCHAR}, + + + purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL}, + + + commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL}, + + + wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL}, + + + low_decimal = #{lowDecimal,jdbcType=DECIMAL}, + + + default_flag = #{defaultFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + create_serial = #{createSerial,jdbcType=VARCHAR}, + + + update_serial = #{updateSerial,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_extend + set material_id = #{materialId,jdbcType=BIGINT}, + bar_code = #{barCode,jdbcType=VARCHAR}, + commodity_unit = #{commodityUnit,jdbcType=VARCHAR}, + sku = #{sku,jdbcType=VARCHAR}, + purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL}, + commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL}, + wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL}, + low_decimal = #{lowDecimal,jdbcType=DECIMAL}, + default_flag = #{defaultFlag,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + create_serial = #{createSerial,jdbcType=VARCHAR}, + update_serial = #{updateSerial,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapperEx.xml new file mode 100644 index 00000000..22801bc5 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialExtendMapperEx.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + update jsh_material_extend + set delete_Flag='1' + where 1=1 + and ifnull(delete_Flag,'0') !='1' + and id in ( + + #{id} + + ) + + + + update jsh_material_extend + set delete_Flag='1' + where 1=1 + and ifnull(delete_Flag,'0') !='1' + and material_id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialInitialStockMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialInitialStockMapper.xml new file mode 100644 index 00000000..a2ff9f8f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialInitialStockMapper.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id + , material_id, depot_id, number, low_safe_stock, high_safe_stock, tenant_id, delete_flag,weight_price,total_price + + + + + delete + from jsh_material_initial_stock + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_initial_stock + + + + + + + update jsh_material_initial_stock + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + number = #{record.number,jdbcType=DECIMAL}, + + + low_safe_stock = #{record.lowSafeStock,jdbcType=DECIMAL}, + + + high_safe_stock = #{record.highSafeStock,jdbcType=DECIMAL}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_initial_stock + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + number = #{record.number,jdbcType=DECIMAL}, + low_safe_stock = #{record.lowSafeStock,jdbcType=DECIMAL}, + high_safe_stock = #{record.highSafeStock,jdbcType=DECIMAL}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_initial_stock + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + number = #{number,jdbcType=DECIMAL}, + + + low_safe_stock = #{lowSafeStock,jdbcType=DECIMAL}, + + + high_safe_stock = #{highSafeStock,jdbcType=DECIMAL}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_initial_stock + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + number = #{number,jdbcType=DECIMAL}, + low_safe_stock = #{lowSafeStock,jdbcType=DECIMAL}, + high_safe_stock = #{highSafeStock,jdbcType=DECIMAL}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialMapper.xml new file mode 100644 index 00000000..4a04fa01 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialMapper.xml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, category_id, name, mfrs, model, standard, color, unit, remark, img_name, unit_id, + expiry_num, weight, enabled, other_field1, other_field2, other_field3, enable_serial_number, + enable_batch_number, tenant_id, delete_flag + + + + + delete from jsh_material + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material + + + + + + + + + + update jsh_material + + + id = #{record.id,jdbcType=BIGINT}, + + + category_id = #{record.categoryId,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + mfrs = #{record.mfrs,jdbcType=VARCHAR}, + + + model = #{record.model,jdbcType=VARCHAR}, + + + standard = #{record.standard,jdbcType=VARCHAR}, + + + color = #{record.color,jdbcType=VARCHAR}, + + + unit = #{record.unit,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + img_name = #{record.imgName,jdbcType=VARCHAR}, + + + unit_id = #{record.unitId,jdbcType=BIGINT}, + + + expiry_num = #{record.expiryNum,jdbcType=INTEGER}, + + + weight = #{record.weight,jdbcType=DECIMAL}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + other_field1 = #{record.otherField1,jdbcType=VARCHAR}, + + + other_field2 = #{record.otherField2,jdbcType=VARCHAR}, + + + other_field3 = #{record.otherField3,jdbcType=VARCHAR}, + + + enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR}, + + + enable_batch_number = #{record.enableBatchNumber,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material + set id = #{record.id,jdbcType=BIGINT}, + category_id = #{record.categoryId,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + mfrs = #{record.mfrs,jdbcType=VARCHAR}, + model = #{record.model,jdbcType=VARCHAR}, + standard = #{record.standard,jdbcType=VARCHAR}, + color = #{record.color,jdbcType=VARCHAR}, + unit = #{record.unit,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + img_name = #{record.imgName,jdbcType=VARCHAR}, + unit_id = #{record.unitId,jdbcType=BIGINT}, + expiry_num = #{record.expiryNum,jdbcType=INTEGER}, + weight = #{record.weight,jdbcType=DECIMAL}, + enabled = #{record.enabled,jdbcType=BIT}, + other_field1 = #{record.otherField1,jdbcType=VARCHAR}, + other_field2 = #{record.otherField2,jdbcType=VARCHAR}, + other_field3 = #{record.otherField3,jdbcType=VARCHAR}, + enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR}, + enable_batch_number = #{record.enableBatchNumber,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material + + + category_id = #{categoryId,jdbcType=BIGINT}, + + + name = #{name,jdbcType=VARCHAR}, + + + mfrs = #{mfrs,jdbcType=VARCHAR}, + + + model = #{model,jdbcType=VARCHAR}, + + + standard = #{standard,jdbcType=VARCHAR}, + + + color = #{color,jdbcType=VARCHAR}, + + + unit = #{unit,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + img_name = #{imgName,jdbcType=VARCHAR}, + + + unit_id = #{unitId,jdbcType=BIGINT}, + + + expiry_num = #{expiryNum,jdbcType=INTEGER}, + + + weight = #{weight,jdbcType=DECIMAL}, + + + enabled = #{enabled,jdbcType=BIT}, + + + other_field1 = #{otherField1,jdbcType=VARCHAR}, + + + other_field2 = #{otherField2,jdbcType=VARCHAR}, + + + other_field3 = #{otherField3,jdbcType=VARCHAR}, + + + enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR}, + + + enable_batch_number = #{enableBatchNumber,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material + set category_id = #{categoryId,jdbcType=BIGINT}, + name = #{name,jdbcType=VARCHAR}, + mfrs = #{mfrs,jdbcType=VARCHAR}, + model = #{model,jdbcType=VARCHAR}, + standard = #{standard,jdbcType=VARCHAR}, + color = #{color,jdbcType=VARCHAR}, + unit = #{unit,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + img_name = #{imgName,jdbcType=VARCHAR}, + unit_id = #{unitId,jdbcType=BIGINT}, + expiry_num = #{expiryNum,jdbcType=INTEGER}, + weight = #{weight,jdbcType=DECIMAL}, + enabled = #{enabled,jdbcType=BIT}, + other_field1 = #{otherField1,jdbcType=VARCHAR}, + other_field2 = #{otherField2,jdbcType=VARCHAR}, + other_field3 = #{otherField3,jdbcType=VARCHAR}, + enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR}, + enable_batch_number = #{enableBatchNumber,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialMapperEx.xml new file mode 100644 index 00000000..d1a36fe3 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialMapperEx.xml @@ -0,0 +1,591 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_material + set delete_flag='1' + where 1=1 + and ifnull(delete_flag,'0') !='1' + and id in ( + + #{id} + + ) + + + + + + + + + + + + + + update jsh_material + set unit_id = null + where 1 = 1 + and ifnull(delete_flag, '0') !='1' + and id = #{id} + + + + update jsh_material + set expiry_num = null + where 1 = 1 + and ifnull(delete_flag, '0') !='1' + and id = #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapper.xml new file mode 100644 index 00000000..0a0ce466 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, native_name, enabled, sort, another_name, delete_flag + + + + + delete from jsh_material_property + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_property + + + + + + insert into jsh_material_property (id, native_name, enabled, + sort, another_name, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{nativeName,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{sort,jdbcType=VARCHAR}, #{anotherName,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_material_property + + + id, + + + native_name, + + + enabled, + + + sort, + + + another_name, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{nativeName,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{anotherName,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_property + + + id = #{record.id,jdbcType=BIGINT}, + + + native_name = #{record.nativeName,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + another_name = #{record.anotherName,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_property + set id = #{record.id,jdbcType=BIGINT}, + native_name = #{record.nativeName,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + another_name = #{record.anotherName,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_property + + + native_name = #{nativeName,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + another_name = #{anotherName,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_property + set native_name = #{nativeName,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + another_name = #{anotherName,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapperEx.xml new file mode 100644 index 00000000..99d2b99e --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MaterialPropertyMapperEx.xml @@ -0,0 +1,38 @@ + + + + + + + update jsh_material_property + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MsgMapper.xml b/zsw-erp/src/main/resources/mappper_xml/MsgMapper.xml new file mode 100644 index 00000000..94eb5c29 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MsgMapper.xml @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, msg_title, msg_content, create_time, type, status, tenant_id, delete_Flag + + + + + + delete from jsh_msg + where id = #{id,jdbcType=BIGINT} + + + + delete from jsh_msg + + + + + + + insert into jsh_msg (id, msg_title, msg_content, + create_time, type, status, + tenant_id, delete_Flag) + values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + + insert into jsh_msg + + + id, + + + msg_title, + + + msg_content, + + + create_time, + + + type, + + + status, + + + tenant_id, + + + delete_Flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{msgTitle,jdbcType=VARCHAR}, + + + #{msgContent,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{type,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + + update jsh_msg + + + id = #{record.id,jdbcType=BIGINT}, + + + msg_title = #{record.msgTitle,jdbcType=VARCHAR}, + + + msg_content = #{record.msgContent,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + + update jsh_msg + set id = #{record.id,jdbcType=BIGINT}, + msg_title = #{record.msgTitle,jdbcType=VARCHAR}, + msg_content = #{record.msgContent,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + type = #{record.type,jdbcType=VARCHAR}, + status = #{record.status,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + + update jsh_msg + + + msg_title = #{msgTitle,jdbcType=VARCHAR}, + + + msg_content = #{msgContent,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + type = #{type,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update jsh_msg + set msg_title = #{msgTitle,jdbcType=VARCHAR}, + msg_content = #{msgContent,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + type = #{type,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/MsgMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/MsgMapperEx.xml new file mode 100644 index 00000000..f5155ab6 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/MsgMapperEx.xml @@ -0,0 +1,75 @@ + + + + + + + + + update jsh_msg + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + insert into jsh_msg(msg_title,msg_content,create_time,type,status,tenant_id) + values ( + #{msgTitle,jdbcType=VARCHAR}, + #{msgContent,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, + #{type,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT} + ) + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapper.xml b/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapper.xml new file mode 100644 index 00000000..9432885a --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapper.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, orga_id, user_id, user_blng_orga_dspl_seq, delete_flag, create_time, creator, + update_time, updater, tenant_id + + + + + + delete from jsh_orga_user_rel + where id = #{id,jdbcType=BIGINT} + + + + delete from jsh_orga_user_rel + + + + + + + insert into jsh_orga_user_rel (id, orga_id, user_id, + user_blng_orga_dspl_seq, delete_flag, create_time, + creator, update_time, updater, + tenant_id) + values (#{id,jdbcType=BIGINT}, #{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}, + #{tenantId,jdbcType=BIGINT}) + + + + insert into jsh_orga_user_rel + + + id, + + + orga_id, + + + user_id, + + + user_blng_orga_dspl_seq, + + + delete_flag, + + + create_time, + + + creator, + + + update_time, + + + updater, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{orgaId,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=CHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{updater,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + + update jsh_orga_user_rel + + + id = #{record.id,jdbcType=BIGINT}, + + + orga_id = #{record.orgaId,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=CHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + updater = #{record.updater,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + + update jsh_orga_user_rel + set id = #{record.id,jdbcType=BIGINT}, + orga_id = #{record.orgaId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=CHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + updater = #{record.updater,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + + update jsh_orga_user_rel + + + orga_id = #{orgaId,jdbcType=BIGINT}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=CHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update jsh_orga_user_rel + set orga_id = #{orgaId,jdbcType=BIGINT}, + user_id = #{userId,jdbcType=BIGINT}, + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=CHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + updater = #{updater,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapperEx.xml new file mode 100644 index 00000000..1e4ec78f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/OrgaUserRelMapperEx.xml @@ -0,0 +1,44 @@ + + + + + + + insert into jsh_orga_user_rel (orga_id, user_id, + user_blng_orga_dspl_seq, delete_flag, create_time, + creator, update_time, updater + ) + values (#{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT} + ) + + + update jsh_orga_user_rel + + + orga_id = #{orgaId}, + + + user_id = #{userId}, + + + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq}, + + + delete_flag = #{deleteFlag}, + + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + and id=#{id} + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/OrganizationMapper.xml b/zsw-erp/src/main/resources/mappper_xml/OrganizationMapper.xml new file mode 100644 index 00000000..2b2b9736 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/OrganizationMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, org_no, org_abr, parent_id, sort, remark, create_time, update_time, tenant_id, + delete_flag + + + + + delete from jsh_organization + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_organization + + + + + + insert into jsh_organization (id, org_no, org_abr, + parent_id, sort, remark, + create_time, update_time, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{orgNo,jdbcType=VARCHAR}, #{orgAbr,jdbcType=VARCHAR}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_organization + + + id, + + + org_no, + + + org_abr, + + + parent_id, + + + sort, + + + remark, + + + create_time, + + + update_time, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{orgNo,jdbcType=VARCHAR}, + + + #{orgAbr,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=BIGINT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_organization + + + id = #{record.id,jdbcType=BIGINT}, + + + org_no = #{record.orgNo,jdbcType=VARCHAR}, + + + org_abr = #{record.orgAbr,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_organization + set id = #{record.id,jdbcType=BIGINT}, + org_no = #{record.orgNo,jdbcType=VARCHAR}, + org_abr = #{record.orgAbr,jdbcType=VARCHAR}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + sort = #{record.sort,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_organization + + + org_no = #{orgNo,jdbcType=VARCHAR}, + + + org_abr = #{orgAbr,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_organization + set org_no = #{orgNo,jdbcType=VARCHAR}, + org_abr = #{orgAbr,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=BIGINT}, + sort = #{sort,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/OrganizationMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/OrganizationMapperEx.xml new file mode 100644 index 00000000..4c7a964b --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/OrganizationMapperEx.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, org_abr,org_no + + + + + + + insert into jsh_organization + (org_no, org_abr, delete_flag, + parent_id, sort, remark, + create_time, update_time) + values + (#{orgNo,jdbcType=VARCHAR}, #{orgAbr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + + update jsh_organization + set update_Time=#{updateTime},delete_flag='1' + where id in ( + + #{id} + + ) + + + update jsh_organization + set update_time=#{updateTime}, + org_no = #{orgNo},org_abr = #{orgAbr}, + delete_flag = #{deleteFlag},parent_id = #{parentId}, + sort = #{sort},remark = #{remark} + where id =#{id} + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/PersonMapper.xml b/zsw-erp/src/main/resources/mappper_xml/PersonMapper.xml new file mode 100644 index 00000000..0a695dc4 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/PersonMapper.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, name, tenant_id, delete_flag + + + + + delete from jsh_person + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_person + + + + + + insert into jsh_person (id, type, name, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_person + + + id, + + + type, + + + name, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_person + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_person + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_person + + + type = #{type,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_person + set type = #{type,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/PersonMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/PersonMapperEx.xml new file mode 100644 index 00000000..75714cf4 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/PersonMapperEx.xml @@ -0,0 +1,44 @@ + + + + + + + update jsh_person + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapper.xml b/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapper.xml new file mode 100644 index 00000000..2cc5b4bc --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, platform_key, platform_key_info, platform_value + + + + + delete from jsh_platform_config + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_platform_config + + + + + + insert into jsh_platform_config (id, platform_key, platform_key_info, + platform_value) + values (#{id,jdbcType=BIGINT}, #{platformKey,jdbcType=VARCHAR}, #{platformKeyInfo,jdbcType=VARCHAR}, + #{platformValue,jdbcType=VARCHAR}) + + + insert into jsh_platform_config + + + id, + + + platform_key, + + + platform_key_info, + + + platform_value, + + + + + #{id,jdbcType=BIGINT}, + + + #{platformKey,jdbcType=VARCHAR}, + + + #{platformKeyInfo,jdbcType=VARCHAR}, + + + #{platformValue,jdbcType=VARCHAR}, + + + + + + update jsh_platform_config + + + id = #{record.id,jdbcType=BIGINT}, + + + platform_key = #{record.platformKey,jdbcType=VARCHAR}, + + + platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR}, + + + platform_value = #{record.platformValue,jdbcType=VARCHAR}, + + + + + + + + update jsh_platform_config + set id = #{record.id,jdbcType=BIGINT}, + platform_key = #{record.platformKey,jdbcType=VARCHAR}, + platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR}, + platform_value = #{record.platformValue,jdbcType=VARCHAR} + + + + + + update jsh_platform_config + + + platform_key = #{platformKey,jdbcType=VARCHAR}, + + + platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR}, + + + platform_value = #{platformValue,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_platform_config + set platform_key = #{platformKey,jdbcType=VARCHAR}, + platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR}, + platform_value = #{platformValue,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapperEx.xml new file mode 100644 index 00000000..96eaf96a --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/PlatformConfigMapperEx.xml @@ -0,0 +1,28 @@ + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml b/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml new file mode 100644 index 00000000..e5c2edde --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/RoleMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, type, value, description, tenant_id, delete_flag + + + + + delete from jsh_role + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_role + + + + + + insert into jsh_role (id, name, type, + value, description, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{value,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_role + + + id, + + + name, + + + type, + + + value, + + + description, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_role + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_role + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + value = #{record.value,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_role + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_role + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml new file mode 100644 index 00000000..009a4301 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/RoleMapperEx.xml @@ -0,0 +1,38 @@ + + + + + + + update jsh_role + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SequenceMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/SequenceMapperEx.xml new file mode 100644 index 00000000..a30f6926 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SequenceMapperEx.xml @@ -0,0 +1,13 @@ + + + + + + update jsh_sequence set current_val = current_val + 1 where seq_name = 'depot_number_seq' + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapper.xml b/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapper.xml new file mode 100644 index 00000000..16371fd5 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapper.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, depot_id, serial_number, is_sell, remark, delete_flag, create_time, + creator, update_time, updater, in_bill_no, out_bill_no, tenant_id + + + + + delete from jsh_serial_number + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_serial_number + + + + + + insert into jsh_serial_number (id, material_id, depot_id, + serial_number, is_sell, remark, + delete_flag, create_time, creator, + update_time, updater, in_bill_no, + out_bill_no, tenant_id) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT}, + #{serialNumber,jdbcType=VARCHAR}, #{isSell,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{deleteFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=BIGINT}, + #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}, #{inBillNo,jdbcType=VARCHAR}, + #{outBillNo,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) + + + insert into jsh_serial_number + + + id, + + + material_id, + + + depot_id, + + + serial_number, + + + is_sell, + + + remark, + + + delete_flag, + + + create_time, + + + creator, + + + update_time, + + + updater, + + + in_bill_no, + + + out_bill_no, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{depotId,jdbcType=BIGINT}, + + + #{serialNumber,jdbcType=VARCHAR}, + + + #{isSell,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{updater,jdbcType=BIGINT}, + + + #{inBillNo,jdbcType=VARCHAR}, + + + #{outBillNo,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + update jsh_serial_number + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + serial_number = #{record.serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{record.isSell,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + updater = #{record.updater,jdbcType=BIGINT}, + + + in_bill_no = #{record.inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{record.outBillNo,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_serial_number + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + serial_number = #{record.serialNumber,jdbcType=VARCHAR}, + is_sell = #{record.isSell,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + updater = #{record.updater,jdbcType=BIGINT}, + in_bill_no = #{record.inBillNo,jdbcType=VARCHAR}, + out_bill_no = #{record.outBillNo,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_serial_number + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + serial_number = #{serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{isSell,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{outBillNo,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_serial_number + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + serial_number = #{serialNumber,jdbcType=VARCHAR}, + is_sell = #{isSell,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + updater = #{updater,jdbcType=BIGINT}, + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + out_bill_no = #{outBillNo,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapperEx.xml new file mode 100644 index 00000000..3d99e1cf --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SerialNumberMapperEx.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + insert into jsh_serial_number + (material_id, serial_number, is_sell, remark,delete_flag, + create_time, creator,update_time, updater,in_bill_no, out_bill_no) + values + (#{materialId},#{serialNumber},#{isSell},#{remark},#{deleteFlag}, + #{createTime},#{creator},#{updateTime},#{updater},#{inBillNo},#{outBillNo} + ) + + + update jsh_serial_number + + + material_id = #{materialId,jdbcType=BIGINT}, + + + serial_number = #{serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{isSell,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + + where id = #{id,jdbcType=BIGINT} + + + + + update jsh_serial_number + + is_sell = '1', + + out_bill_no = #{outBillNo}, + + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + + and material_id = #{materialId} + + and is_sell != '1' + and ifnull(delete_flag,'0') !='1' + + and serial_number + in ( + + #{sn} + + ) + + + + + + update jsh_serial_number + + is_sell = '0', out_bill_no=null, + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + + and material_id = #{materialId} + + + and out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + and is_sell != '0' + and ifnull(delete_flag,'0') !='1' + + and id in + ( select batchSN.id from + ( select selFrom.id from jsh_serial_number selFrom + where 1=1 + + and selFrom.material_id = #{materialId} + + + and selFrom.out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + and selFrom.is_sell !='0' + and ifnull(selFrom.delete_flag,'0') !='1' + limit 0,#{count} + ) batchSN + ) + + + + insert into jsh_serial_number + (material_id, serial_number, is_sell, remark,delete_flag, + create_time, creator,update_time, updater) + values + + (#{each.materialId},#{each.serialNumber},'0',#{each.remark},'0', + #{each.createTime},#{each.creator},#{each.updateTime},#{each.updater} + ) + + + + update jsh_serial_number + set update_time=#{updateTime},updater=#{updater},delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SupplierMapper.xml b/zsw-erp/src/main/resources/mappper_xml/SupplierMapper.xml new file mode 100644 index 00000000..c56a4dca --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SupplierMapper.xml @@ -0,0 +1,495 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, supplier, contacts, phone_num, email, description, isystem, type, enabled, advance_in, + begin_need_get, begin_need_pay, all_need_get, all_need_pay, fax, telephone, address, + tax_num, bank_name, account_number, tax_rate, tenant_id, delete_flag + + + + + delete from jsh_supplier + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_supplier + + + + + + insert into jsh_supplier (id, supplier, contacts, + phone_num, email, description, + isystem, type, enabled, + advance_in, begin_need_get, begin_need_pay, + all_need_get, all_need_pay, fax, + telephone, address, tax_num, + bank_name, account_number, tax_rate, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{supplier,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, + #{phoneNum,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{isystem,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{advanceIn,jdbcType=DECIMAL}, #{beginNeedGet,jdbcType=DECIMAL}, #{beginNeedPay,jdbcType=DECIMAL}, + #{allNeedGet,jdbcType=DECIMAL}, #{allNeedPay,jdbcType=DECIMAL}, #{fax,jdbcType=VARCHAR}, + #{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{taxNum,jdbcType=VARCHAR}, + #{bankName,jdbcType=VARCHAR}, #{accountNumber,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_supplier + + + id, + + + supplier, + + + contacts, + + + phone_num, + + + email, + + + description, + + + isystem, + + + type, + + + enabled, + + + advance_in, + + + begin_need_get, + + + begin_need_pay, + + + all_need_get, + + + all_need_pay, + + + fax, + + + telephone, + + + address, + + + tax_num, + + + bank_name, + + + account_number, + + + tax_rate, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{supplier,jdbcType=VARCHAR}, + + + #{contacts,jdbcType=VARCHAR}, + + + #{phoneNum,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{isystem,jdbcType=TINYINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{advanceIn,jdbcType=DECIMAL}, + + + #{beginNeedGet,jdbcType=DECIMAL}, + + + #{beginNeedPay,jdbcType=DECIMAL}, + + + #{allNeedGet,jdbcType=DECIMAL}, + + + #{allNeedPay,jdbcType=DECIMAL}, + + + #{fax,jdbcType=VARCHAR}, + + + #{telephone,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{taxNum,jdbcType=VARCHAR}, + + + #{bankName,jdbcType=VARCHAR}, + + + #{accountNumber,jdbcType=VARCHAR}, + + + #{taxRate,jdbcType=DECIMAL}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_supplier + + + id = #{record.id,jdbcType=BIGINT}, + + + supplier = #{record.supplier,jdbcType=VARCHAR}, + + + contacts = #{record.contacts,jdbcType=VARCHAR}, + + + phone_num = #{record.phoneNum,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + isystem = #{record.isystem,jdbcType=TINYINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + advance_in = #{record.advanceIn,jdbcType=DECIMAL}, + + + begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL}, + + + begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL}, + + + all_need_get = #{record.allNeedGet,jdbcType=DECIMAL}, + + + all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL}, + + + fax = #{record.fax,jdbcType=VARCHAR}, + + + telephone = #{record.telephone,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + tax_num = #{record.taxNum,jdbcType=VARCHAR}, + + + bank_name = #{record.bankName,jdbcType=VARCHAR}, + + + account_number = #{record.accountNumber,jdbcType=VARCHAR}, + + + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_supplier + set id = #{record.id,jdbcType=BIGINT}, + supplier = #{record.supplier,jdbcType=VARCHAR}, + contacts = #{record.contacts,jdbcType=VARCHAR}, + phone_num = #{record.phoneNum,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + isystem = #{record.isystem,jdbcType=TINYINT}, + type = #{record.type,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + advance_in = #{record.advanceIn,jdbcType=DECIMAL}, + begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL}, + begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL}, + all_need_get = #{record.allNeedGet,jdbcType=DECIMAL}, + all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL}, + fax = #{record.fax,jdbcType=VARCHAR}, + telephone = #{record.telephone,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + tax_num = #{record.taxNum,jdbcType=VARCHAR}, + bank_name = #{record.bankName,jdbcType=VARCHAR}, + account_number = #{record.accountNumber,jdbcType=VARCHAR}, + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_supplier + + + supplier = #{supplier,jdbcType=VARCHAR}, + + + contacts = #{contacts,jdbcType=VARCHAR}, + + + phone_num = #{phoneNum,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + isystem = #{isystem,jdbcType=TINYINT}, + + + type = #{type,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + advance_in = #{advanceIn,jdbcType=DECIMAL}, + + + begin_need_get = #{beginNeedGet,jdbcType=DECIMAL}, + + + begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL}, + + + all_need_get = #{allNeedGet,jdbcType=DECIMAL}, + + + all_need_pay = #{allNeedPay,jdbcType=DECIMAL}, + + + fax = #{fax,jdbcType=VARCHAR}, + + + telephone = #{telephone,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + tax_num = #{taxNum,jdbcType=VARCHAR}, + + + bank_name = #{bankName,jdbcType=VARCHAR}, + + + account_number = #{accountNumber,jdbcType=VARCHAR}, + + + tax_rate = #{taxRate,jdbcType=DECIMAL}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_supplier + set supplier = #{supplier,jdbcType=VARCHAR}, + contacts = #{contacts,jdbcType=VARCHAR}, + phone_num = #{phoneNum,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + isystem = #{isystem,jdbcType=TINYINT}, + type = #{type,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + advance_in = #{advanceIn,jdbcType=DECIMAL}, + begin_need_get = #{beginNeedGet,jdbcType=DECIMAL}, + begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL}, + all_need_get = #{allNeedGet,jdbcType=DECIMAL}, + all_need_pay = #{allNeedPay,jdbcType=DECIMAL}, + fax = #{fax,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + tax_num = #{taxNum,jdbcType=VARCHAR}, + bank_name = #{bankName,jdbcType=VARCHAR}, + account_number = #{accountNumber,jdbcType=VARCHAR}, + tax_rate = #{taxRate,jdbcType=DECIMAL}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SupplierMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/SupplierMapperEx.xml new file mode 100644 index 00000000..68c3c6be --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SupplierMapperEx.xml @@ -0,0 +1,91 @@ + + + + + + + + + + update jsh_supplier + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml b/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml new file mode 100644 index 00000000..b6241fe3 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapper.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code, + depot_flag, customer_flag, minus_stock_flag, tenant_id, delete_flag + + + + delete from jsh_system_config + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_system_config + + + + + + + update jsh_system_config + + + id = #{record.id,jdbcType=BIGINT}, + + + company_name = #{record.companyName,jdbcType=VARCHAR}, + + + company_contacts = #{record.companyContacts,jdbcType=VARCHAR}, + + + company_address = #{record.companyAddress,jdbcType=VARCHAR}, + + + company_tel = #{record.companyTel,jdbcType=VARCHAR}, + + + company_fax = #{record.companyFax,jdbcType=VARCHAR}, + + + company_post_code = #{record.companyPostCode,jdbcType=VARCHAR}, + + + depot_flag = #{record.depotFlag,jdbcType=VARCHAR}, + + + customer_flag = #{record.customerFlag,jdbcType=VARCHAR}, + + + minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_system_config + set id = #{record.id,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + company_contacts = #{record.companyContacts,jdbcType=VARCHAR}, + company_address = #{record.companyAddress,jdbcType=VARCHAR}, + company_tel = #{record.companyTel,jdbcType=VARCHAR}, + company_fax = #{record.companyFax,jdbcType=VARCHAR}, + company_post_code = #{record.companyPostCode,jdbcType=VARCHAR}, + depot_flag = #{record.depotFlag,jdbcType=VARCHAR}, + customer_flag = #{record.customerFlag,jdbcType=VARCHAR}, + minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_system_config + + + company_name = #{companyName,jdbcType=VARCHAR}, + + + company_contacts = #{companyContacts,jdbcType=VARCHAR}, + + + company_address = #{companyAddress,jdbcType=VARCHAR}, + + + company_tel = #{companyTel,jdbcType=VARCHAR}, + + + company_fax = #{companyFax,jdbcType=VARCHAR}, + + + company_post_code = #{companyPostCode,jdbcType=VARCHAR}, + + + depot_flag = #{depotFlag,jdbcType=VARCHAR}, + + + customer_flag = #{customerFlag,jdbcType=VARCHAR}, + + + minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_system_config + set company_name = #{companyName,jdbcType=VARCHAR}, + company_contacts = #{companyContacts,jdbcType=VARCHAR}, + company_address = #{companyAddress,jdbcType=VARCHAR}, + company_tel = #{companyTel,jdbcType=VARCHAR}, + company_fax = #{companyFax,jdbcType=VARCHAR}, + company_post_code = #{companyPostCode,jdbcType=VARCHAR}, + depot_flag = #{depotFlag,jdbcType=VARCHAR}, + customer_flag = #{customerFlag,jdbcType=VARCHAR}, + minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml new file mode 100644 index 00000000..5bb37084 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/SystemConfigMapperEx.xml @@ -0,0 +1,38 @@ + + + + + + + update jsh_system_config + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml b/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml new file mode 100644 index 00000000..2ded3e05 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/TenantMapper.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, tenant_id, login_name, user_num_limit, type, enabled, create_time, expire_time, + remark + + + + + delete from jsh_tenant + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_tenant + + + + + + + update jsh_tenant + + + id = #{record.id,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + login_name = #{record.loginName,jdbcType=VARCHAR}, + + + user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + + + + + + update jsh_tenant + set id = #{record.id,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + login_name = #{record.loginName,jdbcType=VARCHAR}, + user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, + type = #{record.type,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, + remark = #{record.remark,jdbcType=VARCHAR} + + + + + + update jsh_tenant + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + login_name = #{loginName,jdbcType=VARCHAR}, + + + user_num_limit = #{userNumLimit,jdbcType=INTEGER}, + + + type = #{type,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + expire_time = #{expireTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_tenant + set tenant_id = #{tenantId,jdbcType=BIGINT}, + login_name = #{loginName,jdbcType=VARCHAR}, + user_num_limit = #{userNumLimit,jdbcType=INTEGER}, + type = #{type,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + expire_time = #{expireTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml new file mode 100644 index 00000000..559f9456 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/TenantMapperEx.xml @@ -0,0 +1,43 @@ + + + + + + + + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UnitMapper.xml b/zsw-erp/src/main/resources/mappper_xml/UnitMapper.xml new file mode 100644 index 00000000..02755303 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/UnitMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, basic_unit, other_unit, other_unit_two, other_unit_three, ratio, ratio_two, + ratio_three, tenant_id, delete_flag + + + + + delete from jsh_unit + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_unit + + + + + + insert into jsh_unit (id, name, basic_unit, + other_unit, other_unit_two, other_unit_three, + ratio, ratio_two, ratio_three, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{basicUnit,jdbcType=VARCHAR}, + #{otherUnit,jdbcType=VARCHAR}, #{otherUnitTwo,jdbcType=VARCHAR}, #{otherUnitThree,jdbcType=VARCHAR}, + #{ratio,jdbcType=INTEGER}, #{ratioTwo,jdbcType=INTEGER}, #{ratioThree,jdbcType=INTEGER}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_unit + + + id, + + + name, + + + basic_unit, + + + other_unit, + + + other_unit_two, + + + other_unit_three, + + + ratio, + + + ratio_two, + + + ratio_three, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{basicUnit,jdbcType=VARCHAR}, + + + #{otherUnit,jdbcType=VARCHAR}, + + + #{otherUnitTwo,jdbcType=VARCHAR}, + + + #{otherUnitThree,jdbcType=VARCHAR}, + + + #{ratio,jdbcType=INTEGER}, + + + #{ratioTwo,jdbcType=INTEGER}, + + + #{ratioThree,jdbcType=INTEGER}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_unit + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + basic_unit = #{record.basicUnit,jdbcType=VARCHAR}, + + + other_unit = #{record.otherUnit,jdbcType=VARCHAR}, + + + other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR}, + + + other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR}, + + + ratio = #{record.ratio,jdbcType=INTEGER}, + + + ratio_two = #{record.ratioTwo,jdbcType=INTEGER}, + + + ratio_three = #{record.ratioThree,jdbcType=INTEGER}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_unit + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + basic_unit = #{record.basicUnit,jdbcType=VARCHAR}, + other_unit = #{record.otherUnit,jdbcType=VARCHAR}, + other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR}, + other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR}, + ratio = #{record.ratio,jdbcType=INTEGER}, + ratio_two = #{record.ratioTwo,jdbcType=INTEGER}, + ratio_three = #{record.ratioThree,jdbcType=INTEGER}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_unit + + + name = #{name,jdbcType=VARCHAR}, + + + basic_unit = #{basicUnit,jdbcType=VARCHAR}, + + + other_unit = #{otherUnit,jdbcType=VARCHAR}, + + + other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR}, + + + other_unit_three = #{otherUnitThree,jdbcType=VARCHAR}, + + + ratio = #{ratio,jdbcType=INTEGER}, + + + ratio_two = #{ratioTwo,jdbcType=INTEGER}, + + + ratio_three = #{ratioThree,jdbcType=INTEGER}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_unit + set name = #{name,jdbcType=VARCHAR}, + basic_unit = #{basicUnit,jdbcType=VARCHAR}, + other_unit = #{otherUnit,jdbcType=VARCHAR}, + other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR}, + other_unit_three = #{otherUnitThree,jdbcType=VARCHAR}, + ratio = #{ratio,jdbcType=INTEGER}, + ratio_two = #{ratioTwo,jdbcType=INTEGER}, + ratio_three = #{ratioThree,jdbcType=INTEGER}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UnitMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/UnitMapperEx.xml new file mode 100644 index 00000000..8351ad78 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/UnitMapperEx.xml @@ -0,0 +1,48 @@ + + + + + + + update jsh_unit + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + update jsh_unit + set ratio_two=null + where id=#{id} + + + update jsh_unit + set ratio_three=null + where id=#{id} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml new file mode 100644 index 00000000..2ac49f67 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/UserBusinessMapperEx.xml @@ -0,0 +1,15 @@ + + + + + update jsh_user_business + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml b/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml new file mode 100644 index 00000000..d3b0f49f --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/UserMapper.xml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, username, login_name, password, position, department, email, phonenum, ismanager, + isystem, Status, description, remark, tenant_id + + + + + delete from jsh_user + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_user + + + + + + + update jsh_user + + + id = #{record.id,jdbcType=BIGINT}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + login_name = #{record.loginName,jdbcType=VARCHAR}, + + + password = #{record.password,jdbcType=VARCHAR}, + + + position = #{record.position,jdbcType=VARCHAR}, + + + department = #{record.department,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + phonenum = #{record.phonenum,jdbcType=VARCHAR}, + + + ismanager = #{record.ismanager,jdbcType=TINYINT}, + + + isystem = #{record.isystem,jdbcType=TINYINT}, + + + Status = #{record.status,jdbcType=TINYINT}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_user + set id = #{record.id,jdbcType=BIGINT}, + username = #{record.username,jdbcType=VARCHAR}, + login_name = #{record.loginName,jdbcType=VARCHAR}, + password = #{record.password,jdbcType=VARCHAR}, + position = #{record.position,jdbcType=VARCHAR}, + department = #{record.department,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + phonenum = #{record.phonenum,jdbcType=VARCHAR}, + ismanager = #{record.ismanager,jdbcType=TINYINT}, + isystem = #{record.isystem,jdbcType=TINYINT}, + Status = #{record.status,jdbcType=TINYINT}, + description = #{record.description,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_user + + + username = #{username,jdbcType=VARCHAR}, + + + login_name = #{loginName,jdbcType=VARCHAR}, + + + password = #{password,jdbcType=VARCHAR}, + + + position = #{position,jdbcType=VARCHAR}, + + + department = #{department,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + phonenum = #{phonenum,jdbcType=VARCHAR}, + + + ismanager = #{ismanager,jdbcType=TINYINT}, + + + isystem = #{isystem,jdbcType=TINYINT}, + + + Status = #{status,jdbcType=TINYINT}, + + + description = #{description,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_user + set username = #{username,jdbcType=VARCHAR}, + login_name = #{loginName,jdbcType=VARCHAR}, + password = #{password,jdbcType=VARCHAR}, + position = #{position,jdbcType=VARCHAR}, + department = #{department,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + phonenum = #{phonenum,jdbcType=VARCHAR}, + ismanager = #{ismanager,jdbcType=TINYINT}, + isystem = #{isystem,jdbcType=TINYINT}, + Status = #{status,jdbcType=TINYINT}, + description = #{description,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml b/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml new file mode 100644 index 00000000..3e3d6145 --- /dev/null +++ b/zsw-erp/src/main/resources/mappper_xml/UserMapperEx.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + update jsh_user + set status=#{status} + where id in ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zsw-spi/pom.xml b/zsw-spi/pom.xml new file mode 100644 index 00000000..7531d348 --- /dev/null +++ b/zsw-spi/pom.xml @@ -0,0 +1,75 @@ + + + + yudao-dependencies + cn.iocoder.boot + ${revision} + + 4.0.0 + + zsw-spi + pom + ${project.artifactId} + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + \ No newline at end of file diff --git a/zsw-spi/src/main/java/com/zsw/base/R.java b/zsw-spi/src/main/java/com/zsw/base/R.java new file mode 100644 index 00000000..ef0620c9 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/R.java @@ -0,0 +1,224 @@ +package com.zsw.base; + +import cn.hutool.json.JSONUtil; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.zsw.exception.BizException; +import com.zsw.exception.code.BaseExceptionCode; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + + +@Getter +@Setter +@SuppressWarnings("ALL") +@Accessors(chain = true) +public class R implements Serializable { + private static final long serialversionUID = 1L; + public static final String DEF_ERROR_MESSAGE = "系统繁忙,请稍候再试"; + public static final String HYSTRIX_ERROR_MESSAGE = "请求超时,请稍候再试"; + public static final int SUCCESS_CODE = 200; + public static final int FAIL_CODE = -1; + public static final int TIMEOUT_CODE = -2; + /** + * 统一参数验证异常 + */ + public static final int VALID_EX_CODE = -9; + public static final int OPERATION_EX_CODE = -10; + /** + * 调用是否成功标识,0:成功,-1:系统繁忙,此时请开发者稍候再试 详情见[ExceptionCode] + */ + @ApiModelProperty(value = "响应编码:0/200-请求处理成功") + private int code; + + /** + * 是否执行默认操作 + */ + @JsonIgnore + private Boolean defExec = true; + + /** + * 调用结果 + */ + @ApiModelProperty(value = "响应数据") + private T data; + + /** + * 结果消息,如果调用成功,消息通常为空T + */ + @ApiModelProperty(value = "提示消息") + private String msg = "ok"; + + @JsonInclude(JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "请求路径") + private String path; + /** + * 附加数据 + */ + @JsonInclude(JsonInclude.Include.NON_NULL) + @ApiModelProperty(value = "附加数据") + private Map extra; + + /** + * 响应时间 + */ + @ApiModelProperty(value = "响应时间戳") + private LocalDateTime time = LocalDateTime.now(); + + private R() { + super(); + } + + public R(int code, T data, String msg) { + this.code = code; + this.data = data; + this.msg = msg; + this.defExec = false; + } + + public R(int code, T data, String msg, boolean defExec) { + this.code = code; + this.data = data; + this.msg = msg; + this.defExec = defExec; + } + + public static R result(int code, E data, String msg) { + return new R(code, data, msg); + } + + /** + * 请求成功消息 + * + * @param data 结果 + * @return RPC调用结果 + */ + public static R success(E data) { + return new R(SUCCESS_CODE, data, "ok"); + } + + public static R success() { + return new R(SUCCESS_CODE, true, "ok"); + } + + + public static R successDef(E data) { + return new R(SUCCESS_CODE, data, "ok", true); + } + + public static R successDef() { + return new R(SUCCESS_CODE, null, "ok", true); + } + + public static R successDef(E data, String msg) { + return new R(SUCCESS_CODE, data, msg, true); + } + + /** + * 请求成功方法 ,data返回值,msg提示信息 + * + * @param data 结果 + * @param msg 消息 + * @return RPC调用结果 + */ + public static R success(E data, String msg) { + return new R(SUCCESS_CODE, data, msg); + } + + /** + * 请求失败消息 + * + * @param msg + * @return + */ + public static R fail(int code, String msg) { + return new R(code, null, (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg); + } + + public static R fail(String msg) { + return fail(OPERATION_EX_CODE, msg); + } + + public static R fail(String msg, Object... args) { + String message = (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg; + return new R(OPERATION_EX_CODE, null, String.format(message, args)); + } + + public static R fail(BaseExceptionCode exceptionCode) { + return validFail(exceptionCode); + } + + public static R fail(BizException exception) { + if (exception == null) { + return fail(DEF_ERROR_MESSAGE); + } + return new R(exception.getCode(), null, exception.getMessage()); + } + + /** + * 请求失败消息,根据异常类型,获取不同的提供消息 + * + * @param throwable 异常 + * @return RPC调用结果 + */ + public static R fail(Throwable throwable) { + return fail(FAIL_CODE, throwable != null ? throwable.getMessage() : DEF_ERROR_MESSAGE); + } + + public static R validFail(String msg) { + return new R(VALID_EX_CODE, null, (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg); + } + + public static R validFail(String msg, Object... args) { + String message = (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg; + return new R(VALID_EX_CODE, null, String.format(message, args)); + } + + public static R validFail(BaseExceptionCode exceptionCode) { + return new R(exceptionCode.getCode(), null, + (exceptionCode.getMsg() == null || exceptionCode.getMsg().isEmpty()) ? DEF_ERROR_MESSAGE : exceptionCode.getMsg()); + } + + public static R timeout() { + return fail(TIMEOUT_CODE, HYSTRIX_ERROR_MESSAGE); + } + + + public R put(String key, Object value) { + if (this.extra == null) { + this.extra = new HashMap(10); + } + this.extra.put(key, value); + return this; + } + + /** + * 逻辑处理是否成功 + * + * @return 是否成功 + */ + public Boolean getIsSuccess() { + return this.code == SUCCESS_CODE || this.code == 200 || this.code == 0 || this.msg.equals("ok"); + } + + /** + * 逻辑处理是否失败 + * + * @return + */ + public Boolean getIsError() { + return !getIsSuccess(); + } + + @Override + public String toString() { + return JSONUtil.toJsonStr(this); + } +} diff --git a/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java b/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java new file mode 100644 index 00000000..43ab8de8 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/entity/Entity.java @@ -0,0 +1,52 @@ +package com.zsw.base.entity; + + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + + +/** + * 基础实体 + * + * @author 云久 + * @date 2019/05/05 + */ +@Getter +@Setter +@Builder +@Accessors(chain = true) +@ToString(callSuper = true) +public class Entity extends SuperEntity { + + public static final String UPDATE_TIME = "updateTime"; + public static final String UPDATE_USER = "updateUser"; + private static final long serialVersionUID = 5169873634279173683L; + + @ApiModelProperty(value = "最后修改时间",hidden = true) + @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) + protected LocalDateTime updateTime; + + @ApiModelProperty(value = "最后修改人ID",hidden = true) + @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE) + protected T updateUser; + + public Entity(T id, LocalDateTime createTime, T createUser, LocalDateTime updateTime, T updateUser) { + super(id, createTime, createUser); + this.updateTime = updateTime; + this.updateUser = updateUser; + } + + public Entity() { + } + + + +} diff --git a/zsw-spi/src/main/java/com/zsw/base/entity/SuperEntity.java b/zsw-spi/src/main/java/com/zsw/base/entity/SuperEntity.java new file mode 100644 index 00000000..c214c0b1 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/entity/SuperEntity.java @@ -0,0 +1,67 @@ +package com.zsw.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import jdk.nashorn.internal.objects.annotations.Getter; +import jdk.nashorn.internal.objects.annotations.Setter; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import javax.validation.groups.Default; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础实体 + * + * @author 云久 + * @date 2019/05/05 + */ +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ToString(callSuper = true) +public class SuperEntity implements Serializable { + public static final String FIELD_ID = "id"; + public static final String CREATE_TIME = "createTime"; + public static final String CREATE_TIME_COLUMN = "create_time"; + public static final String CREATE_USER = "createUser"; + public static final String CREATE_USER_COLUMN = "create_user"; + + private static final long serialVersionUID = -4603650115461757622L; + + @TableId(value = "id", type = IdType.INPUT) + @ApiModelProperty(value = "主键|新增请删除") + @NotNull(message = "id不能为空", groups = Update.class) + @Null(message = "id错误", groups = Save.class) + protected T id; + + @ApiModelProperty(value = "创建时间",hidden = true) + @TableField(value = "create_time", fill = FieldFill.INSERT) + protected LocalDateTime createTime; + + @ApiModelProperty(value = "创建人ID",hidden = true) + @TableField(value = "create_user", fill = FieldFill.INSERT) + protected T createUser; + + /** + * 保存和缺省验证组 + */ + public interface Save extends Default { + + } + + /** + * 更新和缺省验证组 + */ + public interface Update extends Default { + + } +} diff --git a/zsw-spi/src/main/java/com/zsw/base/entity/TreeEntity.java b/zsw-spi/src/main/java/com/zsw/base/entity/TreeEntity.java new file mode 100644 index 00000000..daacf0a3 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/entity/TreeEntity.java @@ -0,0 +1,66 @@ +package com.zsw.base.entity; + + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; +import java.util.ArrayList; +import java.util.List; + + +/** + * 树形实体 + * + * @author 云久 + * @date 2019/05/05 + */ +@Getter +@Setter +@Accessors(chain = true) +@ToString(callSuper = true) +public class TreeEntity extends Entity { + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + @Length(max = 255, message = "名称长度不能超过255") + @TableField(value = "label") + protected String label; + + /** + * 父ID + */ + @ApiModelProperty(value = "父ID") + @TableField(value = "parent_id") + protected T parentId; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序号") + @TableField(value = "sort_value") + protected Integer sortValue; + + + @ApiModelProperty(value = "子节点", hidden = true) + @TableField(exist = false) + protected List children; + + + /** + * 初始化子类 + */ + public void initChildren() { + if (getChildren() == null) { + this.setChildren(new ArrayList()); + } + } +} diff --git a/zsw-spi/src/main/java/com/zsw/base/mapper/SuperMapper.java b/zsw-spi/src/main/java/com/zsw/base/mapper/SuperMapper.java new file mode 100644 index 00000000..cdaba3d2 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/mapper/SuperMapper.java @@ -0,0 +1,36 @@ +package com.zsw.base.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 基于MP的 BaseMapper 新增了2个方法: insertBatchSomeColumn、updateAllById + * + * @param 实体 + * @author 云久 + * @date 2020年03月06日11:06:46 + */ +public interface SuperMapper extends BaseMapper { + + /** + * 全量修改所有字段 + * + * @param entity + * @return + */ + int updateAllById(@Param(Constants.ENTITY) T entity); + + /** + * 批量插入所有字段 + *

+ * 只测试过MySQL!只测试过MySQL!只测试过MySQL! + * + * @param entityList + * @return + */ + int insertBatchSomeColumn(List entityList); + +} diff --git a/zsw-spi/src/main/java/com/zsw/base/service/SuperService.java b/zsw-spi/src/main/java/com/zsw/base/service/SuperService.java new file mode 100644 index 00000000..7a02644c --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/base/service/SuperService.java @@ -0,0 +1,49 @@ +package com.zsw.base.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.zsw.base.mapper.SuperMapper; +import com.zsw.exception.BizException; +import com.zsw.exception.code.ExceptionCode; + +import java.util.List; + +/** + * 基于MP的 IService 新增了2个方法: saveBatchSomeColumn、updateAllById + * 其中: + * 1,updateAllById 执行后,会清除缓存 + * 2,saveBatchSomeColumn 批量插入 + * + * @param 实体 + * @author 云久 + * @date 2020年03月03日20:49:03 + */ +public interface SuperService extends IService { + + /** + * 批量保存数据 + *

+ * 注意:该方法仅仅测试过mysql + * + * @param entityList + * @return + */ + default boolean saveBatchSomeColumn(List entityList) { + if (entityList.isEmpty()) { + return true; + } + if (entityList.size() > 5000) { + throw BizException.wrap(ExceptionCode.TOO_MUCH_DATA_ERROR); + } + return SqlHelper.retBool(((SuperMapper) getBaseMapper()).insertBatchSomeColumn(entityList)); + } + + /** + * 根据id修改 entity 的所有字段 + * + * @param entity + * @return + */ + boolean updateAllById(T entity); + +} diff --git a/zsw-spi/src/main/java/com/zsw/enums/UserType.java b/zsw-spi/src/main/java/com/zsw/enums/UserType.java new file mode 100644 index 00000000..e0515c1a --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/enums/UserType.java @@ -0,0 +1,30 @@ +package com.zsw.enums; + +/** + * 用户类型枚举 + * + * @author xggz + * @since 2021/6/17 15:24 + */ +public enum UserType { + + /** + * 小程序用户 + */ + MINI, + + /** + * 商家账号 + */ + BUSINESS, + + /** + * 平台管理账号 + */ + PLATFORM_ADMIN, + + /** + * 平台App账号 + */ + PLATFORM_APP; +} \ No newline at end of file diff --git a/zsw-spi/src/main/java/com/zsw/exception/BaseCheckedException.java b/zsw-spi/src/main/java/com/zsw/exception/BaseCheckedException.java new file mode 100644 index 00000000..2f1b19e3 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/BaseCheckedException.java @@ -0,0 +1,55 @@ +package com.zsw.exception; + +/** + * 运行期异常基类 + * + * @author 云久 + * @version 1.0 + * @see Exception + */ +public abstract class BaseCheckedException extends Exception implements BaseException { + + private static final long serialVersionUID = 2706069899924648586L; + + /** + * 异常信息 + */ + protected String message; + + /** + * 具体异常码 + */ + protected int code; + + public BaseCheckedException(int code, String message) { + super(message); + this.code = code; + this.message = message; + } + + public BaseCheckedException(int code, String format, Object... args) { + super(String.format(format, args)); + this.code = code; + this.message = String.format(format, args); + } + + @Override + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/BaseException.java b/zsw-spi/src/main/java/com/zsw/exception/BaseException.java new file mode 100644 index 00000000..5e6f620d --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/BaseException.java @@ -0,0 +1,30 @@ +package com.zsw.exception; + +/** + * 异常接口类 + * + * @author 云久 + * @version 1.0, + */ +public interface BaseException { + + /** + * 统一参数验证异常码 + */ + int BASE_VALID_PARAM = -9; + + /** + * 返回异常信息 + * + * @return + */ + String getMessage(); + + /** + * 返回异常编码 + * + * @return + */ + int getCode(); + +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/BaseUncheckedException.java b/zsw-spi/src/main/java/com/zsw/exception/BaseUncheckedException.java new file mode 100644 index 00000000..464e3728 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/BaseUncheckedException.java @@ -0,0 +1,46 @@ +package com.zsw.exception; + +/** + * 非运行期异常基类,所有自定义非运行时异常继承该类 + * + * @author 云久 + * @version 1.0, + * @see RuntimeException + */ +public class BaseUncheckedException extends RuntimeException implements BaseException { + + private static final long serialVersionUID = -778887391066124051L; + + /** + * 异常信息 + */ + protected String message; + + /** + * 具体异常码 + */ + protected int code; + + public BaseUncheckedException(int code, String message) { + super(message); + this.code = code; + this.message = message; + } + + public BaseUncheckedException(int code, String format, Object... args) { + super(String.format(format, args)); + this.code = code; + this.message = String.format(format, args); + } + + + @Override + public String getMessage() { + return message; + } + + @Override + public int getCode() { + return code; + } +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/BizException.java b/zsw-spi/src/main/java/com/zsw/exception/BizException.java new file mode 100644 index 00000000..f82801c3 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/BizException.java @@ -0,0 +1,58 @@ +package com.zsw.exception; + +import com.zsw.exception.code.BaseExceptionCode; + +/** + * 业务异常 + * 用于在处理业务逻辑时,进行抛出的异常。 + * + * @author 云久 + * @version 1.0, + * @see Exception + */ +public class BizException extends BaseUncheckedException { + + private static final long serialVersionUID = -3843907364558373817L; + + public BizException(String message) { + super(-1, message); + } + + public BizException(int code, String message) { + super(code, message); + } + + public BizException(int code, String message, Object... args) { + super(code, message, args); + } + + /** + * 实例化异常 + * + * @param code 自定义异常编码 + * @param message 自定义异常消息 + * @param args 已定义异常参数 + * @return + */ + public static BizException wrap(int code, String message, Object... args) { + return new BizException(code, message, args); + } + + public static BizException wrap(String message, Object... args) { + return new BizException(-1, message, args); + } + + public static BizException validFail(String message, Object... args) { + return new BizException(-9, message, args); + } + + public static BizException wrap(BaseExceptionCode ex) { + return new BizException(ex.getCode(), ex.getMsg()); + } + + @Override + public String toString() { + return "BizException [message=" + message + ", code=" + code + "]"; + } + +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/CommonException.java b/zsw-spi/src/main/java/com/zsw/exception/CommonException.java new file mode 100644 index 00000000..c1cf8b50 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/CommonException.java @@ -0,0 +1,32 @@ +package com.zsw.exception; + +/** + * 非业务异常 + * 用于在处理非业务逻辑时,进行抛出的异常。 + * + * @author 云久 + * @version 1.0 + * @see Exception + */ +public class CommonException extends BaseCheckedException { + + + public CommonException(int code, String message) { + super(code, message); + } + + public CommonException(int code, String format, Object... args) { + super(code, String.format(format, args)); + this.code = code; + this.message = String.format(format, args); + } + + public CommonException wrap(int code, String format, Object... args) { + return new CommonException(code, format, args); + } + + @Override + public String toString() { + return "BizException [message=" + message + ", code=" + code + "]"; + } +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/code/BaseExceptionCode.java b/zsw-spi/src/main/java/com/zsw/exception/code/BaseExceptionCode.java new file mode 100644 index 00000000..5de802ef --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/code/BaseExceptionCode.java @@ -0,0 +1,18 @@ +package com.zsw.exception.code; + + +public interface BaseExceptionCode { + /** + * 异常编码 + * + * @return + */ + int getCode(); + + /** + * 异常消息 + * + * @return + */ + String getMsg(); +} diff --git a/zsw-spi/src/main/java/com/zsw/exception/code/ExceptionCode.java b/zsw-spi/src/main/java/com/zsw/exception/code/ExceptionCode.java new file mode 100644 index 00000000..06067510 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/exception/code/ExceptionCode.java @@ -0,0 +1,118 @@ +package com.zsw.exception.code; + + +/** + * 全局错误码 10000-15000 + *

+ * 预警异常编码 范围: 30000~34999 + * 标准服务异常编码 范围:35000~39999 + * 邮件服务异常编码 范围:40000~44999 + * 短信服务异常编码 范围:45000~49999 + * 权限服务异常编码 范围:50000-59999 + * 文件服务异常编码 范围:60000~64999 + * 日志服务异常编码 范围:65000~69999 + * 消息服务异常编码 范围:70000~74999 + * 开发者平台异常编码 范围:75000~79999 + * 搜索服务异常编码 范围:80000-84999 + * 共享交换异常编码 范围:85000-89999 + * 移动终端平台 异常码 范围:90000-94999 + *

+ * 安全保障平台 范围: 95000-99999 + * 软硬件平台 异常编码 范围: 100000-104999 + * 运维服务平台 异常编码 范围: 105000-109999 + * 统一监管平台异常 编码 范围: 110000-114999 + * 认证方面的异常编码 范围:115000-115999 + * + * @author 云久 + * @createTime 2017-12-13 16:22 + */ +public enum ExceptionCode implements BaseExceptionCode { + + //系统相关 start + SUCCESS(0, "成功"), + SYSTEM_BUSY(-1, "系统繁忙~请稍后再试~"), + SYSTEM_TIMEOUT(-2, "系统维护中~请稍后再试~"), + PARAM_EX(-3, "参数类型解析异常"), + SQL_EX(-4, "运行SQL出现异常"), + NULL_POINT_EX(-5, "空指针异常"), + ILLEGALA_ARGUMENT_EX(-6, "无效参数异常"), + MEDIA_TYPE_EX(-7, "请求类型异常"), + LOAD_RESOURCES_ERROR(-8, "加载资源出错"), + BASE_VALID_PARAM(-9, "统一验证参数异常"), + OPERATION_EX(-10, "操作异常"), + SERVICE_MAPPER_ERROR(-11, "Mapper类转换异常"), + CAPTCHA_ERROR(-12, "验证码校验失败"), + DuplicateKey(-13,"数据重复"), + + OK(200, "OK"), + BAD_REQUEST(400, "错误的请求"), + /** + * {@code 401 Unauthorized}. + * + * @see HTTP/1.1: Authentication, section 3.1 + */ + UNAUTHORIZED(401, "未经授权"), + /** + * {@code 404 Not Found}. + * + * @see HTTP/1.1: Semantics and Content, section 6.5.4 + */ + NOT_FOUND(404, "没有找到资源"), + METHOD_NOT_ALLOWED(405, "不支持当前请求类型"), + + TOO_MANY_REQUESTS(429, "请求超过次数限制"), + INTERNAL_SERVER_ERROR(500, "内部服务错误"), + BAD_GATEWAY(502, "网关错误"), + GATEWAY_TIMEOUT(504, "网关超时"), + //系统相关 end + + REQUIRED_FILE_PARAM_EX(1001, "请求中必须至少包含一个有效文件"), + + DATA_SAVE_ERROR(2000, "新增数据失败"), + DATA_UPDATE_ERROR(2001, "修改数据失败"), + TOO_MUCH_DATA_ERROR(2002, "批量新增数据过多"), + //jwt token 相关 start + + JWT_BASIC_INVALID(40000, "无效的基本身份验证令牌"), + JWT_TOKEN_EXPIRED(40001, "会话超时,请重新登录"), + JWT_SIGNATURE(40002, "不合法的token,请认真比对 token 的签名"), + JWT_ILLEGAL_ARGUMENT(40003, "缺少token参数"), + JWT_GEN_TOKEN_FAIL(40004, "生成token失败"), + JWT_PARSER_TOKEN_FAIL(40005, "解析用户身份错误,请重新登录!"), + JWT_USER_INVALID(40006, "用户名或密码错误"), + JWT_USER_ENABLED(40007, "用户已经被禁用!"), + JWT_OFFLINE(40008, "您已在另一个设备登录!"), + USER_NOT_BIND_PLATFORM(40030,"您没有注册平台会员,暂不支持本操作"), + //jwt token 相关 end + + ; + + private int code; + private String msg; + + ExceptionCode(int code, String msg) { + this.code = code; + this.msg = msg; + } + + @Override + public int getCode() { + return code; + } + + @Override + public String getMsg() { + return msg; + } + + + public ExceptionCode build(String msg, Object... param) { + this.msg = String.format(msg, param); + return this; + } + + public ExceptionCode param(Object... param) { + msg = String.format(msg, param); + return this; + } +} diff --git a/zsw-spi/src/main/java/com/zsw/model/AuthInfo.java b/zsw-spi/src/main/java/com/zsw/model/AuthInfo.java new file mode 100644 index 00000000..707c62e1 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/model/AuthInfo.java @@ -0,0 +1,46 @@ +package com.zsw.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * AuthInfo + * + * @author 云久 + * @date 2020年03月31日21:43:31 + */ +@Data +@Accessors(chain = true) +@ApiModel(description = "认证信息") +public class AuthInfo { + @ApiModelProperty(value = "令牌") + private String token; + @ApiModelProperty(value = "令牌类型") + private String tokenType; + @ApiModelProperty(value = "刷新令牌") + private String refreshToken; + @ApiModelProperty(value = "用户名") + private String name; + @ApiModelProperty(value = "账号名") + private String account; + @ApiModelProperty(value = "头像") + private String avatar; + @ApiModelProperty(value = "工作描述") + private String workDescribe; + @ApiModelProperty(value = "用户id") + private Long userId; + @ApiModelProperty(value = "用户类型") + private String userType; + @ApiModelProperty(value = "过期时间(秒)") + private long expire; + @ApiModelProperty(value = "到期时间") + private Date expiration; + @ApiModelProperty(value = "注册手机号") + private String mobile; +} + + diff --git a/zsw-spi/src/main/java/com/zsw/model/AuthStore.java b/zsw-spi/src/main/java/com/zsw/model/AuthStore.java new file mode 100644 index 00000000..45828228 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/model/AuthStore.java @@ -0,0 +1,27 @@ +package com.zsw.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel("登录查找的门店信息") +@Builder +public class AuthStore implements Serializable { + + @ApiModelProperty("门店id") + private Long id; + + @ApiModelProperty("门店名称") + private String name; + + @ApiModelProperty(value = "商户类型") + private String posType; + + @ApiModelProperty("是否启用了进销存") + private Boolean useErp; + +} diff --git a/zsw-spi/src/main/java/com/zsw/model/JwtUserInfo.java b/zsw-spi/src/main/java/com/zsw/model/JwtUserInfo.java new file mode 100644 index 00000000..c6019881 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/model/JwtUserInfo.java @@ -0,0 +1,47 @@ +package com.zsw.model; + +import com.zsw.enums.UserType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * jwt 存储的 内容 + * + * @author 云久 + * @date 2018/11/20 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class JwtUserInfo implements Serializable { + + /** + * 账号id + */ + private Long userId; + + /** + * 账号 + */ + private String account; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 用户类型 + */ + private UserType userType; +} \ No newline at end of file diff --git a/zsw-spi/src/main/java/com/zsw/model/TenantAuthInfo.java b/zsw-spi/src/main/java/com/zsw/model/TenantAuthInfo.java new file mode 100644 index 00000000..d6e4c32f --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/model/TenantAuthInfo.java @@ -0,0 +1,25 @@ +package com.zsw.model; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import java.util.List; + +@Data +@ApiModel(description = "商户认证信息") +@ToString(callSuper = true) +public class TenantAuthInfo extends AuthInfo { + + @ApiModelProperty(value = "商户编码") + private String tenantCode; + + @ApiModelProperty("是否是商户管理员") + private Boolean isAdmin = false; + + @ApiModelProperty("店铺列表") + private List storeList; + +} diff --git a/zsw-spi/src/main/java/com/zsw/model/Token.java b/zsw-spi/src/main/java/com/zsw/model/Token.java new file mode 100644 index 00000000..3ae60a8a --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/model/Token.java @@ -0,0 +1,32 @@ +package com.zsw.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Token implements Serializable { + private static final long serialVersionUID = -8482946147572784305L; + /** + * token + */ + @ApiModelProperty(value = "token") + private String token; + /** + * 有效时间:单位:秒 + */ + @ApiModelProperty(value = "有效期") + private Long expire; + + + @ApiModelProperty(value = "到期时间") + private Date expiration; + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/authority/dto/auth/LoginParamDTO.java b/zsw-spi/src/main/java/com/zsw/pos/authority/dto/auth/LoginParamDTO.java new file mode 100644 index 00000000..5438e07e --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/authority/dto/auth/LoginParamDTO.java @@ -0,0 +1,50 @@ +package com.zsw.pos.authority.dto.auth; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; + +/** + * 登录参数 + * + * @author 云久 + * @date 2020年01月05日22:18:12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Builder +@ApiModel(value = "LoginParamDTO", description = "登录参数") +public class LoginParamDTO implements Serializable { + @ApiModelProperty(value = "验证码KEY") + private String key; + @ApiModelProperty(value = "验证码") + private String code; + + @ApiModelProperty(value = "账号") + private String account; + @ApiModelProperty(value = "密码") + private String password; + + /** + * password: 账号密码 + * refresh_token: 刷新token + * captcha: 验证码 + */ + @ApiModelProperty(value = "授权类型", example = "captcha", allowableValues = "captcha,refresh_token,password") + @NotEmpty(message = "授权类型不能为空") + private String grantType; + + /** + * 前端界面点击清空缓存时调用 + */ + @ApiModelProperty(value = "刷新token") + private String refreshToken; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/oauth/service/LoginService.java b/zsw-spi/src/main/java/com/zsw/pos/oauth/service/LoginService.java new file mode 100644 index 00000000..cd67a760 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/oauth/service/LoginService.java @@ -0,0 +1,11 @@ +package com.zsw.pos.oauth.service; + +import com.zsw.base.R; +import com.zsw.model.TenantAuthInfo; +import com.zsw.pos.authority.dto.auth.LoginParamDTO; + +public interface LoginService { + + R grant(LoginParamDTO loginParam); + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/dto/AdminStoreProductDTO.java b/zsw-spi/src/main/java/com/zsw/pos/product/dto/AdminStoreProductDTO.java new file mode 100644 index 00000000..59143f9a --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/dto/AdminStoreProductDTO.java @@ -0,0 +1,41 @@ +package com.zsw.pos.product.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@ApiModel("查询店铺商品使用") +@Data +public class AdminStoreProductDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("是否查询新品") + private Integer newItem; + + @ApiModelProperty("价格排序 -1-从小到大 0-不排序 1-从大到小") + private Integer price; + + @ApiModelProperty("销量排序 -1-从小到大 0-不排序 1-从大到小") + private Integer sellCount; + + @ApiModelProperty("页码 从1开始") + private Integer pageIndex; + + @ApiModelProperty("每页大小") + private Integer pageSize; + + @ApiModelProperty(value = "起始行; 内部使用", hidden = true) + private Integer start; + + @ApiModelProperty(value = "排序条件; 内部使用", hidden = true) + private String orderBy; + + @ApiModelProperty("店铺id, 小程序查询需要传这个参数, 管理后台不用") + private Long storeId; + + @ApiModelProperty("分组id") + private Long groupId; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/dto/IdQueryDTO.java b/zsw-spi/src/main/java/com/zsw/pos/product/dto/IdQueryDTO.java new file mode 100644 index 00000000..cd91cf00 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/dto/IdQueryDTO.java @@ -0,0 +1,15 @@ +package com.zsw.pos.product.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel("只需要根据id查询的接口参数对象") +public class IdQueryDTO implements Serializable { + + @ApiModelProperty("主键id") + private Long id; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/dto/StoreDTO.java b/zsw-spi/src/main/java/com/zsw/pos/product/dto/StoreDTO.java new file mode 100644 index 00000000..ae72eb97 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/dto/StoreDTO.java @@ -0,0 +1,31 @@ +package com.zsw.pos.product.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel("商详店铺信息") +public class StoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("店铺id") + private Long id; + + private String storeName; + + @ApiModelProperty("别名") + private String nickName; + + @ApiModelProperty("店铺图像") + private String logo; + + @ApiModelProperty("商品总类") + private Integer productCount; + + @ApiModelProperty("已售数量") + private Integer soldNum; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/entity/Product.java b/zsw-spi/src/main/java/com/zsw/pos/product/entity/Product.java new file mode 100644 index 00000000..95c0ae88 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/entity/Product.java @@ -0,0 +1,213 @@ +package com.zsw.pos.product.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.zsw.base.entity.Entity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; +import org.springframework.util.ObjectUtils; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + *

+ * 实体类 + * 商品表 + *

+ * + * @author JustArgo + * @since 2020-05-24 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("ceres_product") +@ApiModel(value = "Product", description = "商品表") +@AllArgsConstructor +@Builder +public class Product extends Entity { + + private static final long serialVersionUID = 1L; + + + private Long id; + + /** + * 供应商 + */ + @ApiModelProperty(value = "供应商") + @NotEmpty(message = "供应商不能为空") + @TableField(value = "supplier_name", condition = LIKE) + private String supplierName; + + /** + * 店铺id + */ + @ApiModelProperty(value = "店铺id") + @NotNull(message = "店铺id不能为空") + @TableField("store_id") + private Long storeId; + + /** + * 商品类目ID.必须是叶子类目ID + */ + @ApiModelProperty(value = "商品类目ID.必须是叶子类目ID") + @TableField("category_id") + private Long categoryId; + + /** + * 分组id + */ + @ApiModelProperty(value = "分组id") + @TableField("group_id") + private Long groupId; + + /** + * 商品简称 + */ + @ApiModelProperty(value = "商品简称") + @TableField(value = "short_name", condition = LIKE) + private String shortName; + + /** + * 商品名称 + */ + @ApiModelProperty(value = "商品名称") + @TableField(value = "product_name", condition = LIKE) + private String productName; + + /** + * 商品卖点说明文字 例如:全网最便宜 + */ + @ApiModelProperty(value = "商品卖点说明文字 例如:全网最便宜") + @TableField(value = "sell_desc", condition = LIKE) + private String sellDesc; + + /** + * 商品自编号 + */ + @ApiModelProperty(value = "商品自编号") + @TableField(value = "product_code", condition = LIKE) + private String productCode; + + /** + * 重量,单位:克 + */ + @ApiModelProperty(value = "重量,单位:克") + @TableField("weight") + private Long weight; + + /** + * 采购价,单位:分 + */ + @ApiModelProperty(value = "采购价,单位:分") + @TableField("apply_price") + private BigDecimal applyPrice; + + /** + * 商品列表时显示的价格 + */ + @ApiModelProperty(value = "商品列表时显示的价格") + @TableField("price") + private BigDecimal price; + + /** + * 总库存 + */ + @ApiModelProperty(value = "总库存") + @NotNull(message = "总库存不能为空") + @TableField("stock") + private Integer stock; + + /** + * 总销量 + */ + @ApiModelProperty(value = "总销量") + @TableField("sell_count") + private Integer sellCount; + + /** + * 需要物流:1-需要 0-不需要 + */ + @ApiModelProperty(value = "需要物流:1-需要 0-不需要") + @TableField("need_logistics") + private Integer needLogistics; + + /** + * 允许超卖:1-允许 0-不允许 + */ + @ApiModelProperty(value = "允许超卖:1-允许 0-不允许") + @TableField("oversold") + private Integer oversold; + + /** + * 有机值 + */ + @ApiModelProperty(value = "有机值") + @TableField("organic") + private Integer organic; + + /** + * 状态:1-上架 0-下架 + */ + @ApiModelProperty(value = "状态:1-上架 0-下架") + @TableField("status") + private Integer status; + + @ApiModelProperty(value = "是否在小程序显示(0:否 1:是)") + @TableField("pos_show") + private Boolean posShow; + + @ApiModelProperty(value = "商品类型(0:普通类型;1:拼盘类型)") + @TableField("product_type") + private Integer productType; + + @ApiModelProperty("套餐购买数量 5选2") + @TableField("product_number") + private Integer productNumber; + + /** + * 套餐专属商品 0是 1不是 + */ + @ApiModelProperty(value = "套餐专属商品 0是 1不是") + @TableField("set_meal") + private Integer setMeal; + + /** + * 款式类型:1-多款式 0-单款式 + */ + @ApiModelProperty(value = "款式类型:1-多款式 0-单款式") + @TableField("attr_style") + private Integer attrStyle; + + /** + * 逻辑删除 1-删除 0-未删除 + */ + @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除") + @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空") + @TableField("is_delete") + private Integer isDelete; + + @ApiModelProperty("打印分组标签") + @TableField("printer_flag") + private String printerFlag; + + @ApiModelProperty("仓库成品物料id") + @TableField("material_id") + private Long materialId; + + public String getPrinterFlag() { + if (ObjectUtils.isEmpty(printerFlag)){ + return "DEFAULT"; + } + return printerFlag; + } +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/entity/ProductSku.java b/zsw-spi/src/main/java/com/zsw/pos/product/entity/ProductSku.java new file mode 100644 index 00000000..324285ea --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/entity/ProductSku.java @@ -0,0 +1,153 @@ +package com.zsw.pos.product.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.zsw.base.entity.Entity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + *

+ * 实体类 + * 商品的sku + *

+ * + * @author JustArgo + * @since 2020-05-18 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName(value = "ceres_product_sku",autoResultMap = true) +@ApiModel(value = "ProductSku", description = "商品的sku") +@AllArgsConstructor +@Builder +public class ProductSku extends Entity { + + private static final long serialVersionUID = 1L; + + /** + * 店铺id + */ + @ApiModelProperty(value = "店铺id") + @NotNull(message = "店铺id不能为空") + @TableField("store_id") + private Long storeId; + + /** + * sku编码 + */ + @ApiModelProperty(value = "sku编码") + @Length(max = 255, message = "sku编码长度不能超过255") + @TableField(value = "sku_code", condition = LIKE) + private String skuCode; + + /** + * sku的规格值组合,例如:红色 43码 + */ + @ApiModelProperty(value = "sku的规格值组合,例如:红色 43码") + @Length(max = 255, message = "sku的规格值组合,例如:红色 43码长度不能超过255") + @TableField(value = "sku_name_str", condition = LIKE) + private String skuNameStr; + + /** + * 商品id + */ + @ApiModelProperty(value = "商品id") + @TableField("product_id") + private Long productId; + + /** + * 销售价 + */ + @ApiModelProperty(value = "销售价") + @TableField("sku_price") + private BigDecimal skuPrice; + + /** + * 采购价 + */ + @ApiModelProperty(value = "采购价") + @TableField("apply_price") + private BigDecimal applyPrice; + + @ApiModelProperty("会员价格") + @TableField("vip_price") + private BigDecimal vipPrice; + + + /** + * sku的图片 + */ + @ApiModelProperty(value = "sku的图片") + @Length(max = 200, message = "sku的图片长度不能超过200") + @TableField(value = "sku_img", condition = LIKE) + private String skuImg; + + /** + * sku的库存 + */ + @ApiModelProperty(value = "sku的库存 只用于不启用进销存") + @TableField("sku_stock") + private Integer skuStock; + + /** + * 自动恢复库存(如果大于0,则每天凌晨恢复到设置的库存) + */ + @ApiModelProperty(value = "自动恢复库存") + @TableField("auto_renew_sku_stock") + private Integer autoRenewSkuStock; + + @ApiModelProperty(value = "sku的排序") + @TableField("sort") + private Integer sort; + + /** + * sku套餐 + */ + @ApiModelProperty(value = "sku套餐") + @TableField("set_meal") + private String setMeal; + + + /** + * 重量,单位(千克) + */ + @ApiModelProperty(value = "重量,单位(千克)") + @TableField("weight") + private Double weight; + + @ApiModelProperty(value = "体积,单位(平方米)") + @TableField("volume") + private Double volume; + + /** + * 逻辑删除 1-删除 0-未删除 + */ + @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除") + @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空") + @TableField("is_delete") + private Integer isDelete; + + @ApiModelProperty("SKU的原材料信息") + @TableField(value = "material",typeHandler = JacksonTypeHandler.class) + private SkuMaterial material; + + private Integer version; + + + + + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/entity/SkuMaterial.java b/zsw-spi/src/main/java/com/zsw/pos/product/entity/SkuMaterial.java new file mode 100644 index 00000000..bb80b46b --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/entity/SkuMaterial.java @@ -0,0 +1,30 @@ +package com.zsw.pos.product.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +@ApiModel("sku的物料设置") +public class SkuMaterial { + + @ApiModelProperty("成品id") + @NotNull(message = "物料id不能为空") + private Long materialId; + + @ApiModelProperty("标准量") + @NotNull(message = "标准数量不能为空") + private BigDecimal num; + + @ApiModelProperty("成品名称") + private String materialName; + + @ApiModelProperty("单位") + private String unit; + + @ApiModelProperty("是否可用") + private Boolean enable; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductService.java b/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductService.java new file mode 100644 index 00000000..070f0629 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductService.java @@ -0,0 +1,23 @@ +package com.zsw.pos.product.service; + + +import com.zsw.base.R; +import com.zsw.base.service.SuperService; +import com.zsw.pos.product.dto.AdminStoreProductDTO; +import com.zsw.pos.product.entity.Product; +import com.zsw.pos.product.vo.ProductPageVO; + +/** + *

+ * 业务接口 + * 商品表 + *

+ * + * @author JustArgo + * @date 2020-05-03 + */ +public interface ProductService extends SuperService { + + R findAdminStoreProductList(AdminStoreProductDTO adminStoreProductDTO); + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductSkuService.java b/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductSkuService.java new file mode 100644 index 00000000..118c6491 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/service/ProductSkuService.java @@ -0,0 +1,22 @@ +package com.zsw.pos.product.service; + +import com.zsw.base.service.SuperService; +import com.zsw.pos.product.entity.ProductSku; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 业务接口 + * 商品的sku + *

+ * + * @author JustArgo + * @date 2020-05-07 + */ +public interface ProductSkuService extends SuperService { + + List getProductSkuByMaterial(@Param("ids") List ids); + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductPageVO.java b/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductPageVO.java new file mode 100644 index 00000000..c18eea44 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductPageVO.java @@ -0,0 +1,43 @@ +package com.zsw.pos.product.vo; + +import com.zsw.pos.promotion.vo.web.PromotionShowVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Collections; +import java.util.List; + +@ApiModel("商品列表对象") +@Data +public class ProductPageVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("商品列表") + private List productVOList; + + @ApiModelProperty("商品符合的营销活动的列表") + private List promotionShowVOList; + + @ApiModelProperty("总数") + private Integer total; + + public ProductPageVO(){ + this.total = 0; + this.productVOList = Collections.emptyList(); + } + + public ProductPageVO(Integer total, List productVOList){ + this.total = total; + this.productVOList = productVOList; + } + + public ProductPageVO(Integer total, List productVOList, List promotionShowVOList){ + this.total = total; + this.productVOList = productVOList; + this.promotionShowVOList = promotionShowVOList; + } + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductVO.java b/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductVO.java new file mode 100644 index 00000000..ead98a5a --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/product/vo/ProductVO.java @@ -0,0 +1,54 @@ +package com.zsw.pos.product.vo; + +import cn.hutool.json.JSONArray; +import com.zsw.pos.product.dto.StoreDTO; +import com.zsw.pos.product.entity.Product; +import com.zsw.pos.promotion.dto.ProductSkuVO; +import com.zsw.pos.promotion.vo.web.PromotionShowVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@ApiModel("商详对象") +@Data +public class ProductVO extends Product { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("商品图片列表") + private List imgs; + + @ApiModelProperty("门店信息") + private StoreDTO storeDTO; + + @ApiModelProperty("规格列表") + private JSONArray attrList; + + @ApiModelProperty("商品sku列表") + private List productSkuVOList; + + @ApiModelProperty("发货地址") + private String shipAddress; + + @ApiModelProperty("付款人数") + private Integer buyCount; + + @ApiModelProperty("参加的活动列表") + private List promotionShowVOList; + + @ApiModelProperty("默认购买数量。。。") + private Integer buyNum; + + @ApiModelProperty("商品拼盘数据") + JSONArray productPlatterInfos; + + @ApiModelProperty("该商品被手动标记售罄") + private Boolean markProductNone; + + @ApiModelProperty("名称拼音") + private String namePinyin; + + @ApiModelProperty("首字母缩写") + private String nameInitials; +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuSaveDTO.java b/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuSaveDTO.java new file mode 100644 index 00000000..b840613f --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuSaveDTO.java @@ -0,0 +1,36 @@ +package com.zsw.pos.promotion.dto; + +import cn.hutool.json.JSONArray; +import com.zsw.pos.product.entity.ProductSku; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 实体类 + * 商品的sku + *

+ * + * @author JustArgo + * @since 2020-05-16 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "ProductSkuSaveDTO", description = "商品的sku") +public class ProductSkuSaveDTO extends ProductSku { + + @ApiModelProperty(value = "sku对应的规格编码") + private JSONArray skuAttrCodeDTOList; + + @ApiModelProperty(value = "sku对应的规格列表,编辑商品时使用") + private JSONArray skuAttrList; + + @ApiModelProperty(value = "sku里的setMeal详情,点套餐时使用") + private JSONArray setMealDTOList; + + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuVO.java b/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuVO.java new file mode 100644 index 00000000..83a9b989 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/promotion/dto/ProductSkuVO.java @@ -0,0 +1,10 @@ +package com.zsw.pos.promotion.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@ApiModel("商品sku的前端返回对象") +@Data +public class ProductSkuVO extends ProductSkuSaveDTO { + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/promotion/vo/web/PromotionShowVO.java b/zsw-spi/src/main/java/com/zsw/pos/promotion/vo/web/PromotionShowVO.java new file mode 100644 index 00000000..e47e8157 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/promotion/vo/web/PromotionShowVO.java @@ -0,0 +1,20 @@ +package com.zsw.pos.promotion.vo.web; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 营销活动列表展示对象 + */ +@ApiModel("营销活动列表展示对象") +@Data +public class PromotionShowVO { + + @ApiModelProperty("营销活动的id") + private Long id; + + @ApiModelProperty("营销活动的标签") + private String tag; + +} diff --git a/zsw-spi/src/main/java/com/zsw/pos/store/StoreService.java b/zsw-spi/src/main/java/com/zsw/pos/store/StoreService.java new file mode 100644 index 00000000..2886fe60 --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/store/StoreService.java @@ -0,0 +1,17 @@ +package com.zsw.pos.store; + +import com.zsw.base.service.SuperService; +import com.zsw.pos.store.entity.Store; + +/** + *

+ * 业务接口 店铺表 + *

+ * + * @author kellen + * @date 2020-05-14 + */ + +public interface StoreService extends SuperService { + +} \ No newline at end of file diff --git a/zsw-spi/src/main/java/com/zsw/pos/store/entity/Store.java b/zsw-spi/src/main/java/com/zsw/pos/store/entity/Store.java new file mode 100644 index 00000000..06d00d6e --- /dev/null +++ b/zsw-spi/src/main/java/com/zsw/pos/store/entity/Store.java @@ -0,0 +1,276 @@ +package com.zsw.pos.store.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zsw.base.entity.Entity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalTime; + +import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; + +/** + *

+ * 实体类 店铺表 + *

+ * + * @author kellen + * @since 2020-05-14 + */ +@Data +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName(value = "ceres_store", autoResultMap = true) +@ApiModel(value = "Store", description = "店铺表") +@AllArgsConstructor +public class Store extends Entity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "租户编号") + private String tenantCode; + + @ApiModelProperty(value = "是否用进销存管理库存(0:否;1:是)") + @TableField(value = "use_erp") + private Boolean useErp; + + /** + * 营业开始时间 + */ + @ApiModelProperty(value = "营业开始时间") + @TableField(value = "open_start_time") + @JsonFormat(pattern = "HH:mm:ss") + private LocalTime openStartTime; + + /** + * 营业结束时间 + */ + @ApiModelProperty(value = "营业结束时间") + @TableField(value = "open_end_time") + @JsonFormat(pattern = "HH:mm:ss") + private LocalTime openEndTime; + + /** + * 店铺名称 + */ + @ApiModelProperty(value = "店铺名称") + @Length(max = 200, message = "店铺名称长度不能超过200") + @TableField(value = "store_name", condition = LIKE) + private String storeName; + + @ApiModelProperty(value = "店铺别名") + @TableField("nick_name") + private String nickName; + + /** + * logo + */ + @ApiModelProperty(value = "logo") + @Length(max = 500, message = "logo长度不能超过500") + @TableField(value = "logo", condition = LIKE) + private String logo; + + /** + * facade + */ + @ApiModelProperty(value = "facade") + @Length(max = 500, message = "facade长度不能超过500") + @TableField(value = "facade", condition = LIKE) + private String facade; + + /** + * 发货地址 + */ + @ApiModelProperty(value = "发货地址") + @Length(max = 500, message = "发货地址长度不能超过500") + @TableField(value = "ship_address", condition = LIKE) + private String shipAddress; + + /** + * 店铺简介 + */ + @ApiModelProperty(value = "店铺简介") + @Length(max = 500, message = "店铺简介长度不能超过500") + @TableField(value = "remark", condition = LIKE) + private String remark; + + /** + * 注册手机号 + */ + @ApiModelProperty(value = "注册手机号") + @NotEmpty(message = "注册手机号不能为空") + @Length(max = 32, message = "注册手机号长度不能超过32") + @TableField(value = "mobile", condition = LIKE) + private String mobile; + + @ApiModelProperty("经度") + private BigDecimal longitude; + + @ApiModelProperty("纬度") + private BigDecimal latitude; + + /** + * 退货地址 + */ + @ApiModelProperty(value = "退货地址") + @Length(max = 500, message = "退货地址长度不能超过500") + @TableField(value = "refund_address", condition = LIKE) + private String refundAddress; + + /** + * 退货联系电话 + */ + @ApiModelProperty(value = "退货联系电话") + @Length(max = 32, message = "退货联系电话长度不能超过32") + @TableField(value = "refund_tel", condition = LIKE) + private String refundTel; + + /** + * 退货联系人 + */ + @ApiModelProperty(value = "退货联系人") + @Length(max = 32, message = "退货联系人长度不能超过32") + @TableField(value = "refund_contact", condition = LIKE) + private String refundContact; + + /** + * 是否自动发送退货地址给买家 0否 1是 + */ + @ApiModelProperty(value = "是否自动发送退货地址给买家 0否 1是") + @NotNull(message = "是否自动发送退货地址给买家 0否 1是不能为空") + @TableField("is_auto_send_refund_address") + private Integer isAutoSendRefundAddress; + + /** + * 省份 + */ + @ApiModelProperty(value = "省份") + @NotEmpty(message = "省份不能为空") + @Length(max = 20, message = "省份长度不能超过20") + @TableField(value = "province", condition = LIKE) + private String province; + + /** + * 城市 + */ + @ApiModelProperty(value = "城市") + @NotEmpty(message = "城市不能为空") + @Length(max = 20, message = "城市长度不能超过20") + @TableField(value = "city", condition = LIKE) + private String city; + + /** + * 地区 + */ + @ApiModelProperty(value = "地区") + @NotEmpty(message = "地区不能为空") + @Length(max = 20, message = "地区长度不能超过20") + @TableField(value = "district", condition = LIKE) + private String district; + + /** + * 详细地址 + */ + @ApiModelProperty(value = "详细地址") + @NotEmpty(message = "详细地址不能为空") + @Length(max = 250, message = "详细地址长度不能超过250") + @TableField(value = "address", condition = LIKE) + private String address; + + /** + * 负责人名称 + */ + @ApiModelProperty(value = "负责人名称") + @Length(max = 50, message = "负责人名称长度不能超过50") + @TableField(value = "head_name", condition = LIKE) + private String headName; + + /** + * 收货人电话 + */ + @ApiModelProperty(value = "负责人电话") + @NotEmpty(message = "负责人电话不能为空") + @Length(max = 30, message = "负责人电话长度不能超过30") + @TableField(value = "head_mobile", condition = LIKE) + private String headMobile; + + @ApiModelProperty(value = "联系电话") + @TableField(value = "tel") + private String tel; + + @ApiModelProperty("提供服务") + @TableField("business_service") + private String businessService; + + @ApiModelProperty("业务类型") + @TableField("business_type") + private String businessType; + + /** + * 收单类型 + * #{NORMAL:普通收单;FAST:快消收单 + */ +// @ApiModelProperty(value = "收单类型") +// @TableField("pos_type") +// @JsonProperty(value = "posType") +// private TenantPosTypeEnum posType; +// +// @ApiModelProperty("第三方配送设置") +// @TableField(value = "delivery_info", typeHandler = JacksonTypeHandler.class) +// private DeliveryInfo deliveryInfo; +// +// @ApiModelProperty("小程序配置") +// @TableField(value = "mini_param", typeHandler = JacksonTypeHandler.class) +// private MiniParam miniParam; + + @ApiModelProperty("店铺余额") + private BigDecimal money; + + @ApiModelProperty("平台是否显示") + @TableField("platform_show") + private Boolean platformShow; + + @TableLogic + @TableField("is_delete") + private Integer is_delete; + + @Builder + public Store(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String tenantCode, Boolean useErp, LocalTime openStartTime, LocalTime openEndTime, String storeName, String nickName, String logo, String shipAddress, String remark, String mobile, BigDecimal longitude, BigDecimal latitude, String refundAddress, String refundTel, String refundContact, Integer isAutoSendRefundAddress, String province, String city, String district, String address, String headName, String headMobile, Boolean platformShow) { + super(id, createTime, createUser, updateTime, updateUser); + this.tenantCode = tenantCode; + this.useErp = useErp; + this.openStartTime = openStartTime; + this.openEndTime = openEndTime; + this.storeName = storeName; + this.nickName = nickName; + this.logo = logo; + this.shipAddress = shipAddress; + this.remark = remark; + this.mobile = mobile; + this.longitude = longitude; + this.latitude = latitude; + this.refundAddress = refundAddress; + this.refundTel = refundTel; + this.refundContact = refundContact; + this.isAutoSendRefundAddress = isAutoSendRefundAddress; + this.province = province; + this.city = city; + this.district = district; + this.address = address; + this.headName = headName; + this.headMobile = headMobile; + this.platformShow = platformShow; + } +} \ No newline at end of file