diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java index 764f6c017..7c7dabe68 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMiniappThemeController.java @@ -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 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){ diff --git a/mallinkAdmin/src/main/resources/db/migration/V2021120900001__add_type.sql b/mallinkAdmin/src/main/resources/db/migration/V2021120900001__add_type.sql index e44ae7991..ea535c4b9 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2021120900001__add_type.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2021120900001__add_type.sql @@ -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'); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java index 3de1356da..6bc191b88 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java @@ -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 valueList = wxMiniappThemeService.findTheme(wxThemeMall); + wxThemeMall.setMouldType(mouldType); + WxThemeMall themeMall = wxMiniappThemeService.findThemeMall(wxThemeMall); + List 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 map = new HashMap(); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index 70af66809..06c5c14ec 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -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 mallList = null; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappTheme.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappTheme.java index fa3397120..6226046af 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappTheme.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappTheme.java @@ -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") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappThemeDeploy.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappThemeDeploy.java index 3327e8fa6..83404576b 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappThemeDeploy.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMiniappThemeDeploy.java @@ -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; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxThemeMall.java b/mallinkService/src/main/java/com/iformall/domain/po/WxThemeMall.java index ad654a74a..35414b89f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxThemeMall.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxThemeMall.java @@ -15,4 +15,6 @@ public class WxThemeMall implements Serializable { private Integer themeType; + private Integer mouldType; + } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java index 83569a7e1..710ab7da0 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java @@ -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 * @param type * @return */ - List findDefaultList(Integer type); + List findDefaultList(@Param("type") Integer type, @Param("mouldType")Integer mouldType); /** * 伪删除 @@ -30,11 +31,6 @@ public interface WxMiniappThemeMapper extends CommonMapper */ void updateDel(WxMiniappTheme record); - /** - * 查配置 - * @return - */ - List findDeployList(Integer type); /** * 删value diff --git a/mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java b/mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java index e996123ee..05bbbbfed 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java @@ -11,12 +11,13 @@ public interface WxMiniappThemeService { PageInfo listAsPage(WxMiniappTheme record, Integer pageIndex, Integer pageSize); + WxMiniappTheme selectById(WxMiniappTheme record); WxMiniappTheme getById(WxMiniappTheme record); List findChildList(Long id); /** * 使生效 - * @param id + * @param * @return */ void updateEffect(WxThemeMall record); @@ -27,11 +28,6 @@ public interface WxMiniappThemeService { */ void updateDel(Long id); - /** - * 查配置 - * @return - */ - List findDeployList(Integer type); void saveOrUpdate(WxMiniappTheme record); @@ -51,5 +47,5 @@ public interface WxMiniappThemeService { WxThemeMall findThemeMall(WxThemeMall wxThemeMall); - List findDefaultList(Integer code); + List findDefaultList(Integer code,Integer mouldType); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java index 108a75971..832d8e962 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCustomizeModuleServiceImpl.java @@ -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 findList(WxCustomizeModule record) { return wxCustomizeModuleMapper.findList(record); @@ -54,10 +58,13 @@ public class WxCustomizeModuleServiceImpl implements WxCustomizeModuleService { @Override public List 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 page = wxMiniappThemeService.listAsPage(wxMiniappTheme, 1, 1); themeId = page.getList().get(0).getId(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java index 1166f34a1..7814422ab 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java @@ -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 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 findDefaultList(Integer code) { - return wxMiniappThemeMapper.findDefaultList(code); + public List findDefaultList(Integer code,Integer mouldType) { + return wxMiniappThemeMapper.findDefaultList(code,mouldType); } } diff --git a/mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml b/mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml index 74d7753d8..18ea16279 100644 --- a/mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml @@ -9,6 +9,8 @@ + + @@ -16,7 +18,7 @@ - `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` @@ -28,6 +30,9 @@ and `name` like concat('%', #{name},'%') and `type` = #{type} + + + and `mould_type` = #{mouldType} order by id asc @@ -46,12 +51,6 @@ left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id}; - - update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id}; @@ -59,7 +58,7 @@ @@ -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 diff --git a/mallinkService/src/main/resources/mapper/WxThemeMallMapper.xml b/mallinkService/src/main/resources/mapper/WxThemeMallMapper.xml index aab55fa7a..08dc791d8 100644 --- a/mallinkService/src/main/resources/mapper/WxThemeMallMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxThemeMallMapper.xml @@ -6,14 +6,15 @@ + - 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};