增加平台配置的操作接口

This commit is contained in:
季圣华 2021-12-09 00:43:45 +08:00
parent d0fe0f3578
commit a1e59e8b3e
6 changed files with 64 additions and 28 deletions

View File

@ -1,16 +1,16 @@
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50726
Source Server : 127.0.0.1
Source Server Version : 50704
Source Host : 127.0.0.1:3306
Source Database : jsh_erp
Target Server Type : MYSQL
Target Server Version : 50726
Target Server Version : 50704
File Encoding : 65001
Date: 2021-11-05 17:33:50
Date: 2021-12-09 00:41:43
*/
SET FOREIGN_KEY_CHECKS=0;
@ -268,7 +268,7 @@ CREATE TABLE `jsh_function` (
`delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记0未删除1删除',
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`url`)
) ENGINE=InnoDB AUTO_INCREMENT=258 DEFAULT CHARSET=utf8 COMMENT='功能模块表';
) ENGINE=InnoDB AUTO_INCREMENT=259 DEFAULT CHARSET=utf8 COMMENT='功能模块表';
-- ----------------------------
-- Records of jsh_function
@ -306,7 +306,7 @@ INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/finan
INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/financial/money_out', '/financial/MoneyOutList', '\0', '0480', '', '电脑版', '1,2,7', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/financial/giro', '/financial/GiroList', '\0', '0490', '', '电脑版', '1,2,7', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/report/account_report', '/report/AccountReport', '\0', '0610', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('208', '030103', '进货统计', '0301', '/report/buy_in_report', '/report/BuyInReport', '\0', '0620', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('208', '030103', '采购统计', '0301', '/report/buy_in_report', '/report/BuyInReport', '\0', '0620', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/report/sale_out_report', '/report/SaleOutReport', '\0', '0630', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/bill/retail_out', '/bill/RetailOutList', '\0', '0405', '', '电脑版', '1,2,7', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/bill/retail_back', '/bill/RetailBackList', '\0', '0407', '', '电脑版', '1,2,7', 'profile', '0');
@ -334,6 +334,7 @@ INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/sy
INSERT INTO `jsh_function` VALUES ('246', '030113', '商品库存', '0301', '/report/material_stock', '/report/MaterialStock', '\0', '0605', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('247', '010105', '多属性', '0101', '/material/material_attribute', '/material/MaterialAttributeList', '\0', '0250', '', '电脑版', '1', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('248', '030150', '调拨明细', '0301', '/report/allocation_detail', '/report/AllocationDetail', '\0', '0646', '', '电脑版', '', 'profile', '0');
INSERT INTO `jsh_function` VALUES ('258', '000112', '平台配置', '0001', '/system/platform_config', '/system/PlatformConfigList', '\0', '0175', '', '电脑版', '', 'profile', '0');
-- ----------------------------
-- Table structure for jsh_in_out_item
@ -371,7 +372,7 @@ CREATE TABLE `jsh_log` (
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
PRIMARY KEY (`id`),
KEY `FKF2696AA13E226853` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7558 DEFAULT CHARSET=utf8 COMMENT='操作日志';
) ENGINE=InnoDB AUTO_INCREMENT=7559 DEFAULT CHARSET=utf8 COMMENT='操作日志';
-- ----------------------------
-- Records of jsh_log
@ -685,7 +686,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=7 DEFAULT CHARSET=utf8 COMMENT='平台参数';
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='平台参数';
-- ----------------------------
-- Records of jsh_platform_config
@ -696,6 +697,7 @@ INSERT INTO `jsh_platform_config` VALUES ('3', 'platform_url', '官方网站', '
INSERT INTO `jsh_platform_config` VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0');
INSERT INTO `jsh_platform_config` VALUES ('5', 'bill_print_url', '三联打印地址', '');
INSERT INTO `jsh_platform_config` VALUES ('6', 'pay_fee_url', '租户续费地址', '');
INSERT INTO `jsh_platform_config` VALUES ('7', 'register_flag', '注册启用标记', '1');
-- ----------------------------
-- Table structure for jsh_role
@ -931,7 +933,7 @@ CREATE TABLE `jsh_user_business` (
-- ----------------------------
-- Records of jsh_user_business
-- ----------------------------
INSERT INTO `jsh_user_business` VALUES ('5', 'RoleFunctions', '4', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][1][14][243][15][234][16][18][236][245][248][198]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"btnStr\":\"1\"},{\"funId\":236,\"btnStr\":\"1\"},{\"funId\":245,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,2,7\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,7,2\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,7,2\"},{\"funId\":206,\"btnStr\":\"1,2,7\"},{\"funId\":212,\"btnStr\":\"1,7,2\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', null, '0');
INSERT INTO `jsh_user_business` VALUES ('5', 'RoleFunctions', '4', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][1][14][243][15][234][16][18][236][245][248][198][258]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"btnStr\":\"1\"},{\"funId\":236,\"btnStr\":\"1\"},{\"funId\":245,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,2,7\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,7,2\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,7,2\"},{\"funId\":206,\"btnStr\":\"1,2,7\"},{\"funId\":212,\"btnStr\":\"1,7,2\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', null, '0');
INSERT INTO `jsh_user_business` VALUES ('6', 'RoleFunctions', '5', '[22][23][25][26][194][195][31][33][200][201][41][199][202]', null, null, '0');
INSERT INTO `jsh_user_business` VALUES ('7', 'RoleFunctions', '6', '[22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"33\",\"btnStr\":\"4\"}]', null, '0');
INSERT INTO `jsh_user_business` VALUES ('9', 'RoleFunctions', '7', '[168][13][12][16][14][15][189][18][19][132]', null, null, '0');

View File

@ -1313,5 +1313,11 @@ alter table jsh_unit add ratio_three int(11) DEFAULT NULL COMMENT '比例3' afte
-- 时间 2021年12月07日
-- by jishenghua
-- 更新菜单名称-进货统计改为采购统计
-- 增加平台配置菜单
-- 给平台配置增加注册启用标记
-- --------------------------------------------------------
update jsh_function set name='采购统计' where name='进货统计';
update jsh_function set name='采购统计' where name='进货统计';
insert into `jsh_function`(`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`)
values ('000112', '平台配置', '0001', '/system/platform_config', '/system/PlatformConfigList', '\0', '0175', '', '电脑版', '', 'profile', '0');
insert into `jsh_platform_config`(`platform_key`, `platform_key_info`, `platform_value`)
values ('register_flag', '注册启用标记', '1');

View File

@ -9,11 +9,11 @@ import java.util.List;
public interface PlatformConfigMapperEx {
List<PlatformConfig> selectByConditionPlatformConfig(
@Param("key") String key,
@Param("platformKey") String platformKey,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByPlatformConfig(
@Param("key") String key);
@Param("platformKey") String platformKey);
}

View File

@ -31,35 +31,35 @@ public class PlatformConfigComponent implements ICommonQuery {
private List<?> getPlatformConfigList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String key = StringUtil.getInfo(search, "key");
return platformConfigService.select(key, QueryUtils.offset(map), QueryUtils.rows(map));
String platformKey = StringUtil.getInfo(search, "platformKey");
return platformConfigService.select(platformKey, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String key = StringUtil.getInfo(search, "key");
return platformConfigService.countPlatformConfig(key);
String platformKey = StringUtil.getInfo(search, "platformKey");
return platformConfigService.countPlatformConfig(platformKey);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return platformConfigService.insertSystemConfig(obj, request);
return platformConfigService.insertPlatformConfig(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return platformConfigService.updateSystemConfig(obj, request);
return platformConfigService.updatePlatformConfig(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return platformConfigService.deleteSystemConfig(id, request);
return platformConfigService.deletePlatformConfig(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return platformConfigService.batchDeleteSystemConfig(ids, request);
return platformConfigService.batchDeletePlatformConfig(ids, request);
}
@Override

View File

@ -48,20 +48,20 @@ public class PlatformConfigService {
return list;
}
public List<PlatformConfig> select(String key, int offset, int rows)throws Exception {
public List<PlatformConfig> select(String platformKey, int offset, int rows)throws Exception {
List<PlatformConfig> list=null;
try{
list=platformConfigMapperEx.selectByConditionPlatformConfig(key, offset, rows);
list=platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countPlatformConfig(String key)throws Exception {
public Long countPlatformConfig(String platformKey)throws Exception {
Long result=null;
try{
result=platformConfigMapperEx.countsByPlatformConfig(key);
result=platformConfigMapperEx.countsByPlatformConfig(platformKey);
}catch(Exception e){
JshException.readFail(logger, e);
}
@ -69,7 +69,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{
public int insertPlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{
PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class);
int result=0;
try{
@ -81,7 +81,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{
public int updatePlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{
PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class);
int result=0;
try{
@ -93,7 +93,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSystemConfig(Long id, HttpServletRequest request)throws Exception {
public int deletePlatformConfig(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=platformConfigMapper.deleteByPrimaryKey(id);
@ -104,7 +104,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSystemConfig(String ids, HttpServletRequest request)throws Exception {
public int batchDeletePlatformConfig(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
PlatformConfigExample example = new PlatformConfigExample();
example.createCriteria().andIdIn(idList);

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.PlatformConfigMapperEx">
<select id="selectByConditionPlatformConfig" parameterType="com.jsh.erp.datasource.entities.PlatformConfigExample" resultMap="com.jsh.erp.datasource.mappers.PlatformConfigMapper.BaseResultMap">
select *
FROM jsh_platform_config
where 1=1
and platform_key!='activation_code'
<if test="platformKey != null and platformKey != ''">
<bind name="bindKey" value="'%'+platformKey+'%'"/>
and platform_key like #{bindKey}
</if>
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByPlatformConfig" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_platform_config
WHERE 1=1
and platform_key!='activation_code'
<if test="platformKey != null and platformKey != ''">
<bind name="bindKey" value="'%'+platformKey+'%'"/>
and platform_key like #{bindKey}
</if>
</select>
</mapper>