浏览代码

导入自动带出辅单位

yaoyu 1 年之前
父节点
当前提交
c754f70eda

+ 9 - 3
mmpac/mmpac/src/private/u8c/bs/mmpac/bp/SpecialDataRule.java

@@ -2,10 +2,10 @@ package u8c.bs.mmpac.bp;
 
 import java.util.Map;
 
+import nc.bs.framework.common.InvocationInfoProxy;
 import nc.bs.framework.common.NCLocator;
 import nc.itf.uap.IUAPQueryBS;
 import nc.itf.uap.bd.def.IDefdoc;
-import nc.itf.uap.bd.item.IJobmanagedoc;
 import nc.jdbc.framework.processor.ColumnProcessor;
 import nc.jdbc.framework.processor.MapProcessor;
 import nc.vo.bd.def.DefdocVO;
@@ -25,6 +25,7 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
 	private  IUAPQueryBS iuap = NCLocator.getInstance().lookup(IUAPQueryBS.class);
 	@Override
 	public void process(ExAggOrderMainVO[] vos) throws BusinessException {
+		String w = InvocationInfoProxy.getInstance().getLangCode();
 		for(int i = 0; i < vos.length; i++) {
 			OrderMainVO headvo = (OrderMainVO) vos[i].getParentVO();
 			Map<String,String> JobbasfilMap = getJobbasfil(headvo.getProjectid());
@@ -50,6 +51,8 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
 				orderInVO.setModel(invbasdocMap.get("invtype"));
 				//计量单位
 				orderInVO.setUnitid(invbasdocMap.get("measname"));
+				//辅单位
+				orderInVO.setCastunitid(invbasdocMap.get("measnames"));
 				disposeDefdoc("YS(颜色)", orderInVO.getColor());
 				disposeDefdoc("DC(定尺)", orderInVO.getSizing());
 			}
@@ -78,10 +81,13 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
     	sql.append(" bd_invbasdoc.invname as invname,");
     	sql.append(" bd_invbasdoc.invspec as invspec,");
     	sql.append(" bd_invbasdoc.invtype as invtype,");
-    	sql.append(" bd_measdoc.measname as measname");
+    	sql.append(" bd_measdoc.measname as measname,");
+    	sql.append(" bd_measdocs.measname as measnames");
     	sql.append(" FROM");
     	sql.append(" bd_invbasdoc bd_invbasdoc");
     	sql.append(" left join bd_measdoc bd_measdoc  on bd_invbasdoc.pk_measdoc = bd_measdoc.pk_measdoc");
+    	sql.append(" left join bd_convert bd_convert on bd_invbasdoc.pk_invbasdoc = bd_convert.pk_invbasdoc");
+    	sql.append(" left join bd_measdoc bd_measdocs on bd_convert.pk_measdoc = bd_measdocs.pk_measdoc");
     	sql.append(" WHERE");
     	sql.append(" bd_invbasdoc.invcode = '"+code+"'");
     	sql.append(" and bd_invbasdoc.dr = 0");
@@ -108,7 +114,7 @@ public class SpecialDataRule implements IRule<ExAggOrderMainVO>{
         //无数据新增档案
         if (pk_defdoc == null) {
         	DefdocVO defdocVO = new DefdocVO();
-        	//公司
+        	//公司                  
         	defdocVO.setPk_corp("0001");
         	//档案编码
         	defdocVO.setDoccode(docname);

+ 11 - 6
xc/cg/src/private/u8c/bs/mytest/bp/SpecialDataRule.java

@@ -45,6 +45,8 @@ public class SpecialDataRule implements IRule<AggDemandVO> {
 				demandBVO.setModel(invbasdocMap.get("invtype"));
 				//數講等弇
 				demandBVO.setUnitid(invbasdocMap.get("measname"));
+				//落數講等弇
+				demandBVO.setCastunitid(invbasdocMap.get("measnames"));
 				disposeDefdoc("YSㄗ晇伎ㄘ", demandBVO.getColor());
 				disposeDefdoc("DCㄗ隅喜ㄘ", demandBVO.getSizing());
 			}
@@ -54,9 +56,9 @@ public class SpecialDataRule implements IRule<AggDemandVO> {
 	//脤戙砐醴
     public Map<String,String> getJobbasfil(String pk_jobmngfil)throws BusinessException {
     	StringBuffer sql = new StringBuffer();
-    	sql.append("SELECT");
+    	sql.append("select");
     	sql.append(" bd_jobbasfil.jobcode as jobcode,bd_jobbasfil.jobname as jobname,bd_jobtype.jobtypecode as jobtypecode,bd_jobtype.jobtypename as jobtypename");
-    	sql.append(" FROM");
+    	sql.append(" from");
     	sql.append(" bd_jobbasfil bd_jobbasfil");
     	sql.append(" left join bd_jobmngfil bd_jobmngfil on bd_jobbasfil.pk_jobbasfil = bd_jobmngfil.pk_jobbasfil");
     	sql.append(" left join bd_jobtype bd_jobtype on bd_jobbasfil.pk_jobtype = bd_jobtype.pk_jobtype");
@@ -68,15 +70,18 @@ public class SpecialDataRule implements IRule<AggDemandVO> {
     //脤戙昜蹋
     public Map<String,String> getInvbasdoc(String code)throws BusinessException {
     	StringBuffer sql = new StringBuffer();
-    	sql.append("SELECT");
+    	sql.append("select");
     	sql.append(" bd_invbasdoc.invname as invname,");
     	sql.append(" bd_invbasdoc.invspec as invspec,");
     	sql.append(" bd_invbasdoc.invtype as invtype,");
-    	sql.append(" bd_measdoc.measname as measname");
-    	sql.append(" FROM");
+    	sql.append(" bd_measdoc.measname as measname,");
+    	sql.append(" bd_measdocs.measname as measnames");
+    	sql.append(" from");
     	sql.append(" bd_invbasdoc bd_invbasdoc");
     	sql.append(" left join bd_measdoc bd_measdoc  on bd_invbasdoc.pk_measdoc = bd_measdoc.pk_measdoc");
-    	sql.append(" WHERE");
+    	sql.append(" left join bd_convert bd_convert on bd_invbasdoc.pk_invbasdoc = bd_convert.pk_invbasdoc");
+    	sql.append(" left join bd_measdoc bd_measdocs on bd_convert.pk_measdoc = bd_measdocs.pk_measdoc");
+    	sql.append(" where");
     	sql.append(" bd_invbasdoc.invcode = '"+code+"'");
     	sql.append(" and bd_invbasdoc.dr = 0");
     	Map<String,String> map =  (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());