|
@@ -384,7 +384,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
SpObserver.putSp(master);
|
|
SpObserver.putSp(master);
|
|
|
//创建中
|
|
//创建中
|
|
|
baseDao.execute("update CatlDoc set CA_DOCSTATE=2 where ca_id = "+id);
|
|
baseDao.execute("update CatlDoc set CA_DOCSTATE=2 where ca_id = "+id);
|
|
|
- SqlRowList docList = baseDao.queryForRowSet("SELECT * FROM ( " +
|
|
|
|
|
|
|
+ /*SqlRowList docList = baseDao.queryForRowSet("SELECT * FROM ( " +
|
|
|
"select cd_cpn,min(CD_DC) ztcnno,pc_zbzsmount_user zzbsmount,pc_zzxsmount_user zzxsmount,pc_zzbsmount_user zbzsmount ,cd_newboxcode " +
|
|
"select cd_cpn,min(CD_DC) ztcnno,pc_zbzsmount_user zzbsmount,pc_zzxsmount_user zzxsmount,pc_zzbsmount_user zbzsmount ,cd_newboxcode " +
|
|
|
" ,sum(CD_QTY) zmount,cd_wflag zwidth,ca_code||'_'||cd_newboxcode zzstz " +
|
|
" ,sum(CD_QTY) zmount,cd_wflag zwidth,ca_code||'_'||cd_newboxcode zzstz " +
|
|
|
" ,cd_newboxcode||(case when cd_remark is not null then ' '||cd_remark else '' end) zremark,count(1) codecount,wm_concat(cd_id) cd_ids " +
|
|
" ,cd_newboxcode||(case when cd_remark is not null then ' '||cd_remark else '' end) zremark,count(1) codecount,wm_concat(cd_id) cd_ids " +
|
|
@@ -392,7 +392,21 @@ public class ERPServiceImpl implements ERPService {
|
|
|
"where cd_caid = ? and nvl(pc_zbzsmount_user,0)>0 " +
|
|
"where cd_caid = ? and nvl(pc_zbzsmount_user,0)>0 " +
|
|
|
" and CD_PANID is null "+
|
|
" and CD_PANID is null "+
|
|
|
" group by CD_CPN,pc_zbzsmount_user,pc_zzxsmount_user,pc_zzbsmount_user,cd_wflag,cd_remark,cd_newboxcode,ca_code||'_'||cd_newboxcode order by min(cd_detno)" +
|
|
" group by CD_CPN,pc_zbzsmount_user,pc_zzxsmount_user,pc_zzbsmount_user,cd_wflag,cd_remark,cd_newboxcode,ca_code||'_'||cd_newboxcode order by min(cd_detno)" +
|
|
|
- " ) order by to_number(cd_newboxcode)",id);
|
|
|
|
|
|
|
+ " ) order by to_number(cd_newboxcode)",id);*/
|
|
|
|
|
+ SqlRowList docList = baseDao.queryForRowSet("SELECT * FROM ( " +
|
|
|
|
|
+ " select cd_cpn,min(CD_DC) ztcnno,pc_zbzsmount_user zzbsmount,pc_zzxsmount_user zzxsmount,pc_zzbsmount_user zbzsmount ,cd_newboxcode " +
|
|
|
|
|
+ " ,sum(CD_QTY) zmount,cd_wflag zwidth,ca_code||'_'||cd_newboxcode zzstz " +
|
|
|
|
|
+ " ,cd_newboxcode||' '||to_char(wm_concat(cd_remark)) zremark,sum(codecount) codecount,wm_concat(cd_id) cd_ids " +
|
|
|
|
|
+ " from( " +
|
|
|
|
|
+ " select min(cd_detno) cd_detno,CD_CPN,pc_zbzsmount_user,pc_zzxsmount_user,pc_zzbsmount_user,cd_wflag,cd_remark,cd_newboxcode,ca_code " +
|
|
|
|
|
+ " ,sum(CD_QTY) CD_QTY,min(CD_DC) CD_DC,count(1) codecount,to_char(wm_concat(cd_id)) cd_id " +
|
|
|
|
|
+ " from CatlDocDetail left join CatlDoc on ca_id = cd_caid left join customer on cu_code = CA_CUSTCODE " +
|
|
|
|
|
+ " left join product on pr_code = CD_PRCODE left join PRODUCTCUSTOMER on pc_custid= cu_id and pc_prodid=pr_id " +
|
|
|
|
|
+ " where cd_caid = ? and nvl(pc_zbzsmount_user,0)>0 and CD_PANID is null " +
|
|
|
|
|
+ " group by CD_CPN,pc_zbzsmount_user,pc_zzxsmount_user,pc_zzbsmount_user,cd_wflag,cd_remark,cd_newboxcode,ca_code " +
|
|
|
|
|
+ " ) " +
|
|
|
|
|
+ " group by CD_CPN,pc_zbzsmount_user,pc_zzxsmount_user,pc_zzbsmount_user,cd_wflag,cd_newboxcode,ca_code||'_'||cd_newboxcode order by min(cd_detno) " +
|
|
|
|
|
+ ") order by to_number(cd_newboxcode)",id);
|
|
|
if(!docList.hasNext()){
|
|
if(!docList.hasNext()){
|
|
|
retMap.put("success",false);
|
|
retMap.put("success",false);
|
|
|
retMap.put("message","没有需要对接的明细.");
|
|
retMap.put("message","没有需要对接的明细.");
|