Browse Source

项目接口修改

yaoyu 1 year ago
parent
commit
9c65782325

+ 5 - 0
mmpac/META-INF/mmpac.upm

@@ -20,5 +20,10 @@
  	<component name="projectadd" priority="0" singleton="true" remote="true" tx="NONE" supportAlias="true">
        <implementation>u8c.impl.mmpac.mmpac.ProjectAddImpl</implementation>
  	</component>
+ 	 <component priority="0" singleton="true" remote="true" tx="CMT" supportAlias="true">
+      <interface>u8c.itf.mmpac.mmpac.IUtilMaintain</interface>
+      <implementation>u8c.impl.mmpac.mmpac.UtilMaintainImpl</implementation>
+    </component>
+ 	
   </public>
 </module>

+ 4 - 11
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/ProjectAddImpl.java

@@ -19,6 +19,7 @@ import nc.vo.uapbd.itembasedoc.JobbasfilVO;
 import nc.vo.uapbd.itemmngdoc.JobmngfilVO;
 import u8c.bs.servlet.service.BaseServlet;
 import u8c.bs.servlet.service.GetBaseDAOUtil;
+import u8c.itf.mmpac.mmpac.IUtilMaintain;
 import u8c.log.NcLog;
 
 public class ProjectAddImpl  extends BaseServlet implements IHttpServletAdaptor{
@@ -53,9 +54,8 @@ public class ProjectAddImpl  extends BaseServlet implements IHttpServletAdaptor{
 					//项目档案VO
 					JobbasfilVO jobbasfilVO = new JobbasfilVO();
 					
-					String pk_corp = GetBaseDAOUtil.getCorpPK(jsonObject.getString("pk_corp"));
 					//公司
-					jobbasfilVO.setPk_corp(pk_corp);
+					jobbasfilVO.setPk_corp(jsonObject.getString("pk_corp"));
 					//项目类型
 					jobbasfilVO.setPk_jobtype(GetBaseDAOUtil.getprjtypePK(jsonObject.getString("pk_jobtype")));
 					//项目编码
@@ -68,15 +68,8 @@ public class ProjectAddImpl  extends BaseServlet implements IHttpServletAdaptor{
 					//是否封存
 					jobbasfilVO.setSealflag(UFBoolean.FALSE);
 					
-					jobmngfilVO.setJobBasicInfo(jobbasfilVO);
-					//公司
-					jobmngfilVO.setPk_corp(pk_corp);
-					//公共项目标识
-					jobmngfilVO.setPubflag(UFBoolean.FALSE);
-					//封存标志
-					jobmngfilVO.setSealflag(UFBoolean.FALSE);
-					IJobmanagedoc iJobmanagedoc = NCLocator.getInstance().lookup(IJobmanagedoc.class);
-					iJobmanagedoc.insertJobmngfilVO(jobmngfilVO);
+					IUtilMaintain iUtilMaintain = NCLocator.getInstance().lookup(IUtilMaintain.class);
+					iUtilMaintain.project_RequiresNew(jobbasfilVO);
 					result.add(formatRSJsonData("成功", "", jsonObject.getString("jobcode")));
 				} catch (Exception e) {
 					result.add(formatRSJsonData("失败", e.getMessage(), jsonObject.getString("jobcode")));

+ 28 - 0
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/UtilMaintainImpl.java

@@ -0,0 +1,28 @@
+package u8c.impl.mmpac.mmpac;
+
+import java.util.List;
+import java.util.Map;
+
+import nc.bs.framework.common.NCLocator;
+import nc.itf.uap.bd.item.IJobbasedoc;
+import nc.vo.uapbd.itembasedoc.JobbasfilVO;
+import u8c.bs.servlet.service.GetBaseDAOUtil;
+import u8c.itf.mmpac.mmpac.IUtilMaintain;
+
+public class UtilMaintainImpl implements IUtilMaintain{
+
+	@Override
+	public void project_RequiresNew(JobbasfilVO jobbasfilVO) throws Exception {
+		
+		IJobbasedoc iJobbasedoc = NCLocator.getInstance().lookup(IJobbasedoc.class);
+		JobbasfilVO JobbasfilVOs = (JobbasfilVO) iJobbasedoc.insertJobBDVOWithNewReturn(jobbasfilVO);
+		List<Map<String,String>> listMap = GetBaseDAOUtil.getCorpList();
+		String[] pk_corps =  new String[listMap.size()];
+		for (int i = 0; i < listMap.size(); i++) {
+			pk_corps[i] = listMap.get(i).get("pk_corp");
+		}
+		iJobbasedoc.assignJobbasfilVOs(pk_corps, new JobbasfilVO[] {JobbasfilVOs});
+		
+	}
+
+}

+ 10 - 0
mmpac/mmpac/src/public/u8c/bs/servlet/service/GetBaseDAOUtil.java

@@ -1,12 +1,16 @@
 package u8c.bs.servlet.service;
 
 import java.util.List;
+import java.util.Map;
 
 import nc.bs.framework.common.NCLocator;
 import nc.itf.uap.IUAPQueryBS;
 import nc.jdbc.framework.processor.BeanProcessor;
 import nc.jdbc.framework.processor.ColumnListProcessor;
 import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.jdbc.framework.processor.MapListProcessor;
+import nc.jdbc.framework.processor.MapProcessor;
+import nc.md.data.criterion.db.ListMapProcessor;
 import nc.vo.bd.b09.CumandocVO;
 import nc.vo.bd.def.DefdefVO;
 import nc.vo.bd.invdoc.InvbasdocVO;
@@ -333,4 +337,10 @@ public class GetBaseDAOUtil {
     	}
     	return res;
     }
+    
+    //查询所有公司
+    public static List<Map<String,String>> getCorpList()throws Exception{
+    	String sql = "select pk_corp from bd_corp where dr = 0";
+		return (List<Map<String, String>>) iuap.executeQuery(sql, new MapListProcessor());
+    }
 }

+ 13 - 0
mmpac/mmpac/src/public/u8c/itf/mmpac/mmpac/IUtilMaintain.java

@@ -0,0 +1,13 @@
+package u8c.itf.mmpac.mmpac;
+
+import nc.vo.uapbd.itembasedoc.JobbasfilVO;
+
+/**
+ * 独立事务处理类
+ * @author yy
+ *
+ */
+public interface IUtilMaintain {
+
+	void project_RequiresNew(JobbasfilVO jobbasfilVO) throws Exception;
+}