|
|
@@ -51,8 +51,10 @@ public class ERPServiceImpl implements ERPService {
|
|
|
public ApiResult<String> syncProductStock(String data) {
|
|
|
logger.info("sendProd-Begin:master {} ids {}");
|
|
|
try {
|
|
|
- SqlRowList docMsg = baseDao.queryForRowSet(" select pr_id,to_char(sysdate,'yyyy-mm-dd') ba_date,ba_remain,tspr_eightcode,pr_code,tspr_ninecode,tspr_description,ba_code from product left join batch on pr_code=ba_prodcode left join transsionproduct on pr_code=tspr_uasprcode " +
|
|
|
- " where tspr_enable=-1 and pr_statuscode='AUDITED' and ba_whcode='BSD056' and ba_remain>0");
|
|
|
+ SqlRowList docMsg = baseDao.queryForRowSet(" select pr_id,to_char(sysdate,'yyyy-mm-dd') ba_date,ba_remain,tspr_eightcode,pr_code,tspr_ninecode,tspr_description,ba_code from product left join " +
|
|
|
+ " (select ba_prodcode,sum(ba_remain) ba_remain,max(ba_code) ba_code from batch where ba_remain>0 and ba_whcode='BSD056' group by ba_prodcode) " +
|
|
|
+ " on pr_code=ba_prodcode left join transsionproduct on pr_code=tspr_uasprcode " +
|
|
|
+ " where tspr_enable=-1 and pr_statuscode='AUDITED' and ba_remain>0");
|
|
|
if(!docMsg.hasNext()){
|
|
|
return ApiResponse.failRsp("102","没有需要同步的商品库存");
|
|
|
}
|