|
@@ -11,6 +11,7 @@ import nc.itf.uap.IUAPQueryBS;
|
|
import nc.itf.uap.IVOPersistence;
|
|
import nc.itf.uap.IVOPersistence;
|
|
import nc.itf.uap.pf.IplatFormEntry;
|
|
import nc.itf.uap.pf.IplatFormEntry;
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
|
|
+import nc.jdbc.framework.processor.MapProcessor;
|
|
import nc.ui.hr.frame.FrameUI;
|
|
import nc.ui.hr.frame.FrameUI;
|
|
import nc.ui.hr.frame.action.AbstractAction;
|
|
import nc.ui.hr.frame.action.AbstractAction;
|
|
import nc.ui.hr.frame.impl.MainBillMgrPanel;
|
|
import nc.ui.hr.frame.impl.MainBillMgrPanel;
|
|
@@ -30,6 +31,14 @@ import nc.vo.pub.lang.UFDouble;
|
|
import u8c.ui.mm.panel.OperationMainPanel;
|
|
import u8c.ui.mm.panel.OperationMainPanel;
|
|
import u8c.ui.mm.panel.OperationTestUI;
|
|
import u8c.ui.mm.panel.OperationTestUI;
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * 请购单
|
|
|
|
+ *@Description: TODO
|
|
|
|
+ *@Author: ZTH
|
|
|
|
+ *@Date:2023年12月22日 下午6:49:00
|
|
|
|
+ *@Version: V1.0
|
|
|
|
+ */
|
|
|
|
+
|
|
public class PushParybillAction extends AbstractAction {
|
|
public class PushParybillAction extends AbstractAction {
|
|
|
|
|
|
private IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
private IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
@@ -128,12 +137,31 @@ public class PushParybillAction extends AbstractAction {
|
|
header.setCaccountyear(String.valueOf(new UFDate().getYear()));// 年份
|
|
header.setCaccountyear(String.valueOf(new UFDate().getYear()));// 年份
|
|
header.setIpraysource(5);// 请购来源
|
|
header.setIpraysource(5);// 请购来源
|
|
header.setIpraytype(2);// 请购类型
|
|
header.setIpraytype(2);// 请购类型
|
|
- //项目编码 pk_defdoc9
|
|
|
|
- header.setAttributeValue("pk_defdoc9", headvo.getProjectid());
|
|
|
|
|
|
+// //项目编码 pk_defdoc9
|
|
|
|
+// header.setAttributeValue("pk_defdoc9", headvo.getProjectid());
|
|
|
|
+// //项目名称pk_defdoc10
|
|
|
|
+// header.setAttributeValue("pk_defdoc10", headvo.getProjectid());
|
|
|
|
+// //加工单号pk_defdoc2
|
|
|
|
+// header.setAttributeValue("pk_defdoc2", entry.getKey());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String,String> mapcodename=getprojectmap(headvo.getProjectid());
|
|
|
|
+// //项目编码
|
|
|
|
+// header.setAttributeValue("vuserdef9",mapcodename.get("jobcode") );
|
|
|
|
+// //项目编码 pk_defdoc9
|
|
|
|
+// header.setAttributeValue("pk_defdoc9", headvo.getProjectid());
|
|
|
|
+ //项目名称
|
|
|
|
+ header.setAttributeValue("vdef10", mapcodename.get("jobname"));
|
|
//项目名称pk_defdoc10
|
|
//项目名称pk_defdoc10
|
|
- header.setAttributeValue("pk_defdoc10", headvo.getProjectid());
|
|
|
|
- //加工单号pk_defdoc2
|
|
|
|
- header.setAttributeValue("pk_defdoc2", entry.getKey());
|
|
|
|
|
|
+ header.setAttributeValue("pk_defdoc10", headvo.getProjectid());
|
|
|
|
+ //加工单号
|
|
|
|
+ header.setAttributeValue("vdef1", entry.getKey());
|
|
|
|
+ //业务类型
|
|
|
|
+ header.setAttributeValue("vdef7", headvo.getBusitype());
|
|
|
|
+
|
|
|
|
+ header.setAttributeValue("pk_defdoc7",getpkdefdoc( headvo.getBusitype()));
|
|
|
|
+
|
|
|
|
|
|
List<OperationPurchaseVO> lispurvos=entry.getValue();
|
|
List<OperationPurchaseVO> lispurvos=entry.getValue();
|
|
PraybillItemVO[] items = new PraybillItemVO[lispurvos.size()];
|
|
PraybillItemVO[] items = new PraybillItemVO[lispurvos.size()];
|
|
@@ -147,8 +175,12 @@ public class PushParybillAction extends AbstractAction {
|
|
praybillItemVO.setCmangid(getCmangchid(getCmangid(zbvo.getCmaterialcode()))); //存货编码
|
|
praybillItemVO.setCmangid(getCmangchid(getCmangid(zbvo.getCmaterialcode()))); //存货编码
|
|
praybillItemVO.setCbaseid(getCmangid(zbvo.getCmaterialcode())); //存货基础ID
|
|
praybillItemVO.setCbaseid(getCmangid(zbvo.getCmaterialcode())); //存货基础ID
|
|
// praybillItemVO.setNpraynum(new UFDouble(zbvo.getNum())); //数量
|
|
// praybillItemVO.setNpraynum(new UFDouble(zbvo.getNum())); //数量
|
|
- praybillItemVO.setNpraynum(new UFDouble(zbvo.getVdef26())); //数量
|
|
|
|
- praybillItemVO.setNassistnum (zbvo.getNastnum());//辅计量数量
|
|
|
|
|
|
+ UFDouble num=new UFDouble(zbvo.getVdef26());
|
|
|
|
+ praybillItemVO.setNpraynum(num); //数量
|
|
|
|
+ UFDouble hsl=new UFDouble(zbvo.getVdef13());
|
|
|
|
+ praybillItemVO.setNexchangerate(hsl);//换算率
|
|
|
|
+ praybillItemVO.setCassistunit(getMeasidByNames(zbvo.getCastunitid()));//辅计量单位ID
|
|
|
|
+ praybillItemVO.setNassistnum (num.div(hsl));//辅计量数量
|
|
String cprojectid = headvo.getProjectid();//项目id
|
|
String cprojectid = headvo.getProjectid();//项目id
|
|
praybillItemVO.setCprojectid(cprojectid);
|
|
praybillItemVO.setCprojectid(cprojectid);
|
|
// praybillItemVO.setCassistunit(demandBVO.getCastunitid());//辅助计量单位
|
|
// praybillItemVO.setCassistunit(demandBVO.getCastunitid());//辅助计量单位
|
|
@@ -158,22 +190,41 @@ public class PushParybillAction extends AbstractAction {
|
|
praybillItemVO.setDsuggestdate(new UFDate(ClientEnvironment.getInstance().getBusinessDate().toString()));
|
|
praybillItemVO.setDsuggestdate(new UFDate(ClientEnvironment.getInstance().getBusinessDate().toString()));
|
|
// praybillItemVO.setPk_purcorp(PubEnv.getCorpCode());
|
|
// praybillItemVO.setPk_purcorp(PubEnv.getCorpCode());
|
|
praybillItemVO.setPk_reqcorp(PubEnv.getCorpCode());
|
|
praybillItemVO.setPk_reqcorp(PubEnv.getCorpCode());
|
|
- praybillItemVO.setAttributeValue("pk_defdoc1",zbvo.getVdef1() );//楼号楼层
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc2", zbvo.getVdef2());//樘数(数量)
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc3", zbvo.getVdef3());//框统计
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc4", zbvo.getVdef4());//扇统计
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc5", zbvo.getVdef5());//半成品分类
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc6", zbvo.getVdef6());//面积
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc7", zbvo.getVdef7());//切割长度
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc8", zbvo.getVdef8());//切割角度左下
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc9", zbvo.getVdef9());//切割角度右上
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc10",zbvo.getVdef10());//备注
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc11",zbvo.getWidth());//宽度
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc12",zbvo.getHeight());//高度
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc13",zbvo.getVdef11());//系列
|
|
|
|
- praybillItemVO.setAttributeValue("pk_defdoc14",zbvo.getVdef12());//玻璃编号
|
|
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc1",zbvo.getVdef1() );//楼号楼层
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc2", zbvo.getVdef2());//樘数(数量)
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc3", zbvo.getVdef3());//框统计
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc4", zbvo.getVdef4());//扇统计
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc5", zbvo.getVdef5());//半成品分类
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc6", zbvo.getVdef6());//面积
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc7", zbvo.getVdef7());//切割长度
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc8", zbvo.getVdef8());//切割角度左下
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc9", zbvo.getVdef9());//切割角度右上
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc10",zbvo.getVdef10());//备注
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc11",zbvo.getWidth());//宽度
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc12",zbvo.getHeight());//高度
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc13",zbvo.getVdef11());//系列
|
|
|
|
+// praybillItemVO.setAttributeValue("pk_defdoc14",zbvo.getVdef12());//玻璃编号
|
|
|
|
|
|
- praybillItemVO.setCassistunit(getMeasidByNames(zbvo.getCastunitid()));//辅计量单位ID
|
|
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef1",zbvo.getVdef1() );//楼号楼层
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef2", zbvo.getVdef2());//樘数(数量)
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef3", zbvo.getVdef3());//框统计
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef4", zbvo.getVdef4());//扇统计
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef5", zbvo.getVdef5());//半成品分类
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef6", zbvo.getVdef6());//面积
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef7", zbvo.getVdef7());//切割长度
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef8", zbvo.getVdef8());//切割角度左下
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef9", zbvo.getVdef9());//切割角度右上
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef10",zbvo.getVdef10());//备注
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef11",zbvo.getWidth());//宽度
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef12",zbvo.getHeight());//高度
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef13",zbvo.getVdef11());//系列
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef14",zbvo.getVdef12());//玻璃编号
|
|
|
|
+
|
|
|
|
+// praybillItemVO.setAttributeValue("vdef15",vector.get()==null?null:vector.get().toString());//开票类型
|
|
|
|
+ // praybillItemVO.setAttributeValue("vdef17",vector.get(18)==null?null:vector.get(18).toString());//窗号
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef18",zbvo.getWeight());//米重
|
|
|
|
+ praybillItemVO.setAttributeValue("vdef19",zbvo.getRound());//装饰面周长
|
|
|
|
+ // itemvo.setAttributeValue("vuserdef20",vector.get(5)==null?null:vector.get(5).toString());//专用区
|
|
|
|
|
|
praybillItemVO.setVproducenum (zbvo.getVbatchcode());
|
|
praybillItemVO.setVproducenum (zbvo.getVbatchcode());
|
|
praybillItemVO.setVfree1(zbvo.getColor());
|
|
praybillItemVO.setVfree1(zbvo.getColor());
|
|
@@ -235,6 +286,62 @@ public class PushParybillAction extends AbstractAction {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ //项目管理档案-编码和名称
|
|
|
|
+ public Map<String,String> getprojectmap(String pk_jobmngfil ) throws Exception {
|
|
|
|
+ String sql = "select jobcode,jobname from bd_jobbasfil where "
|
|
|
|
+ + "pk_jobbasfil = (select pk_jobbasfil from bd_jobmngfil where pk_jobmngfil ='"+pk_jobmngfil+"' and dr = 0) "
|
|
|
|
+ + "and dr=0";
|
|
|
|
+ Map<String,String> map = (Map<String, String>) iuap.executeQuery(sql, new MapProcessor());
|
|
|
|
+ if (map == null || map.size()==0) {
|
|
|
|
+ throw new Exception("项目管理档案"+pk_jobmngfil+"未查到,请检查");
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //业务类型自定义档案查询
|
|
|
|
+ private String getpkdefdoc(String docname ) throws Exception {
|
|
|
|
+ String sql="select pk_defdoc from bd_defdoc where pk_defdoclist = "
|
|
|
|
+ + "(select pk_defdoclist from bd_defdef where defname = '业务类型' and dr=0 ) and dr=0 "
|
|
|
|
+ + "and docname='"+docname+"'";
|
|
|
|
+
|
|
|
|
+ Object pkdefdoc = iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
|
+ if(pkdefdoc == null || "".equals(pkdefdoc)) {
|
|
|
|
+ throw new Exception("业务类型【"+docname+"】未查到,请检查");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return pkdefdoc.toString();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询现存量物料换算率
|
|
|
|
+ * @param pk_corp
|
|
|
|
+ * @param storcode
|
|
|
|
+ * @param cinvbasid
|
|
|
|
+ * @param vbatchcode
|
|
|
|
+ * @param color 颜色
|
|
|
|
+ * @param sizing 定尺
|
|
|
|
+ * @param alloy 合金
|
|
|
|
+ * @param standard 标准
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public Object getHandNum(String pk_corp,String storcode,String cinvbasid,String vbatchcode, String color ,String sizing,String alloy,String standard)throws Exception {
|
|
|
|
+ StringBuffer sql = new StringBuffer();
|
|
|
|
+ sql.append("SELECT ");
|
|
|
|
+ sql.append(" nonhandnum/nonhandastnum as hsl");
|
|
|
|
+ sql.append(" FROM");
|
|
|
|
+ sql.append(" ic_onhandnum");
|
|
|
|
+ sql.append(" WHERE");
|
|
|
|
+ sql.append(" pk_corp = '"+pk_corp+"'");
|
|
|
|
+ sql.append(" AND cwarehouseid = ( SELECT pk_stordoc FROM bd_stordoc WHERE storcode = '"+storcode+"' and sealflag = 'N' and dr = 0)");
|
|
|
|
+ sql.append(" AND cinvbasid = '"+cinvbasid+"' AND vfree1='"+color+"' AND vfree2='"+alloy+"' AND vfree3='"+sizing+"' AND vfree4='"+standard+"' ");
|
|
|
|
+ if(vbatchcode != null) {
|
|
|
|
+ sql.append(" AND vlot = '"+vbatchcode+"'");
|
|
|
|
+ }
|
|
|
|
+ return iuap.executeQuery(sql.toString(), new ColumnProcessor());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|