|
@@ -25,10 +25,10 @@ import u8c.vo.DemandVO;
|
|
|
public class DemandPurchaseRequisitionImpl implements IDemandPurchaseRequisition {
|
|
|
|
|
|
private IUAPQueryBS iuap = NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
|
|
- DemandTestUI frameUI = null;
|
|
|
+// DemandTestUI frameUI = null;
|
|
|
|
|
|
/**
|
|
|
- * 根据材料采购单生成请购单
|
|
|
+ * 鏍规嵁鏉愭枡閲囪喘鍗曠敓鎴愯�璐�崟
|
|
|
* @param s
|
|
|
* @throws Exception
|
|
|
*/
|
|
@@ -47,32 +47,32 @@ public class DemandPurchaseRequisitionImpl implements IDemandPurchaseRequisition
|
|
|
// }
|
|
|
// }
|
|
|
// if(demandBVOs.size()==0) {
|
|
|
-// throw new BusinessException("当前材料采购单没有数据,请先添加数据");
|
|
|
+// throw new BusinessException("褰撳墠鏉愭枡閲囪喘鍗曟病鏈夋暟鎹�紝璇峰厛娣诲姞鏁版嵁");
|
|
|
// }
|
|
|
PraybillHeaderVO header = new PraybillHeaderVO();
|
|
|
- header.setPk_corp(demandVO.getPk_corp());//公司
|
|
|
- header.setDpraydate(demandVO.getDbilldate());//单据日期-->请购日期
|
|
|
- header.setIpraysource(5);//请购来源
|
|
|
- header.setIpraytype(2);//请购类型
|
|
|
- header.isDirecttransit(new UFBoolean(true));// -->是否直运???
|
|
|
- header.setIbillstatus(0);//单据状态
|
|
|
- header.setCpraypsn(demandVO.getWorkmanid());//请购人id-->业务员
|
|
|
- header.setCdeptid(demandVO.getPlandeptid());//请购部门id-->计划部门
|
|
|
- header.setVmemo(demandVO.getVnote());//备注-》备注
|
|
|
+ header.setPk_corp(demandVO.getPk_corp());//鍏�徃
|
|
|
+ header.setDpraydate(demandVO.getDbilldate());//鍗曟嵁鏃ユ湡-->璇疯喘鏃ユ湡
|
|
|
+ header.setIpraysource(5);//璇疯喘鏉ユ簮
|
|
|
+ header.setIpraytype(2);//璇疯喘绫诲瀷
|
|
|
+ header.isDirecttransit(new UFBoolean(true));// -->鏄�惁鐩磋繍锛燂紵锛�
|
|
|
+ header.setIbillstatus(0);//鍗曟嵁鐘舵€�
|
|
|
+ header.setCpraypsn(demandVO.getWorkmanid());//璇疯喘浜篿d-->涓氬姟鍛�
|
|
|
+ header.setCdeptid(demandVO.getPlandeptid());//璇疯喘閮ㄩ棬id-->璁″垝閮ㄩ棬
|
|
|
+ header.setVmemo(demandVO.getVnote());//澶囨敞-銆嬪�娉�
|
|
|
header.setDr(0);
|
|
|
- header.setCaccountyear(String.valueOf(new UFDate().getYear()));//年份
|
|
|
- header.setCoperator(demandVO.getBillmaker());//制单人-》制单人
|
|
|
+ header.setCaccountyear(String.valueOf(new UFDate().getYear()));//骞翠唤
|
|
|
+ header.setCoperator(demandVO.getBillmaker());//鍒跺崟浜�-銆嬪埗鍗曚汉
|
|
|
PraybillItemVO[] items = new PraybillItemVO[demandBVOs.size()];
|
|
|
for (int i = 0; i < demandBVOs.size(); i++) {
|
|
|
DemandBVO demandBVO = demandBVOs.get(i);
|
|
|
PraybillItemVO praybillItemVO = new PraybillItemVO();
|
|
|
- praybillItemVO.setPk_corp(demandVO.getPk_corp()); // 公司
|
|
|
- // 表体赋值
|
|
|
- praybillItemVO.setRowno((i+1)*10+"");//行号(单据模板里面是crowno,但是对象中只有Rowno)
|
|
|
- praybillItemVO.setCmangid(getCmangid(demandBVO.getCmaterialcode())); //存货编码-》存货编码
|
|
|
- praybillItemVO.setNpraynum(demandBVO.getNum()); //主数量-》数量
|
|
|
- praybillItemVO.setDdemanddate(new UFDate());//-->需求日期 ???
|
|
|
- String cprojectid = "";//项目id
|
|
|
+ praybillItemVO.setPk_corp(demandVO.getPk_corp()); // 鍏�徃
|
|
|
+ // 琛ㄤ綋璧嬪€�
|
|
|
+ praybillItemVO.setRowno((i+1)*10+"");//琛屽彿锛堝崟鎹�ā鏉块噷闈㈡槸crowno锛屼絾鏄��璞′腑鍙�湁Rowno锛�
|
|
|
+ praybillItemVO.setCmangid(getCmangid(demandBVO.getCmaterialcode())); //瀛樿揣缂栫爜-銆嬪瓨璐х紪鐮�
|
|
|
+ praybillItemVO.setNpraynum(demandBVO.getNum()); //涓绘暟閲�-銆嬫暟閲�
|
|
|
+ praybillItemVO.setDdemanddate(new UFDate());//-->闇€姹傛棩鏈� 锛燂紵锛�
|
|
|
+ String cprojectid = "";//椤圭洰id
|
|
|
if(demandBVO.getPrjcode().startsWith("1001")) {
|
|
|
cprojectid = demandBVO.getPrjcode();
|
|
|
}
|
|
@@ -80,9 +80,9 @@ public class DemandPurchaseRequisitionImpl implements IDemandPurchaseRequisition
|
|
|
cprojectid = GetBaseDAOUtil.getprojectid(demandBVO.getPrjcode());
|
|
|
}
|
|
|
praybillItemVO.setCprojectid(cprojectid);
|
|
|
-// praybillItemVO.setCassistunit(demandBVO.getCastunitid());//辅助计量单位
|
|
|
-// praybillItemVO.setNassistnum(new UFDouble(demandBVO.getNastnum()));//辅计量数量
|
|
|
-// praybillItemVO.setVproducenum(demandBVO.getVbatchcode());//批次号
|
|
|
+// praybillItemVO.setCassistunit(demandBVO.getCastunitid());//杈呭姪璁¢噺鍗曚綅
|
|
|
+// praybillItemVO.setNassistnum(new UFDouble(demandBVO.getNastnum()));//杈呰�閲忔暟閲�
|
|
|
+// praybillItemVO.setVproducenum(demandBVO.getVbatchcode());//鎵规�鍙�
|
|
|
items[i] = praybillItemVO;
|
|
|
}
|
|
|
PraybillVO vo = new PraybillVO();
|
|
@@ -92,14 +92,14 @@ public class DemandPurchaseRequisitionImpl implements IDemandPurchaseRequisition
|
|
|
praybillVOs[0] = vo;
|
|
|
IplatFormEntry iIplatFormEntry = (IplatFormEntry)NCLocator.getInstance().lookup(IplatFormEntry.class.getName());
|
|
|
ArrayList retObj = (ArrayList) iIplatFormEntry.processAction("SAVEBASE", "20", vo.getHeadVO().getDpraydate().toString(), null, vo, null, null);
|
|
|
- MessageDialog.showHintDlg(frameUI, "成功", "请购单新增成功");
|
|
|
+// MessageDialog.showHintDlg(frameUI, "鎴愬姛", "璇疯喘鍗曟柊澧炴垚鍔�");
|
|
|
// IPrayBillMaintainAPI prayBillMaintainAPI = NCLocator.getInstance().lookup(IPrayBillMaintainAPI.class);
|
|
|
// prayBillMaintainAPI.insert(praybillVOs);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据物料code查询主键
|
|
|
+ * 鏍规嵁鐗╂枡code鏌ヨ�涓婚敭
|
|
|
* @param code
|
|
|
* @return
|
|
|
* @throws BusinessException
|
|
@@ -109,7 +109,7 @@ public class DemandPurchaseRequisitionImpl implements IDemandPurchaseRequisition
|
|
|
String sql = " select pk_invbasdoc from bd_invbasdoc" + " where invcode ='" + code + "' and dr =0 ";
|
|
|
cmangid = (String) iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
if (cmangid == null) {
|
|
|
- throw new BusinessException("U8C物料code不存在:" + code);
|
|
|
+ throw new BusinessException("U8C鐗╂枡code涓嶅瓨鍦�:" + code);
|
|
|
}
|
|
|
return cmangid;
|
|
|
}
|