Authored by Lixiaodi
Committed by mali

fixBug:重复尺码

... ... @@ -39,4 +39,6 @@ public interface StorageMapper {
int updateDeleteSuggestPrice();
int updateSkuStatus(@Param("storageId")Integer storageId, @Param("status")Integer status);
Storage selectBySize(@Param("productId")Integer productId, @Param("sizeId")Integer sizeId);
}
\ No newline at end of file
... ...
... ... @@ -113,4 +113,8 @@
<update id="updateSkuStatus">
UPDATE storage s set s.status = #{status, jdbcType=INTEGER} where s.id = #{storageId, jdbcType=INTEGER}
</update>
<select id="selectBySize" resultMap="BaseResultMap">
select id, product_id, goods_id, size_id, storage_num, update_time, create_time, suggest_low_price, suggest_high_price
from storage where product_id=#{productId} and size_id=#{sizeId}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -211,6 +211,9 @@ public class SelfSizeServiceImpl implements ISelfSizeService {
if(null == selfSize) {
throw new PlatformException("记录不存在", 400);
}
if (storageMapper.selectBySize(selfSize.getProductId(), selfSize.getSizeId()) != null) {
throw new PlatformException("该尺码已存在", 400);
}
UserHelper userInfo = new UserHelper();
int num = selfSizeMapper.upadteAuditResult(req.getId(), req.getStatus(), userInfo.getUserId());
//清商品详情缓存
... ... @@ -243,7 +246,7 @@ public class SelfSizeServiceImpl implements ISelfSizeService {
}
private int saveStorage(SelfSize selfSize) {
Storage record = new Storage();
Storage record = new Storage();
record.setProductId(selfSize.getProductId());
record.setGoodsId(selfSize.getGoodsId());
record.setSizeId(selfSize.getSizeId());
... ...