diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/SysConfigController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/SysConfigController.java new file mode 100644 index 000000000..aa63a8f45 --- /dev/null +++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/SysConfigController.java @@ -0,0 +1,52 @@ +package com.iformall.controller.sys; + +import com.iformall.common.ResultData; +import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.SysConfig; +import com.iformall.domain.po.SysConfigValue; +import com.iformall.service.SysConfigService; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +/** + * @author gongbiao + */ +@RestController +@RequestMapping("sysConfig") +public class SysConfigController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private SysConfigService sysConfigService; + + @ApiOperation("列表接口") + @GetMapping("list") + public ResultData list() { + SysConfig config = new SysConfig(); + config.setStatus(0); + List list = sysConfigService.getList(config, getTenantInfo()); + return new ResultData(list); + } + + @ApiOperation("详情接口") + @GetMapping("detail") + @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", dataType = "long", paramType = "query", required = true)}) + public ResultData detail(Long id) { + SysConfig config = sysConfigService.getById(id, getTenantInfo()); + return new ResultData(config); + } + + @ApiOperation("更新值接口") + @PostMapping("saveValue") + public ResultData saveValue(@RequestBody SysConfigValue configValue) { + sysConfigService.saveConfigValue(configValue.getConfigItemId(), getTenantInfo(), configValue.getConfigItemValue()); + return new ResultData(); + } + +} diff --git a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index 49a06d984..fbfab326b 100644 --- a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -55,6 +55,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", + "sys_config" }; private static String[] filterSubTables = new String[] { @@ -93,7 +94,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", - + "sys_config" }; @Override diff --git a/mallinkAdmin/src/main/resources/db/migration/V2021112900001__dynamicId.sql b/mallinkAdmin/src/main/resources/db/migration/V2021112900001__dynamicId.sql index eb9da64e1..102a1b9f3 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2021112900001__dynamicId.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2021112900001__dynamicId.sql @@ -1,303 +1,22 @@ -ALTER TABLE wx_coupon_0 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_1 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_2 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_3 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_4 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_5 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_6 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_7 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_8 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_9 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_10 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_11 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_12 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_13 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_14 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_15 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_16 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_17 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_18 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_19 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_20 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_21 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_22 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_23 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_24 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_25 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_26 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_27 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_28 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_29 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_30 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_31 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_32 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_33 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_34 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_35 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_36 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_37 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_38 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_39 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_40 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_41 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_42 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_43 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_44 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_45 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_46 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_47 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_48 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_49 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_50 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_51 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_52 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_53 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_54 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_55 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_56 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_57 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_58 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_59 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_60 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_61 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_62 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_63 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_64 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_65 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_66 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_67 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_68 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_69 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_70 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_71 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_72 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_73 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_74 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_75 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_76 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_77 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_78 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_79 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_80 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_81 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_82 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_83 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_84 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_85 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_86 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_87 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_88 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_89 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_90 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_91 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_92 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_93 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_94 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_95 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_96 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_97 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_98 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; -ALTER TABLE wx_coupon_99 ADD COLUMN `handle_vierfy_secodes` int(6) COMMENT '手动核销过期时间,秒' ; +CREATE TABLE `sys_config` ( + `id` bigint(20) unsigned NOT NULL, + `config_item_key` varchar(30) NOT NULL COMMENT '配置项key', + `config_item_remark` varchar(1000) DEFAULT NULL COMMENT '配置项说明', + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `status` int(1) NOT NULL DEFAULT '0' COMMENT '0-有效 1-无效', + PRIMARY KEY (`id`), + UNIQUE KEY `UNIQUE_ITEM` (`config_item_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -ALTER TABLE wx_coupon_0 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_1 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_2 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_3 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_4 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_5 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_6 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_7 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_8 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_9 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_10 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_11 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_12 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_13 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_14 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_15 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_16 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_17 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_18 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_19 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_20 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_21 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_22 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_23 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_24 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_25 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_26 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_27 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_28 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_29 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_30 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_31 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_32 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_33 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_34 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_35 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_36 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_37 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_38 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_39 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_40 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_41 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_42 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_43 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_44 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_45 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_46 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_47 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_48 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_49 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_50 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_51 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_52 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_53 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_54 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_55 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_56 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_57 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_58 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_59 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_60 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_61 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_62 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_63 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_64 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_65 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_66 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_67 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_68 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_69 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_70 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_71 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_72 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_73 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_74 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_75 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_76 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_77 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_78 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_79 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_80 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_81 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_82 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_83 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_84 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_85 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_86 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_87 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_88 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_89 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_90 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_91 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_92 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_93 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_94 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_95 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_96 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_97 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_98 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; -ALTER TABLE wx_coupon_99 ADD COLUMN `equipment_vierfy_secodes` int(6) COMMENT '设备核销过期时间,秒' ; - -update wx_coupon_0 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_1 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_2 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_3 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_4 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_5 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_6 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_7 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_8 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_9 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_10 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_11 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_12 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_13 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_14 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_15 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_16 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_17 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_18 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_19 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_20 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_21 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_22 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_23 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_24 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_25 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_26 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_27 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_28 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_29 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_30 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_31 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_32 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_33 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_34 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_35 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_36 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_37 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_38 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_39 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_40 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_41 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_42 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_43 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_44 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_45 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_46 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_47 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_48 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_49 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_50 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_51 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_52 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_53 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_54 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_55 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_56 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_57 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_58 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_59 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_60 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_61 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_62 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_63 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_64 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_65 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_66 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_67 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_68 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_69 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_70 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_71 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_72 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_73 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_74 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_75 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_76 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_77 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_78 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_79 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_80 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_81 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_82 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_83 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_84 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_85 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_86 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_87 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_88 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_89 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_90 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_91 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_92 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_93 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_94 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_95 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_96 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_97 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_98 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; -update wx_coupon_99 set handle_vierfy_secodes=60,equipment_vierfy_secodes=30; \ No newline at end of file +CREATE TABLE `sys_config_value` ( + `id` bigint(20) unsigned NOT NULL, + `config_item_id` bigint(1) NOT NULL COMMENT '配置项id', + `config_item_value` varchar(100) DEFAULT NULL COMMENT '配置项value', + `tenant_id` varchar(5) NOT NULL, + `parent_tenant_id` varchar(5) DEFAULT NULL, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `UNIQUE_CONFIG_TENANT` (`config_item_id`,`tenant_id`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2; \ No newline at end of file diff --git a/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java index b4dfcaff1..b6db7ab07 100644 --- a/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -43,7 +43,9 @@ public class TenantInfoImpl implements TenantInfo { "wx_c_user_tags", "wx_weapp_ext_set", "wx_msg_validationcode_model", - "wx_component_verify_ticket"}; + "wx_component_verify_ticket", + "sys_config" + }; private static String[] filterSubTables = new String[] { "wx_mall", @@ -71,7 +73,9 @@ public class TenantInfoImpl implements TenantInfo { "wx_weapp_code_status", "wx_weapp_release_status", "mem_coupon_from_dsp", - "wx_component_verify_ticket"}; + "wx_component_verify_ticket", + "sys_config" + }; @Override public String getTenantId() { diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java index 089546319..74d5c3f5b 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java @@ -5,6 +5,7 @@ import com.iformall.annotation.RedisCache; import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; +import com.iformall.common.SysConfigConstant; import com.iformall.domain.po.*; import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.po.base.TenantEntity; @@ -14,6 +15,7 @@ import com.iformall.domain.vo.WxCouponOrderCVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.service.MemCouponFromDspService; +import com.iformall.service.SysConfigService; import com.iformall.service.WxCouponOrderService; import com.iformall.service.WxCouponService; import com.iformall.utils.Constant; @@ -55,6 +57,9 @@ public class WxCouponOrderController extends BaseController { @Autowired StringRedisTemplate stringRedisTemplate; + + @Autowired + SysConfigService sysConfigService; //@RedisCache(expireTime = 100) @ApiOperation("券包分页列表接口") @@ -208,34 +213,14 @@ public class WxCouponOrderController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } - WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,getTenantInfo()); - if (wxCouponOrderCVo == null) { - return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); - } - - WxCouponCVo wxCouponCVo = null; - String key = "cd:" + wxCouponOrderCVo.getCouponId(); - ValueOperations operations = cdRedisTemplate.opsForValue(); - // 缓存 - boolean hasKey = cdRedisTemplate.hasKey(key); - if (hasKey) { - // 从缓存获取用户信息 - wxCouponCVo = operations.get(key); - if (wxCouponCVo == null) { - return new ResultData(ErrorCode.COUPON_IS_EMPTY); - } - } else { - wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId()); - if (wxCouponCVo == null) { - return new ResultData(ErrorCode.COUPON_IS_EMPTY); - } - // 插入缓存 - operations.set(key, wxCouponCVo, 3600, TimeUnit.SECONDS); + SysConfig sysConfig = sysConfigService.getByKey(SysConfigConstant.handle_vierfy_seconds_key, getTenantInfo()); + if (null == sysConfig || StringUtils.isBlank(sysConfig.getConfigItemValue())) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"系统设置[手动核销超时时间未配置]"); } Map retmap = new HashMap(); - retmap.put("dynamicId", WxCouponOrderCVo.calcuteExpiredCouponOrderId(couponOrderId,wxCouponCVo.getHandleVierfySecodes())); - retmap.put("expiredSeconds", wxCouponCVo.getHandleVierfySecodes()); + retmap.put("dynamicId", WxCouponOrderCVo.calcuteExpiredCouponOrderId(couponOrderId,Integer.parseInt(sysConfig.getConfigItemValue()))); + retmap.put("expiredSeconds", Integer.parseInt(sysConfig.getConfigItemValue())); return new ResultData(retmap); } diff --git a/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java index b9c12c46d..2019873be 100644 --- a/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -49,6 +49,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", + "sys_config" }; private static String[] filterSubTables = new String[] { @@ -84,6 +85,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", + "sys_config" }; diff --git a/mallinkCallback/src/main/java/com/iformall/controller/callback/JinMaoController.java b/mallinkCallback/src/main/java/com/iformall/controller/callback/JinMaoController.java index 35cd2d386..3fa65aa81 100644 --- a/mallinkCallback/src/main/java/com/iformall/controller/callback/JinMaoController.java +++ b/mallinkCallback/src/main/java/com/iformall/controller/callback/JinMaoController.java @@ -195,5 +195,58 @@ public class JinMaoController extends BaseController { } } + + @RequestMapping(value = "/dfh/verify") + public void dfhVerify(@RequestBody Map param) throws Exception { + logger.info("dfh verify:"+param); + try { + String price = param.get("price")==null?"":param.get("price").toString(); + Integer payment = 0; + if(StringUtils.isNotBlank(price)) { + payment = new BigDecimal(price) + .multiply(new BigDecimal(100)) + .intValue(); + } + Integer num = param.get("num")==null?1:Integer.parseInt(param.get("num").toString()); + String userPhone = param.get("userPhone")==null?"":param.get("userPhone").toString(); + String gymName = param.get("gymName")==null?"":param.get("gymName").toString(); + String payWay = param.get("payWay")==null?"":param.get("payWay").toString(); + String orderId = param.get("ID")==null?"":param.get("ID").toString(); + String timeStr = param.get("time")==null?"":param.get("time").toString(); + Date paymentTime = null; + if(StringUtils.isNotBlank(timeStr)){ + paymentTime = sdf.parse(timeStr); + } + String productName = param.get("productName")==null?"":param.get("productName").toString(); + if(StringUtils.isNotBlank(userPhone) && userPhone.matches("^1[0-9]{10}$") + && StringUtils.isNotBlank(orderId)){ + WxCUserBasicInfo basicInfo = new WxCUserBasicInfo(); + basicInfo.setPhone(userPhone); + wxCUserBasicInfoService.registerJinmao(tenantEntity,basicInfo); + + JmSportOrder order = new JmSportOrder(); + order.updateTenantInfo(tenantEntity); + order.setOrderId(orderId); + order.setUserPhone(userPhone); + order.setUserId(basicInfo.getId()); + order.setProductName(productName); + order.setNum(num); + order.setPrice(price); + order.setPayment(payment); + order.setPaymentTime(paymentTime); + order.setPayWay(payWay); + order.setGymName(gymName); + jmSportOrderService.saveOrUpdate(order); + + wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_DEV, basicInfo,tenantEntity,jinMaoOrderTagsDeveloper); + + }else{ + logger.error("JinMaoController --dfhOrder--订单手机号为空或者订单号为空-userPhone{}"+userPhone+"-orderId{}"+orderId); + } + }catch(Exception e){ + logger.error("JinMaoController --dfhOrder",e); + } + + } } diff --git a/mallinkNeuPosAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkNeuPosAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index b9c12c46d..2019873be 100644 --- a/mallinkNeuPosAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkNeuPosAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -49,6 +49,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", + "sys_config" }; private static String[] filterSubTables = new String[] { @@ -84,6 +85,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_question_oneself_log", "wx_question_oneself_topic", "wx_question_oneself_user", + "sys_config" }; diff --git a/mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java b/mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java new file mode 100644 index 000000000..0aaa241cd --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java @@ -0,0 +1,7 @@ +package com.iformall.common; + +public class SysConfigConstant { + + public static final String handle_vierfy_seconds_key="handleVierfySeconds"; + public static final String equiment_vierfy_seconds_key="equimentVierfySeconds"; +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/SysConfig.java b/mallinkService/src/main/java/com/iformall/domain/po/SysConfig.java new file mode 100644 index 000000000..3a15717c2 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/SysConfig.java @@ -0,0 +1,35 @@ +package com.iformall.domain.po; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@TableName(value = "sys_config") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysConfig extends BaseEntity { + private static final long serialVersionUID = 1L; + + + protected Long id; + + @io.swagger.annotations.ApiModelProperty(value="配置项key",name="configItemKey") + private String configItemKey; + @io.swagger.annotations.ApiModelProperty(value="配置项说明",name="configItemRemark") + private String configItemRemark; + @io.swagger.annotations.ApiModelProperty(value="",name="createDate") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="",name="updateDate") + private Date updateDate; + @io.swagger.annotations.ApiModelProperty(value="0-有效 1-无效",name="status") + private Integer status; + + + @io.swagger.annotations.ApiModelProperty(value="配置项value,查询显示用",name="configItemValue") + @TableField(exist = false) + private String configItemValue; +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/SysConfigValue.java b/mallinkService/src/main/java/com/iformall/domain/po/SysConfigValue.java new file mode 100644 index 000000000..afb3b8db2 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/SysConfigValue.java @@ -0,0 +1,38 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.BaseEntity; +import com.iformall.domain.po.base.TenantEntity; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + + +/** + * 系统用户Token + * + * @author Stormeye + */ +@Data +@TableName("sys_config_value") +@EqualsAndHashCode(callSuper = true) +public class SysConfigValue extends TenantEntity { + + private static final long serialVersionUID = -5887774776970688169L; + + private Long id; + + @io.swagger.annotations.ApiModelProperty(value="配置项id",name="configItemId") + private Long configItemId; + @io.swagger.annotations.ApiModelProperty(value="配置项value",name="configItemValue") + private String configItemValue; + @io.swagger.annotations.ApiModelProperty(value="过期时间",name="expireTime") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") + private Date updateDate; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 830a9a18e..65f00808c 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -226,12 +226,6 @@ public class WxCoupon extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") private String giftList; - @io.swagger.annotations.ApiModelProperty(value="手动核销过期时间,秒",name="handleVierfySecodes") - private int handleVierfySecodes; - @io.swagger.annotations.ApiModelProperty(value="设备核销过期时间,秒",name="equipmentVierfySecodes") - private int equipmentVierfySecodes; - - @TableField(exist = false) private List giftCouponList; diff --git a/mallinkService/src/main/java/com/iformall/mapper/SysConfigMapper.java b/mallinkService/src/main/java/com/iformall/mapper/SysConfigMapper.java new file mode 100644 index 000000000..3a08365b6 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/SysConfigMapper.java @@ -0,0 +1,14 @@ +package com.iformall.mapper; + +import java.util.*; +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.SysConfig; + +public interface SysConfigMapper extends CommonMapper { + + List findList(SysConfig sysMonitor); + + SysConfig findByKey(SysConfig sysMonitor); + + +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/SysConfigValueMapper.java b/mallinkService/src/main/java/com/iformall/mapper/SysConfigValueMapper.java new file mode 100644 index 000000000..fcf456c20 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/SysConfigValueMapper.java @@ -0,0 +1,10 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.SysConfigValue; + +public interface SysConfigValueMapper extends CommonMapper { + + SysConfigValue findByItemId(SysConfigValue record); + +} diff --git a/mallinkService/src/main/java/com/iformall/service/SysConfigService.java b/mallinkService/src/main/java/com/iformall/service/SysConfigService.java new file mode 100644 index 000000000..89dac60cc --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/SysConfigService.java @@ -0,0 +1,37 @@ +package com.iformall.service; + +import com.github.pagehelper.PageInfo; +import com.iformall.domain.po.SysConfig; +import com.iformall.domain.po.base.TenantEntity; + +import java.util.List; + +public interface SysConfigService { + + /** + * 根据实体查询列表 + * + * @param record + * @return + */ + List getList(SysConfig record,TenantEntity tenantEntity); + + /** + * 根据Id获得实体 + * + * @param id + * @return + */ + SysConfig getById(Long id,TenantEntity tenantEntity); + + SysConfig getByKey(String key,TenantEntity tenantEntity); + + /** + * 保存或更新实体 + * + * @param record + */ + void saveConfigValue(Long id,TenantEntity tenantEntity,String value); + + +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/SysConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/SysConfigServiceImpl.java new file mode 100644 index 000000000..a5b98ff73 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,112 @@ +package com.iformall.service.impl; + +import java.util.*; +import com.iformall.domain.po.SysConfig; +import com.iformall.domain.po.SysConfigValue; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.mapper.SysConfigMapper; +import com.iformall.mapper.SysConfigValueMapper; +import com.iformall.service.SysConfigService; +import com.iformall.utils.RedisCacheUtils; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; +import com.iformall.common.IdWorker; + +@Service +public class SysConfigServiceImpl implements SysConfigService { + + private static final String cache_prex = "sysconfig:%s:%s"; + + @Autowired + SysConfigMapper sysConfigMapper; + @Autowired + SysConfigValueMapper sysConfigValueMapper; + + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate baseRedisTemplate; + + @Override + public List getList(SysConfig record,TenantEntity tenantEntity) { + List list = sysConfigMapper.findList(record); + if (null != list) { + for (SysConfig config : list) { + SysConfigValue cvq = new SysConfigValue(); + cvq.setConfigItemId(config.getId()); + cvq.updateTenantInfo(tenantEntity); + SysConfigValue configValue = sysConfigValueMapper.findByItemId(cvq); + if (null != configValue) { + config.setConfigItemValue(configValue.getConfigItemValue()); + } + } + } + return list; + } + + @Override + public SysConfig getById(Long id,TenantEntity tenantEntity) { + SysConfig config = sysConfigMapper.selectById(id); + if (null != config ) { + SysConfigValue cvq = new SysConfigValue(); + cvq.setConfigItemId(config.getId()); + cvq.updateTenantInfo(tenantEntity); + SysConfigValue configValue = sysConfigValueMapper.findByItemId(cvq); + if (null != configValue) { + config.setConfigItemValue(configValue.getConfigItemValue()); + } + } + return config; + } + + @Override + public SysConfig getByKey(String key,TenantEntity tenantEntity) { + SysConfig config = RedisCacheUtils.getCacheObject(baseRedisTemplate, String.format(cache_prex, tenantEntity.getTenantId(),key), SysConfig.class); + if (null == config) { + SysConfig cq = new SysConfig(); + cq.setConfigItemKey(key); + config = sysConfigMapper.findByKey(cq); + if (null != config ) { + SysConfigValue cvq = new SysConfigValue(); + cvq.setConfigItemId(config.getId()); + cvq.updateTenantInfo(tenantEntity); + SysConfigValue configValue = sysConfigValueMapper.findByItemId(cvq); + if (null != configValue) { + config.setConfigItemValue(configValue.getConfigItemValue()); + } + RedisCacheUtils.cache(baseRedisTemplate, String.format(cache_prex, tenantEntity.getTenantId(),key), config, 3600*24*3); + } + } + return config; + } + + @Override + public void saveConfigValue(Long id,TenantEntity tenantEntity,String value) { + SysConfig config = sysConfigMapper.selectById(id); + + SysConfigValue cvq = new SysConfigValue(); + cvq.setConfigItemId(config.getId()); + cvq.updateTenantInfo(tenantEntity); + SysConfigValue configValue = sysConfigValueMapper.findByItemId(cvq); + if (null != configValue) { + configValue.setConfigItemValue(value); + configValue.setUpdateDate(new Date()); + sysConfigValueMapper.updateById(configValue); + }else { + final IdWorker idWorker = IdWorker.get(); + configValue = new SysConfigValue(); + configValue.setConfigItemId(config.getId()); + configValue.setId(idWorker.nextId()); + configValue.updateTenantInfo(tenantEntity); + configValue.setConfigItemValue(value); + configValue.setCreateDate(new Date()); + } + + RedisCacheUtils.removeCache(baseRedisTemplate, String.format(cache_prex, tenantEntity.getTenantId(),config.getConfigItemKey())); + } + + + +} diff --git a/mallinkService/src/main/resources/mapper/SysConfigMapper.xml b/mallinkService/src/main/resources/mapper/SysConfigMapper.xml new file mode 100644 index 000000000..61034237c --- /dev/null +++ b/mallinkService/src/main/resources/mapper/SysConfigMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + `id`,`config_item_key`,`config_item_remark`,`create_date`,`update_date`,`status` + + + + where 1 = 1 + + and `id` = #{id} + + + and `config_item_key` = #{configItemKey} + + + and `status` = #{status} + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + + + + + + diff --git a/mallinkService/src/main/resources/mapper/SysConfigValueMapper.xml b/mallinkService/src/main/resources/mapper/SysConfigValueMapper.xml new file mode 100644 index 000000000..bd150eaaf --- /dev/null +++ b/mallinkService/src/main/resources/mapper/SysConfigValueMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`config_item_id`,`config_item_value`,`update_date`,`create_date` + + + + where 1=1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `config_item_id` = #{configItemId} + + + + and `config_item_value` = #{configItemValue} + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 3bf1b31f6..e8c6f1de1 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -54,8 +54,6 @@ - - @@ -105,8 +103,6 @@ - - @@ -115,7 +111,7 @@ c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.pick_start_date,c.pick_end_date,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`, c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`, c.`press_limit_num`, c.`press_limit_hours`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`, - c.`conditions`,c.approval_type,c.content_type,c.source_type,c.password_support,c.gift_list,c.handle_vierfy_secodes,c.equipment_vierfy_secodes + c.`conditions`,c.approval_type,c.content_type,c.source_type,c.password_support,c.gift_list @@ -662,8 +658,6 @@ - - - -