| @@ -55,16 +55,8 @@ public class MouldPatchController extends BaseController { | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | ||||
| MouldPatch mouldPatch = mouldPatchService.getById(id); | |||||
| if(mouldPatch.getSceneSignList() != null && !mouldPatch.getSceneSignList().isEmpty()){ | |||||
| MouldPatchSign signQ = new MouldPatchSign(); | |||||
| signQ.setIds(mouldPatch.getSceneSignList()); | |||||
| List<MouldPatchSign> signList = mouldPatchSignService.getList(signQ); | |||||
| mouldPatch.setMouldPatchSign(signList); | |||||
| } | |||||
| if(mouldPatch.getColour() != null){ | |||||
| mouldPatch.setColourStr(EnumColour.getEnum(mouldPatch.getColour()).getMessage()); | |||||
| } | |||||
| MouldPatch mouldPatch = mouldPatchService.getDetailById(id); | |||||
| return new ResultData(mouldPatch); | return new ResultData(mouldPatch); | ||||
| } | } | ||||
| @@ -36,6 +36,9 @@ public class UserMouldVideoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private UserMouldVideoService userMouldVideoService; | private UserMouldVideoService userMouldVideoService; | ||||
| @Autowired | |||||
| private MouldPatchService mouldPatchService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -59,6 +62,15 @@ public class UserMouldVideoController extends BaseController { | |||||
| if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){ | if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据"); | ||||
| } | } | ||||
| if(mouldVideo.getPersonMouldId() != null){ | |||||
| mouldVideo.setPersonMould(mouldPatchService.getDetailById(mouldVideo.getPersonMouldId())); | |||||
| } | |||||
| if(mouldVideo.getVoiceMouldId() != null){ | |||||
| mouldVideo.setVoiceMould(mouldPatchService.getDetailById(mouldVideo.getVoiceMouldId())); | |||||
| } | |||||
| if(mouldVideo.getBackgroundMouldId() != null){ | |||||
| mouldVideo.setBackgroundMould(mouldPatchService.getDetailById(mouldVideo.getBackgroundMouldId())); | |||||
| } | |||||
| return new ResultData(mouldVideo); | return new ResultData(mouldVideo); | ||||
| } | } | ||||
| @@ -73,7 +73,9 @@ public class MouldPatch extends TenantEntity { | |||||
| if(StringUtils.isNotBlank(this.getSceneSign())){ | if(StringUtils.isNotBlank(this.getSceneSign())){ | ||||
| try{ | try{ | ||||
| List<Long> longs = JSONObject.parseArray(this.getSceneSign(), Long.class); | List<Long> longs = JSONObject.parseArray(this.getSceneSign(), Long.class); | ||||
| return longs; | |||||
| if(longs != null && longs.size() > 0){ | |||||
| return longs; | |||||
| } | |||||
| }catch(Exception e){ | }catch(Exception e){ | ||||
| } | } | ||||
| } | } | ||||
| @@ -42,16 +42,24 @@ public class UserMouldVideo extends TenantEntity { | |||||
| private Long personMouldId; | private Long personMouldId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="人物模板文件",name="personMouldPath") | @io.swagger.annotations.ApiModelProperty(value="人物模板文件",name="personMouldPath") | ||||
| private String personMouldPath; | private String personMouldPath; | ||||
| @TableField(exist = false) | |||||
| private MouldPatch personMould; | |||||
| @io.swagger.annotations.ApiModelProperty(value="声音模板ID",name="voiceMouldId") | @io.swagger.annotations.ApiModelProperty(value="声音模板ID",name="voiceMouldId") | ||||
| private Long voiceMouldId; | private Long voiceMouldId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="声音模板文件",name="voiceMouldPath") | @io.swagger.annotations.ApiModelProperty(value="声音模板文件",name="voiceMouldPath") | ||||
| private String voiceMouldPath; | private String voiceMouldPath; | ||||
| @TableField(exist = false) | |||||
| private MouldPatch voiceMould; | |||||
| @io.swagger.annotations.ApiModelProperty(value="文案",name="paperwork") | @io.swagger.annotations.ApiModelProperty(value="文案",name="paperwork") | ||||
| private String paperwork; | private String paperwork; | ||||
| @io.swagger.annotations.ApiModelProperty(value="背景模板ID",name="backgroundMouldId") | @io.swagger.annotations.ApiModelProperty(value="背景模板ID",name="backgroundMouldId") | ||||
| private String backgroundMouldId; | |||||
| private Long backgroundMouldId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="背景模板文件",name="backgroundMouldPath") | @io.swagger.annotations.ApiModelProperty(value="背景模板文件",name="backgroundMouldPath") | ||||
| private String backgroundMouldPath; | private String backgroundMouldPath; | ||||
| @TableField(exist = false) | |||||
| private MouldPatch backgroundMould; | |||||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | ||||
| private String title; | private String title; | ||||
| @@ -35,6 +35,7 @@ public interface MouldPatchService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| MouldPatch getById(Long id); | MouldPatch getById(Long id); | ||||
| MouldPatch getDetailById(Long id); | |||||
| /** | /** | ||||
| * 保存或更新实体 | * 保存或更新实体 | ||||
| @@ -51,4 +52,5 @@ public interface MouldPatchService { | |||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| void updateOnline(MouldPatch record); | void updateOnline(MouldPatch record); | ||||
| } | } | ||||
| @@ -6,12 +6,15 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.sm.MouldPatch; | import com.iformall.domain.po.sm.MouldPatch; | ||||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||||
| import com.iformall.enums.EnumColour; | |||||
| import com.iformall.enums.EnumCouponStatus; | import com.iformall.enums.EnumCouponStatus; | ||||
| import com.iformall.enums.EnumMouldSendType; | import com.iformall.enums.EnumMouldSendType; | ||||
| import com.iformall.enums.EnumaMouldPatchStatus; | import com.iformall.enums.EnumaMouldPatchStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.sm.MouldPatchService; | import com.iformall.service.sm.MouldPatchService; | ||||
| import com.iformall.service.sm.MouldPatchSignService; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -29,6 +32,9 @@ public class MouldPatchServiceImpl implements MouldPatchService { | |||||
| @Autowired | @Autowired | ||||
| MouldPatchMapper mouldPatchMapper; | MouldPatchMapper mouldPatchMapper; | ||||
| @Autowired | |||||
| MouldPatchSignService mouldPatchSignService; | |||||
| @Override | @Override | ||||
| public PageInfo<MouldPatch> listAsPage(MouldPatch record, Integer pageIndex, Integer pageSize) { | public PageInfo<MouldPatch> listAsPage(MouldPatch record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -45,6 +51,21 @@ public class MouldPatchServiceImpl implements MouldPatchService { | |||||
| return mouldPatchMapper.selectById(id); | return mouldPatchMapper.selectById(id); | ||||
| } | } | ||||
| @Override | |||||
| public MouldPatch getDetailById(Long id) { | |||||
| MouldPatch mouldPatch = getById(id); | |||||
| if(mouldPatch.getSceneSignList() != null && !mouldPatch.getSceneSignList().isEmpty()){ | |||||
| MouldPatchSign signQ = new MouldPatchSign(); | |||||
| signQ.setIds(mouldPatch.getSceneSignList()); | |||||
| List<MouldPatchSign> signList = mouldPatchSignService.getList(signQ); | |||||
| mouldPatch.setMouldPatchSign(signList); | |||||
| } | |||||
| if(mouldPatch.getColour() != null){ | |||||
| mouldPatch.setColourStr(EnumColour.getEnum(mouldPatch.getColour()).getMessage()); | |||||
| } | |||||
| return mouldPatch; | |||||
| } | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(MouldPatch record) { | public ResultData saveOrUpdate(MouldPatch record) { | ||||
| //金额处理 | //金额处理 | ||||