diff --git a/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp b/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp index f456c570b..b7d5c881c 100644 --- a/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp @@ -81,6 +81,7 @@ String sButtons[][] =new String[][] { {"true","","Button","流程信息","流程信息","viewAllFlow()","","","","btn_icon_detail",""}, {"true","","Button","附件信息","附件信息","viewAllFlowAttachment()","","","","btn_icon_detail",""}, + {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""}, {"true","","Button","合同信息","合同信息","viewContractInfo()","","","","btn_icon_detail",""} }; %><%@include file="/Frame/resources/include/ui/include_list.jspf"%> @@ -126,5 +127,25 @@ function viewContractInfo(){ var sparm='ContractId='+sPara+"&ProjectId="+getItemValue(0,getRow(0),'project_id')+"&ShowType="+ShowType+"&RightType=ReadOnly&IsHistory=false"+"&contract_no="+contract_no+"&productId="+productId+"&FlowUnid="+FlowUnid; AsControl.OpenTab(sUrl,sparm,{title:'合同基本信息【'+ getItemValue(0,getRow(0),'contract_no')+'】'}); } +function openFileList(){ + let proj_id=getItemValue(0,getRow(0),'project_id'); + openFileListByProjectId(proj_id); +} +function openFileListByProjectId(proj_id){ + let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl",""); + let params = getRequestParam(proj_id); + if(params=='error'){ + alert('未找到对应的影像配置,请联系管理员'); + return; + } + if(params!=null){ + AsControl.postICMS(url,params); + } +} +function getRequestParam(proj_id){ + let code = 'ECM0002'; + let param = RunJavaMethodTrans("com.ample.icms.service.ImageQueryService","getRequestParamByProjectIdJMT","projectId="+proj_id+",code="+code); + return param; +} <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src/com/ample/icms/service/ImageUploadService.java b/src/com/ample/icms/service/ImageUploadService.java index e8ed7891b..ef2ae2d17 100644 --- a/src/com/ample/icms/service/ImageUploadService.java +++ b/src/com/ample/icms/service/ImageUploadService.java @@ -139,7 +139,7 @@ public class ImageUploadService { throw new Exception(responseMsg); } - if(root.toString().contains("APZLJJ000080")){ + if(countResult.contains("APZLJJ000080")){ return true; } //todo diff --git a/src/com/ample/icms/util/GetInfoUtil.java b/src/com/ample/icms/util/GetInfoUtil.java index 1f993871b..0b51caee7 100644 --- a/src/com/ample/icms/util/GetInfoUtil.java +++ b/src/com/ample/icms/util/GetInfoUtil.java @@ -143,6 +143,7 @@ public class GetInfoUtil { String appCode = null; String appName = null; JSONArray ja = new JSONArray(); + rs.beforeFirst(); while (rs.next()) { appCode = rs.getString("app_code"); appName = rs.getString("app_name"); diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportFlowCount.java b/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportFlowCount.java new file mode 100644 index 000000000..f191ba3ab --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/InsertReportFlowCount.java @@ -0,0 +1,62 @@ +package com.tenwa.lease.app.quartzmession; + + +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.log.Log; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.base.util.QuartzUtil; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +public class InsertReportFlowCount implements Job{ + + @Override + public void execute(JobExecutionContext arg0) throws JobExecutionException { + JBOTransaction tx=null; + Transaction Sqlca=null; + String startime =StringFunction.getTodayNow(); + startime = startime.substring(0, 10); + + Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId"); + String curUserId = userId == null? "system" : userId.toString(); + + try { + tx= JBOFactory.createJBOTransaction(); + Sqlca=Transaction.createTransaction(tx); + + String sql="{CALL insert_flow_report()};"; + SqlObject asql = new SqlObject(sql); + Sqlca.executeSQL(asql); + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "成功", curUserId); + } catch (Exception e) { + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.Commission", "success", "失败", curUserId); + logger.error(e.getMessage()); + e.printStackTrace(); + if(Sqlca!=null){ + try { + Sqlca.rollback(); + Sqlca = null; + } catch (JBOException e1) { + e1.printStackTrace(); + } + } + }finally{ + if(Sqlca!=null){ + try { + Sqlca.commit(); + Sqlca.disConnect(); + Sqlca = null; + } catch (JBOException e) { + e.printStackTrace(); + } + } + } + } + private static Log logger=ARE.getLog(); +} diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckAll.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckAll.java new file mode 100644 index 000000000..4e6ed7f84 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckAll.java @@ -0,0 +1,99 @@ +package com.tenwa.lease.flow.project.commcheck; + +import com.amarsoft.app.alarm.AlarmBiz; +import com.amarsoft.awe.util.Transaction; +import com.ample.icms.query.ImageCount; +import com.ample.icms.util.GetInfoUtil; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.Node; + +import java.util.Iterator; +import java.util.List; + +/** + * 资料清单检查 + * @author 20170524 + * + */ +public class IcmsDocListCheckAll extends AlarmBiz { + @Override + public Object run(Transaction Sqlca) throws Exception { + String responseCode = ""; + String responseMsg = "资料未初始化,请联系IT管理员!"; + String flowUnid = this.getAttribute("ObjectNo").toString(); + GetInfoUtil gif = new GetInfoUtil(); + String projectNo = gif.getProjectNoByFlowUnid(flowUnid); + if (projectNo == null) { + setPass(false); + putMsg("未找到匹配的项目编号,请联系IT管理员!"); + return null; + } + String app = gif.getAppInfoByFlowUnid(flowUnid); + String[] appInfo = app.split("@"); + String appCode = appInfo[0]; + String appName = appInfo[1]; + if ("0000".equals(appCode)) { + setPass(false); + putMsg(appName); + return null; + } + ImageCount ic = new ImageCount(); + ic.setAppCode(appCode); + ic.setAppName(appName); + ic.setBusiNo(projectNo); + String result = ic.getResult(); + //校验链接是否成功 + if ("0000".equals(result)) { + setPass(false); + putMsg("连接影像系统失败,请及时联系IT管理员!"); + return null; + } + Document dom = DocumentHelper.parseText(result); + Element root = dom.getRootElement(); + responseCode = root.element("RESPONSE_CODE").getTextTrim(); + //校验返回结果 + if ("400".equals(responseCode)) { + setPass(false); + responseMsg = root.element("RESPONSE_MSG").getTextTrim(); + putMsg(responseMsg); + return null; + } + //校验总个数 + String sumImgs = root.element("RETURN_DATA").element("SUM_IMGS").getTextTrim(); + if ("0".equals(sumImgs)) { + setPass(false); + responseMsg = root.element("RESPONSE_MSG").getTextTrim(); + putMsg(responseMsg); + return null; + } + List nodes = root.element("ATREE_ALL").elements("NODE"); + for (Iterator it = nodes.iterator(); it.hasNext(); ) { + Element elm = (Element) it.next(); + String isMust = elm.element("IS_MUST").getTextTrim(); + String docName = elm.element("DOC_NAME").getTextTrim(); + if ("0".equals(isMust)) { + continue; + } + String docCode = elm.element("DOC_CODE").getTextTrim(); + Node node = root.element("RETURN_DATA").element("NODES").selectSingleNode("//NODE/NODE_ID[text()='" + docCode + "']"); + if (node == null) { + setPass(false); + putMsg( docName + ":未上传"); + return null; + } + Element test = node.getParent(); + String imgNum = test.elementText("IMG_NUM"); + if (Integer.parseInt(imgNum)<=0) { + setPass(false); + putMsg(docName + ":未上传"); + return null; + } + } + + setPass(true); + putMsg("资料已按规则上传完成"); + return null; + } +}