上传照片
附件一览及下载 测算 合同列表 法人列表 自然人列表
This commit is contained in:
parent
531b44faa9
commit
eccdeb8c68
@ -0,0 +1,59 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.BusinessDocDetailService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.impl.BusinessDocDetailServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/apply")
|
||||
public class BusinessDocDetailController {
|
||||
|
||||
@Path("/business/doc/detail")
|
||||
@POST
|
||||
public Map<String, Object> docDetail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] BusinessDocDetailController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/business/doc/detail" + " run .................");
|
||||
|
||||
BusinessDocDetailService service = new BusinessDocDetailServiceImpl();
|
||||
try {
|
||||
return service.docDetail(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Path("/business/doc")
|
||||
@POST
|
||||
public Map<String, Object> doc(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] BusinessDocDetailController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/business/doc" + " run .................");
|
||||
|
||||
BusinessDocDetailService service = new BusinessDocDetailServiceImpl();
|
||||
try {
|
||||
return service.doc(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.LBDocAttributeService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.impl.LBDocAttributeServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/file")
|
||||
public class LBDocAttributeController {
|
||||
@Path("/att/list")
|
||||
@POST
|
||||
public Map<String, Object> attList(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] LBDocAttributeController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/business/upload" + " run .................");
|
||||
|
||||
LBDocAttributeService service = new LBDocAttributeServiceImpl();
|
||||
try {
|
||||
return service.attList(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface BusinessDocDetailService {
|
||||
Map<String, Object> docDetail(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> doc(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface LBDocAttributeService {
|
||||
Map<String, Object> attList(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,354 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
|
||||
import jbo.app.tenwa.doc.LB_DOCLIBRARY;
|
||||
import jbo.app.tenwa.doc.LB_DOCRELATIVE;
|
||||
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
|
||||
import net.sf.json.JSONObject;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.BusinessDocDetailService;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.JsonUtil;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
public Map<String, Object> docDetail(ReturnMapUtil ReturnMapUtil) {
|
||||
String docName1 = RestfullConstant.baseProperty.get("COMPANY_DOC_NAME")
|
||||
.toString();
|
||||
String docName2 = RestfullConstant.baseProperty.get("PERSON_DOC_NAME")
|
||||
.toString();
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("companyDocName", getDocDetails(docName1));
|
||||
body.put("personDocName", getDocDetails(docName2));
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getDocDetails(String docName) {
|
||||
ARE.getLog().info(docName);
|
||||
// 格式:key@display,key1@display1
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
|
||||
if (docName.length() > 0) {
|
||||
String[] arr = docName.trim().split(",");
|
||||
for (String str : arr) {
|
||||
if (str.length() > 0) {
|
||||
String[] conf = str.trim().split("@");
|
||||
if (conf.length == 2) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("key", conf[0]);
|
||||
map.put("display", conf[1]);
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> docDetail(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
|
||||
String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
"objectno").toString(); // 流程号
|
||||
|
||||
if (StringX.isSpace(flowUnid)) { // 获取所有配置docName
|
||||
return docDetail(ReturnMapUtil);
|
||||
}
|
||||
|
||||
BizObjectManager businessManage = JBOFactory
|
||||
.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
|
||||
BizObject business = businessManage.createQuery("flow_unid=:flow_unid")
|
||||
.setParameter("flow_unid", flowUnid).getSingleResult(false);
|
||||
|
||||
String custType = "";
|
||||
try {
|
||||
String json = business.getAttribute("FIXEDFLOWPARAM") == null ? ""
|
||||
: business.getAttribute("FIXEDFLOWPARAM").toString();
|
||||
if (json.length() < 1) {
|
||||
ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty
|
||||
.get("FAIL").toString(), "未找到客户类型!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
JSONObject jo = JsonUtil.str2JSONObject(json);
|
||||
custType = jo.get("custType") == null ? "" : jo.get("custType")
|
||||
.toString();// CustomerType
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ARE.getLog().error(e);
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"获取客户类型失败!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
String docName = custType.equals("01") ? RestfullConstant.baseProperty
|
||||
.get("COMPANY_DOC_NAME").toString()
|
||||
: RestfullConstant.baseProperty.get("PERSON_DOC_NAME")
|
||||
.toString();
|
||||
|
||||
|
||||
if (docName!=null) {
|
||||
String [] docNames = docName.split(",");
|
||||
docName = "";
|
||||
for (String str : docNames) {
|
||||
if (str.length() > 0) {
|
||||
String[] conf = str.trim().split("@");
|
||||
if (conf.length == 2) {
|
||||
docName += conf[0] + ",";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Map<String, Object> body = new HashMap<String, Object>();
|
||||
// body.put("docName", getDocDetails(docName));
|
||||
// ReturnMapUtil.setReturnMap(body,
|
||||
// RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
|
||||
// return ReturnMapUtil.getReturnMap();
|
||||
return doc(flowUnid, docName, request, response, tx, sqlca,
|
||||
ReturnMapUtil);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> doc(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
|
||||
String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
"objectno").toString(); // 流程号
|
||||
String docName = fieldMap.get("docname") == null ? "" : fieldMap.get(
|
||||
"docname").toString(); // docname
|
||||
|
||||
if (docName.contains(",")) {
|
||||
String[] array = docName.split(",");
|
||||
docName = "";
|
||||
|
||||
for (String str : array) {
|
||||
docName += "'" + str + "',";
|
||||
}
|
||||
|
||||
if (array.length > 1) {
|
||||
docName = docName.substring(0, docName.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
BizObjectManager relaManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME);
|
||||
BizObject rela = relaManage.createQuery("FLOW_UNID=:FLOW_UNID")
|
||||
.setParameter("FLOW_UNID", flowUnid).getSingleResult(false);
|
||||
String relaId = "";
|
||||
if (null == rela) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"未找到该业务流程的资料清单!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
relaId = rela.getAttribute("ID") == null ? "" : rela.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
|
||||
BizObjectManager libraryManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
List<BizObject> librarys = libraryManage
|
||||
.createQuery(
|
||||
"RELATIVE_ID=:RELATIVE_ID AND DOC_NAME IN (" + docName
|
||||
+ ") ORDER BY SERIAL_NUM")
|
||||
.setParameter("RELATIVE_ID", relaId).getResultList(false);
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
for (BizObject library : librarys) {
|
||||
Map<String, Object> libraryMap = new HashMap<String, Object>();
|
||||
String libraryId = library.getAttribute("ID") == null ? ""
|
||||
: library.getAttribute("ID").toString();
|
||||
String remark = library.getAttribute("REMARK") == null ? ""
|
||||
: library.getAttribute("REMARK").toString();
|
||||
String docType = library.getAttribute("DOC_TYPE") == null ? ""
|
||||
: library.getAttribute("DOC_TYPE").toString();
|
||||
String docName1 = library.getAttribute("DOC_NAME") == null ? ""
|
||||
: library.getAttribute("DOC_NAME").toString();
|
||||
String oneClassly = library.getAttribute("ONE_CLASSIFY") == null ? ""
|
||||
: library.getAttribute("ONE_CLASSIFY").toString();
|
||||
String tweClassly = library.getAttribute("TWO_CLASSIFY") == null ? ""
|
||||
: library.getAttribute("TWO_CLASSIFY").toString();
|
||||
|
||||
libraryMap.put("libraryId", libraryId);
|
||||
libraryMap.put("remark", remark);
|
||||
libraryMap.put("docType", docType);
|
||||
libraryMap.put("docName", docName1);
|
||||
libraryMap.put("oneClassly", oneClassly);
|
||||
libraryMap.put("tweClassly", tweClassly);
|
||||
|
||||
BizObjectManager attManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME);
|
||||
List<BizObject> atts = attManage
|
||||
.createQuery("LIBRARY_ID=:LIBRARY_ID")
|
||||
.setParameter("LIBRARY_ID", libraryId).getResultList(false);
|
||||
List<Map<String, Object>> attList = new ArrayList<Map<String, Object>>();
|
||||
for (BizObject att : atts) {
|
||||
Map<String, Object> attMap = new HashMap<String, Object>();
|
||||
String attId = att.getAttribute("ID") == null ? "" : att
|
||||
.getAttribute("ID").toString();
|
||||
String fileName = att.getAttribute("FILENAME") == null ? ""
|
||||
: att.getAttribute("FILENAME").toString();
|
||||
String fileSize = att.getAttribute("FILESIZE") == null ? ""
|
||||
: att.getAttribute("FILESIZE").toString();
|
||||
String fileType = att.getAttribute("CONTENT_TYPE") == null ? ""
|
||||
: att.getAttribute("CONTENT_TYPE").toString();
|
||||
String attRemark = att.getAttribute("REMARK") == null ? ""
|
||||
: att.getAttribute("REMARK").toString();
|
||||
|
||||
attMap.put("attId", attId);
|
||||
attMap.put("fileName", fileName);
|
||||
attMap.put("fileSize", fileSize);
|
||||
attMap.put("fileType", fileType);
|
||||
attMap.put("attRemark", attRemark);
|
||||
attList.add(attMap);
|
||||
}
|
||||
libraryMap.put("fileList", attList);
|
||||
list.add(libraryMap);
|
||||
}
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("datas", list);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> doc(String objectNo, String docName,
|
||||
HttpServletRequest request, HttpServletResponse response,
|
||||
JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws JBOException {
|
||||
|
||||
String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
"objectno").toString(); // 流程号
|
||||
|
||||
if (docName.contains(",")) {
|
||||
String[] array = docName.split(",");
|
||||
docName = "";
|
||||
|
||||
for (String str : array) {
|
||||
docName += "'" + str + "',";
|
||||
}
|
||||
|
||||
if (array.length > 0) {
|
||||
docName = docName.substring(0, docName.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
BizObjectManager relaManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME);
|
||||
BizObject rela = relaManage.createQuery("FLOW_UNID=:FLOW_UNID")
|
||||
.setParameter("FLOW_UNID", flowUnid).getSingleResult(false);
|
||||
String relaId = "";
|
||||
if (null == rela) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"未找到该业务流程的资料清单!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
relaId = rela.getAttribute("ID") == null ? "" : rela.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
|
||||
BizObjectManager libraryManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
List<BizObject> librarys = libraryManage
|
||||
.createQuery(
|
||||
"RELATIVE_ID=:RELATIVE_ID AND DOC_NAME IN (" + docName
|
||||
+ ") ORDER BY SERIAL_NUM")
|
||||
.setParameter("RELATIVE_ID", relaId).getResultList(false);
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
for (BizObject library : librarys) {
|
||||
Map<String, Object> libraryMap = new HashMap<String, Object>();
|
||||
String libraryId = library.getAttribute("ID") == null ? ""
|
||||
: library.getAttribute("ID").toString();
|
||||
String remark = library.getAttribute("REMARK") == null ? ""
|
||||
: library.getAttribute("REMARK").toString();
|
||||
String docType = library.getAttribute("DOC_TYPE") == null ? ""
|
||||
: library.getAttribute("DOC_TYPE").toString();
|
||||
String docName1 = library.getAttribute("DOC_NAME") == null ? ""
|
||||
: library.getAttribute("DOC_NAME").toString();
|
||||
String oneClassly = library.getAttribute("ONE_CLASSIFY") == null ? ""
|
||||
: library.getAttribute("ONE_CLASSIFY").toString();
|
||||
String tweClassly = library.getAttribute("TWO_CLASSIFY") == null ? ""
|
||||
: library.getAttribute("TWO_CLASSIFY").toString();
|
||||
|
||||
libraryMap.put("libraryId", libraryId);
|
||||
libraryMap.put("remark", remark);
|
||||
libraryMap.put("docType", docType);
|
||||
libraryMap.put("docName", docName1);
|
||||
libraryMap.put("oneClassly", oneClassly);
|
||||
libraryMap.put("tweClassly", tweClassly);
|
||||
|
||||
BizObjectManager attManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME);
|
||||
List<BizObject> atts = attManage
|
||||
.createQuery("LIBRARY_ID=:LIBRARY_ID")
|
||||
.setParameter("LIBRARY_ID", libraryId).getResultList(false);
|
||||
List<Map<String, Object>> attList = new ArrayList<Map<String, Object>>();
|
||||
for (BizObject att : atts) {
|
||||
Map<String, Object> attMap = new HashMap<String, Object>();
|
||||
String attId = att.getAttribute("ID") == null ? "" : att
|
||||
.getAttribute("ID").toString();
|
||||
String fileName = att.getAttribute("FILENAME") == null ? ""
|
||||
: att.getAttribute("FILENAME").toString();
|
||||
String fileSize = att.getAttribute("FILESIZE") == null ? ""
|
||||
: att.getAttribute("FILESIZE").toString();
|
||||
String fileType = att.getAttribute("CONTENT_TYPE") == null ? ""
|
||||
: att.getAttribute("CONTENT_TYPE").toString();
|
||||
String attRemark = att.getAttribute("REMARK") == null ? ""
|
||||
: att.getAttribute("REMARK").toString();
|
||||
|
||||
attMap.put("attId", attId);
|
||||
attMap.put("fileName", fileName);
|
||||
attMap.put("fileSize", fileSize);
|
||||
attMap.put("fileType", fileType);
|
||||
attMap.put("attRemark", attRemark);
|
||||
attList.add(attMap);
|
||||
}
|
||||
libraryMap.put("fileList", attList);
|
||||
list.add(libraryMap);
|
||||
}
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("datas", list);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.LBDocAttributeService;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class LBDocAttributeServiceImpl implements LBDocAttributeService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> attList(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
|
||||
String libraryId = fieldMap.get("id") == null ? "" : fieldMap.get("id")
|
||||
.toString();
|
||||
|
||||
BizObjectManager bom = JBOFactory
|
||||
.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME);
|
||||
List<BizObject> bos = bom
|
||||
.createQuery("LIBRARY_ID=:LIBRARY_ID")
|
||||
.setParameter("LIBRARY_ID", libraryId).getResultList(false);
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
for (BizObject bo : bos) {
|
||||
String id = bo.getAttribute("ID") == null ? "" : bo.getAttribute(
|
||||
"ID").toString();
|
||||
String fileSize = bo.getAttribute("FILESIZE") == null ? "" : bo
|
||||
.getAttribute("FILESIZE").toString();
|
||||
String fileName = bo.getAttribute("FILENAME") == null ? "" : bo
|
||||
.getAttribute("FILENAME").toString();
|
||||
String fileType = bo.getAttribute("CONTENT_TYPE") == null ? "" : bo
|
||||
.getAttribute("CONTENT_TYPE").toString();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("id", id);
|
||||
map.put("fileSize", fileSize);
|
||||
map.put("fileName", fileName);
|
||||
map.put("fileType", fileType);
|
||||
|
||||
list.add(map);
|
||||
}
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("fileList", list);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.BusinessDocUploadService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl.BusinessDocUploadServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/apply")
|
||||
public class BusinessDocUploadController {
|
||||
@Path("/business/upload")
|
||||
@POST
|
||||
public Map<String, Object> upload(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] BusinessDocUploadController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/business/upload" + " run .................");
|
||||
|
||||
BusinessDocUploadService service = new BusinessDocUploadServiceImpl();
|
||||
try {
|
||||
return service.upload(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.LibraryDocUploadService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl.LibraryDocUploadServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/apply")
|
||||
public class LibraryDocUploadController {
|
||||
@Path("/comm/upload/library")
|
||||
@POST
|
||||
public Map<String, Object> upload(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] LibraryDocUploadController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/comm/upload/library" + " run .................");
|
||||
|
||||
LibraryDocUploadService service = new LibraryDocUploadServiceImpl();
|
||||
try {
|
||||
return service.upload(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface BusinessDocUploadService {
|
||||
Map<String, Object> upload(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface LibraryDocUploadService {
|
||||
Map<String, Object> upload(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jbo.app.tenwa.doc.LB_DOCLIBRARY;
|
||||
import jbo.app.tenwa.doc.LB_DOCRELATIVE;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.BusinessDocUploadService;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class BusinessDocUploadServiceImpl implements BusinessDocUploadService {
|
||||
private Map<String, Object> fieldMap;
|
||||
private List<Map<String, Object>> fileList;
|
||||
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public Map<String, Object> upload(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
fileList = (List<Map<String, Object>>) testMap.get("fileList"); // 资料列表
|
||||
String applyType = "BusinessApplyApply";
|
||||
String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
"objectno").toString(); // 流程号
|
||||
|
||||
String docName = fieldMap.get("docname") == null ? "" : fieldMap.get(
|
||||
"docname").toString(); // docName
|
||||
|
||||
String remark = fieldMap.get("remark") == null ? "" : fieldMap.get(
|
||||
"remark").toString(); // remark
|
||||
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
ASUser user = new ASUser(userId, sqlca);
|
||||
String time = StringFunction.getTodayNow();
|
||||
|
||||
BizObjectManager relaManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME);
|
||||
BizObject rela = relaManage.createQuery("FLOW_UNID=:FLOW_UNID")
|
||||
.setParameter("FLOW_UNID", flowUnid).getSingleResult(false);
|
||||
String relaId = "";
|
||||
if (null == rela) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"未找到该业务流程的资料清单!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
relaId = rela.getAttribute("ID") == null ? "" : rela.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
|
||||
BizObjectManager libraryManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
BizObject library = libraryManage
|
||||
.createQuery(
|
||||
"RELATIVE_ID=:RELATIVE_ID AND DOC_NAME=:DOC_NAME").setParameter("RELATIVE_ID", relaId).setParameter("DOC_NAME", docName)
|
||||
.getSingleResult(true);
|
||||
String libraryId = "";
|
||||
if (null == library) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"未找到该业务流程的资料清单类型!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
libraryId = library.getAttribute("ID") == null ? "" : library.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
library.setAttributeValue("Remark", remark);
|
||||
tx.join(libraryManage);
|
||||
libraryManage.saveObject(library);
|
||||
Configure CurConfig = Configure.getInstance();
|
||||
BizObjectManager attrBm=JBOFactory.getBizObjectManager("jbo.app.tenwa.doc.LB_DOCATTRIBUTE");
|
||||
for (Map<String, Object> file : fileList) {
|
||||
BizObject attr=attrBm.newObject();
|
||||
attr.setAttributeValue("Library_Id", libraryId);
|
||||
attr.setAttributeValue("FileName", file.get("fileName"));
|
||||
attr.setAttributeValue("InputUserId", user.getUserID());
|
||||
attr.setAttributeValue("InputOrgId", user.getOrgID());
|
||||
attr.setAttributeValue("InputTime",time);
|
||||
attr.setAttributeValue("objectType", applyType);
|
||||
|
||||
//得到不带路径的文件名
|
||||
String sFileName = StringFunction.getFileName(file.get("fileName").toString());
|
||||
sFileName = URLDecoder.decode(URLDecoder.decode(sFileName,"UTF-8"),"UTF-8");
|
||||
|
||||
//定义数据库操作变量
|
||||
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
|
||||
|
||||
String uuid=java.util.UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String sFullPath =com.tenwa.officetempalte.util.FileOperatorUtil.getuploadFileDir(sFileSavePath) +uuid+"_"+sFileName;
|
||||
InputStream is = (InputStream) file.get("file");
|
||||
File f = new File(sFullPath);
|
||||
DataOutputStream fileout = new DataOutputStream(
|
||||
new FileOutputStream(f));
|
||||
String sFileSize = file.get("fileSize") == null ? "" : file.get("fileSize").toString();
|
||||
byte b[] = new byte[Integer.valueOf(sFileSize)];
|
||||
@SuppressWarnings("unused")
|
||||
int i = is.read(b, 0, Integer.valueOf(sFileSize) - 1);
|
||||
fileout.write(b, 0, b.length); // 将文件数据存盘
|
||||
fileout.close();
|
||||
|
||||
//得到带相对路径的文件名
|
||||
String sFilePath = sFullPath.replace(sFileSavePath, "");
|
||||
attr.setAttributeValue("FilePath",sFilePath);
|
||||
attr.setAttributeValue("FullPath",sFullPath);
|
||||
attr.setAttributeValue("Content_Type", file.get("fileContentType"));
|
||||
attr.setAttributeValue("FileSize", file.get("fileSize"));
|
||||
tx.join(attrBm);
|
||||
attrBm.saveObject(attr);
|
||||
}
|
||||
|
||||
ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jbo.app.tenwa.doc.LB_DOCLIBRARY;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.LibraryDocUploadService;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class LibraryDocUploadServiceImpl implements LibraryDocUploadService {
|
||||
private Map<String, Object> fieldMap;
|
||||
private List<Map<String, Object>> fileList;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> upload(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
fileList = (List<Map<String, Object>>) testMap.get("fileList"); // 资料列表
|
||||
String applyType = fieldMap.get("applytype") == null ? "" : fieldMap.get(
|
||||
"applytype").toString();
|
||||
|
||||
String libraryId = fieldMap.get("id") == null ? "" : fieldMap.get(
|
||||
"id").toString(); // docName
|
||||
|
||||
String remark = fieldMap.get("remark") == null ? "" : fieldMap.get(
|
||||
"remark").toString(); // remark
|
||||
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
ASUser user = new ASUser(userId, sqlca);
|
||||
String time = StringFunction.getTodayNow();
|
||||
|
||||
BizObjectManager libraryManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
BizObject library = libraryManage
|
||||
.createQuery(
|
||||
"ID=:ID").setParameter("ID", libraryId)
|
||||
.getSingleResult(true);
|
||||
if (null == library) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"未找到该业务流程的资料清单类型!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
} else {
|
||||
libraryId = library.getAttribute("ID") == null ? "" : library.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
library.setAttributeValue("Remark", remark);
|
||||
tx.join(libraryManage);
|
||||
libraryManage.saveObject(library);
|
||||
@SuppressWarnings("deprecation")
|
||||
Configure CurConfig = Configure.getInstance();
|
||||
BizObjectManager attrBm=JBOFactory.getBizObjectManager("jbo.app.tenwa.doc.LB_DOCATTRIBUTE");
|
||||
for (Map<String, Object> file : fileList) {
|
||||
BizObject attr=attrBm.newObject();
|
||||
attr.setAttributeValue("Library_Id", libraryId);
|
||||
attr.setAttributeValue("FileName", file.get("fileName"));
|
||||
attr.setAttributeValue("InputUserId", user.getUserID());
|
||||
attr.setAttributeValue("InputOrgId", user.getOrgID());
|
||||
attr.setAttributeValue("InputTime",time);
|
||||
attr.setAttributeValue("objectType", applyType);
|
||||
|
||||
//得到不带路径的文件名
|
||||
String sFileName = StringFunction.getFileName(file.get("fileName").toString());
|
||||
sFileName = URLDecoder.decode(URLDecoder.decode(sFileName,"UTF-8"),"UTF-8");
|
||||
|
||||
//定义数据库操作变量
|
||||
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
|
||||
|
||||
String uuid=java.util.UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String sFullPath =com.tenwa.officetempalte.util.FileOperatorUtil.getuploadFileDir(sFileSavePath) +uuid+"_"+sFileName;
|
||||
InputStream is = (InputStream) file.get("file");
|
||||
File f = new File(sFullPath);
|
||||
DataOutputStream fileout = new DataOutputStream(
|
||||
new FileOutputStream(f));
|
||||
String sFileSize = file.get("fileSize") == null ? "" : file.get("fileSize").toString();
|
||||
byte b[] = new byte[Integer.valueOf(sFileSize)];
|
||||
@SuppressWarnings("unused")
|
||||
int i = is.read(b, 0, Integer.valueOf(sFileSize) - 1);
|
||||
fileout.write(b, 0, b.length); // 将文件数据存盘
|
||||
fileout.close();
|
||||
|
||||
//得到带相对路径的文件名
|
||||
String sFilePath = sFullPath.replace(sFileSavePath, "");
|
||||
attr.setAttributeValue("FilePath",sFilePath);
|
||||
attr.setAttributeValue("FullPath",sFullPath);
|
||||
attr.setAttributeValue("Content_Type", file.get("fileContentType"));
|
||||
attr.setAttributeValue("FileSize", file.get("fileSize"));
|
||||
tx.join(attrBm);
|
||||
attrBm.saveObject(attr);
|
||||
}
|
||||
|
||||
ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,72 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.loan.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.loan.service.LoanSimulationBasicService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.loan.service.impl.LoanSimulationBasicServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/loan/simulation/basic")
|
||||
public class LoanSimulationBasicInfoController {
|
||||
|
||||
@Path("/query")
|
||||
@POST
|
||||
public Map<String, Object> queryInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@Context JBOTransaction tx, @Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] LoanSimulationBasicInfo run .................");
|
||||
ARE.getLog().info("[Path] /loan/simulation/basic/query" + " run .................");
|
||||
|
||||
LoanSimulationBasicService service = new LoanSimulationBasicServiceImpl();
|
||||
try {
|
||||
return service.queryInfo(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Path("/save")
|
||||
@POST
|
||||
public Map<String, Object> saveInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@Context JBOTransaction tx, @Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] LoanSimulationBasicInfo run .................");
|
||||
ARE.getLog().info("[Path] /loan/simulation/basic/save" + " run .................");
|
||||
|
||||
LoanSimulationBasicService service = new LoanSimulationBasicServiceImpl();
|
||||
try {
|
||||
return service.saveInfo(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Path("/run")
|
||||
@POST
|
||||
public Map<String, Object> run(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@Context JBOTransaction tx, @Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] LoanSimulationBasicInfo run .................");
|
||||
ARE.getLog().info("[Path] /loan/simulation/basic/run" + " run .................");
|
||||
|
||||
LoanSimulationBasicService service = new LoanSimulationBasicServiceImpl();
|
||||
try {
|
||||
return service.saveInfo(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.loan.manage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.AbstractAweDoQueryManage;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class LoanSimulationBasicInfoAppInfoDoManage extends AbstractAweDoQueryManage {
|
||||
private String sAddWhere;
|
||||
private String dono;
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
public void setFieldMap(Map<String, Object> fieldMap) {
|
||||
this.fieldMap = fieldMap;
|
||||
}
|
||||
|
||||
public void setDono(String dono) {
|
||||
this.dono = dono;
|
||||
}
|
||||
|
||||
public void getGroupId() {
|
||||
sGroupId = this.dono;
|
||||
}
|
||||
|
||||
public void getOtherWhere() {
|
||||
super.sOtherWhere = StringX.isSpace(sAddWhere) ? ""
|
||||
: this.sAddWhere;
|
||||
}
|
||||
|
||||
public void setsAddWhere(String sAddWhere) {
|
||||
this.sAddWhere = sAddWhere;
|
||||
}
|
||||
|
||||
public Map<String, Object> queryDefaultDo(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception {
|
||||
setParamMap(fieldMap);
|
||||
return getData(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.loan.manage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.AbstractAweDoSaveManage;
|
||||
|
||||
public class LoanSimulationBasicInfoAppInfoSaveDoManage extends AbstractAweDoSaveManage {
|
||||
private String addWhere;
|
||||
private String dono;
|
||||
private Map<String, Object> fieldMap;
|
||||
private ASUser curUser;
|
||||
|
||||
public void setFieldMap(Map<String, Object> fieldMap) {
|
||||
this.fieldMap = fieldMap;
|
||||
}
|
||||
|
||||
public void setCurUser(ASUser curUser) {
|
||||
this.curUser = curUser;
|
||||
}
|
||||
|
||||
public void setDono(String dono) {
|
||||
this.dono = dono;
|
||||
}
|
||||
|
||||
public void setAddWhere(String addWhere) {
|
||||
this.addWhere = addWhere;
|
||||
}
|
||||
|
||||
public Map<String, Object> DefaultSave(@Context HttpServletRequest request,
|
||||
@Context Transaction sqlca, @Context JBOTransaction tx,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
return saveBusiness(sqlca, tx, dono, fieldMap, curUser.getUserID(),
|
||||
addWhere, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.loan.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface LoanSimulationBasicService {
|
||||
Map<String, Object> queryInfo(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> saveInfo(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> run(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,282 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.loan.service.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoDoManage;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoSaveDoManage;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.loan.service.LoanSimulationBasicService;
|
||||
|
||||
import com.amarsoft.app.lc.workflow.action.GetFlowAction;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.reckon.bean.TabCalBean;
|
||||
import com.tenwa.reckon.executor.CreateTransactionExecutor;
|
||||
import com.tenwa.reckon.util.TbBeanTools;
|
||||
import com.tenwa.util.SerialNumberUtil;
|
||||
|
||||
public class LoanSimulationBasicServiceImpl implements
|
||||
LoanSimulationBasicService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> queryInfo(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
|
||||
String flowunid = fieldMap.get("objectNo".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("objectNo".toLowerCase()).toString();
|
||||
String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null
|
||||
: fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号
|
||||
String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null
|
||||
: fieldMap.get("ProductId".toLowerCase()).toString();
|
||||
String calType = fieldMap.get("calType".toLowerCase()) == null ? null
|
||||
: fieldMap.get("calType".toLowerCase()).toString();
|
||||
|
||||
fieldMap.put("flowunid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flowunid".toUpperCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toUpperCase(), flowunid);
|
||||
|
||||
/* 获取参数 */
|
||||
/* 根据参数判断 是否去数据库查询 */
|
||||
BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid);
|
||||
if (productId == null) {
|
||||
productId = flow.getAttribute("productId").getString();
|
||||
}
|
||||
if (calType == null) {
|
||||
calType = "proj_process";
|
||||
}
|
||||
|
||||
TabCalBean tcb = TbBeanTools.getTabInfo(calType);
|
||||
String planCName = tcb.getPlanCName();
|
||||
// 方案编号
|
||||
if (plannumber == null) {
|
||||
if ("pay_process".equals(calType)
|
||||
|| "onHire_process".equals(calType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName).getString();
|
||||
}
|
||||
} else {
|
||||
// String planType = ProductParamUtil.getProductParameterValue(
|
||||
// productId, "PRD0314", "planinformation");
|
||||
// if ("SinglePlan".equals(planType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName)
|
||||
.getString();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
LoanSimulationBasicInfoAppInfoDoManage manage = new LoanSimulationBasicInfoAppInfoDoManage();
|
||||
manage.setDono("LoanSimulationBasicInfoApp2");
|
||||
manage.setsAddWhere(" and " + planCName + "='" + plannumber + "'");
|
||||
manage.setsJboClass(tcb.getCondition_tb());
|
||||
manage.setFieldMap(fieldMap);
|
||||
return manage.queryDefaultDo(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> saveInfo(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
|
||||
String flowunid = fieldMap.get("objectNo".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("objectNo".toLowerCase()).toString();
|
||||
String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null
|
||||
: fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号
|
||||
String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null
|
||||
: fieldMap.get("ProductId".toLowerCase()).toString();
|
||||
String calType = fieldMap.get("calType".toLowerCase()) == null ? null
|
||||
: fieldMap.get("calType".toLowerCase()).toString();
|
||||
|
||||
fieldMap.put("flowunid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flowunid".toUpperCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toUpperCase(), flowunid);
|
||||
|
||||
/* 获取参数 */
|
||||
/* 根据参数判断 是否去数据库查询 */
|
||||
BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid);
|
||||
if (productId == null) {
|
||||
productId = flow.getAttribute("productId").getString();
|
||||
}
|
||||
if (calType == null) {
|
||||
calType = "proj_process";
|
||||
}
|
||||
|
||||
TabCalBean tcb = TbBeanTools.getTabInfo(calType);
|
||||
String planCName = tcb.getPlanCName();
|
||||
// 方案编号
|
||||
if (plannumber == null) {
|
||||
if ("pay_process".equals(calType)
|
||||
|| "onHire_process".equals(calType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName).getString();
|
||||
}
|
||||
} else {
|
||||
// String planType = ProductParamUtil.getProductParameterValue(
|
||||
// productId, "PRD0314", "planinformation");
|
||||
// if ("SinglePlan".equals(planType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName)
|
||||
.getString();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// 新增数据 自动生成方案编号
|
||||
if (plannumber == null) {
|
||||
String sSerialType = "";
|
||||
if ("proj_process".equals(calType)) {
|
||||
BizObject proj = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP",
|
||||
"flowunid=:flowunid")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
sSerialType = proj.getAttribute("PROJECT_NO").getString();
|
||||
} else {
|
||||
BizObject contract = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP",
|
||||
"flowunid=:flowunid")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
sSerialType = contract.getAttribute("CONTRACT_NO").getString();
|
||||
}
|
||||
plannumber = SerialNumberUtil.getPlannumber(sSerialType, calType,
|
||||
tx);
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
LoanSimulationBasicInfoAppInfoSaveDoManage manage = new LoanSimulationBasicInfoAppInfoSaveDoManage();
|
||||
manage.setDono("LoanSimulationBasicInfoApp2");
|
||||
manage.setAddWhere(" and " + planCName + "='" + plannumber + "'");
|
||||
manage.setsJboClass(tcb.getCondition_tb());
|
||||
manage.setFieldMap(fieldMap);
|
||||
String userId = request.getSession().getAttribute("userid").toString();
|
||||
ASUser user = new ASUser(userId, sqlca);
|
||||
manage.setCurUser(user);
|
||||
return manage.DefaultSave(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> run(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
|
||||
String flowunid = fieldMap.get("objectNo".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("objectNo".toLowerCase()).toString();
|
||||
String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null
|
||||
: fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号
|
||||
String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null
|
||||
: fieldMap.get("ProductId".toLowerCase()).toString();
|
||||
String calType = fieldMap.get("calType".toLowerCase()) == null ? null
|
||||
: fieldMap.get("calType".toLowerCase()).toString();
|
||||
|
||||
fieldMap.put("flowunid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flowunid".toUpperCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toLowerCase(), flowunid);
|
||||
fieldMap.put("flow_unid".toUpperCase(), flowunid);
|
||||
|
||||
/* 获取参数 */
|
||||
/* 根据参数判断 是否去数据库查询 */
|
||||
BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid);
|
||||
if (productId == null) {
|
||||
productId = flow.getAttribute("productId").getString();
|
||||
}
|
||||
if (calType == null) {
|
||||
calType = "proj_process";
|
||||
}
|
||||
|
||||
TabCalBean tcb = TbBeanTools.getTabInfo(calType);
|
||||
String planCName = tcb.getPlanCName();
|
||||
// 方案编号
|
||||
if (plannumber == null) {
|
||||
if ("pay_process".equals(calType)
|
||||
|| "onHire_process".equals(calType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName).getString();
|
||||
}
|
||||
} else {
|
||||
// String planType = ProductParamUtil.getProductParameterValue(
|
||||
// productId, "PRD0314", "planinformation");
|
||||
// if ("SinglePlan".equals(planType)) {
|
||||
BizObject condtion = JBOFactory
|
||||
.createBizObjectQuery(
|
||||
"jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP",
|
||||
"flowunid=:flowunid")
|
||||
.setParameter("flowunid", flowunid)
|
||||
.getSingleResult(false);
|
||||
if (condtion != null) {
|
||||
plannumber = condtion.getAttribute(planCName)
|
||||
.getString();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
CreateTransactionExecutor cte = new CreateTransactionExecutor();
|
||||
cte.setCalType(calType);
|
||||
cte.setFlowunid(flowunid);
|
||||
cte.setPlannumber(plannumber);
|
||||
cte.setProductId(productId);
|
||||
String result = cte.run();
|
||||
ReturnMapUtil
|
||||
.setReturnMap(null, RestfullConstant.baseProperty
|
||||
.get("success").toString(), result);
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,15 +4,17 @@ import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.base.constant.RestfullConstant;
|
||||
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.tenwa.lease.flow.project.projectapproval.BusinessApprovalStartAction;
|
||||
|
||||
public class BusinessBO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -25060991874562555L;
|
||||
|
||||
private static final String applyType = "BusinessApplyApply";
|
||||
private String carAttributes; // 车辆属性
|
||||
private String leasehold; // 租赁方式
|
||||
private String productModel; // 品牌选择
|
||||
@ -25,83 +27,170 @@ public class BusinessBO implements Serializable {
|
||||
private String customerType; // 客户类别
|
||||
private String certtype; // 证件类型
|
||||
private String certid; // 证件号码
|
||||
|
||||
private String businessType;
|
||||
private String versionId;
|
||||
private String modelId;
|
||||
|
||||
|
||||
private String businessType; // 业务类型,1是汽车业务,2是传统业务,3是汽车传统业务
|
||||
private String versionId; // 版本ID
|
||||
private String modelId; // 车型ID
|
||||
|
||||
private String price; // 车辆指导价
|
||||
private String liter; // 排量
|
||||
private String geartype; // 档位
|
||||
private String curUserId;
|
||||
|
||||
|
||||
private String fixedFlowParam;
|
||||
|
||||
private String msg;
|
||||
private Map<String, String> params;
|
||||
public void setParam(Map<String, Object> fieldMap, String param, Object obj) {
|
||||
obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get(
|
||||
param.toLowerCase()).toString();
|
||||
}
|
||||
|
||||
public BusinessBO(Map<String, Object> fieldMap) {
|
||||
this.carAttributes = fieldMap.get("carAttributes".toLowerCase()) == null ? "1"
|
||||
: fieldMap.get("carAttributes".toLowerCase()).toString(); // 车辆属性 1,新车,2,二手车
|
||||
this.leasehold = fieldMap.get("leasehold".toLowerCase()) == null ? "3"
|
||||
: fieldMap.get("leasehold".toLowerCase()).toString(); // 租赁方式 3,直租,4,回租
|
||||
this.productModel = fieldMap.get("productModel".toLowerCase()) == null ? "DefaultCarBrand"
|
||||
public boolean checkKeyField() {
|
||||
|
||||
if (StringX.isSpace(carAttributes)) {
|
||||
msg = "请选择车辆属性";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(leasehold)) {
|
||||
msg = "请选择租赁方式";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(productModel)) {
|
||||
msg = "请选择汽车品牌";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(carSystem)) {
|
||||
msg = "请选择品牌车系";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(carSeries)) {
|
||||
msg = "请选择品牌车型";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(CUSTOMERNAME)) {
|
||||
msg = "请输入客户名称";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(customerType)) {
|
||||
msg = "请选择客户类别";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(certtype)) {
|
||||
msg = "请选择证件类型";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(certid)) {
|
||||
msg = "请输入证件号码";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public BusinessBO(Map<String, Object> fieldMap, JBOTransaction tx)
|
||||
throws Exception {
|
||||
this.carAttributes = fieldMap.get("carAttributes".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("carAttributes".toLowerCase()).toString(); // 车辆属性
|
||||
// 1,新车,2,二手车
|
||||
this.leasehold = fieldMap.get("leasehold".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("leasehold".toLowerCase()).toString(); // 租赁方式
|
||||
// 3,直租,4,回租
|
||||
this.productModel = fieldMap.get("productModel".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("productModel".toLowerCase()).toString(); // 品牌
|
||||
this.carSeries = fieldMap.get("carSeries".toLowerCase()) == null ? "DefaultCarSeries"
|
||||
this.carSeries = fieldMap.get("carSeries".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("carSeries".toLowerCase()).toString(); // 车系
|
||||
this.carSystem = fieldMap.get("carSystem".toLowerCase()) == null ? "DefaultCarSystem"
|
||||
this.carSystem = fieldMap.get("carSystem".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("carSystem".toLowerCase()).toString(); // 车型
|
||||
this.productId = fieldMap.get("productId".toLowerCase()) == null ? null
|
||||
: fieldMap.get("productId".toLowerCase()).toString(); // 产品类型
|
||||
this.productName = fieldMap.get("productName".toLowerCase()) == null ? "DefaultProduct"
|
||||
: fieldMap.get("productName".toLowerCase()).toString(); // 产品名称
|
||||
this.productName = fieldMap.get("productName".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("productName".toLowerCase()).toString(); // 产品名称
|
||||
this.CUSTOMERID = fieldMap.get("CUSTOMERID".toLowerCase()) == null ? null
|
||||
: fieldMap.get("CUSTOMERID".toLowerCase()).toString(); // 客户编号
|
||||
this.CUSTOMERNAME = fieldMap.get("CUSTOMERNAME".toLowerCase()) == null ? "DefaultUser"
|
||||
this.CUSTOMERNAME = fieldMap.get("CUSTOMERNAME".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("CUSTOMERNAME".toLowerCase()).toString(); // 客户名称
|
||||
this.customerType = fieldMap.get("customerType".toLowerCase()) == null ? "03"
|
||||
: fieldMap.get("customerType".toLowerCase()).toString(); // 客户类型 01,法人,03,个人
|
||||
this.certtype = "01".equals(this.customerType) ? "Ent02" : "Ind01"; // 证件类型 Ent02,组织机构号,Ind01,身份证
|
||||
this.customerType = fieldMap.get("customerType".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("customerType".toLowerCase()).toString(); // 客户类型
|
||||
// 01,法人,03,个人
|
||||
this.certtype = "01".equals(this.customerType) ? "Ent02" : "03"
|
||||
.equals(this.customerType) ? "Ind01" : ""; // 证件类型
|
||||
// Ent02,组织机构号,Ind01,身份证
|
||||
this.certid = fieldMap.get("certid".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("certid".toLowerCase()).toString(); // 证件号
|
||||
|
||||
|
||||
this.curUserId = fieldMap.get("userid".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("userid".toLowerCase()).toString(); // 证件号
|
||||
|
||||
this.businessType = RestfullConstant.baseProperty
|
||||
.get("BUSINESS_TYPE") == null ? ""
|
||||
|
||||
this.businessType = RestfullConstant.baseProperty.get("BUSINESS_TYPE") == null ? ""
|
||||
: RestfullConstant.baseProperty.get("BUSINESS_TYPE").toString(); // 业务类型
|
||||
|
||||
this.modelId = fieldMap.get("modelId".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("modelId".toLowerCase()).toString(); // 汽车类型
|
||||
|
||||
|
||||
this.versionId = fieldMap.get("versionId".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("versionId".toLowerCase()).toString(); // 产品版本
|
||||
|
||||
this.price = fieldMap.get("price".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("price".toLowerCase()).toString(); // 车辆指导价
|
||||
this.liter = fieldMap.get("liter".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("liter".toLowerCase()).toString(); // 排量
|
||||
this.geartype = fieldMap.get("geartype".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("geartype".toLowerCase()).toString(); // 档位
|
||||
|
||||
if (!checkKeyField()) // 校验非空字段
|
||||
return;
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
map.put("ProductId", productId);
|
||||
map.put("ProductName", productName);
|
||||
|
||||
map.put("ApplyType", "BusinessApplyApply");
|
||||
BusinessApprovalStartAction action = new BusinessApprovalStartAction();
|
||||
|
||||
map.put("ApplyType", applyType);
|
||||
action.setApplyType(applyType);
|
||||
map.put("CurUserID", curUserId);
|
||||
map.put("leasehold", leasehold);
|
||||
|
||||
map.put("productModel", productModel);
|
||||
map.put("carSeries", carSeries);
|
||||
map.put("carAttributes", carAttributes);
|
||||
map.put("carSystem", carSystem);
|
||||
|
||||
action.setCurUserID(curUserId);
|
||||
map.put("ProductId", productId);
|
||||
action.setProductId(productId);
|
||||
map.put("ProductName", productName);
|
||||
action.setProductName(productName);
|
||||
map.put("CustomerType", customerType);
|
||||
map.put("certid", certid);
|
||||
map.put("certtype", certtype);
|
||||
action.setCustomerType(customerType);
|
||||
action.setCustomertype(customerType);
|
||||
map.put("carAttributes", carAttributes);
|
||||
action.setCarAttributes(carAttributes);
|
||||
map.put("leasehold", leasehold);
|
||||
action.setLeasehold(leasehold);
|
||||
map.put("carSystem", carSystem);
|
||||
action.setCarSystem(carSystem);
|
||||
map.put("custname", CUSTOMERNAME);
|
||||
|
||||
map.put("modelid", modelId);
|
||||
action.setCustname(CUSTOMERNAME);
|
||||
map.put("certtype", certtype);
|
||||
action.setCerttype(certtype);
|
||||
map.put("certid", certid);
|
||||
action.setCertid(certid);
|
||||
map.put("productModel", productModel);
|
||||
action.setProductModel(productModel);
|
||||
map.put("carSeries", carSeries);
|
||||
action.setCarSeries(carSeries);
|
||||
|
||||
map.put("versionid", versionId);
|
||||
action.setVersionid(versionId);
|
||||
map.put("modelid", modelId);
|
||||
action.setModelid(modelId);
|
||||
map.put("businessType", businessType);
|
||||
|
||||
action.setBusinessType(businessType);
|
||||
map.put("price", price);
|
||||
action.setPrice(price);
|
||||
map.put("liter", liter);
|
||||
action.setLiter(liter);
|
||||
map.put("geartype", geartype);
|
||||
action.setGeartype(geartype);
|
||||
|
||||
JSONObject jsonObject = JSONObject.fromObject(map);
|
||||
this.fixedFlowParam = jsonObject.toString();
|
||||
action.setFixedFlowParam(fixedFlowParam);
|
||||
msg = action.initFLow(tx); // 定义流程中需要的参数
|
||||
params = action.getFlowParam();
|
||||
}
|
||||
|
||||
public String getCarAttributes() {
|
||||
@ -239,4 +328,48 @@ public class BusinessBO implements Serializable {
|
||||
public void setModelId(String modelId) {
|
||||
this.modelId = modelId;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getLiter() {
|
||||
return liter;
|
||||
}
|
||||
|
||||
public void setLiter(String liter) {
|
||||
this.liter = liter;
|
||||
}
|
||||
|
||||
public String getGeartype() {
|
||||
return geartype;
|
||||
}
|
||||
|
||||
public void setGeartype(String geartype) {
|
||||
this.geartype = geartype;
|
||||
}
|
||||
|
||||
public String getApplytype() {
|
||||
return applyType;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.bo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.tenwa.flow.action.comm.BaseFlowStartAction;
|
||||
|
||||
public class SupplementBO implements Serializable{
|
||||
private static final long serialVersionUID = 8691609268336102273L;
|
||||
// ApplyType=BContractSupportApply
|
||||
private final String ApplyType = "BContractSupportApply";
|
||||
private String CurUserID;
|
||||
private String ProjectId;
|
||||
private String FlowKey;
|
||||
private String ProductId;
|
||||
private String ContractId;
|
||||
private String ProjectName;
|
||||
|
||||
private String fixedFlowParam;
|
||||
|
||||
private String msg;
|
||||
private Map<String, String> params;
|
||||
public void setParam(Map<String, Object> fieldMap, String param, Object obj) {
|
||||
obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get(
|
||||
param.toLowerCase()).toString();
|
||||
}
|
||||
|
||||
public SupplementBO(Map<String, Object> fieldMap, JBOTransaction tx) throws Exception {
|
||||
CurUserID = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
ProjectId = fieldMap.get("project_id") == null ? "" : fieldMap.get("project_id").toString();
|
||||
FlowKey = fieldMap.get("contract_number") == null ? "" : fieldMap.get("contract_number").toString();
|
||||
ProductId = fieldMap.get("product_id") == null ? "" : fieldMap.get("product_id").toString();
|
||||
ContractId = fieldMap.get("id") == null ? "" : fieldMap.get("id").toString();
|
||||
ProjectName = fieldMap.get("project_name") == null ? "" : fieldMap.get("project_name").toString();
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
BaseFlowStartAction action = new BaseFlowStartAction();
|
||||
map.put("ApplyType", ApplyType);
|
||||
action.setApplyType(ApplyType);
|
||||
map.put("CurUserID", CurUserID);
|
||||
action.setCurUserID(CurUserID);
|
||||
map.put("ProjectId", ProjectId);
|
||||
action.setProjectId(ProjectId);
|
||||
map.put("FlowKey", FlowKey);
|
||||
action.setFlowKey(FlowKey);
|
||||
map.put("ProductId", ProductId);
|
||||
action.setProductId(ProductId);
|
||||
map.put("ContractId", ContractId);
|
||||
action.setContractId(ContractId);
|
||||
map.put("ProjectName", ProjectName);
|
||||
action.setProjectName(ProjectName);
|
||||
|
||||
JSONObject jsonObject = JSONObject.fromObject(map);
|
||||
this.fixedFlowParam = jsonObject.toString();
|
||||
action.setFixedFlowParam(fixedFlowParam);
|
||||
msg = action.initFLow(tx);
|
||||
|
||||
params = action.getFlowParam();
|
||||
|
||||
}
|
||||
|
||||
public String getCurUserID() {
|
||||
return CurUserID;
|
||||
}
|
||||
|
||||
public void setCurUserID(String curUserID) {
|
||||
CurUserID = curUserID;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return ProjectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
ProjectId = projectId;
|
||||
}
|
||||
|
||||
public String getFlowKey() {
|
||||
return FlowKey;
|
||||
}
|
||||
|
||||
public void setFlowKey(String flowKey) {
|
||||
FlowKey = flowKey;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return ProductId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId) {
|
||||
ProductId = productId;
|
||||
}
|
||||
|
||||
public String getContractId() {
|
||||
return ContractId;
|
||||
}
|
||||
|
||||
public void setContractId(String contractId) {
|
||||
ContractId = contractId;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return ProjectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
ProjectName = projectName;
|
||||
}
|
||||
|
||||
public String getFixedFlowParam() {
|
||||
return fixedFlowParam;
|
||||
}
|
||||
|
||||
public void setFixedFlowParam(String fixedFlowParam) {
|
||||
this.fixedFlowParam = fixedFlowParam;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public String getApplyType() {
|
||||
return ApplyType;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.ApplyCancelService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.ApplyCancelServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/apply")
|
||||
public class ApplyCancelController {
|
||||
@Path("/business/cancel")
|
||||
@POST
|
||||
public Map<String, Object> applyCancel(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] ApplyCancelController run .................");
|
||||
ARE.getLog().info("[Path] /apply/business/channel" + " run .................");
|
||||
|
||||
ApplyCancelService service = new ApplyCancelServiceImpl();
|
||||
try {
|
||||
return service.applyCancel(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.ContractInformationSupplementService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.ContractInformationSupplementServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/apply")
|
||||
public class ContractInformationSupplementController {
|
||||
@Path("/contract/supplement/start")
|
||||
@POST
|
||||
public Map<String, Object> applyStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] ContractInformationSupplementController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /apply/contract/supplement/start"
|
||||
+ " run .................");
|
||||
|
||||
ContractInformationSupplementService service = new ContractInformationSupplementServiceImpl();
|
||||
return service.applyStart(request, response, tx, sqlca, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface ApplyCancelService {
|
||||
Map<String, Object> applyCancel(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface ContractInformationSupplementService {
|
||||
Map<String, Object> applyStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.service.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jbo.sys.FLOW_OBJECT;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.ApplyCancelService;
|
||||
|
||||
import com.amarsoft.app.flow.FlowAction;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class ApplyCancelServiceImpl implements ApplyCancelService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> applyCancel(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
|
||||
String objectNo = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
"objectno").toString();
|
||||
BizObjectManager objectManage = JBOFactory
|
||||
.getBizObjectManager(FLOW_OBJECT.CLASS_NAME);
|
||||
BizObject object = objectManage.createQuery("OBJECTNO=:OBJECTNO")
|
||||
.setParameter("OBJECTNO", objectNo).getSingleResult(false);
|
||||
if (null == object) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("fail").toString(),
|
||||
"未找到流程实例!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
String sObjectType = object.getAttribute("ObjectType") == null ? ""
|
||||
: object.getAttribute("ObjectType").toString();
|
||||
String sFlowNo = object.getAttribute("flowno") == null ? "" : object.getAttribute("flowno").toString();
|
||||
FlowAction action = new FlowAction();
|
||||
action.setObjectNo(objectNo);
|
||||
action.setObjectType(sObjectType);
|
||||
action.setFlowNo(sFlowNo);
|
||||
|
||||
String result = action.delete(tx);
|
||||
if (result.startsWith("success")) {
|
||||
ReturnMapUtil
|
||||
.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("success")
|
||||
.toString(), "");
|
||||
} else {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("fail").toString(),
|
||||
"取消申请失败!");
|
||||
}
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,17 +6,14 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.doc.action.DocListInitAction;
|
||||
import com.tenwa.lease.flow.project.projectapproval.BusinessApprovalStartAction;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService;
|
||||
|
||||
public class BusinessApplyStartServiceImpl implements BusinessApplyStartService {
|
||||
private Map<String, Object> fieldMap;
|
||||
@ -29,45 +26,13 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
BusinessBO bo = new BusinessBO(fieldMap);
|
||||
BusinessBO bo = new BusinessBO(fieldMap, tx);
|
||||
|
||||
String applyType = "BusinessApplyApply";
|
||||
String uid = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
BusinessApprovalStartAction BusinessApprovalStartAction = new BusinessApprovalStartAction();
|
||||
|
||||
BusinessApprovalStartAction.setApplyType(applyType);
|
||||
BusinessApprovalStartAction.setCurUserID(uid);
|
||||
|
||||
BusinessApprovalStartAction.setFixedFlowParam(bo.getFixedFlowParam());
|
||||
|
||||
// 产品租赁信息
|
||||
BusinessApprovalStartAction.setBusinessType(bo.getBusinessType());
|
||||
BusinessApprovalStartAction.setVersionid(bo.getVersionId());
|
||||
BusinessApprovalStartAction.setProductID(bo.getProductId());
|
||||
BusinessApprovalStartAction.setProductId(bo.getProductId());
|
||||
BusinessApprovalStartAction.setProductName(bo.getProductName());
|
||||
BusinessApprovalStartAction.setLeasehold(bo.getLeasehold());
|
||||
|
||||
// 车辆信息
|
||||
BusinessApprovalStartAction.setModelid(bo.getModelId());
|
||||
BusinessApprovalStartAction.setCarAttributes(bo.getCarAttributes());
|
||||
BusinessApprovalStartAction.setProductModel(bo.getProductModel());
|
||||
BusinessApprovalStartAction.setCarSystem(bo.getCarSystem());
|
||||
BusinessApprovalStartAction.setCarSeries(bo.getCarSeries());
|
||||
|
||||
// 用户信息
|
||||
BusinessApprovalStartAction.setCertid(bo.getCertid());
|
||||
BusinessApprovalStartAction.setCerttype(bo.getCerttype());
|
||||
BusinessApprovalStartAction.setCustname(bo.getCUSTOMERNAME());
|
||||
BusinessApprovalStartAction.setCustomerType(bo.getCustomerType());
|
||||
|
||||
String sReturnInfo = BusinessApprovalStartAction.initFLow(tx);
|
||||
String sReturnInfo = bo.getMsg();
|
||||
if (sReturnInfo.startsWith("success")) {
|
||||
String serialNo = sReturnInfo.split("@")[1];
|
||||
// 获取当前申请的相关参数,包含FlowUnid
|
||||
Map<String, String> params = BusinessApprovalStartAction
|
||||
.getFlowParam();
|
||||
Map<String, String> params = bo.getParams();
|
||||
// 返回前台的数据
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("flowUnid", params.get("FlowUnid"));
|
||||
@ -78,11 +43,15 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(),
|
||||
"发起成功");
|
||||
} else
|
||||
} else if (sReturnInfo.startsWith("failed")) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"发起失败");
|
||||
|
||||
} else {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
sReturnInfo);
|
||||
}
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.SupplementBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.ContractInformationSupplementService;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class ContractInformationSupplementServiceImpl implements
|
||||
ContractInformationSupplementService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> applyStart(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
SupplementBO bo = new SupplementBO(fieldMap, tx);
|
||||
|
||||
String sReturnInfo = bo.getMsg();
|
||||
if (sReturnInfo.startsWith("success")) {
|
||||
String serialNo = sReturnInfo.split("@")[1];
|
||||
// 获取当前申请的相关参数,包含FlowUnid
|
||||
Map<String, String> params = bo.getParams();
|
||||
// 返回前台的数据
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("flowUnid", params.get("FlowUnid"));
|
||||
body.put("objectNo", params.get("FlowUnid"));
|
||||
body.put("projectId", params.get("ProjectId"));
|
||||
body.put("taskNo", serialNo);
|
||||
body.put("serialNo", serialNo);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(),
|
||||
"发起成功");
|
||||
} else if (sReturnInfo.startsWith("failed")) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"发起失败");
|
||||
} else {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
sReturnInfo);
|
||||
}
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -657,7 +657,7 @@ public abstract class AbstractAweDoQueryManage extends AbstractAweDoHandler {
|
||||
String sSql = "SELECT " + sJboQuery + " ";
|
||||
sSql += "FROM " + sJboFrom + this.sJboWhere + this.sJboGroup + " "
|
||||
+ this.sJboOrder;
|
||||
logger.debug("sql:" + sSql);
|
||||
logger.info("sql:" + sSql);
|
||||
BizObjectManager classManage = JBOFactory
|
||||
.getBizObjectManager(this.sJboClass);
|
||||
List<BizObject> rtBos = classManage.createQuery(sSql).getResultList(
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
package apx.com.amarsoft.als.base.awe.execute.manage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.AbstractAweDoQueryManage;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.comm.dataRightmanager.DataRightManager;
|
||||
|
||||
public class ContractInfoAllViewDoQueryManage extends AbstractAweDoQueryManage {
|
||||
private String sAddWhere;
|
||||
private String dono;
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
public void setFieldMap(Map<String, Object> fieldMap) {
|
||||
this.fieldMap = fieldMap;
|
||||
}
|
||||
|
||||
public void setDono(String dono) {
|
||||
this.dono = dono;
|
||||
}
|
||||
|
||||
public void getGroupId() {
|
||||
sGroupId = this.dono;
|
||||
}
|
||||
|
||||
public void getOtherWhere() {
|
||||
super.sOtherWhere = StringX.isSpace(sAddWhere) ? "" : this.sAddWhere;
|
||||
}
|
||||
|
||||
public void setsAddWhere(String sAddWhere) {
|
||||
this.sAddWhere = sAddWhere;
|
||||
}
|
||||
|
||||
public Map<String, Object> queryDefaultDo(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception {
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
ASUser CurUser = new ASUser(userId, sqlca);
|
||||
sAddWhere = DataRightManager
|
||||
.getRightCondition(CurUser, "O", "contract");
|
||||
// setsJboWhere(sCondtion);
|
||||
setParamMap(fieldMap);
|
||||
return getData(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package apx.com.amarsoft.als.base.awe.execute.manage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.AbstractAweDoQueryManage;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.comm.dataRightmanager.DataRightManager;
|
||||
|
||||
public class CustomerCompanyListDoQueryManage extends AbstractAweDoQueryManage {
|
||||
private String sAddWhere;
|
||||
private String dono;
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
public void setFieldMap(Map<String, Object> fieldMap) {
|
||||
this.fieldMap = fieldMap;
|
||||
}
|
||||
|
||||
public void setDono(String dono) {
|
||||
this.dono = dono;
|
||||
}
|
||||
|
||||
public void getGroupId() {
|
||||
sGroupId = this.dono;
|
||||
}
|
||||
|
||||
public void getOtherWhere() {
|
||||
super.sOtherWhere = StringX.isSpace(sAddWhere) ? "" : this.sAddWhere;
|
||||
}
|
||||
|
||||
public void setsAddWhere(String sAddWhere) {
|
||||
this.sAddWhere = sAddWhere;
|
||||
}
|
||||
|
||||
public Map<String, Object> queryDefaultDo(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception {
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
ASUser CurUser = new ASUser(userId, sqlca);
|
||||
sAddWhere = DataRightManager.getRightCondition(CurUser, "O", "cust");
|
||||
setParamMap(fieldMap);
|
||||
return getData(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package apx.com.amarsoft.als.base.awe.execute.manage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.AbstractAweDoQueryManage;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.comm.dataRightmanager.DataRightManager;
|
||||
|
||||
public class CustomerPersonListDoQueryManage extends AbstractAweDoQueryManage {
|
||||
private String sAddWhere;
|
||||
private String dono;
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
public void setFieldMap(Map<String, Object> fieldMap) {
|
||||
this.fieldMap = fieldMap;
|
||||
}
|
||||
|
||||
public void setDono(String dono) {
|
||||
this.dono = dono;
|
||||
}
|
||||
|
||||
public void getGroupId() {
|
||||
sGroupId = this.dono;
|
||||
}
|
||||
|
||||
public void getOtherWhere() {
|
||||
super.sOtherWhere = StringX.isSpace(sAddWhere) ? "" : this.sAddWhere;
|
||||
}
|
||||
|
||||
public void setsAddWhere(String sAddWhere) {
|
||||
this.sAddWhere = sAddWhere;
|
||||
}
|
||||
|
||||
public Map<String, Object> queryDefaultDo(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception {
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get(
|
||||
"userid").toString();
|
||||
ASUser CurUser = new ASUser(userId, sqlca);
|
||||
sAddWhere = DataRightManager.getRightCondition(CurUser, "O", "cust");
|
||||
setParamMap(fieldMap);
|
||||
return getData(request, sqlca, tx, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,6 @@ import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public class SelectCarAttributeServiceImpl implements SelectCarAttributeService{
|
||||
@ -69,7 +68,9 @@ public class SelectCarAttributeServiceImpl implements SelectCarAttributeService{
|
||||
request);
|
||||
ASUser curUser = new ASUser((String) request.getSession().getAttribute(
|
||||
"userid"), sqlca);
|
||||
select.setParam("orgId", curUser.getOrgID());
|
||||
select.setParam("CurOrgID", curUser.getOrgID());
|
||||
select.setParam("orgid", curUser.getOrgID());
|
||||
select.setParam("YesNo", "Y");
|
||||
Map<String, Object> body = select.execute(tx, sqlca, request);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
(String) RestfullConstant.baseProperty.get("SUCCESS"), "");
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package apx.com.amarsoft.als.currency.select.apzl.contract.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import apx.com.amarsoft.als.currency.select.apzl.contract.service.SelectContractService;
|
||||
import apx.com.amarsoft.als.currency.select.apzl.contract.service.impl.SelectContractServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/select")
|
||||
public class SelectContractController {
|
||||
@Path("/contract")
|
||||
@POST
|
||||
public Map<String, Object> selectContract(
|
||||
@Context HttpServletRequest request, @Context Transaction sqlca,
|
||||
@Context JBOTransaction tx) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
SelectContractService service = new SelectContractServiceImpl();
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] SelectContractController run .................");
|
||||
ARE.getLog().info("[Path] /select/contract run .................");
|
||||
try {
|
||||
return service
|
||||
.selectContract(request, sqlca, tx, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package apx.com.amarsoft.als.currency.select.apzl.contract.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface SelectContractService {
|
||||
Map<String, Object> selectContract(@Context HttpServletRequest request,
|
||||
@Context Transaction sqlca, @Context JBOTransaction tx,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package apx.com.amarsoft.als.currency.select.apzl.contract.service.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.select.SelectCatalogWin;
|
||||
import apx.com.amarsoft.als.currency.select.apzl.contract.service.SelectContractService;
|
||||
|
||||
public class SelectContractServiceImpl implements SelectContractService {
|
||||
|
||||
public Map<String, Object> selectContract(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception {
|
||||
String sSelName = "SelectContract";
|
||||
SelectCatalogWin select = new SelectCatalogWin(sSelName, tx, sqlca,
|
||||
request);
|
||||
ASUser curUser = new ASUser((String) request.getSession().getAttribute(
|
||||
"userid"), sqlca);
|
||||
select.setParam("orgId", curUser.getOrgID());
|
||||
Map<String, Object> body = select.execute(tx, sqlca, request);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
(String) RestfullConstant.baseProperty.get("SUCCESS"), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class RestfullConstant {
|
||||
public final static String PROPERTY_KEY_MSG_406 = "base.return.msg.406";
|
||||
public final static String PROPERTY_KEY_RESULT_SUCCESS_CODE = "base.return.result.success.code";
|
||||
public final static String PROPERTY_KEY_RESULT_FAIL_CODE = "base.return.result.fail.code";
|
||||
|
||||
|
||||
public final static String BUSINESS_TYPE = "base.business.type";
|
||||
|
||||
public final static String PROPERTY_KEY_PUSH_ENABLE = "push.message.switch";
|
||||
@ -87,9 +87,12 @@ public class RestfullConstant {
|
||||
|
||||
public static final String CUSTOMER_TYPE_COMPANY = "base.customer.type.company";
|
||||
public static final String CUSTOMER_TYPE_PERSON = "base.customer.type.person";
|
||||
|
||||
|
||||
public static final String FILTER_USER_ROLE_ID = "base.filter.user.role.id";
|
||||
|
||||
public static final String COMPANY_DOC_NAME = "base.company.doc.name";
|
||||
public static final String PERSON_DOC_NAME = "base.person.doc.name";
|
||||
|
||||
/**
|
||||
* APP SESSION ÅäÖÃ
|
||||
*/
|
||||
@ -182,7 +185,7 @@ public class RestfullConstant {
|
||||
pro.getProperty(DES_SECRET_KEY_TWO));
|
||||
setMap(baseProperty, "DES_SECRET_KEY_THREE",
|
||||
pro.getProperty(DES_SECRET_KEY_THREE));
|
||||
|
||||
|
||||
// CUSTOMER TYPE 01
|
||||
setMap(baseProperty, "CUSTOMER_TYPE_COMPANY",
|
||||
pro.getProperty(CUSTOMER_TYPE_COMPANY));
|
||||
@ -190,9 +193,12 @@ public class RestfullConstant {
|
||||
setMap(baseProperty, "CUSTOMER_TYPE_PERSON",
|
||||
pro.getProperty(CUSTOMER_TYPE_PERSON));
|
||||
// BUSINESS_TYPE
|
||||
setMap(baseProperty, "BUSINESS_TYPE",
|
||||
pro.getProperty(BUSINESS_TYPE));
|
||||
|
||||
setMap(baseProperty, "BUSINESS_TYPE", pro.getProperty(BUSINESS_TYPE));
|
||||
// COMPANY_DOC_NAME AND PERSON_DOC_NAME
|
||||
setMap(baseProperty, "COMPANY_DOC_NAME",
|
||||
pro.getProperty(COMPANY_DOC_NAME));
|
||||
setMap(baseProperty, "PERSON_DOC_NAME",
|
||||
pro.getProperty(PERSON_DOC_NAME));
|
||||
}
|
||||
|
||||
private static void loadSessionKey(Properties pro) {
|
||||
@ -216,18 +222,18 @@ public class RestfullConstant {
|
||||
// String proRootPath = directory.getCanonicalPath();
|
||||
URL url = RestfullConstant.class.getResource("/");
|
||||
String sClassPath = url.getPath();
|
||||
String os = System.getProperty("os.name");
|
||||
if(os.toLowerCase().startsWith("win")){
|
||||
sClassPath = sClassPath.startsWith("/") ? sClassPath.substring(1,
|
||||
sClassPath.indexOf("/WEB-INF") + 8) : sClassPath;
|
||||
}else {
|
||||
sClassPath = sClassPath.startsWith("/") ? sClassPath.substring(0,
|
||||
sClassPath.indexOf("/WEB-INF") + 8) : sClassPath;
|
||||
String os = System.getProperty("os.name");
|
||||
if (os.toLowerCase().startsWith("win")) {
|
||||
sClassPath = sClassPath.startsWith("/") ? sClassPath.substring(
|
||||
1, sClassPath.indexOf("/WEB-INF") + 8) : sClassPath;
|
||||
} else {
|
||||
sClassPath = sClassPath.startsWith("/") ? sClassPath.substring(
|
||||
0, sClassPath.indexOf("/WEB-INF") + 8) : sClassPath;
|
||||
}
|
||||
|
||||
String fileName = sClassPath
|
||||
+ CurConfig.getConfigure("AppConfigPath");
|
||||
//String fileName = CurConfig.getConfigure("AppConfigPath");
|
||||
// String fileName = CurConfig.getConfigure("AppConfigPath");
|
||||
ARE.getLog().debug("Îļþȫ·¾¶£º" + fileName);
|
||||
Properties pro = new Properties();
|
||||
FileInputStream in = new FileInputStream(fileName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user