|
|
@@ -18,6 +18,7 @@ import com.uas.platform.b2b.openapi.model.Forecast;
|
|
|
import com.uas.platform.b2b.openapi.model.IO;
|
|
|
import com.uas.platform.b2b.openapi.model.Sale;
|
|
|
import com.uas.platform.b2b.openapi.model.Stock;
|
|
|
+import com.uas.platform.b2b.openapi.model.TEMP_DATA;
|
|
|
import com.uas.platform.b2b.openapi.model.TEMP_FORECAST;
|
|
|
import com.uas.platform.b2b.openapi.model.TEMP_IO;
|
|
|
import com.uas.platform.b2b.openapi.model.TEMP_SALE;
|
|
|
@@ -95,7 +96,7 @@ public class UASCustDataService implements CustDataService {
|
|
|
if (StringUtils.hasText(code))
|
|
|
sql.append(" and pr_orispeccode='").append(code).append("'");
|
|
|
sql.append(" and pr_brand in (").append(brandsWithFix).append(")");
|
|
|
- sql.append(" order by pr_brand,pr_orispeccode,sa_date,sd_detno");
|
|
|
+ sql.append(" order by pr_brand,pr_spec,sa_date,sd_detno");
|
|
|
return TEMP_SALE.reduce(commonDao.query(sql.toString(), TEMP_SALE.class));
|
|
|
} finally {
|
|
|
SpObserver.putSp(currDs);
|
|
|
@@ -123,8 +124,16 @@ public class UASCustDataService implements CustDataService {
|
|
|
if (StringUtils.hasText(code))
|
|
|
sql.append(" and pr_orispeccode='").append(code).append("'");
|
|
|
sql.append(" and pr_brand in (").append(brandsWithFix).append(")");
|
|
|
- sql.append(" order by pr_brand,pr_orispeccode,pi_date,pd_pdno");
|
|
|
- return TEMP_IO.reduce(commonDao.query(sql.toString(), TEMP_IO.class, month));
|
|
|
+ sql.append(" order by pr_brand,pr_spec,pi_date,pd_pdno");
|
|
|
+ // 无io部分
|
|
|
+ StringBuffer noioSql = new StringBuffer(
|
|
|
+ "select pr_brand as brand,nvl(pr_orispeccode,pr_spec) as code,pr_detail as title,pr_spec as spec,pr_unit as unit,pm_beginqty as beginStock from v$productmonth left join product on pm_prodcode=pr_code where pm_yearmonth=? and pm_beginqty > 0");
|
|
|
+ noioSql.append(" and pr_brand in (").append(brandsWithFix).append(")");
|
|
|
+ noioSql.append(" and not exists (select 1 from prodinout left join prodiodetail on pi_id=pd_piid where to_char(pi_date,'yyyymm')=pm_yearmonth and pi_statuscode='POSTED' and pd_prodcode=pm_prodcode)");
|
|
|
+ noioSql.append(" order by pr_brand,pr_spec");
|
|
|
+
|
|
|
+ return TEMP_IO.reduce(commonDao.query(sql.toString(), TEMP_IO.class, month),
|
|
|
+ commonDao.query(noioSql.toString(), TEMP_DATA.class, month));
|
|
|
} finally {
|
|
|
SpObserver.putSp(currDs);
|
|
|
}
|
|
|
@@ -149,7 +158,7 @@ public class UASCustDataService implements CustDataService {
|
|
|
if (StringUtils.hasText(code))
|
|
|
sql.append(" and pr_orispeccode='").append(code).append("'");
|
|
|
sql.append(" and pr_brand in (").append(brandsWithFix).append(")");
|
|
|
- sql.append(" order by pr_brand,pr_orispeccode,sf_date,sd_detno");
|
|
|
+ sql.append(" order by pr_brand,pr_spec,sf_date,sd_detno");
|
|
|
return TEMP_FORECAST.reduce(commonDao.query(sql.toString(), TEMP_FORECAST.class));
|
|
|
} finally {
|
|
|
SpObserver.putSp(currDs);
|