Authored by caoyan

Merge branch 'dev_确认收货优化' of http://git.yoho.cn/ufo/ufo-platform into dev_确认收货优化

... ... @@ -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
... ...
... ... @@ -61,7 +61,7 @@
<update id="upadteAuditResult">
update self_size set status=#{status}, audit_time=unix_timestamp(), audit_uid=#{auditUid}
where id=#{id}
where id=#{id} and status=0
</update>
</mapper>
\ 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
... ...
... ... @@ -217,8 +217,10 @@ public class SelfSizeServiceImpl implements ISelfSizeService {
clearProductDetailCache(selfSize.getProductId());
if(num > 0 && req.getStatus().intValue() == 1) {//审核通过
//添加尺码到storage表
saveStorage(selfSize);
//添加尺码到storage表
if (storageMapper.selectBySize(selfSize.getProductId(), selfSize.getSizeId()) == null) {
saveStorage(selfSize);
}
Product product = productMapper.selectByPrimaryKey(selfSize.getProductId());
Size size = ufoSizeMapper.selectOneById(selfSize.getSizeId());
... ... @@ -239,11 +241,11 @@ public class SelfSizeServiceImpl implements ISelfSizeService {
inboxService.sendSmsMessage(smsReq);
}
}
return num;
return 1;
}
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());
... ...