app合同制作发起
This commit is contained in:
parent
5df96dfc43
commit
0342a0d045
@ -556,6 +556,7 @@
|
||||
apx.com.amarsoft.als.business.verification.controller,
|
||||
apx.com.amarsoft.als.apzl.apply.business.data.controller,
|
||||
apx.com.amarsoft.als.apzl.flow.data.controller,
|
||||
apx.com.amarsoft.als.apzl.apply.contract.make.controller,
|
||||
</param-value>
|
||||
</context-param>
|
||||
<!-- 对整个webapi进行一些通用处理的过滤器 -->
|
||||
|
||||
@ -0,0 +1,428 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.start.bo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jbo.app.LB_DOCLIBRARY;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP;
|
||||
import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
|
||||
import jbo.app.tenwa.doc.LB_DOCRELATIVE;
|
||||
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.BizObjectQuery;
|
||||
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.base.constant.RestfullConstant;
|
||||
import com.base.util.JsonUtil;
|
||||
import com.base.util.StringUtil;
|
||||
import com.tenwa.lease.flow.contract.contractapproval.ContractApprovalStartAction;
|
||||
|
||||
public class MakeContractBusinessBO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -25060991874562555L;
|
||||
private String ApplyType;
|
||||
private String SubjectId;
|
||||
private String SubjectName;
|
||||
private String CurUserID;
|
||||
private String signType;
|
||||
private String sealType;
|
||||
private String carAttributes;
|
||||
private String leasform;
|
||||
private String ProductId;
|
||||
private String ProjectId;
|
||||
private String ProjectNo;
|
||||
private String customertype;
|
||||
private String ProjectName;
|
||||
private String ContractId;
|
||||
|
||||
private String msg;
|
||||
private String operationType;
|
||||
private Map<String, String> params;
|
||||
private String fixedFlowParam;
|
||||
private String objectNo;
|
||||
private String serialNo;
|
||||
|
||||
public void setParam(Map<String, Object> fieldMap, String param, Object obj) {
|
||||
obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get(
|
||||
param.toLowerCase()).toString();
|
||||
}
|
||||
|
||||
public boolean checkKeyField() {
|
||||
if (StringX.isSpace(ApplyType)) {
|
||||
msg = "申请编号不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(carAttributes)) {
|
||||
msg = "车辆属性不能为空!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (StringX.isSpace(SubjectId)) {
|
||||
msg = "主体id不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(CurUserID)) {
|
||||
msg = "用户id不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(signType)) {
|
||||
msg = "签约方式不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(sealType)) {
|
||||
msg = "盖章方式不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(leasform)) {
|
||||
msg = "租赁形式不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(ProductId)) {
|
||||
msg = "产品id不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(ProjectId)) {
|
||||
msg = "项目id不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(ProjectNo)) {
|
||||
msg = "项目编号不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(customertype)) {
|
||||
msg = "客户类型不能为空!";
|
||||
return false;
|
||||
}
|
||||
if (StringX.isSpace(ProjectName)) {
|
||||
msg = "项目名称不能为空!";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public MakeContractBusinessBO(Map<String, Object> fieldMap, JBOTransaction tx)
|
||||
throws Exception {
|
||||
this.ApplyType = fieldMap.get("ApplyType".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("ApplyType".toLowerCase()).toString(); // 流程实例号
|
||||
this.SubjectId = fieldMap.get("subjectid".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("subjectid".toLowerCase()).toString(); //主体id
|
||||
|
||||
this.SubjectName = fieldMap.get("SubjectName".toLowerCase()) == null ? null
|
||||
: fieldMap.get("SubjectName".toLowerCase()).toString(); //主体名称
|
||||
this.CurUserID = fieldMap.get("userid".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("userid".toLowerCase()).toString(); // 客户id
|
||||
this.signType = fieldMap.get("signType".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("signType".toLowerCase()).toString(); // 签约类型
|
||||
|
||||
this.sealType = fieldMap.get("sealType".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("sealType".toLowerCase()).toString(); // 盖章类型
|
||||
this.carAttributes = fieldMap.get("CAR_TYPE".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("CAR_TYPE".toLowerCase()).toString(); // 车辆类型
|
||||
this.leasform = fieldMap.get("leas_form".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("leas_form".toLowerCase()).toString(); // 租赁形式
|
||||
this.ProductId = fieldMap.get("product_id".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("product_id".toLowerCase()).toString(); // 产品id
|
||||
this.ProjectId = fieldMap.get("projectid".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("projectid".toLowerCase()).toString(); // 项目id
|
||||
this.ProjectNo = fieldMap.get("project_no".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("project_no".toLowerCase()).toString(); // 项目编号
|
||||
this.customertype = fieldMap.get("customertype".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("customertype".toLowerCase()).toString(); // 租赁类型
|
||||
this.ProjectName = fieldMap.get("project_name".toLowerCase()) == null ? ""
|
||||
: fieldMap.get("project_name".toLowerCase()).toString(); // 项目名称
|
||||
}
|
||||
|
||||
public void businessAppStart(JBOTransaction tx) throws Exception {
|
||||
if (!checkKeyField()) // 校验非空字段
|
||||
return;
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ContractApprovalStartAction action = new ContractApprovalStartAction();
|
||||
|
||||
map.put("ApplyType", ApplyType);
|
||||
action.setApplyType(ApplyType);
|
||||
map.put("CurUserID", CurUserID);
|
||||
action.setCurUserID(CurUserID);
|
||||
map.put("leasform", leasform);
|
||||
action.setLeasform(leasform);
|
||||
map.put("ProductId", ProductId);
|
||||
action.setProductId(ProductId);
|
||||
map.put("customertype", customertype);
|
||||
action.setCustomertype(customertype);
|
||||
map.put("carAttributes", carAttributes);
|
||||
action.setCarAttributes(carAttributes);
|
||||
map.put("ProjectName", ProjectName);
|
||||
action.setProjectName(ProjectName);
|
||||
map.put("ProjectId", ProjectId);
|
||||
action.setProjectId(ProjectId);
|
||||
|
||||
map.put("ProjectNo", ProjectNo);
|
||||
map.put("sourcetype", "app");
|
||||
map.put("SubjectId", SubjectId);
|
||||
map.put("SubjectName", SubjectName);
|
||||
|
||||
map.put("signType", signType);
|
||||
map.put("sealType", sealType);
|
||||
|
||||
JSONObject jsonObject = JSONObject.fromObject(map);
|
||||
this.fixedFlowParam = jsonObject.toString();
|
||||
action.setFixedFlowParam(fixedFlowParam);
|
||||
msg = action.initFLow(tx); // 定义流程中需要的参数
|
||||
params = action.getFlowParam();
|
||||
|
||||
objectNo = params.get("FlowUnid");
|
||||
ContractId = params.get("ProjectId");
|
||||
if (msg.startsWith("success")) {
|
||||
serialNo = msg.split("@")[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean checkDoc() throws JBOException {
|
||||
BizObjectManager fboM = JBOFactory
|
||||
.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
|
||||
|
||||
BizObject fbo = fboM.createQuery("flow_unid=:flow_unid")
|
||||
.setParameter("flow_unid", objectNo).getSingleResult(false);
|
||||
if (null == fbo) {
|
||||
msg = "未找到流程实例!";
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
String flowPara = fbo.getAttribute("FixedFlowParam") == null ? ""
|
||||
: fbo.getAttribute("FixedFlowParam").toString();
|
||||
JSONObject jo = JsonUtil.str2JSONObject(flowPara.trim());
|
||||
customertype = jo.get("CustomerType") == null ? "" : jo
|
||||
.getString("CustomerType");
|
||||
} catch (Exception e) {
|
||||
ARE.getLog().error(e);
|
||||
msg = "获取客户信息失败!";
|
||||
return false;
|
||||
}
|
||||
String proj_id = fbo.getAttribute("proj_id").getString();
|
||||
String sql = "";
|
||||
sql = "SELECT DISTINCT O.ID, O.DOC_NAME,r.id " + "FROM O, "
|
||||
+ LB_DOCRELATIVE.CLASS_NAME + " R "
|
||||
+ "WHERE O.RELATIVE_ID = R.ID "
|
||||
+ "AND O.ID NOT IN (SELECT A.LIBRARY_ID FROM "
|
||||
+ LB_DOCATTRIBUTE.CLASS_NAME + " A) "
|
||||
+ "AND R.ObjectType='BusinessApplyFlow' and R.proj_id=:projid " + "AND o.DOC_NATURE='01' "
|
||||
+ "ORDER BY SERIAL_NUM";
|
||||
// R.ObjectType='BusinessApplyFlow' and R.proj_id=:projid
|
||||
BizObjectManager libraryManage = JBOFactory
|
||||
.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
BizObjectQuery query = libraryManage.createQuery(sql).setParameter(
|
||||
"projid", proj_id);
|
||||
List<BizObject> librarys = query.getResultList(false);
|
||||
|
||||
String docNameConfig = "01".equals(customertype) ? RestfullConstant.baseProperty
|
||||
.get("COMPANY_DOC_NAME").toString()
|
||||
: "03".equals(customertype) ? RestfullConstant.baseProperty
|
||||
.get("PERSON_DOC_NAME").toString() : "";
|
||||
String[] array = docNameConfig.trim().split(",");
|
||||
String docName = "";
|
||||
for (String str : array) {
|
||||
String[] array2 = str.trim().split("@");
|
||||
docName += array2[0].trim() + ",";
|
||||
}
|
||||
String[] docArr = docName.split(",");
|
||||
Object[] arr2 = StringUtil.removalDuplicate(docArr);
|
||||
msg = "";
|
||||
for (int i = 0; i < arr2.length; i++) {
|
||||
String doc = arr2[i].toString();
|
||||
for (BizObject library : librarys) {
|
||||
if (doc.trim().equals(
|
||||
library.getAttribute("DOC_NAME").toString().trim())) {
|
||||
msg += " [" + doc + "] 必备 未上传资料照片!\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BizObjectManager conditionM = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME);
|
||||
BizObjectManager rentM = JBOFactory.getBizObjectManager(LC_RENT_PLAN_TEMP.CLASS_NAME);
|
||||
BizObject condition = conditionM.createQuery("FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", objectNo).getSingleResult(false);
|
||||
BizObject rent = rentM.createQuery("FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", objectNo).getSingleResult(false);
|
||||
|
||||
if (null == condition || null == rent) {
|
||||
msg += " [商务条件] 没有找到业务测算信息!\r\n";
|
||||
}
|
||||
|
||||
|
||||
if (msg.equals("")) {
|
||||
return true;
|
||||
}
|
||||
// msg += "业务申请 提交风险预警报告";
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getApplyType() {
|
||||
return ApplyType;
|
||||
}
|
||||
|
||||
public void setApplyType(String applyType) {
|
||||
ApplyType = applyType;
|
||||
}
|
||||
|
||||
public String getSubjectId() {
|
||||
return SubjectId;
|
||||
}
|
||||
|
||||
public void setSubjectId(String subjectId) {
|
||||
SubjectId = subjectId;
|
||||
}
|
||||
|
||||
public String getSubjectName() {
|
||||
return SubjectName;
|
||||
}
|
||||
|
||||
public void setSubjectName(String subjectName) {
|
||||
SubjectName = subjectName;
|
||||
}
|
||||
|
||||
public String getCurUserID() {
|
||||
return CurUserID;
|
||||
}
|
||||
|
||||
public void setCurUserID(String curUserID) {
|
||||
CurUserID = curUserID;
|
||||
}
|
||||
|
||||
public String getSignType() {
|
||||
return signType;
|
||||
}
|
||||
|
||||
public void setSignType(String signType) {
|
||||
this.signType = signType;
|
||||
}
|
||||
|
||||
public String getSealType() {
|
||||
return sealType;
|
||||
}
|
||||
|
||||
public void setSealType(String sealType) {
|
||||
this.sealType = sealType;
|
||||
}
|
||||
|
||||
public String getCarAttributes() {
|
||||
return carAttributes;
|
||||
}
|
||||
|
||||
public void setCarAttributes(String carAttributes) {
|
||||
this.carAttributes = carAttributes;
|
||||
}
|
||||
|
||||
public String getLeasform() {
|
||||
return leasform;
|
||||
}
|
||||
|
||||
public void setLeasform(String leasform) {
|
||||
this.leasform = leasform;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return ProductId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId) {
|
||||
ProductId = productId;
|
||||
}
|
||||
|
||||
public String getProjectNo() {
|
||||
return ProjectNo;
|
||||
}
|
||||
|
||||
public void setProjectNo(String projectNo) {
|
||||
ProjectNo = projectNo;
|
||||
}
|
||||
|
||||
public String getCustomertype() {
|
||||
return customertype;
|
||||
}
|
||||
|
||||
public void setCustomertype(String customertype) {
|
||||
this.customertype = customertype;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return ProjectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
ProjectName = projectName;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getOperationType() {
|
||||
return operationType;
|
||||
}
|
||||
|
||||
public void setOperationType(String operationType) {
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public String getFixedFlowParam() {
|
||||
return fixedFlowParam;
|
||||
}
|
||||
|
||||
public void setFixedFlowParam(String fixedFlowParam) {
|
||||
this.fixedFlowParam = fixedFlowParam;
|
||||
}
|
||||
public String getSerialNo() {
|
||||
return serialNo;
|
||||
}
|
||||
|
||||
public void setSerialNo(String serialNo) {
|
||||
this.serialNo = serialNo;
|
||||
}
|
||||
|
||||
public String getObjectNo() {
|
||||
return objectNo;
|
||||
}
|
||||
|
||||
public void setObjectNo(String objectNo) {
|
||||
this.objectNo = objectNo;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return ProjectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
ProjectId = projectId;
|
||||
}
|
||||
|
||||
public String getContractId() {
|
||||
return ContractId;
|
||||
}
|
||||
|
||||
public void setContractId(String contractId) {
|
||||
ContractId = contractId;
|
||||
}
|
||||
|
||||
}
|
||||
@ -70,4 +70,22 @@ public class BusinessApplyStartController {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
//ºÏÍ¬ÖÆ×÷·¢ÆðÁ÷³Ì
|
||||
@Path("/makeContract/start")
|
||||
@POST
|
||||
public Map<String, Object> makeContractStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] BusinessApplyStartController run .................");
|
||||
ARE.getLog().info("[Path] /apply/changeApply/start" + " run .................");
|
||||
|
||||
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
|
||||
try {
|
||||
return service.makeContractStart(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,4 +22,8 @@ public interface BusinessApplyStartService {
|
||||
Map<String, Object> changeApplyStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
|
||||
Map<String, Object> makeContractStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl.BusinessDocUploadServiceImpl;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.ChangeBusinessBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.bo.MakeContractBusinessBO;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.init.InitDocListTools;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService;
|
||||
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
|
||||
@ -150,7 +151,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
System.out.println("=============发起申请参数================================");
|
||||
System.out.println("=============业务变更申请参数================================");
|
||||
System.out.println(testMap.toString());
|
||||
System.out.println("=======================================");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
@ -177,4 +178,36 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> makeContractStart(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
System.out.println("=============合同制作申请参数================================");
|
||||
System.out.println(testMap.toString());
|
||||
System.out.println("=======================================");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
MakeContractBusinessBO bo = new MakeContractBusinessBO(fieldMap, tx);
|
||||
bo.businessAppStart(tx);
|
||||
tx.commit();
|
||||
String sReturnInfo = bo.getMsg();
|
||||
if (sReturnInfo.startsWith("success")) {
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("flowUnid", bo.getObjectNo());
|
||||
body.put("objectNo", bo.getObjectNo());
|
||||
body.put("projectId", bo.getProjectId());
|
||||
body.put("taskNo", bo.getSerialNo());
|
||||
body.put("serialNo", bo.getSerialNo());
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(),
|
||||
"发起成功");
|
||||
}else{
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("fail").toString(),
|
||||
sReturnInfo);
|
||||
}
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.contract.make.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.contract.make.service.ContractMakeService;
|
||||
import apx.com.amarsoft.als.apzl.apply.contract.make.service.impl.ContractMakeServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/contract/make")
|
||||
public class ContractMakeController {
|
||||
|
||||
//获取需要合同制作的代办数
|
||||
@Path("/get/number")
|
||||
@POST
|
||||
public Map<String, Object> getMakeContractNumber(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] BusinessDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /contract/make/number" + " run .................");
|
||||
|
||||
ContractMakeService service = new ContractMakeServiceImpl();
|
||||
try {
|
||||
return service.getMakeContractNumber(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.contract.make.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 ContractMakeService {
|
||||
Map<String, Object> getMakeContractNumber(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.contract.make.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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.amarsoft.context.ASUser;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.contract.make.service.ContractMakeService;
|
||||
|
||||
public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
|
||||
private Map<String, Object> fieldMap;
|
||||
@Override
|
||||
public Map<String, Object> getMakeContractNumber(
|
||||
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 userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
ASUser asUser = new ASUser(userId);
|
||||
String orgID = asUser.getOrgID();
|
||||
String sql = "";
|
||||
if("8006011".equals(orgID)){
|
||||
sql = "SELECT lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.INPUTORGID='"+orgID+"' AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC";
|
||||
}else{
|
||||
sql="SELECT lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.PROJECT_MANAGE='"+userId+"' AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC";
|
||||
}
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
body.put("datas", dataList);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user