Authored by qinchao

Merge branch 'test6.9.2' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.2

@@ -8,6 +8,8 @@ public interface SecondhandInfoMapper { @@ -8,6 +8,8 @@ public interface SecondhandInfoMapper {
8 8
9 int insert(@Param("record")SecondhandInfo record); 9 int insert(@Param("record")SecondhandInfo record);
10 10
  11 + int updateStatus(@Param("skup") Integer skup, @Param("status") Integer status);
  12 +
11 SecondhandInfo selectBySkup(Integer skup); 13 SecondhandInfo selectBySkup(Integer skup);
12 14
13 } 15 }
@@ -23,4 +23,8 @@ @@ -23,4 +23,8 @@
23 select * from secondhand_info where skup = #{skup} 23 select * from secondhand_info where skup = #{skup}
24 </select> 24 </select>
25 25
  26 + <update id="updateStatus">
  27 + update secondhand_info set status = #{status,jdbcType=INTEGER}
  28 + where skup = #{skup,jdbcType=INTEGER} and status=0
  29 + </update>
26 </mapper> 30 </mapper>
@@ -26,4 +26,5 @@ public class SecondHandProductResp { @@ -26,4 +26,5 @@ public class SecondHandProductResp {
26 /** 全新瑕疵,二手. */ 26 /** 全新瑕疵,二手. */
27 private String sechondHandTypeName; 27 private String sechondHandTypeName;
28 private String soldTime; 28 private String soldTime;
  29 + private int status;
29 } 30 }
@@ -417,6 +417,11 @@ public class ProductServiceImpl implements ProductService { @@ -417,6 +417,11 @@ public class ProductServiceImpl implements ProductService {
417 if (storagePriceMapper.updateStatus(skup, status, 0) == 0) { 417 if (storagePriceMapper.updateStatus(skup, status, 0) == 0) {
418 throw new ServiceException(400, "商品(skup)状态已变更"); 418 throw new ServiceException(400, "商品(skup)状态已变更");
419 } 419 }
  420 + if (status == 10) {
  421 + if (secondhandInfoMapper.updateStatus(skup, 10) == 0) {
  422 + throw new ServiceException(400, "商品(skup)改成待审核失败,状态已变更");
  423 + }
  424 + }
420 } else { 425 } else {
421 if (storagePriceMapper.updateStatus(skup, status, 1) == 0) { 426 if (storagePriceMapper.updateStatus(skup, status, 1) == 0) {
422 throw new ServiceException(400, "商品(skup)状态已变更"); 427 throw new ServiceException(400, "商品(skup)状态已变更");
@@ -1228,6 +1233,7 @@ public class ProductServiceImpl implements ProductService { @@ -1228,6 +1233,7 @@ public class ProductServiceImpl implements ProductService {
1228 bean.setSkup(sp.getSkup()); 1233 bean.setSkup(sp.getSkup());
1229 bean.setPrice(sp.getPrice().toString()); 1234 bean.setPrice(sp.getPrice().toString());
1230 bean.setSechondHandTypeName(sp.getPreSaleFlag() == 5 ? "全新瑕疵" : "二手"); 1235 bean.setSechondHandTypeName(sp.getPreSaleFlag() == 5 ? "全新瑕疵" : "二手");
  1236 + bean.setStatus(sp.getStatus());
1231 Storage storage = storageMap.get(sp.getStorageId()); 1237 Storage storage = storageMap.get(sp.getStorageId());
1232 if (storage != null) { 1238 if (storage != null) {
1233 Size size = sizeMap.get(storage.getSizeId()); 1239 Size size = sizeMap.get(storage.getSizeId());