diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index 2c26a5a2..0b845be8 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50704 File Encoding : 65001 -Date: 2023-05-28 22:28:31 +Date: 2023-06-21 19:00:09 */ SET FOREIGN_KEY_CHECKS=0; @@ -702,7 +702,7 @@ CREATE TABLE `jsh_platform_config` ( `platform_key_info` varchar(100) DEFAULT NULL COMMENT '关键词名称', `platform_value` varchar(200) DEFAULT NULL COMMENT '值', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='平台参数'; +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='平台参数'; -- ---------------------------- -- Records of jsh_platform_config @@ -725,7 +725,6 @@ INSERT INTO `jsh_platform_config` VALUES ('15', 'aliOss_accessKeySecret', '阿 INSERT INTO `jsh_platform_config` VALUES ('16', 'aliOss_bucketName', '阿里OSS-bucketName', ''); INSERT INTO `jsh_platform_config` VALUES ('17', 'aliOss_linkUrl', '阿里OSS-linkUrl', ''); - -- ---------------------------- -- Table structure for jsh_role -- ---------------------------- @@ -827,6 +826,7 @@ CREATE TABLE `jsh_supplier` ( `account_number` varchar(50) DEFAULT NULL COMMENT '账号', `tax_rate` decimal(24,6) DEFAULT NULL COMMENT '税率', `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `creator` bigint(20) DEFAULT NULL COMMENT '操作员', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) @@ -835,13 +835,13 @@ CREATE TABLE `jsh_supplier` ( -- ---------------------------- -- Records of jsh_supplier -- ---------------------------- -INSERT INTO `jsh_supplier` VALUES ('57', '供应商1', '小军', '12345678', '', '', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '4.000000', '', '15000000000', '地址1', '', '', '', '12.000000', null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('58', '客户1', '小李', '12345678', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '-100.000000', null, '', '', '', '', '', '', '12.000000', null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('59', '客户2', '小陈', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('60', '12312666', '小曹', '', '', '', null, '会员', '', '970.000000', '0.000000', '0.000000', null, null, '', '13000000000', '', '', '', '', null, null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('68', '供应商3', '晓丽', '12345678', '', 'fasdfadf', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '-35.000000', '', '13000000000', 'aaaa', '1341324', '', '', '13.000000', null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('71', '客户3', '小周', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '0'); -INSERT INTO `jsh_supplier` VALUES ('74', '供应商5', '小季', '77779999', '', '', null, '供应商', '', '0.000000', '0.000000', '5.000000', '0.000000', '5.000000', '', '15806283912', '', '', '', '', '3.000000', null, '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('57', '供应商1', '小军', '12345678', '', '', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '4.000000', '', '15000000000', '地址1', '', '', '', '12.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('58', '客户1', '小李', '12345678', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '-100.000000', null, '', '', '', '', '', '', '12.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('59', '客户2', '小陈', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('60', '12312666', '小曹', '', '', '', null, '会员', '', '970.000000', '0.000000', '0.000000', null, null, '', '13000000000', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('68', '供应商3', '晓丽', '12345678', '', 'fasdfadf', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '-35.000000', '', '13000000000', 'aaaa', '1341324', '', '', '13.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('71', '客户3', '小周', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('74', '供应商5', '小季', '77779999', '', '', null, '供应商', '', '0.000000', '0.000000', '5.000000', '0.000000', '5.000000', '', '15806283912', '', '', '', '', '3.000000', null, '63', '63', '0'); -- ---------------------------- -- Table structure for jsh_system_config diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt index 7869d87b..fa0d5ca3 100644 --- a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt +++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt @@ -1509,4 +1509,12 @@ INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platfor INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_accessKeyId', '阿里OSS-accessKeyId', ''); INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_accessKeySecret', '阿里OSS-accessKeySecret', ''); INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_bucketName', '阿里OSS-bucketName', ''); -INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_linkUrl', '阿里OSS-linkUrl', ''); \ No newline at end of file +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_linkUrl', '阿里OSS-linkUrl', ''); + +-- -------------------------------------------------------- +-- 时间 2023年06月21日 +-- by jishenghua +-- 给商家表增加操作员字段,并给该字段赋默认值 +-- -------------------------------------------------------- +alter table jsh_supplier add creator bigint(20) DEFAULT NULL COMMENT '操作员' after sort; +update jsh_supplier set creator=tenant_id; \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Supplier.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Supplier.java index 45191b6b..5d82e519 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Supplier.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Supplier.java @@ -47,6 +47,8 @@ public class Supplier { private String sort; + private Long creator; + private Long tenantId; private String deleteFlag; @@ -227,6 +229,14 @@ public class Supplier { this.sort = sort == null ? null : sort.trim(); } + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + public Long getTenantId() { return tenantId; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SupplierExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SupplierExample.java index dd1379d8..6af9583c 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SupplierExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SupplierExample.java @@ -1555,6 +1555,66 @@ public class SupplierExample { 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 andTenantIdIsNull() { addCriterion("tenant_id is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java index 9f5d4660..96726101 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/SupplierMapperEx.java @@ -14,6 +14,7 @@ public interface SupplierMapperEx { @Param("type") String type, @Param("phonenum") String phonenum, @Param("telephone") String telephone, + @Param("creatorArray") String[] creatorArray, @Param("offset") Integer offset, @Param("rows") Integer rows); @@ -21,7 +22,8 @@ public interface SupplierMapperEx { @Param("supplier") String supplier, @Param("type") String type, @Param("phonenum") String phonenum, - @Param("telephone") String telephone); + @Param("telephone") String telephone, + @Param("creatorArray") String[] creatorArray); List findByAll( @Param("supplier") String supplier, diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierComponent.java b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierComponent.java index 1201c5db..b1db4e3b 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierComponent.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierComponent.java @@ -37,8 +37,8 @@ public class SupplierComponent implements ICommonQuery { 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)); + String roleType = StringUtil.getInfo(search, "roleType"); + return supplierService.select(supplier, type, phonenum, telephone, roleType, QueryUtils.offset(map), QueryUtils.rows(map)); } @Override @@ -48,7 +48,8 @@ public class SupplierComponent implements ICommonQuery { 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); + String roleType = StringUtil.getInfo(search, "roleType"); + return supplierService.countSupplier(supplier, type, phonenum, telephone, roleType); } @Override diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java index 34f9d700..a9759a39 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java @@ -98,10 +98,11 @@ public class SupplierService { return list; } - public List select(String supplier, String type, String phonenum, String telephone, int offset, int rows) throws Exception{ + public List select(String supplier, String type, String phonenum, String telephone, String roleType, int offset, int rows) throws Exception{ List resList = new ArrayList(); try{ - List list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, offset, rows); + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + List list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, creatorArray, offset, rows); for(Supplier s : list) { Integer supplierId = s.getId().intValue(); String beginTime = Tools.getYearBegin(); @@ -153,10 +154,11 @@ public class SupplierService { return resList; } - public Long countSupplier(String supplier, String type, String phonenum, String telephone) throws Exception{ + public Long countSupplier(String supplier, String type, String phonenum, String telephone, String roleType) throws Exception{ Long result=null; try{ - result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone); + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone, creatorArray); }catch(Exception e){ JshException.readFail(logger, e); } @@ -169,6 +171,8 @@ public class SupplierService { int result=0; try{ supplier.setEnabled(true); + User userInfo=userService.getCurrentUser(); + supplier.setCreator(userInfo==null?null:userInfo.getId()); result=supplierMapper.insertSelective(supplier); //新增客户时给当前用户自动授权 if("客户".equals(supplier.getType())) { diff --git a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml index 6622baff..d7a8fe4c 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml @@ -24,6 +24,7 @@ + @@ -88,7 +89,7 @@ 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, sort, tenant_id, delete_flag + tax_num, bank_name, account_number, tax_rate, sort, creator, tenant_id, delete_flag