Authored by caoyan

尺码集合

... ... @@ -23,4 +23,6 @@ public interface SizePoolMapper {
List<SizePool> selectByCondition(@Param("sizePoolReq")SizePoolRequest sizePoolReq);
int updateStatus(@Param("id") Integer id, @Param("status") Integer status);
}
... ...
... ... @@ -90,4 +90,9 @@
limit #{sizePoolReq.startIndex},#{sizePoolReq.rows}
</if>
</select>
<update id="updateStatus">
update size_pool set status=#{status}
where id=#{id}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -85,7 +85,18 @@ public class SizePoolController {
PageResponseBO<SizePoolResp> result = sizePoolService.querySizePoolList(req);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).build();
return new ApiResponse.ApiResponseBuilder().code(200).data(result == null ? "数据为空" : result).build();
}
@RequestMapping(value = "/updateSizePoolStatus")
public ApiResponse updateSizePoolStatus(@RequestBody SizePoolRequest bo) {
LOGGER.info(" Method updateSizePoolStatus in.");
int result = sizePoolService.updateSizePoolStatus(bo);
if(result == 0) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新失败").build();
}
return new ApiResponse.ApiResponseBuilder().code(200).build();
}
}
... ...
... ... @@ -16,4 +16,6 @@ public interface ISizePoolService {
PageResponseBO<SizePoolResp> querySizePoolList (SizePoolRequest req);
int updateSizePoolStatus(SizePoolRequest bo);
}
... ...
... ... @@ -189,6 +189,17 @@ public class SizePoolService implements ISizePoolService{
}
@Override
public int updateSizePoolStatus(SizePoolRequest bo) {
Optional<SizePoolRequest> poolOptional = Optional.ofNullable(bo);
if(!poolOptional.isPresent() || null == bo.getId()){
logger.warn("in updateSizePoolStatus, id is null");
return 0;
}
return sizePoolMapper.updateStatus(bo.getId(), bo.getStatus());
}
private String getIsIncludeItemStr(List<SizePoolDetail> list) {
if(CollectionUtils.isEmpty(list)) {
return StringUtils.EMPTY;
... ...