xhxu 5 лет назад
Родитель
Сommit
8606bbf2cd
5 измененных файлов: 26 добавлений и 2 удалений
  1. +3
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java
  2. +7
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java
  3. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java
  4. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java
  5. +9
    -2
      mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml

+ 3
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java Просмотреть файл

@@ -42,6 +42,9 @@ public class WxMiniappThemeController extends BaseController {
wxThemeMall.setTenantId(getTenantInfo().getTenantId()); wxThemeMall.setTenantId(getTenantInfo().getTenantId());
wxThemeMall.setThemeType(EnumThemeType.C.getCode()); wxThemeMall.setThemeType(EnumThemeType.C.getCode());
List<WxMiniappThemeValue> valueList = wxMiniappThemeService.findTheme(wxThemeMall); List<WxMiniappThemeValue> valueList = wxMiniappThemeService.findTheme(wxThemeMall);
if(valueList == null || valueList.size() == 0){
valueList = wxMiniappThemeService.findDefaultList(EnumThemeType.C.getCode());
}


Map<String,WxMiniappThemeValue> map = new HashMap<String,WxMiniappThemeValue>(); Map<String,WxMiniappThemeValue> map = new HashMap<String,WxMiniappThemeValue>();
for (WxMiniappThemeValue v:valueList) { for (WxMiniappThemeValue v:valueList) {


+ 7
- 0
mallinkService/src/main/java/com/iformall/mapper/WxMiniappThemeMapper.java Просмотреть файл

@@ -17,6 +17,13 @@ public interface WxMiniappThemeMapper extends CommonMapper<WxMiniappTheme, Long>


List<WxMiniappThemeValue> findChildList(Long id); List<WxMiniappThemeValue> findChildList(Long id);


/**
* 默认主题
* @param type
* @return
*/
List<WxMiniappThemeValue> findDefaultList(Integer type);

/** /**
* 伪删除 * 伪删除
* @param record * @param record


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxMiniappThemeService.java Просмотреть файл

@@ -48,4 +48,6 @@ public interface WxMiniappThemeService {
void insertValue(WxMiniappThemeValue record); void insertValue(WxMiniappThemeValue record);


List<WxMiniappThemeValue> findTheme(WxThemeMall wxThemeMall); List<WxMiniappThemeValue> findTheme(WxThemeMall wxThemeMall);

List<WxMiniappThemeValue> findDefaultList(Integer code);
} }

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMiniappThemeServiceImpl.java Просмотреть файл

@@ -115,4 +115,9 @@ public class WxMiniappThemeServiceImpl implements WxMiniappThemeService {
return wxMiniappThemeMapper.finThemeByThemeMall(wxThemeMall); return wxMiniappThemeMapper.finThemeByThemeMall(wxThemeMall);
} }


@Override
public List<WxMiniappThemeValue> findDefaultList(Integer code) {
return wxMiniappThemeMapper.findDefaultList(code);
}

} }

+ 9
- 2
mallinkService/src/main/resources/mapper/WxMiniappThemeMapper.xml Просмотреть файл

@@ -23,7 +23,7 @@
where del_status = 0 where del_status = 0
<if test=" null != id "> and `id` = #{id} </if> <if test=" null != id "> and `id` = #{id} </if>
<if test=" null != tenantId and '' != tenantId"> <if test=" null != tenantId and '' != tenantId">
and (`tenant_id` = 0 or`tenant_id` = #{tenantId})
and (`tenant_id` = 1 or`tenant_id` = #{tenantId})
</if> </if>
<if test=" null != name and '' != name "> and `name` like concat('%', #{name},'%') </if> <if test=" null != name and '' != name "> and `name` like concat('%', #{name},'%') </if>
<if test=" null != type"> <if test=" null != type">
@@ -46,6 +46,12 @@
left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id}; left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id and mtv.miniapp_theme_id = #{id};
</select> </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 id="updateDel" parameterType="com.iformall.domain.po.WxMiniappTheme">
update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id}; update wx_miniapp_theme set `del_status` = 1, update_date = now() where id = #{id};
</update> </update>
@@ -73,7 +79,8 @@
FROM wx_miniapp_theme_deploy mtd FROM wx_miniapp_theme_deploy mtd
left join wx_miniapp_theme_value mtv on mtv.miniapp_deploy_id = mtd.id 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_theme_mall tm on tm.theme_id = mtv.miniapp_theme_id and tm.theme_type = mtd.theme_type
where mtd.theme_type = #{themeType} and tm.tenant_id = #{tenantId}
left join wx_miniapp_theme mt on tm.id = tm.theme_id
where mtd.theme_type = #{themeType} and mt.del_status = 0 and tm.tenant_id = #{tenantId}
</select> </select>






Загрузка…
Отмена
Сохранить