Authored by mali

Merge branch 'test6.9.9' into test6.9.10

@@ -262,7 +262,7 @@ @@ -262,7 +262,7 @@
262 </update> 262 </update>
263 <update id="changeSaleStatusOn"> 263 <update id="changeSaleStatusOn">
264 update storage_deposit 264 update storage_deposit
265 - set order_status = 1, new_skup = #{newSkup} ,update_time = unix_timestamp(now()) 265 + set order_status = 1, lock_flag=0, new_skup = #{newSkup} ,update_time = unix_timestamp(now())
266 where owner_uid=#{uid} and deposit_code = #{depositCode,jdbcType=VARCHAR} and status=1 and order_status = 0 266 where owner_uid=#{uid} and deposit_code = #{depositCode,jdbcType=VARCHAR} and status=1 and order_status = 0
267 </update> 267 </update>
268 <update id="changeSaleStatusOff"> 268 <update id="changeSaleStatusOff">
@@ -320,7 +320,10 @@ @@ -320,7 +320,10 @@
320 where owner_uid = #{uid} and new_skup =#{skup} 320 where owner_uid = #{uid} and new_skup =#{skup}
321 </select> 321 </select>
322 <update id="sale"> 322 <update id="sale">
323 - update storage_deposit set del_status=1, new_order_code =#{orderCode}, update_time = unix_timestamp(now()) 323 + update storage_deposit set del_status=1,
  324 + order_status=0,
  325 + new_order_code =#{orderCode},
  326 + update_time = unix_timestamp(now())
324 where owner_uid = #{uid} and new_skup =#{skup} and del_status=0 327 where owner_uid = #{uid} and new_skup =#{skup} and del_status=0
325 </update> 328 </update>
326 <select id="getDepositOffShelvesCount" resultType="java.lang.Integer"> 329 <select id="getDepositOffShelvesCount" resultType="java.lang.Integer">
@@ -420,7 +423,7 @@ @@ -420,7 +423,7 @@
420 where owner_uid = #{uid,jdbcType=INTEGER} 423 where owner_uid = #{uid,jdbcType=INTEGER}
421 and deposit_code = #{depositCode,jdbcType=VARCHAR} 424 and deposit_code = #{depositCode,jdbcType=VARCHAR}
422 AND lock_flag = #{expectStatus,jdbcType=INTEGER} 425 AND lock_flag = #{expectStatus,jdbcType=INTEGER}
423 - and status = 1 426 + and order_status = #{expectStatus,jdbcType=INTEGER}
424 </update> 427 </update>
425 428
426 </mapper> 429 </mapper>
@@ -321,13 +321,13 @@ public class DepositServiceImpl implements DepositService { @@ -321,13 +321,13 @@ public class DepositServiceImpl implements DepositService {
321 boolean lock(){ 321 boolean lock(){
322 int rows = storageDepositMapper.updateStorageLockFlagByCAS(sellerUid, depositCode, lockStatus, unlockStatus); 322 int rows = storageDepositMapper.updateStorageLockFlagByCAS(sellerUid, depositCode, lockStatus, unlockStatus);
323 LOGGER.info("in DepositLock.lock sellerUid {} depositCode {} rows {}", sellerUid, depositCode, rows); 323 LOGGER.info("in DepositLock.lock sellerUid {} depositCode {} rows {}", sellerUid, depositCode, rows);
324 - return rows == 1; 324 + return rows > 0;
325 } 325 }
326 326
327 boolean unlock(){ 327 boolean unlock(){
328 int rows = storageDepositMapper.updateStorageLockFlagByCAS(sellerUid, depositCode, unlockStatus, lockStatus); 328 int rows = storageDepositMapper.updateStorageLockFlagByCAS(sellerUid, depositCode, unlockStatus, lockStatus);
329 LOGGER.info("in DepositLock.unlock sellerUid {} depositCode {} rows {}", sellerUid, depositCode, rows); 329 LOGGER.info("in DepositLock.unlock sellerUid {} depositCode {} rows {}", sellerUid, depositCode, rows);
330 - return rows == 1; 330 + return rows > 0;
331 } 331 }
332 } 332 }
333 /** 333 /**