|
|
@@ -8,6 +8,7 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
@@ -144,6 +145,8 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
info.setSecondparty_name(request.getParameter("secondparty_name"));
|
|
|
|
|
|
//ContractInfo oldInfo = new ContractInfo();
|
|
|
+ String flowOnOff = request.getParameter("flowOnOff");
|
|
|
+ request.setAttribute("flowOnOff", flowOnOff);
|
|
|
try {
|
|
|
int isExist = contractEntryService.isExistEditContractNumber(info, oasession);
|
|
|
if (isExist > 0) {
|
|
|
@@ -151,33 +154,39 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
return "contractEntry.do?task=toEditContractEntry&id=" + info.getUniversalid();
|
|
|
}
|
|
|
//oldInfo = contractEntryService.toEditContractEntry(info.getUniversalid(), oasession);
|
|
|
- String insName = "合同审批["+info.getUniversalid()+"]";
|
|
|
+ Map<String, Object> flow_params = null;
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ String insName = "合同审批["+info.getContract_name()+"]";
|
|
|
+
|
|
|
+ String flow_json = request.getParameter("flow_json");
|
|
|
+ flow_params = new HashMap<String, Object>();
|
|
|
+ if (!StringUtil.isEmpty(flow_json)) {
|
|
|
+ JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
+ List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
+ flow_params = flow_list.get(0);
|
|
|
+ }
|
|
|
+ flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
+ flow_params.put("business_id", info.getUniversalid());
|
|
|
+ flow_params.put("is_config", true);
|
|
|
+ flow_params.put("oasession", oasession);
|
|
|
+ flow_params.put("insName", insName);
|
|
|
+ }
|
|
|
|
|
|
- String flow_json = request.getParameter("flow_json");
|
|
|
- Map<String, Object> flow_params = new HashMap<String, Object>();
|
|
|
- if (!StringUtil.isEmpty(flow_json)) {
|
|
|
- JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
- List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
- flow_params = flow_list.get(0);
|
|
|
- }
|
|
|
- flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
- flow_params.put("business_id", info.getUniversalid());
|
|
|
- flow_params.put("is_config", true);
|
|
|
- flow_params.put("oasession", oasession);
|
|
|
- flow_params.put("insName", insName);
|
|
|
int rs = contractEntryService.editContractEntry(info);
|
|
|
if (rs > 0) {
|
|
|
int rz = contractEntryService.changeDraftToContract(info,flow_params);
|
|
|
if (rz > 0) {
|
|
|
- //this.addInfo("修改成功");
|
|
|
- request.setAttribute("theme", flowTitle); //流程主题
|
|
|
- request.setAttribute("flow_contract_id", info.getUniversalid()); //申请合同流程ID
|
|
|
- request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
- //流程运转结束
|
|
|
- request.setAttribute("finish", "finish");
|
|
|
- //启动流程开始
|
|
|
- //传入合同申请单流程模板ID号
|
|
|
- this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ this.addInfo("修改成功");
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ request.setAttribute("theme", flowTitle); //流程主题
|
|
|
+ request.setAttribute("flow_contract_id", info.getUniversalid()); //申请合同流程ID
|
|
|
+ request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
+ //流程运转结束
|
|
|
+ request.setAttribute("finish", "finish");
|
|
|
+ //启动流程开始
|
|
|
+ //传入合同申请单流程模板ID号
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
this.addError("修改失败");
|
|
|
@@ -225,7 +234,7 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
|
|
|
CodeFlowServiceIface ifaceCodeFlowService=this.getBean(IfaceCodeFlowService.class, "ifaceCodeFlowService");
|
|
|
Map<String, Object> resultMap=ifaceCodeFlowService.toStartFlow(ContractConstant.CONTRACT_ADD,oasession.getUnit().getId());
|
|
|
- //流程模版 未关联 不能发起申请
|
|
|
+ /*//流程模版 未关联 不能发起申请
|
|
|
if (resultMap.get("result") != null) {
|
|
|
Map<String, Object> result = (Map<String, Object>) resultMap.get("result");
|
|
|
request.setAttribute("tache", result.get("tinstance"));
|
|
|
@@ -236,7 +245,8 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
request.setAttribute("nextHandTmodels", result.get("nextHandTmodels"));
|
|
|
request.setAttribute("tList", result.get("tList"));
|
|
|
}
|
|
|
- request.setAttribute("flowOnOff", resultMap.get("flowOnOff"));
|
|
|
+ request.setAttribute("flowOnOff", resultMap.get("flowOnOff"));*/
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -718,6 +728,8 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
info.setFirstparty_name(request.getParameter("firstparty_name"));
|
|
|
info.setSecondparty_name(request.getParameter("secondparty_name"));
|
|
|
String draftId = request.getParameter("draftId");
|
|
|
+ String flowOnOff = request.getParameter("flowOnOff");
|
|
|
+ request.setAttribute("flowOnOff", flowOnOff);
|
|
|
if ("".equals(draftId)) {// 没有草稿等情况
|
|
|
int rs;
|
|
|
try {
|
|
|
@@ -731,31 +743,36 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
// }
|
|
|
Long ID = StringUtil.getSeq();
|
|
|
info.setUniversalid(ID);
|
|
|
- String insName = "合同审批["+ID+"]";
|
|
|
-
|
|
|
- String flow_json = request.getParameter("flow_json");
|
|
|
- Map<String, Object> flow_params = new HashMap<String, Object>();
|
|
|
- if (!StringUtil.isEmpty(flow_json)) {
|
|
|
- JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
- List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
- flow_params = flow_list.get(0);
|
|
|
- }
|
|
|
- flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
- flow_params.put("business_id", ID);
|
|
|
- flow_params.put("is_config", true);
|
|
|
- flow_params.put("oasession", oasession);
|
|
|
- flow_params.put("insName", insName);
|
|
|
+ Map<String, Object> flow_params = null;
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ flow_params = new HashMap<String, Object>();
|
|
|
+ String insName = "合同审批["+info.getContract_name()+"]";
|
|
|
+ String flow_json = request.getParameter("flow_json");
|
|
|
+
|
|
|
+ if (!StringUtil.isEmpty(flow_json)) {
|
|
|
+ JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
+ List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
+ flow_params = flow_list.get(0);
|
|
|
+ }
|
|
|
+ flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
+ flow_params.put("business_id", ID);
|
|
|
+ flow_params.put("is_config", true);
|
|
|
+ flow_params.put("oasession", oasession);
|
|
|
+ flow_params.put("insName", insName);
|
|
|
+ }
|
|
|
rs = contractEntryService.addContractEntry(info,flow_params);
|
|
|
if (rs > 0) {
|
|
|
this.addInfo("添加成功!");
|
|
|
- request.setAttribute("theme", flowTitle); //流程主题
|
|
|
- request.setAttribute("flow_contract_id", ID); //申请合同流程ID
|
|
|
- request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
- //流程运转结束
|
|
|
- request.setAttribute("finish", "finish");
|
|
|
- //启动流程开始
|
|
|
- //传入合同申请单流程模板ID号
|
|
|
- this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ request.setAttribute("theme", flowTitle); //流程主题
|
|
|
+ request.setAttribute("flow_contract_id", ID); //申请合同流程ID
|
|
|
+ request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
+ //流程运转结束
|
|
|
+ request.setAttribute("finish", "finish");
|
|
|
+ //启动流程开始
|
|
|
+ //传入合同申请单流程模板ID号
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.addError("添加失败!");
|
|
|
ContractInfo infoRecord = new ContractInfo();
|
|
|
@@ -771,31 +788,37 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
try {
|
|
|
int rs = contractEntryService.editContractEntry(info);
|
|
|
if (rs > 0) {
|
|
|
- String insName = "合同审批["+info.getUniversalid()+"]";
|
|
|
+ String insName = "合同审批["+info.getContract_name()+"]";
|
|
|
|
|
|
String flow_json = request.getParameter("flow_json");
|
|
|
- Map<String, Object> flow_params = new HashMap<String, Object>();
|
|
|
- if (!StringUtil.isEmpty(flow_json)) {
|
|
|
- JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
- List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
- flow_params = flow_list.get(0);
|
|
|
+ Map<String, Object> flow_params = null;
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ flow_params = new HashMap<String, Object>();
|
|
|
+ if (!StringUtil.isEmpty(flow_json)) {
|
|
|
+ JSONArray jsonArray = JSONArray.fromObject(URLDecoder.decode(flow_json, "utf-8"));
|
|
|
+ List<Map<String, Object>> flow_list = JSONArray.toList(jsonArray, Map.class);
|
|
|
+ flow_params = flow_list.get(0);
|
|
|
+ }
|
|
|
+ flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
+ flow_params.put("business_id", info.getUniversalid());
|
|
|
+ flow_params.put("is_config", true);
|
|
|
+ flow_params.put("oasession", oasession);
|
|
|
+ flow_params.put("insName", insName);
|
|
|
}
|
|
|
- flow_params.put("flag", ContractConstant.CONTRACT_ADD);
|
|
|
- flow_params.put("business_id", info.getUniversalid());
|
|
|
- flow_params.put("is_config", true);
|
|
|
- flow_params.put("oasession", oasession);
|
|
|
- flow_params.put("insName", insName);
|
|
|
+
|
|
|
int rz = contractEntryService.changeDraftToContract(info,flow_params);
|
|
|
if (rz > 0) {
|
|
|
this.addInfo("添加成功!");
|
|
|
- request.setAttribute("theme", flowTitle); //流程主题
|
|
|
- request.setAttribute("flow_contract_id", info.getUniversalid()); //申请合同流程ID
|
|
|
- request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
- //流程运转结束
|
|
|
- request.setAttribute("finish", "finish");
|
|
|
- //启动流程开始
|
|
|
- //传入合同申请单流程模板ID号
|
|
|
- this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ if(!Objects.equals(flowOnOff,"off")){
|
|
|
+ request.setAttribute("theme", flowTitle); //流程主题
|
|
|
+ request.setAttribute("flow_contract_id", info.getUniversalid()); //申请合同流程ID
|
|
|
+ request.setAttribute("flow_type", ContractConstant.CONTRACT_ADD_MODELTYPE); //合同流程关联模板配置ID
|
|
|
+ //流程运转结束
|
|
|
+ request.setAttribute("finish", "finish");
|
|
|
+ //启动流程开始
|
|
|
+ //传入合同申请单流程模板ID号
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.addError("添加失败!");
|
|
|
ContractInfo infoRecord = new ContractInfo();
|
|
|
@@ -879,7 +902,7 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
if (infoList.size() > 0) {
|
|
|
request.setAttribute("typeList", infoList);
|
|
|
}
|
|
|
- CodeFlowServiceIface ifaceCodeFlowService=this.getBean(IfaceCodeFlowService.class, "ifaceCodeFlowService");
|
|
|
+ /*CodeFlowServiceIface ifaceCodeFlowService=this.getBean(IfaceCodeFlowService.class, "ifaceCodeFlowService");
|
|
|
Map<String, Object> resultMap=ifaceCodeFlowService.toStartFlow(ContractConstant.CONTRACT_ADD,oasession.getUnit().getId());
|
|
|
//流程模版 未关联 不能发起申请
|
|
|
if (resultMap.get("result") != null) {
|
|
|
@@ -892,7 +915,8 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
request.setAttribute("nextHandTmodels", result.get("nextHandTmodels"));
|
|
|
request.setAttribute("tList", result.get("tList"));
|
|
|
}
|
|
|
- request.setAttribute("flowOnOff", resultMap.get("flowOnOff"));
|
|
|
+ request.setAttribute("flowOnOff", resultMap.get("flowOnOff"));*/
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -916,6 +940,7 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
String contract_search_firstparty = request.getParameter("contract_search_firstparty");
|
|
|
String contract_search_duty_dept = request.getParameter("contract_search_duty_dept");
|
|
|
String contract_search_signdate_end = request.getParameter("contract_search_signdate_end");
|
|
|
+ String flowOnOff = request.getParameter("flowOnOff");
|
|
|
|
|
|
List<ContractInfo> infoList = new ArrayList<ContractInfo>();
|
|
|
ContractInfo info = new ContractInfo();
|
|
|
@@ -958,7 +983,9 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
if (contract_search_signdate_end != null && !"".equals(contract_search_signdate_end)) {
|
|
|
ph.setParam("contract_search_signdate_end", contract_search_signdate_end);
|
|
|
}
|
|
|
- ph.setParam("au_state", "2");
|
|
|
+ if(!Objects.equals(flowOnOff, "off")){
|
|
|
+ ph.setParam("au_state", "2");
|
|
|
+ }
|
|
|
infoList = contractEntryService.contractEntryList(p, pSize, ph, info, oasession);
|
|
|
// 去除不用的参数
|
|
|
// params.remove(0);
|
|
|
@@ -982,6 +1009,7 @@ public class ContractEntryAction extends ContractFlowAction {
|
|
|
if (infoList.size() > 0) {
|
|
|
request.setAttribute("typeList", infoList);
|
|
|
}
|
|
|
+ this.toStartFlow(request, response,ContractConstant.CONTRACT_ADD_MODELTYPE);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|