| @@ -1,8 +1,12 @@ | |||||
| ALTER TABLE `person_mould` | ALTER TABLE `person_mould` | ||||
| ADD COLUMN customized int(1) NOT NULL DEFAULT 0 COMMENT '是否私人定制EnumYesOrNo' AFTER `is_del`; | ADD COLUMN customized int(1) NOT NULL DEFAULT 0 COMMENT '是否私人定制EnumYesOrNo' AFTER `is_del`; | ||||
| ALTER TABLE `person_mould` | |||||
| ADD COLUMN customized_user_id BIGINT(11) COMMENT '私人定制所属用户' AFTER `customized`; | |||||
| ##更新这几个表 | ##更新这几个表 | ||||
| apimenu,apiguide,apidetail,thirdpartyapi | apimenu,apiguide,apidetail,thirdpartyapi | ||||
| ALTER TABLE `voice_language` | ALTER TABLE `voice_language` | ||||
| ADD COLUMN customized int(1) NOT NULL DEFAULT 0 COMMENT '是否私人定制EnumYesOrNo' AFTER `is_del`; | ADD COLUMN customized int(1) NOT NULL DEFAULT 0 COMMENT '是否私人定制EnumYesOrNo' AFTER `is_del`; | ||||
| ALTER TABLE `voice_language` | |||||
| ADD COLUMN customized_user_id BIGINT(11) COMMENT '私人定制所属用户' AFTER `customized`; | |||||
| @@ -11,6 +11,7 @@ import com.iformall.domain.po.sm.UserMouldVideo; | |||||
| import com.iformall.enums.EnumLanguages; | import com.iformall.enums.EnumLanguages; | ||||
| import com.iformall.enums.EnumMouldPatchType; | import com.iformall.enums.EnumMouldPatchType; | ||||
| import com.iformall.enums.EnumMouldSendType; | import com.iformall.enums.EnumMouldSendType; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.enums.EnumaMouldPatchStatus; | import com.iformall.enums.EnumaMouldPatchStatus; | ||||
| import com.iformall.language.LanguageDetect; | import com.iformall.language.LanguageDetect; | ||||
| import com.iformall.service.sm.MouldPatchService; | import com.iformall.service.sm.MouldPatchService; | ||||
| @@ -46,7 +47,6 @@ public class PersonMouldController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::list"); | |||||
| if (record == null) record = new PersonMould(); | if (record == null) record = new PersonMould(); | ||||
| if(record.getVideoType() != null && record.getVideoType().intValue() == -1){ | if(record.getVideoType() != null && record.getVideoType().intValue() == -1){ | ||||
| record.setVideoType(null); | record.setVideoType(null); | ||||
| @@ -60,6 +60,27 @@ public class PersonMouldController extends BaseController { | |||||
| final PageInfo<PersonMould> page = personMouldService.cListAsPage(record, pageNum, pageSize); | final PageInfo<PersonMould> page = personMouldService.cListAsPage(record, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("loginList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData loginList(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) { | |||||
| if (record == null) record = new PersonMould(); | |||||
| if(record.getVideoType() != null && record.getVideoType().intValue() == -1){ | |||||
| record.setVideoType(null); | |||||
| } | |||||
| if(record.getSex() != null && record.getSex().intValue() == -1){ | |||||
| record.setSex(null); | |||||
| } | |||||
| record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||||
| record.setCustomizedQuery(EnumYesOrNo.YES.getCode()); | |||||
| record.setCustomizedUserId(getMemberId()); | |||||
| final PageInfo<PersonMould> page = personMouldService.cListAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @AuthIgnore | @AuthIgnore | ||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.sm.PersonMould; | import com.iformall.domain.po.sm.PersonMould; | ||||
| import com.iformall.domain.po.sm.UserMouldVideo; | import com.iformall.domain.po.sm.UserMouldVideo; | ||||
| import com.iformall.domain.po.sm.VoiceLanguage; | |||||
| import com.iformall.domain.po.sm.VoiceMould; | import com.iformall.domain.po.sm.VoiceMould; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.language.LanguageDetect; | import com.iformall.language.LanguageDetect; | ||||
| @@ -143,8 +144,17 @@ public class VoiceMouldController extends BaseController { | |||||
| @GetMapping("/voiceTotal") | @GetMapping("/voiceTotal") | ||||
| @ApiImplicitParams({}) | @ApiImplicitParams({}) | ||||
| public ResultData voiceTotal() { | public ResultData voiceTotal() { | ||||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::voiceTotal"); | |||||
| return new ResultData(voiceLanguageService.voiceTotal()); | |||||
| return new ResultData(voiceLanguageService.voiceTotal(new VoiceLanguage())); | |||||
| } | |||||
| @ApiOperation("登录状态下语言选择下拉框") | |||||
| @GetMapping("/loginVoiceTotal") | |||||
| @ApiImplicitParams({}) | |||||
| public ResultData loginVoiceTotal() { | |||||
| VoiceLanguage vl = new VoiceLanguage(); | |||||
| vl.setCustomizedQuery(EnumYesOrNo.YES.getCode()); | |||||
| vl.setCustomizedUserId(getMemberId()); | |||||
| return new ResultData(voiceLanguageService.voiceTotal(vl)); | |||||
| } | } | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @@ -126,8 +126,15 @@ public class PersonMould extends TenantEntity { | |||||
| private Date updateDate; | private Date updateDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="isDel",name="isDel") | @io.swagger.annotations.ApiModelProperty(value="isDel",name="isDel") | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @TableField(exist = false) | |||||
| private Integer customizedQuery = 0; | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否私人定制EnumYesOrNo",name="customized") | @io.swagger.annotations.ApiModelProperty(value="是否私人定制EnumYesOrNo",name="customized") | ||||
| private Integer customized; | private Integer customized; | ||||
| @io.swagger.annotations.ApiModelProperty(value="私人定制所属用户",name="customizedUserId") | |||||
| private Long customizedUserId; | |||||
| public String getSalePriceStr() { | public String getSalePriceStr() { | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.domain.po.sm; | package com.iformall.domain.po.sm; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| @@ -60,7 +61,11 @@ public class VoiceLanguage extends TenantEntity { | |||||
| */ | */ | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @TableField(exist = false) | |||||
| private Integer customizedQuery = 0; | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否私人定制EnumYesOrNo",name="customized") | @io.swagger.annotations.ApiModelProperty(value="是否私人定制EnumYesOrNo",name="customized") | ||||
| private Integer customized; | private Integer customized; | ||||
| @io.swagger.annotations.ApiModelProperty(value="私人定制所属用户",name="customizedUserId") | |||||
| private Long customizedUserId; | |||||
| } | } | ||||
| @@ -15,6 +15,9 @@ import java.util.List; | |||||
| * @date 2023-10-13 | * @date 2023-10-13 | ||||
| */ | */ | ||||
| public interface VoiceLanguageMapper extends CommonMapper<VoiceLanguage, Long> { | public interface VoiceLanguageMapper extends CommonMapper<VoiceLanguage, Long> { | ||||
| List<VoiceLanguage> findList(VoiceLanguage record); | |||||
| void saveBatch(@Param("set") HashSet<VoiceLanguage> set); | void saveBatch(@Param("set") HashSet<VoiceLanguage> set); | ||||
| /** | /** | ||||
| @@ -7,7 +7,7 @@ import java.util.List; | |||||
| public interface VoiceLanguageService { | public interface VoiceLanguageService { | ||||
| List<VoiceLanguage> voiceTotal(); | |||||
| List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage); | |||||
| VoiceLanguage getLanguage(String paperwork); | VoiceLanguage getLanguage(String paperwork); | ||||
| @@ -26,8 +26,10 @@ public class VoiceLanguageServiceImpl implements VoiceLanguageService { | |||||
| private VoiceLanguageMapper voiceLanguageMapper; | private VoiceLanguageMapper voiceLanguageMapper; | ||||
| @Override | @Override | ||||
| public List<VoiceLanguage> voiceTotal() { | |||||
| List<VoiceLanguage> languages = voiceLanguageMapper.selectList(new LambdaQueryWrapper<VoiceLanguage>().eq(VoiceLanguage::getIsDel, 0).orderByAsc(VoiceLanguage::getLocal)); | |||||
| public List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage) { | |||||
| voiceLanguage.setIsDel(0); | |||||
| voiceLanguage.setSortColumns("local asc"); | |||||
| List<VoiceLanguage> languages = voiceLanguageMapper.findList(voiceLanguage); | |||||
| return CollectionUtils.isEmpty(languages) ? Lists.newArrayList() : languages; | return CollectionUtils.isEmpty(languages) ? Lists.newArrayList() : languages; | ||||
| } | } | ||||
| @@ -30,13 +30,14 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | <result column="is_del" jdbcType="INTEGER" property="isDel"/> | ||||
| <result column="customized" jdbcType="INTEGER" property="customized"/> | <result column="customized" jdbcType="INTEGER" property="customized"/> | ||||
| <result column="customized_user_id" jdbcType="INTEGER" property="customizedUserId"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `video_type`, `cover_img`, `cover_picture`, `detail_picture`, | `id`, `tenant_id`, `parent_tenant_id`, `video_type`, `cover_img`, `cover_picture`, `detail_picture`, | ||||
| `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | ||||
| `send_type`, `detail`, `remark`, `mould_sm_id`,`material`,`background_id`,`background_material`, | `send_type`, `detail`, `remark`, `mould_sm_id`,`material`,`background_id`,`background_material`, | ||||
| `status`, `puton_date`, `create_date`, `update_date`,`is_del`,`customized` | |||||
| `status`, `puton_date`, `create_date`, `update_date`,`is_del`,`customized`,`customized_user_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -107,6 +108,17 @@ | |||||
| <if test=" null != customized"> | <if test=" null != customized"> | ||||
| and customized = #{customized} | and customized = #{customized} | ||||
| </if> | </if> | ||||
| <if test=" null != customizedUserId"> | |||||
| and customized_user_id = #{customizedUserId} | |||||
| </if> | |||||
| <if test=" 1 == customizedQuery"> | |||||
| and ( customized = 0 or (customized = 1 and customized_user_id = #{customizedUserId}) ) | |||||
| </if> | |||||
| <if test=" 0 == customizedQuery"> | |||||
| and customized = 0 | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -115,7 +127,7 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| <if test=" null != sortColumns">order by customized desc,${sortColumns}</if> | |||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.sm.PersonMould" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.sm.PersonMould" resultMap="BaseResultMap"> | ||||
| @@ -134,7 +146,7 @@ | |||||
| `id`, `video_type`, `cover_img`, `cover_picture`, | `id`, `video_type`, `cover_img`, `cover_picture`, | ||||
| `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | ||||
| `send_type`, `mould_sm_id`,`material`,`background_id`,`background_material`, | `send_type`, `mould_sm_id`,`material`,`background_id`,`background_material`, | ||||
| `status`, `create_date`, `update_date`,`customized` | |||||
| `status`, `create_date`, `update_date`,`customized`,`customized_user_id` | |||||
| from person_mould | from person_mould | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| @@ -1,10 +1,68 @@ | |||||
| <?xml version="1.0" encoding="utf-8" ?> | <?xml version="1.0" encoding="utf-8" ?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||||
| <mapper namespace="com.iformall.mapper.VoiceLanguageMapper"> | <mapper namespace="com.iformall.mapper.VoiceLanguageMapper"> | ||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.VoiceLanguage"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="language" jdbcType="VARCHAR" property="language"/> | |||||
| <result column="country" jdbcType="VARCHAR" property="country"/> | |||||
| <result column="local" jdbcType="VARCHAR" property="local"/> | |||||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||||
| <result column="chinese_name" jdbcType="VARCHAR" property="chineseName"/> | |||||
| <result column="img" jdbcType="VARCHAR" property="img"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||||
| <result column="customized" jdbcType="INTEGER" property="customized"/> | |||||
| <result column="customized_user_id" jdbcType="INTEGER" property="customizedUserId"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `language`, `country`, `local`, `name`, `chinese_name`, `img`, `create_date`, `update_date`, `is_del`,`customized` | |||||
| `id`, `tenant_id`, `parent_tenant_id`, `language`, `country`, `local`, `name`, `chinese_name`, `img`, `create_date`, | |||||
| `update_date`, `is_del`,`customized`,`customized_user_id` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != isDel "> | |||||
| and `is_del` = #{isDel} | |||||
| </if> | |||||
| <if test=" 1 == customizedQuery"> | |||||
| and ( customized = 0 or (customized = 1 and customized_user_id = #{customizedUserId}) ) | |||||
| </if> | |||||
| <if test=" 0 == customizedQuery"> | |||||
| and customized = 0 | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by customized desc,${sortColumns}</if> | |||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.sm.VoiceLanguage" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from voice_language | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <insert id="saveBatch" parameterType="java.util.HashSet"> | <insert id="saveBatch" parameterType="java.util.HashSet"> | ||||
| INSERT INTO voice_language (`id`, `country`, | INSERT INTO voice_language (`id`, `country`, | ||||
| `language`, `local`, `name`, `img`, `is_del`,`chinese_name`) | `language`, `local`, `name`, `img`, `is_del`,`chinese_name`) | ||||