|
|
@@ -971,6 +971,17 @@ public class ERPServiceImpl implements ERPService {
|
|
|
" where pd_piid = "+prodInOut.getPiId()+" and pb_sendwms = -1 " +
|
|
|
" group by pd_piid,pd_prodcode,pr_detail,pr_brand,pd_whcode,wh_description,pd_description" +
|
|
|
" order by MIN(pd_pdno) ";
|
|
|
+ if("out".equals(prodInOut.getPiWmsInType())){
|
|
|
+ detSql = "select pd_piid pdPiid,min(pd_id) pdId,min(pd_pdno) pdPdno,pd_prodcode pdProdcode,pr_detail pdProdname,pr_brand pdBrandName" +
|
|
|
+ ",sum(nvl(pd_inqty,0)+nvl(pd_outqty,0)) pdQty" +
|
|
|
+ ",pd_whcode pdWhcode,wh_description pdWhname,pd_description pdInBatch" +
|
|
|
+ ",pd_custprodcode pdCustprodcode,pd_custprodcode1_user pdCustprodcode1, pd_pocode pdPocode" +
|
|
|
+ " from "+master+".prodiodetail LEFT JOIN "+master+".product on pr_code = pd_prodcode left join "+master+".productbrand on pb_name = pr_brand " +
|
|
|
+ " left join "+master+".warehouse on wh_Code = pd_whcode " +
|
|
|
+ " where pd_piid = "+prodInOut.getPiId()+" and pb_sendwms = -1 " +
|
|
|
+ " group by pd_piid,pd_prodcode,pr_detail,pr_brand,pd_whcode,wh_description,pd_description,pd_custprodcode,pd_custprodcode1_user,pd_pocode" +
|
|
|
+ " order by MIN(pd_pdno) ";
|
|
|
+ }
|
|
|
List<Prodiodetail> details = baseDao.getJdbcTemplate().query(detSql,
|
|
|
new BeanPropertyRowMapper<Prodiodetail>(Prodiodetail.class));
|
|
|
prodInOut.setDetails(details);
|
|
|
@@ -983,8 +994,13 @@ public class ERPServiceImpl implements ERPService {
|
|
|
" from "+master+".prodinout where pi_id = "+prodInOut.getPiId());
|
|
|
//写入 prodiowms_Lines 账套
|
|
|
baseDao.execute("delete from "+master+".prodiowms_lines where pl_piid = "+prodInOut.getPiId());
|
|
|
- baseDao.execute("INSERT INTO "+master+".prodiowms_Lines(ITIME,PL_PIID,LINENO, ITEMCODE, PLANQTY,virtualWarehouse, USERDEFINED1,userDefined3,USERDEFINED4)" +
|
|
|
- "select sysdate,pdPiid,pdPdno,pdProdcode,pdQty,pdWhname,pdInBatch,pdBrandName,'"+master+"' from ("+detSql+") ");
|
|
|
+ if("out".equals(prodInOut.getPiWmsInType())){
|
|
|
+ baseDao.execute("INSERT INTO "+master+".prodiowms_Lines(ITIME,PL_PIID,LINENO, ITEMCODE, PLANQTY,virtualWarehouse, USERDEFINED1,userDefined3,USERDEFINED4,customField1,customField2,customField3)" +
|
|
|
+ "select sysdate,pdPiid,pdPdno,pdProdcode,pdQty,pdWhname,pdInBatch,pdBrandName,'"+master+"',pdCustprodcode,pdCustprodcode1,pdPocode from ("+detSql+") ");
|
|
|
+ }else {
|
|
|
+ baseDao.execute("INSERT INTO "+master+".prodiowms_Lines(ITIME,PL_PIID,LINENO, ITEMCODE, PLANQTY,virtualWarehouse, USERDEFINED1,userDefined3,USERDEFINED4)" +
|
|
|
+ "select sysdate,pdPiid,pdPdno,pdProdcode,pdQty,pdWhname,pdInBatch,pdBrandName,'"+master+"' from ("+detSql+") ");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return prodInOut;
|
|
|
@@ -998,7 +1014,10 @@ public class ERPServiceImpl implements ERPService {
|
|
|
orderLine = new OrderLineIn(); // 创建入库订单行对象
|
|
|
((OrderLineIn) orderLine).setStockinDate(prodInOut.getPiDate()); // 设置入库日期
|
|
|
} else {
|
|
|
- orderLine = new OrderLine(); // 创建普通订单行对象
|
|
|
+ orderLine = new OrderLineOut(); // 创建普通订单行对象
|
|
|
+ ((OrderLineOut) orderLine).setCustomField1(detail.getPdCustprodcode());
|
|
|
+ ((OrderLineOut) orderLine).setCustomField2(detail.getPdCustprodcode1());
|
|
|
+ ((OrderLineOut) orderLine).setCustomField3(detail.getPdPocode());
|
|
|
}
|
|
|
// 设置通用属性
|
|
|
orderLine.setLineNo(String.valueOf(detail.getPdPdno()));// 行号
|