Authored by caoyan

尺码集合

@@ -22,5 +22,7 @@ public interface SizePoolMapper { @@ -22,5 +22,7 @@ public interface SizePoolMapper {
22 int selectTotalByCondition(@Param("sizePoolReq") SizePoolRequest sizePoolReq); 22 int selectTotalByCondition(@Param("sizePoolReq") SizePoolRequest sizePoolReq);
23 23
24 List<SizePool> selectByCondition(@Param("sizePoolReq")SizePoolRequest sizePoolReq); 24 List<SizePool> selectByCondition(@Param("sizePoolReq")SizePoolRequest sizePoolReq);
  25 +
  26 + int updateStatus(@Param("id") Integer id, @Param("status") Integer status);
25 27
26 } 28 }
@@ -90,4 +90,9 @@ @@ -90,4 +90,9 @@
90 limit #{sizePoolReq.startIndex},#{sizePoolReq.rows} 90 limit #{sizePoolReq.startIndex},#{sizePoolReq.rows}
91 </if> 91 </if>
92 </select> 92 </select>
  93 +
  94 + <update id="updateStatus">
  95 + update size_pool set status=#{status}
  96 + where id=#{id}
  97 + </update>
93 </mapper> 98 </mapper>
@@ -85,7 +85,18 @@ public class SizePoolController { @@ -85,7 +85,18 @@ public class SizePoolController {
85 85
86 PageResponseBO<SizePoolResp> result = sizePoolService.querySizePoolList(req); 86 PageResponseBO<SizePoolResp> result = sizePoolService.querySizePoolList(req);
87 87
88 - return new ApiResponse.ApiResponseBuilder().code(200).data(result).build(); 88 + return new ApiResponse.ApiResponseBuilder().code(200).data(result == null ? "数据为空" : result).build();
  89 + }
  90 +
  91 + @RequestMapping(value = "/updateSizePoolStatus")
  92 + public ApiResponse updateSizePoolStatus(@RequestBody SizePoolRequest bo) {
  93 + LOGGER.info(" Method updateSizePoolStatus in.");
  94 + int result = sizePoolService.updateSizePoolStatus(bo);
  95 +
  96 + if(result == 0) {
  97 + return new ApiResponse.ApiResponseBuilder().code(200).message("更新失败").build();
  98 + }
  99 + return new ApiResponse.ApiResponseBuilder().code(200).build();
89 } 100 }
90 101
91 } 102 }
@@ -15,5 +15,7 @@ public interface ISizePoolService { @@ -15,5 +15,7 @@ public interface ISizePoolService {
15 int deleteSizePool(Integer sizePoolId) throws PlatformException; 15 int deleteSizePool(Integer sizePoolId) throws PlatformException;
16 16
17 PageResponseBO<SizePoolResp> querySizePoolList (SizePoolRequest req); 17 PageResponseBO<SizePoolResp> querySizePoolList (SizePoolRequest req);
  18 +
  19 + int updateSizePoolStatus(SizePoolRequest bo);
18 20
19 } 21 }
@@ -189,6 +189,17 @@ public class SizePoolService implements ISizePoolService{ @@ -189,6 +189,17 @@ public class SizePoolService implements ISizePoolService{
189 189
190 } 190 }
191 191
  192 + @Override
  193 + public int updateSizePoolStatus(SizePoolRequest bo) {
  194 + Optional<SizePoolRequest> poolOptional = Optional.ofNullable(bo);
  195 + if(!poolOptional.isPresent() || null == bo.getId()){
  196 + logger.warn("in updateSizePoolStatus, id is null");
  197 + return 0;
  198 + }
  199 +
  200 + return sizePoolMapper.updateStatus(bo.getId(), bo.getStatus());
  201 + }
  202 +
192 private String getIsIncludeItemStr(List<SizePoolDetail> list) { 203 private String getIsIncludeItemStr(List<SizePoolDetail> list) {
193 if(CollectionUtils.isEmpty(list)) { 204 if(CollectionUtils.isEmpty(list)) {
194 return StringUtils.EMPTY; 205 return StringUtils.EMPTY;