| @@ -11,10 +11,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.enums.EnumGroupSupport; | |||
| import com.iformall.enums.EnumInvestUserType; | |||
| import com.iformall.enums.EnumThemeType; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.PasswordHelper; | |||
| import com.iformall.utils.Constant; | |||
| @@ -60,26 +57,31 @@ public class WxMiniappThemeController extends BaseController { | |||
| if(wxMiniappTheme.getType() == null){ | |||
| wxMiniappTheme.setType(EnumThemeType.C.getCode()); | |||
| } | |||
| if(wxMiniappTheme.getMouldType() == null){ | |||
| wxMiniappTheme.setMouldType(EnumAppModelType.CLASSICS.getCode()); | |||
| } | |||
| PageInfo<WxMiniappTheme> page = wxMiniappThemeService.listAsPage(wxMiniappTheme, pageNum, pageSize); | |||
| WxThemeMall wxThemeMall = new WxThemeMall(); | |||
| wxThemeMall.setTenantId(getTenantInfo().getTenantId()); | |||
| wxThemeMall.setThemeType(EnumThemeType.C.getCode()); | |||
| WxThemeMall themeMall = wxMiniappThemeService.findThemeMall(wxThemeMall); | |||
| boolean updateStatus = true; | |||
| if(themeMall != null){ | |||
| for (WxMiniappTheme theme:page.getList()) { | |||
| if(theme.getId().equals(themeMall.getThemeId())){ | |||
| theme.setStatus(0); | |||
| updateStatus = false; | |||
| }else{ | |||
| theme.setStatus(1); | |||
| if(page.getList() != null && page.getList().size() > 0){ | |||
| WxThemeMall wxThemeMall = new WxThemeMall(); | |||
| wxThemeMall.setTenantId(getTenantInfo().getTenantId()); | |||
| wxThemeMall.setThemeType(wxMiniappTheme.getType()); | |||
| wxThemeMall.setMouldType(wxMiniappTheme.getMouldType()); | |||
| WxThemeMall themeMall = wxMiniappThemeService.findThemeMall(wxThemeMall); | |||
| boolean updateStatus = true; | |||
| if(themeMall != null){ | |||
| for (WxMiniappTheme theme:page.getList()) { | |||
| if(theme.getId().equals(themeMall.getThemeId())){ | |||
| theme.setStatus(0); | |||
| updateStatus = false; | |||
| }else{ | |||
| theme.setStatus(1); | |||
| } | |||
| } | |||
| } | |||
| if(updateStatus){ | |||
| page.getList().get(0).setStatus(0); | |||
| } | |||
| } | |||
| if(updateStatus){ | |||
| page.getList().get(0).setStatus(0); | |||
| } | |||
| return new ResultData(page); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| @@ -97,7 +99,16 @@ public class WxMiniappThemeController extends BaseController { | |||
| if(wxThemeMall == null || wxThemeMall.getThemeId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxMiniappTheme miniappTheme = new WxMiniappTheme(); | |||
| miniappTheme.setTenantId(getTenantInfo().getTenantId()); | |||
| miniappTheme.setId(wxThemeMall.getThemeId()); | |||
| WxMiniappTheme theme = wxMiniappThemeService.selectById(miniappTheme); | |||
| if(theme == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| wxThemeMall.setTenantId(getTenantInfo().getTenantId()); | |||
| wxThemeMall.setMouldType(theme.getMouldType()); | |||
| if(wxThemeMall.getThemeType() == null){ | |||
| wxThemeMall.setThemeType(EnumThemeType.C.getCode()); | |||
| } | |||
| @@ -137,7 +148,7 @@ public class WxMiniappThemeController extends BaseController { | |||
| } | |||
| @PostMapping("update") | |||
| @SystemControllerLog(description = "集团-更新") | |||
| @SystemControllerLog(description = "-更新") | |||
| public ResultData update(@RequestBody WxMiniappTheme wxMiniappTheme) { | |||
| logger.debug("[" + getIpAddr() + "] WxMiniappThemeController::update"); | |||
| if(wxMiniappTheme == null){ | |||
| @@ -8,5 +8,41 @@ ADD COLUMN `is_only_ad` tinyint(1) NOT NULL DEFAULT 0 COMMENT '首页是否只 | |||
| ALTER TABLE `mallink`.`wx_appinfo` | |||
| ADD COLUMN `mould_type` smallint(2) NOT NULL DEFAULT 0 COMMENT '风格模板类型' AFTER `type`; | |||
| ALTER TABLE `mallink`.`wx_miniapp_theme` | |||
| ADD COLUMN `mould_type` smallint(2) NOT NULL DEFAULT 0 COMMENT '风格模板类型' AFTER `type`; | |||
| ALTER TABLE `mallink`.`wx_theme_mall` | |||
| ADD COLUMN `mould_type` smallint(2) NOT NULL DEFAULT 0 COMMENT '风格模板类型' AFTER `theme_type`; | |||
| ALTER TABLE `mallink`.`wx_theme_mall` | |||
| DROP INDEX `tt_type`, | |||
| ADD UNIQUE INDEX `tt_type`(`tenant_id`, `theme_type`, `mould_type`) USING BTREE; | |||
| ALTER TABLE `mallink`.`wx_miniapp_theme_deploy` | |||
| ADD COLUMN `mould_type` smallint(2) NOT NULL DEFAULT 0 COMMENT '风格模板类型' AFTER `theme_type`; | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (908, '主题风格管理', 910, 'Y', NULL, 1, NULL, NULL, 'miniappModelType', NULL, 0, 904); | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 420, 421, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 961, 60701, 60702]' WHERE `id` = 2; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 60701, 60702]' WHERE `id` = 3; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 591, 601, 602, 604, 605, 606, 607, 608, 610, 611, 612, 613, 614, 622, 623, 624, 625, 626, 641, 642, 643, 644, 661, 662, 663, 664, 671, 672, 674, 675, 681, 682, 684, 685, 686, 691, 692, 693, 694, 695, 711, 901, 902, 904, 905, 906, 907, 908, 910, 931, 932, 60701, 60702]' WHERE `id` = 4; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 202, 211, 212, 221, 222, 409, 411, 416, 500, 502, 504, 505, 506, 511, 512, 591, 595, 602, 606, 610, 641, 680, 711, 901, 902, 904, 907]' WHERE `id` = 11; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1035001036; | |||
| INSERT INTO `mallink`.`wx_miniapp_theme`(`id`, `tenant_id`, `name`, `remarks`, `preview_url`, `type`, `mould_type`, `create_date`, `update_date`, `del_status`) VALUES (5, '1', '新版默认主题', NULL, 'https://formall.oss-accelerate.aliyuncs.com/cimg/newstyle/style-3.png', 2, 1, '2020-12-18 15:53:09', '2020-12-18 15:53:09', 0); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (41, '0', NULL, 5, '砍价', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/77c7079fe3af4a14b5ad4e0b7506f0e6.png', NULL, 1, '/pages/bargain/bargain', NULL, 1, 1, 0, '2021-12-01 13:38:32', '2021-12-01 13:38:35'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (42, '0', NULL, 5, '拼团', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/b3edb50a154a4ee58ec3a945e7d34f3c.png', NULL, 1, '/pages/spellGroup/spellGroup', NULL, 2, 1, 0, '2021-12-01 13:39:36', '2021-12-01 13:39:39'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (43, '0', NULL, 5, '消费卡', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/494f99c4c57844d7b8b2bbb3ad0bf704.png', NULL, 1, '/pages/discountCardList/discountCardList', NULL, 3, 1, 0, '2021-12-01 13:40:34', '2021-12-01 13:40:37'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (44, '0', NULL, 5, '我的卷包', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/24644b2189fa46ceaf5f9e4879efecb4.png', NULL, 1, '/pages/game/index', NULL, 4, 1, 0, '2021-12-01 13:41:57', '2021-12-01 13:42:00'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (45, '0', NULL, 5, '每日签到', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/cceadb8763f149608b551d1eb4d81fa3.png', NULL, 1, '/pages/activityCalendar/activityCalendar', NULL, 5, 1, 0, '2021-12-01 13:42:50', '2021-12-01 13:42:53'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (46, '0', NULL, 5, '活动日历', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/741827da43204dbcbcf9d2570497eee1.png', NULL, 1, '/pages/dateLsit/dateLsit', NULL, 6, 1, 0, '2021-12-01 13:43:57', '2021-12-01 13:44:00'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (47, '0', NULL, 5, '积分商城', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/9e60741507cc40e18a9725537e513b00.png', NULL, 1, '/pages/integralmall/index', NULL, 7, 1, 0, '2021-12-01 13:44:45', '2021-12-01 13:44:48'); | |||
| INSERT INTO `mallink`.`wx_customize_module`(`id`, `tenant_id`, `parent_tenant_id`, `theme_id`, `name`, `remarks`, `theme_type`, `icon`, `style`, `link_type`, `link_url`, `out_link_appid`, `sort`, `is_using`, `del_status`, `create_date`, `update_date`) VALUES (48, '0', NULL, 5, '直播厅', NULL, 2, 'https://formall.oss-accelerate.aliyuncs.com/1026/malinkadmin/2021-12-14/6ad1409e8e6f481db26ce3e9a22f0a04.png', NULL, 1, '/pages2/live/livelist/index', NULL, 8, 1, 0, '2021-12-01 13:45:25', '2021-12-01 13:45:28'); | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMiniappThemeValue; | |||
| import com.iformall.domain.po.WxThemeMall; | |||
| import com.iformall.enums.EnumAppModelType; | |||
| import com.iformall.enums.EnumThemeType; | |||
| import com.iformall.service.WxMiniappThemeService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -33,15 +34,23 @@ public class WxMiniappThemeController extends BaseController { | |||
| @ApiOperation("查询MiniappTheme列表") | |||
| @GetMapping(value = "/getOne") | |||
| @TenantIgnore | |||
| public ResultData getOne() { | |||
| public ResultData getOne(Integer mouldType) { | |||
| logger.debug("[" + getIpAddr() + "] WxMiniappThemeController::getOne"); | |||
| if(mouldType == null){ | |||
| mouldType = EnumAppModelType.CLASSICS.getCode(); | |||
| } | |||
| try { | |||
| WxThemeMall wxThemeMall = new WxThemeMall(); | |||
| wxThemeMall.setTenantId(getTenantInfo().getTenantId()); | |||
| wxThemeMall.setThemeType(EnumThemeType.C.getCode()); | |||
| List<WxMiniappThemeValue> valueList = wxMiniappThemeService.findTheme(wxThemeMall); | |||
| wxThemeMall.setMouldType(mouldType); | |||
| WxThemeMall themeMall = wxMiniappThemeService.findThemeMall(wxThemeMall); | |||
| List<WxMiniappThemeValue> valueList = null; | |||
| if(themeMall != null){ | |||
| valueList = wxMiniappThemeService.findTheme(themeMall); | |||
| } | |||
| if(valueList == null || valueList.size() == 0){ | |||
| valueList = wxMiniappThemeService.findDefaultList(EnumThemeType.C.getCode()); | |||
| valueList = wxMiniappThemeService.findDefaultList(EnumThemeType.C.getCode(),mouldType); | |||
| } | |||
| Map<String,WxMiniappThemeValue> map = new HashMap<String,WxMiniappThemeValue>(); | |||
| @@ -198,7 +198,8 @@ public class WxUserGrantController extends BaseController { | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| wxCUserFrom.updateTenantInfo(wxMall); | |||
| resultMap.put("selectedMall", wxMall.getTenantId()); | |||
| resultMap.put("mall", wxMall); | |||
| // resultMap.put("selectedMall", wxMall.getTenantId()); | |||
| // 集团版,获取子集团list | |||
| List<WxMall> mallList = null; | |||
| @@ -24,6 +24,9 @@ public class WxMiniappTheme implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumThemeType",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板类型",name="mouldType") | |||
| private Integer mouldType; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| @@ -19,6 +19,8 @@ public class WxMiniappThemeDeploy implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumThemeType",name="type") | |||
| private Integer themeType; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板类型",name="mouldType") | |||
| private Integer mouldType; | |||
| @io.swagger.annotations.ApiModelProperty(value="图标",name="defaultIcon") | |||
| private String defaultIcon; | |||
| @@ -15,4 +15,6 @@ public class WxThemeMall implements Serializable { | |||
| private Integer themeType; | |||
| private Integer mouldType; | |||
| } | |||
| @@ -5,6 +5,7 @@ import com.iformall.domain.po.WxMiniappTheme; | |||
| import com.iformall.domain.po.WxMiniappThemeDeploy; | |||
| import com.iformall.domain.po.WxMiniappThemeValue; | |||
| import com.iformall.domain.po.WxThemeMall; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| @@ -22,7 +23,7 @@ public interface WxMiniappThemeMapper extends CommonMapper<WxMiniappTheme, Long> | |||
| * @param type | |||
| * @return | |||
| */ | |||
| List<WxMiniappThemeValue> findDefaultList(Integer type); | |||
| List<WxMiniappThemeValue> findDefaultList(@Param("type") Integer type, @Param("mouldType")Integer mouldType); | |||
| /** | |||
| * 伪删除 | |||
| @@ -30,11 +31,6 @@ public interface WxMiniappThemeMapper extends CommonMapper<WxMiniappTheme, Long> | |||
| */ | |||
| void updateDel(WxMiniappTheme record); | |||
| /** | |||
| * 查配置 | |||
| * @return | |||
| */ | |||
| List<WxMiniappThemeDeploy> findDeployList(Integer type); | |||
| /** | |||
| * 删value | |||
| @@ -11,12 +11,13 @@ public interface WxMiniappThemeService { | |||
| PageInfo<WxMiniappTheme> listAsPage(WxMiniappTheme record, Integer pageIndex, Integer pageSize); | |||
| WxMiniappTheme selectById(WxMiniappTheme record); | |||
| WxMiniappTheme getById(WxMiniappTheme record); | |||
| List<WxMiniappThemeValue> findChildList(Long id); | |||
| /** | |||
| * 使生效 | |||
| * @param id | |||
| * @param | |||
| * @return | |||
| */ | |||
| void updateEffect(WxThemeMall record); | |||
| @@ -27,11 +28,6 @@ public interface WxMiniappThemeService { | |||
| */ | |||
| void updateDel(Long id); | |||
| /** | |||
| * 查配置 | |||
| * @return | |||
| */ | |||
| List<WxMiniappThemeDeploy> findDeployList(Integer type); | |||
| void saveOrUpdate(WxMiniappTheme record); | |||
| @@ -51,5 +47,5 @@ public interface WxMiniappThemeService { | |||
| WxThemeMall findThemeMall(WxThemeMall wxThemeMall); | |||
| List<WxMiniappThemeValue> findDefaultList(Integer code); | |||
| List<WxMiniappThemeValue> findDefaultList(Integer code,Integer mouldType); | |||
| } | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.mapper.WxCustomizeModuleMapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxCustomizeModuleService; | |||
| import com.iformall.service.WxMiniappThemeService; | |||
| import org.slf4j.Logger; | |||
| @@ -30,6 +31,9 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { | |||
| @Autowired | |||
| WxMiniappThemeService wxMiniappThemeService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @Override | |||
| public List<WxCustomizeModule> findList(WxCustomizeModule record) { | |||
| return wxCustomizeModuleMapper.findList(record); | |||
| @@ -54,10 +58,13 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { | |||
| @Override | |||
| public List<WxCustomizeModule> findDefault(WxCustomizeModule record) { | |||
| //获取风格 | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(record, null); | |||
| //获取主题 | |||
| WxThemeMall wxThemeMall = new WxThemeMall(); | |||
| wxThemeMall.setTenantId(record.getTenantId()); | |||
| wxThemeMall.setThemeType(record.getThemeType()); | |||
| wxThemeMall.setMouldType(cAppInfo.getMouldType()); | |||
| WxThemeMall themeMall = wxMiniappThemeService.findThemeMall(wxThemeMall); | |||
| Long themeId = 0l; | |||
| if(themeMall != null){ | |||
| @@ -66,6 +73,7 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { | |||
| WxMiniappTheme wxMiniappTheme = new WxMiniappTheme(); | |||
| wxMiniappTheme.setTenantId(record.getTenantId()); | |||
| wxMiniappTheme.setType(record.getThemeType()); | |||
| wxMiniappTheme.setMouldType(cAppInfo.getMouldType()); | |||
| PageInfo<WxMiniappTheme> page = wxMiniappThemeService.listAsPage(wxMiniappTheme, 1, 1); | |||
| themeId = page.getList().get(0).getId(); | |||
| } | |||
| @@ -4,7 +4,6 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxMiniappTheme; | |||
| import com.iformall.domain.po.WxMiniappThemeDeploy; | |||
| import com.iformall.domain.po.WxMiniappThemeValue; | |||
| import com.iformall.domain.po.WxThemeMall; | |||
| import com.iformall.mapper.WxMiniappThemeMapper; | |||
| @@ -39,6 +38,11 @@ public class WxMiniappThemeServiceImpl implements WxMiniappThemeService { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMiniappThemeMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxMiniappTheme selectById(WxMiniappTheme record) { | |||
| return wxMiniappThemeMapper.selectById(record.getId()); | |||
| } | |||
| @Override | |||
| public WxMiniappTheme getById(WxMiniappTheme record) { | |||
| WxMiniappTheme wxMiniappTheme = wxMiniappThemeMapper.selectById(record.getId()); | |||
| @@ -69,11 +73,6 @@ public class WxMiniappThemeServiceImpl implements WxMiniappThemeService { | |||
| wxMiniappThemeMapper.updateDel(record); | |||
| } | |||
| @Override | |||
| public List<WxMiniappThemeDeploy> findDeployList(Integer type) { | |||
| return wxMiniappThemeMapper.findDeployList(type); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxMiniappTheme record) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -121,8 +120,8 @@ public class WxMiniappThemeServiceImpl implements WxMiniappThemeService { | |||
| } | |||
| @Override | |||
| public List<WxMiniappThemeValue> findDefaultList(Integer code) { | |||
| return wxMiniappThemeMapper.findDefaultList(code); | |||
| public List<WxMiniappThemeValue> findDefaultList(Integer code,Integer mouldType) { | |||
| return wxMiniappThemeMapper.findDefaultList(code,mouldType); | |||
| } | |||
| } | |||
| @@ -9,6 +9,8 @@ | |||
| <result column="remarks" property="remarks" /> | |||
| <result column="preview_url" property="previewUrl" /> | |||
| <result column="type" property="type" /> | |||
| <result column="mould_type" property="mouldType" /> | |||
| <result column="create_date" property="createDate" /> | |||
| <result column="update_date" property="updateDate" /> | |||
| @@ -16,7 +18,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`name`,`remarks`,`preview_url`,`type`,`create_date`,`update_date` | |||
| `id`,`tenant_id`,`name`,`remarks`,`preview_url`,`type`,`mould_type`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -28,6 +30,9 @@ | |||
| <if test=" null != name and '' != name "> and `name` like concat('%', #{name},'%') </if> | |||
| <if test=" null != type"> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != mouldType"> | |||
| and `mould_type` = #{mouldType} | |||
| </if> | |||
| order by id asc | |||
| </sql> | |||
| @@ -46,12 +51,6 @@ | |||
| left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id}; | |||
| </select> | |||
| <select id="findDefaultList" resultType="com.iformall.domain.po.WxMiniappThemeValue"> | |||
| SELECT `name`, remarks,default_icon icon,default_style styleClass | |||
| FROM wx_miniapp_theme_deploy | |||
| where theme_type = #{themeType}; | |||
| </select> | |||
| <update id="updateDel" parameterType="com.iformall.domain.po.WxMiniappTheme"> | |||
| update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id}; | |||
| </update> | |||
| @@ -59,7 +58,7 @@ | |||
| <select id="findDeployList" parameterType="Integer" resultType="com.iformall.domain.po.WxMiniappThemeDeploy"> | |||
| SELECT id,`name`,remarks,theme_type themeType,default_icon defaultIcon,default_style defaultStyle | |||
| FROM wx_miniapp_theme_deploy where theme_type = #{themeType}; | |||
| FROM wx_miniapp_theme_deploy where theme_type = #{themeType} and mould_type = #{mouldType}; | |||
| </select> | |||
| @@ -77,10 +76,9 @@ | |||
| SELECT mtv.id id,mtv.miniapp_theme_id miniappThemeId,mtv.miniapp_deploy_id miniappDeployId, | |||
| mtd.name name,mtd.remarks remarks,ifnull(mtv.icon,mtd.default_icon) icon,ifnull(mtv.style_class,mtd.default_style) styleClass | |||
| FROM wx_miniapp_theme_deploy mtd | |||
| left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id | |||
| left join wx_theme_mall tm on tm.theme_id = mtv.miniapp_theme_id and tm.theme_type = mtd.theme_type | |||
| left join wx_miniapp_theme mt on mt.id = tm.theme_id | |||
| where mtd.theme_type = #{themeType} and mt.del_status = 0 and tm.tenant_id = #{tenantId} | |||
| left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{themeId} | |||
| left join wx_miniapp_theme mt on mt.id = mtv.miniapp_theme_id | |||
| where mt.del_status = 0 | |||
| </select> | |||
| @@ -6,14 +6,15 @@ | |||
| <result column="tenant_id" property="tenantId" /> | |||
| <result column="theme_id" jdbcType="BIGINT" property="themeId" /> | |||
| <result column="theme_type" jdbcType="INTEGER" property="themeType" /> | |||
| <result column="mould_type" jdbcType="INTEGER" property="mouldType" /> | |||
| </resultMap> | |||
| <update id="updateType" parameterType="com.iformall.domain.po.WxThemeMall"> | |||
| update wx_theme_mall set theme_id = #{themeId} where tenant_id = #{tenantId} and theme_type = #{themeType}; | |||
| update wx_theme_mall set theme_id = #{themeId} where tenant_id = #{tenantId} and theme_type = #{themeType} and mould_type = #{mouldType}; | |||
| </update> | |||
| <select id="findOne" parameterType="com.iformall.domain.po.WxThemeMall" resultMap="BaseResultMap"> | |||
| select tenant_id,theme_id,theme_type from wx_theme_mall where tenant_id = #{tenantId} and theme_type = #{themeType}; | |||
| select tenant_id,theme_id,theme_type from wx_theme_mall where tenant_id = #{tenantId} and theme_type = #{themeType} and mould_type = #{mouldType}; | |||
| </select> | |||
| </mapper> | |||