Pārlūkot izejas kodu

加end_item_fld返回出货客户所属行业

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@4019 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
yingp 10 gadi atpakaļ
vecāks
revīzija
e272c98990

+ 15 - 1
src/main/java/com/uas/platform/b2b/openapi/model/IOItem.java

@@ -25,15 +25,21 @@ public class IOItem implements Serializable {
 	 * 客户、供应商名称
 	 */
 	// private String trader;
+	
+	/**
+	 * 行业
+	 */
+	private String end_item_fld;
 
 	/**
 	 * 发货、收货日期
 	 */
 	private Date date;
 
-	public IOItem(Date date, Double qty) {
+	public IOItem(Date date, String kind, Double qty) {
 		super();
 		this.qty = qty;
+		this.end_item_fld = kind;
 		// this.trader = trader;
 		this.date = date;
 	}
@@ -62,4 +68,12 @@ public class IOItem implements Serializable {
 		this.date = date;
 	}
 
+	public String getEnd_item_fld() {
+		return end_item_fld;
+	}
+
+	public void setEnd_item_fld(String end_item_fld) {
+		this.end_item_fld = end_item_fld;
+	}
+
 }

+ 19 - 9
src/main/java/com/uas/platform/b2b/openapi/model/TEMP_IO.java

@@ -16,7 +16,9 @@ public class TEMP_IO extends Data {
 
 	private Double qty;
 
-	private String trader;
+	// private String trader;
+
+	private String end_item_fld;
 
 	private String type;// in/out
 
@@ -41,13 +43,13 @@ public class TEMP_IO extends Data {
 		this.qty = qty;
 	}
 
-	public String getTrader() {
-		return trader;
-	}
-
-	public void setTrader(String trader) {
-		this.trader = trader;
-	}
+	// public String getTrader() {
+	// return trader;
+	// }
+	//
+	// public void setTrader(String trader) {
+	// this.trader = trader;
+	// }
 
 	public String getType() {
 		return type;
@@ -84,7 +86,7 @@ public class TEMP_IO extends Data {
 					}
 				}
 
-				items.add(new IOItem(temp.getDate(), temp.getQty()));
+				items.add(new IOItem(temp.getDate(), temp.getEnd_item_fld(), temp.getQty()));
 				if ("in".equals(temp.getType())) {
 					imap.put(data, items);
 				} else {
@@ -109,4 +111,12 @@ public class TEMP_IO extends Data {
 		this.beginStock = beginStock;
 	}
 
+	public String getEnd_item_fld() {
+		return end_item_fld;
+	}
+
+	public void setEnd_item_fld(String end_item_fld) {
+		this.end_item_fld = end_item_fld;
+	}
+
 }

+ 4 - 4
src/main/java/com/uas/platform/b2b/openapi/service/impl/UASCustDataService.java

@@ -69,7 +69,7 @@ public class UASCustDataService implements CustDataService {
 				final String brandsWithFix = StringUtils.collectionToDelimitedString(Arrays.asList(brands.split(",")), ",", "'", "'");
 				int nowMonth = DateUtils.getYearmonth(new Date());
 				return commonDao
-						.query("select pr_brand as brand,pr_orispeccode as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,po_onhand as stock,(select pm_beginqty from v$productmonth where pr_code=pm_prodcode and pm_yearmonth=?) as beginStock from productonhand left join product on po_prodcode=pr_code where po_onhand > 0 and pr_brand in ("
+						.query("select pr_brand as brand,nvl(pr_orispeccode,pr_spec) as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,po_onhand as stock,(select pm_beginqty from v$productmonth where pr_code=pm_prodcode and pm_yearmonth=?) as beginStock from productonhand left join product on po_prodcode=pr_code where po_onhand > 0 and pr_brand in ("
 								+ brandsWithFix + ")", Stock.class, nowMonth);
 			} finally {
 				SpObserver.putSp(currDs);
@@ -90,7 +90,7 @@ public class UASCustDataService implements CustDataService {
 				// A,B,C格式的数据改为'A','B','C'格式
 				final String brandsWithFix = StringUtils.collectionToDelimitedString(Arrays.asList(brands.split(",")), ",", "'", "'");
 				StringBuffer sql = new StringBuffer(
-						"select pr_brand as brand,pr_orispeccode as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,sa_date as \"DATE\",sd_qty as qty from sale left join saledetail on sa_id=sd_said left join product on sd_prodcode=pr_code where ");
+						"select pr_brand as brand,nvl(pr_orispeccode,pr_spec) as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,sa_date as \"DATE\",sd_qty as qty from sale left join saledetail on sa_id=sd_said left join product on sd_prodcode=pr_code where ");
 				sql.append("sa_statuscode='AUDITED' and sa_date > to_date('").append(startDate).append("','yyyy-mm-dd')");
 				if (StringUtils.hasText(code))
 					sql.append(" and pr_orispeccode='").append(code).append("'");
@@ -118,7 +118,7 @@ public class UASCustDataService implements CustDataService {
 				// {@code startDate}所处期间
 				int month = DateUtils.getYearmonth(startDate);
 				StringBuffer sql = new StringBuffer(
-						"select pr_brand as brand,pr_orispeccode as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,pi_date as \"DATE\",nvl(pd_inqty,0)+nvl(pd_outqty,0) as qty,case when nvl(pd_inqty,0)<>0 then 'in' else 'out' end as type,(select pm_beginqty from v$productmonth where pr_code=pm_prodcode and pm_yearmonth=?) as beginStock from prodinout left join prodiodetail on pi_id=pd_piid left join product on pd_prodcode=pr_code where ");
+						"select cu_kind as end_item_fld,pr_brand as brand,nvl(pr_orispeccode,pr_spec) as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,pi_date as \"DATE\",nvl(pd_inqty,0)+nvl(pd_outqty,0) as qty,case when nvl(pd_inqty,0)<>0 then 'in' else 'out' end as type,(select pm_beginqty from v$productmonth where pr_code=pm_prodcode and pm_yearmonth=?) as beginStock from prodinout left join prodiodetail on pi_id=pd_piid left join customer on pi_cardcode=cu_code left join product on pd_prodcode=pr_code where ");
 				sql.append("pi_statuscode='POSTED' and pi_date > to_date('").append(startDate).append("','yyyy-mm-dd')");
 				if (StringUtils.hasText(code))
 					sql.append(" and pr_orispeccode='").append(code).append("'");
@@ -144,7 +144,7 @@ public class UASCustDataService implements CustDataService {
 				// A,B,C格式的数据改为'A','B','C'格式
 				final String brandsWithFix = StringUtils.collectionToDelimitedString(Arrays.asList(brands.split(",")), ",", "'", "'");
 				StringBuffer sql = new StringBuffer(
-						"select pr_brand as brand,pr_orispeccode as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,sf_date as \"DATE\",sd_qty as qty,sd_needdate as needDate,sd_enddate as endDate from saleforecast left join saleforecastdetail on sf_id=sd_sfid left join customer on sd_custcode=cu_code left join product on sd_prodcode=pr_code where ");
+						"select pr_brand as brand,nvl(pr_orispeccode,pr_spec) as org_item,pr_detail as item_desc,pr_spec as item_spec,pr_unit as item_unit,sf_date as \"DATE\",sd_qty as qty,sd_needdate as needDate,sd_enddate as endDate from saleforecast left join saleforecastdetail on sf_id=sd_sfid left join customer on sd_custcode=cu_code left join product on sd_prodcode=pr_code where ");
 				sql.append("sf_statuscode='AUDITED' and sf_date > to_date('").append(startDate).append("','yyyy-mm-dd')");
 				if (StringUtils.hasText(code))
 					sql.append(" and pr_orispeccode='").append(code).append("'");