@@ -27,6 +27,8 @@ import org.slf4j.LoggerFactory; | |||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import java.util.List; | |||||
@RestController | @RestController | ||||
@RequestMapping("/api/voiceMould") | @RequestMapping("/api/voiceMould") | ||||
@@ -64,7 +66,16 @@ public class VoiceMouldController extends BaseController { | |||||
public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | ||||
VoiceMould voiceMould = voiceMouldService.getDetailById(id); | VoiceMould voiceMould = voiceMouldService.getDetailById(id); | ||||
if(voiceMould.getParentId() == 0l && voiceMould.getCountSub() > 0){ | |||||
VoiceMould voiceQ = new VoiceMould(); | |||||
voiceQ.setParentId(voiceMould.getId()); | |||||
voiceQ.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | |||||
voiceQ.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||||
List<VoiceMould> sublist = voiceMouldService.getClist(voiceQ); | |||||
if(sublist != null && !sublist.isEmpty()){ | |||||
voiceMould.setSubVoiceMould(sublist); | |||||
} | |||||
} | |||||
return new ResultData(voiceMould); | return new ResultData(voiceMould); | ||||
} | } | ||||
@@ -96,6 +107,7 @@ public class VoiceMouldController extends BaseController { | |||||
} | } | ||||
VoiceMould voiceMould = new VoiceMould(); | VoiceMould voiceMould = new VoiceMould(); | ||||
voiceMould.setParentId(0l); | |||||
voiceMould.setSex(sex); | voiceMould.setSex(sex); | ||||
voiceMould.setSendType(EnumMouldSendType.auto.getCode()); | voiceMould.setSendType(EnumMouldSendType.auto.getCode()); | ||||
voiceMould.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | voiceMould.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | ||||
@@ -43,6 +43,8 @@ public class VoiceMould extends TenantEntity { | |||||
@io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="endDate") | @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="endDate") | ||||
private Date endDate; | private Date endDate; | ||||
private List<VoiceMould> subVoiceMould; | |||||
@io.swagger.annotations.ApiModelProperty(value="",name="parentId") | @io.swagger.annotations.ApiModelProperty(value="",name="parentId") | ||||
private Long parentId; | private Long parentId; | ||||
@io.swagger.annotations.ApiModelProperty(value="",name="countSub") | @io.swagger.annotations.ApiModelProperty(value="",name="countSub") | ||||
@@ -5,8 +5,12 @@ 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.VoiceMould; | import com.iformall.domain.po.sm.VoiceMould; | ||||
import java.util.List; | |||||
public interface VoiceMouldService { | public interface VoiceMouldService { | ||||
List<VoiceMould> getClist(VoiceMould record); | |||||
/** | /** | ||||
* 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
* | * | ||||
@@ -37,6 +37,11 @@ public class VoiceMouldServiceImpl implements VoiceMouldService { | |||||
MouldPatchSignService mouldPatchSignService; | MouldPatchSignService mouldPatchSignService; | ||||
@Override | |||||
public List<VoiceMould> getClist(VoiceMould record) { | |||||
return voiceMouldMapper.findCList(record); | |||||
} | |||||
@Override | @Override | ||||
public PageInfo<VoiceMould> listAsPage(VoiceMould record, Integer pageIndex, Integer pageSize) { | public PageInfo<VoiceMould> listAsPage(VoiceMould record, Integer pageIndex, Integer pageSize) { | ||||
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> voiceMouldMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> voiceMouldMapper.findList(record)); | ||||