APP付款申请流程接口发起&放款后督流程接口发起实现

This commit is contained in:
zhangjun 2020-06-05 18:19:23 +08:00
parent f9de6cd991
commit 70cb50f080
10 changed files with 1016 additions and 159 deletions

View File

@ -1,91 +1,130 @@
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.BusinessApplyStartService;
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.BusinessApplyStartServiceImpl;
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 BusinessApplyStartController {
@Path("/business/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] BusinessApplyStartController run .................");
ARE.getLog().info("[Path] /apply/business/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.applyStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
@Path("/action/submit/risk/warning")
@POST
public Map<String, Object> riskWarning(@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/action/submit/risk/warning" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.riskWarning(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
@Path("/changeApply/start")
@POST
public Map<String, Object> changeApplyStart(@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.changeApplyStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
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);
}
}
}
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.BusinessApplyStartService;
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.BusinessApplyStartServiceImpl;
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 BusinessApplyStartController {
@Path("/business/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] BusinessApplyStartController run .................");
ARE.getLog().info("[Path] /apply/business/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.applyStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
@Path("/action/submit/risk/warning")
@POST
public Map<String, Object> riskWarning(@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/action/submit/risk/warning" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.riskWarning(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
@Path("/changeApply/start")
@POST
public Map<String, Object> changeApplyStart(@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.changeApplyStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
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);
}
}
//付款申请发起流程
@Path("/payment/start")
@POST
public Map<String, Object> PaymentStart(@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/payment/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.PaymentStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
// 放款后督发起流程
@Path("/overseers/start")
@POST
public Map<String, Object> OverseersStart(@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/overseers/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.OverseersStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
}

View File

@ -0,0 +1,360 @@
package apx.com.amarsoft.als.apzl.apply.business.start.initiate;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.flow.action.comm.BaseFlowStartAction;
import com.tenwa.lease.flow.contract.contractapproval.ContractApprovalStartAction;
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;
public class OverseersBO implements Serializable{
private static final long serialVersionUID = -33708969676078106L;
private String ApplyType;
private String CurUserID;
private String ProjectId;
private String FlowKey;
private String ProductId;
private String ContractId;
private String ProjectName;
private String ProjectNo;
private String CustomerName;
private String customertype;
private String msg;
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(ProductId)) {
msg = "产品id不能为空";
return false;
}
if (StringX.isSpace(ProjectId)) {
msg = "项目id不能为空";
return false;
}
if (StringX.isSpace(ProjectNo)) {
msg = "项目编号不能为空!";
return false;
}
if (StringX.isSpace(ProjectName)) {
msg = "项目名称不能为空!";
return false;
}
if (StringX.isSpace(CurUserID)) {
msg = "用户id不能为空";
return false;
}
if (StringX.isSpace(FlowKey)) {
msg = "互斥id不能为空";
return false;
}
return true;
}
public OverseersBO(Map<String, Object> fieldMap, JBOTransaction tx) throws Exception {
this.ApplyType = fieldMap.get("ApplyType".toLowerCase()) == null ? ""
: fieldMap.get("ApplyType".toLowerCase()).toString(); // 流程实例号
this.ProductId = fieldMap.get("PROJECT_ID".toLowerCase()) == null ? ""
: fieldMap.get("PROJECT_ID".toLowerCase()).toString(); // 项目id
this.ProjectId = fieldMap.get("PRODUCT_ID".toLowerCase()) == null ? ""
: fieldMap.get("PRODUCT_ID".toLowerCase()).toString(); // 产品id
this.ProjectName = fieldMap.get("PROJECT_NAME".toLowerCase()) == null ? ""
: fieldMap.get("PROJECT_NAME".toLowerCase()).toString(); // 项目名称
this.ProjectNo = fieldMap.get("project_no".toLowerCase()) == null ? ""
: fieldMap.get("project_no".toLowerCase()).toString(); // 申请编号
this.CustomerName = fieldMap.get("customer_name".toLowerCase()) == null ? ""
: fieldMap.get("customer_name".toLowerCase()).toString(); // 客户名称
this.customertype = fieldMap.get("customertype".toLowerCase()) == null ? ""
: fieldMap.get("customertype".toLowerCase()).toString(); // 租赁类型
this.CurUserID = fieldMap.get("userid".toLowerCase()) == null ? ""
: fieldMap.get("userid".toLowerCase()).toString(); // 客户id
this.FlowKey = fieldMap.get("contract_number".toLowerCase()) == null ? ""
: fieldMap.get("contract_number".toLowerCase()).toString(); // 合同号
}
public void businessAppStart(JBOTransaction tx) throws Exception {
if (!checkKeyField()) // 校验非空字段
return;
Map<String, Object> map = new HashMap<String, Object>();
BaseFlowStartAction action = new BaseFlowStartAction();
map.put("ApplyType", ApplyType);
action.setApplyType(ApplyType);
map.put("ProductId", ProductId);
action.setProductId(ProductId);
map.put("ProjectName", ProjectName);
action.setProjectName(ProjectName);
map.put("ProjectId", ProjectId);
action.setProjectId(ProjectId);
map.put("FlowKey", FlowKey);
action.setFlowKey(FlowKey);
map.put("ProjectNo", ProjectNo);
map.put("customertype", customertype);
action.setCustomertype(customertype);
map.put("CurUserID", CurUserID);
action.setCurUserID(CurUserID);
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];
}
}
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 getProductId() {
return ProductId;
}
public void setProductId(String productId) {
ProductId = productId;
}
public String getProjectId() {
return ProjectId;
}
public void setProjectId(String projectId) {
ProjectId = projectId;
}
public String getProjectName() {
return ProjectName;
}
public void setProjectName(String projectName) {
ProjectName = projectName;
}
public String getProjectNo() {
return ProjectNo;
}
public void setProjectNo(String projectNo) {
ProjectNo = projectNo;
}
public String getCustomerName() {
return CustomerName;
}
public void setCustomerName(String customerName) {
CustomerName = customerName;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
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 getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getObjectNo() {
return objectNo;
}
public void setObjectNo(String objectNo) {
this.objectNo = objectNo;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getContractId() {
return ContractId;
}
public void setContractId(String contractId) {
ContractId = contractId;
}
public String getCustomertype() {
return customertype;
}
public void setCustomertype(String customertype) {
this.customertype = customertype;
}
public String getCurUserID() {
return CurUserID;
}
public void setCurUserID(String curUserID) {
CurUserID = curUserID;
}
public String getFlowKey() {
return FlowKey;
}
public void setFlowKey(String flowKey) {
FlowKey = flowKey;
}
}

View File

@ -0,0 +1,406 @@
package apx.com.amarsoft.als.apzl.apply.business.start.initiate;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.flow.action.comm.BaseFlowStartAction;
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;
public class PaymentRequestBO implements Serializable{
private static final long serialVersionUID = 5036535189309046074L;
private String ContractId;
private String FlowKey;
private String ProjectId;
private String ProductId;
private String contract_number;
private String ProjectName;
private String ApplyType;
private String CurUserID;
private String customertype;
private String CustomerName;// 客户名称
/*private String total;
private String usedlines;
private String relines;
private String plan_money;
private String afact_money;
private String allfact_money;
private String fee_adjust;
private String overmoney;
private String username;*/
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(ContractId)) {
msg = "合同编号不能为空!";
return false;
}
if (StringX.isSpace(CurUserID)) {
msg = "用户id不能为空";
return false;
}
if (StringX.isSpace(ProductId)) {
msg = "产品id不能为空";
return false;
}
if (StringX.isSpace(ProjectId)) {
msg = "项目id不能为空";
return false;
}
if (StringX.isSpace(ProjectName)) {
msg = "项目名称不能为空!";
return false;
}
return true;
}
public PaymentRequestBO(Map<String, Object> fieldMap, JBOTransaction tx)
throws Exception {
this.ApplyType = fieldMap.get("ApplyType".toLowerCase()) == null ? ""
: fieldMap.get("ApplyType".toLowerCase()).toString(); // 流程实例号
this.CurUserID = fieldMap.get("userid".toLowerCase()) == null ? ""
: fieldMap.get("userid".toLowerCase()).toString(); // 客户id
this.ProductId = fieldMap.get("product_id".toLowerCase()) == null ? ""
: fieldMap.get("product_id".toLowerCase()).toString(); // 产品id
this.ProjectId = fieldMap.get("project_id".toLowerCase()) == null ? ""
: fieldMap.get("project_id".toLowerCase()).toString(); // 项目id
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(); // 项目名称
this.FlowKey = fieldMap.get("contract_no".toLowerCase()) == null ? ""
: fieldMap.get("contract_no".toLowerCase()).toString(); // 合同号
this.contract_number = fieldMap.get("contract_number".toLowerCase()) == null ? ""
: fieldMap.get("contract_number".toLowerCase()).toString(); // 合同编码
this.CustomerName = fieldMap.get("customername".toLowerCase()) == null ? ""
: fieldMap.get("customername".toLowerCase()).toString(); // 客户名称
this.ContractId = fieldMap.get("contract_id".toLowerCase()) == null ? ""
: fieldMap.get("contract_id".toLowerCase()).toString(); // 合同ID
/*this.total = fieldMap.get("total".toLowerCase()) == null ? ""
: fieldMap.get("total".toLowerCase()).toString();
this.usedlines = fieldMap.get("usedlines".toLowerCase()) == null ? ""
: fieldMap.get("usedlines".toLowerCase()).toString();
this.relines = fieldMap.get("relines".toLowerCase()) == null ? ""
: fieldMap.get("relines".toLowerCase()).toString();
this.plan_money = fieldMap.get("plan_money".toLowerCase()) == null ? ""
: fieldMap.get("plan_money".toLowerCase()).toString();
this.afact_money = fieldMap.get("afact_money".toLowerCase()) == null ? ""
: fieldMap.get("afact_money".toLowerCase()).toString();
this.allfact_money = fieldMap.get("allfact_money".toLowerCase()) == null ? ""
: fieldMap.get("allfact_money".toLowerCase()).toString();
this.fee_adjust = fieldMap.get("fee_adjust".toLowerCase()) == null ? ""
: fieldMap.get("fee_adjust".toLowerCase()).toString();
this.overmoney = fieldMap.get("overmoney".toLowerCase()) == null ? ""
: fieldMap.get("overmoney".toLowerCase()).toString();
this.username = fieldMap.get("username".toLowerCase()) == null ? ""
: fieldMap.get("username".toLowerCase()).toString();
*/
this.ProjectName = FlowKey+"-"+CustomerName;
}
public void businessAppStart(JBOTransaction tx) throws Exception {
if (!checkKeyField()) // 校验非空字段
return;
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("ProductId", ProductId);
action.setProductId(ProductId);
map.put("ProjectName", ProjectName);
action.setProjectName(ProjectName);
map.put("ProjectId", ProjectId);
action.setProjectId(ProjectId);
map.put("customertype", customertype);
action.setCustomertype(customertype);
map.put("FlowKey", FlowKey);
action.setFlowKey(FlowKey);
map.put("ContractId", ContractId);
action.setContractId(ContractId);
/*map.put("total", total);
map.put("usedlines", usedlines);
map.put("relines", relines);
map.put("plan_money", plan_money);
map.put("afact_money", afact_money);
map.put("allfact_money", allfact_money);
map.put("fee_adjust", fee_adjust);
map.put("overmoney", overmoney);
map.put("username", username);
*/
JSONObject jsonObject = JSONObject.fromObject(map);
this.fixedFlowParam = jsonObject.toString();
action.setFixedFlowParam(fixedFlowParam);
msg = action.initFLow(tx); // 定义流程中需要的参数
params = action.getFlowParam();
objectNo = params.get("FlowUnid");
ProjectId = params.get("PROJECT_ID");
if (msg.startsWith("success")) {
serialNo = msg.split("@")[1];
}
}
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 getFlowKey() {
return FlowKey;
}
public void setFlowKey(String flowKey) {
FlowKey = flowKey;
}
public String getApplyType() {
return ApplyType;
}
public void setApplyType(String applyType) {
ApplyType = applyType;
}
public String getCustomerName() {
return CustomerName;
}
public void setCustomerName(String customerName) {
CustomerName = customerName;
}
public String getCurUserID() {
return CurUserID;
}
public void setCurUserID(String curUserID) {
CurUserID = curUserID;
}
public String getProductId() {
return ProductId;
}
public void setProductId(String productId) {
ProductId = productId;
}
public String getProjectId() {
return ProjectId;
}
public void setProjectId(String projectId) {
ProjectId = projectId;
}
public String getProjectName() {
return ProjectName;
}
public void setProjectName(String projectName) {
ProjectName = projectName;
}
public String getContractId() {
return ContractId;
}
public void setContractId(String contractId) {
ContractId = contractId;
}
public String getCustomertype() {
return customertype;
}
public void setCustomertype(String customertype) {
this.customertype = customertype;
}
public String getContract_number() {
return contract_number;
}
public void setContract_number(String contract_number) {
this.contract_number = contract_number;
}
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 getObjectNo() {
return objectNo;
}
public void setObjectNo(String objectNo) {
this.objectNo = objectNo;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}

View File

@ -1,29 +1,37 @@
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 BusinessApplyStartService {
Map<String, Object> applyStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> riskWarning(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
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;
}
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 BusinessApplyStartService {
Map<String, Object> applyStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> riskWarning(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
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;
Map<String, Object> PaymentStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> OverseersStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
}

View File

@ -14,6 +14,8 @@ 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.initiate.OverseersBO;
import apx.com.amarsoft.als.apzl.apply.business.start.initiate.PaymentRequestBO;
import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService;
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
@ -210,4 +212,67 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
return ReturnMapUtil.getReturnMap();
}
@Override
public Map<String, Object> PaymentStart(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");
PaymentRequestBO bo = new PaymentRequestBO(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("project_Id", 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();
}
@Override
public Map<String, Object> OverseersStart(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");
OverseersBO bo = new OverseersBO(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();
}
}

View File

@ -9,6 +9,7 @@ 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;
@ -29,21 +30,20 @@ public class ApplyOverseeServiceImpl implements ApplyOverseeService{
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
String sql = "select bo.flow_key,lfi.fact_money,ft.endtime,lec.MODEL,lec.FRAME_NUMBER,lrp.rent,lcc.INCOME_NUMBER from LB_CONTRACT_INFO lci left join FLOW_BUSSINESS_OBJECT bo on bo.contract_id =lci.id left join lc_fund_income lfi ON lfi.contract_id=lci.id AND lfi.plan_list='1' AND lfi.fee_type='feetype10' AND lfi.pay_status='have_paid' AND lfi.pay_type='pay_type_out' AND (lfi.settle_method='settlemethod6' or lfi.settle_method='settlemethod13') AND lfi.ROLL_BACK='0' left join (SELECT ft1.objectno,ft1.endtime,ft1.flowno FROM FLOW_TASK ft1 WHERE ft1.phaseno='0010' AND ft1.begintime IN (SELECT MAX(ft2.begintime) FROM FLOW_TASK ft2 WHERE ft2.phaseno='0010' AND ft1.objectno=ft2.objectno GROUP BY ft2.objectno)) ft ON ft.objectno = bo.flow_unid LEFT JOIN LB_EQUIPMENT_CAR lec ON lci.id=lec.contract_id LEFT JOIN lc_rent_plan lrp ON lrp.CONTRACT_ID=lci.ID AND lrp.plan_list='1' left join LC_CALC_CONDITION_TEMP lcc on lcc.flowunid=lci.FLOWUNID where ft.flowno='MortgageFileFlow' and lci.FLOWUNID='"+flowunid+"' ";
//String sql = "select bo.flow_key,lfi.fact_money,ft.endtime,lec.MODEL,lec.FRAME_NUMBER,lrp.rent,lcc.INCOME_NUMBER from LB_CONTRACT_INFO lci left join FLOW_BUSSINESS_OBJECT bo on bo.contract_id =lci.id left join lc_fund_income lfi ON lfi.contract_id=lci.id AND lfi.plan_list='1' AND lfi.fee_type='feetype10' AND lfi.pay_status='have_paid' AND lfi.pay_type='pay_type_out' AND (lfi.settle_method='settlemethod6' or lfi.settle_method='settlemethod13') AND lfi.ROLL_BACK='0' left join (SELECT ft1.objectno,ft1.endtime,ft1.flowno FROM FLOW_TASK ft1 WHERE ft1.phaseno='0010' AND ft1.begintime IN (SELECT MAX(ft2.begintime) FROM FLOW_TASK ft2 WHERE ft2.phaseno='0010' AND ft1.objectno=ft2.objectno GROUP BY ft2.objectno)) ft ON ft.objectno = bo.flow_unid LEFT JOIN LB_EQUIPMENT_CAR lec ON lci.id=lec.contract_id LEFT JOIN lc_rent_plan lrp ON lrp.CONTRACT_ID=lci.ID AND lrp.plan_list='1' left join LC_CALC_CONDITION_TEMP lcc on lcc.flowunid=lci.FLOWUNID where ft.flowno='MortgageFileFlow' and lci.FLOWUNID='"+flowunid+"' ";
ASUser asUser = new ASUser(userId);
String orgID = asUser.getOrgID();
String sql = "";
if("8006011".equals(orgID)){
sql = "select lci.project_id as PROJECT_ID,lci.product_id as PRODUCT_ID,lci.contract_number as CONTRACT_NUMBER,lci.project_name as PROJECT_NAME,lpi.project_no as project_no,lul.customer_name as customer_name,ci.customertype as customertype from lb_contract_info lci left join lb_project_info lpi on lci.project_id=lpi.id left join lb_union_lessee lul on lci.id=lul.contract_id AND lul.IS_MAIN='Y' LEFT JOIN CUSTOMER_INFO ci ON lul.customer_id = ci.customerid WHERE (lci.contract_status>=31 and lci.contract_status<100) AND lci.BUSINESSTYPE='1' AND lci.id NOT IN (SELECT contract_id FROM LB_FILE_ARCHIVING_INFO) AND lci.inputorgid='"+orgID+"' ";
}else{
sql = "select lci.project_id as PROJECT_ID,lci.product_id as PRODUCT_ID,lci.contract_number as CONTRACT_NUMBER,lci.project_name as PROJECT_NAME,lpi.project_no as project_no,lul.customer_name as customer_name,ci.customertype as customertype from lb_contract_info lci left join lb_project_info lpi on lci.project_id=lpi.id left join lb_union_lessee lul on lci.id=lul.contract_id AND lul.IS_MAIN='Y' LEFT JOIN CUSTOMER_INFO ci ON lul.customer_id = ci.customerid WHERE (lci.contract_status>=31 and lci.contract_status<100) AND lci.BUSINESSTYPE='1' AND lci.id NOT IN (SELECT contract_id FROM LB_FILE_ARCHIVING_INFO) AND lci.project_manage='"+userId+"' ";
}
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
Map<String, Object> body = new HashMap<String, Object>();
if(dataList.size()>0){
for (Map<String, String> map : dataList) {
body.put(map.get("flow_key"),map.get("flow_key"));
body.put(map.get("fact_money"),map.get("fact_money"));
body.put(map.get("endtime"),map.get("endtime"));
body.put(map.get("MODEL"),map.get("MODEL"));
body.put(map.get("FRAME_NUMBER"),map.get("FRAME_NUMBER"));
body.put(map.get("rent"),map.get("rent"));
body.put(map.get("INCOME_NUMBER"),map.get("INCOME_NUMBER"));
}
}
body.put("datas", dataList);
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}

View File

@ -34,9 +34,9 @@ public class ApplyPaymentServiceImpl implements ApplyPaymentService{
String orgID = asUser.getOrgID();
String sql = "";
if(orgID=="8006011"){
sql = "select CONTRACT_NUMBER,CONTRACT_NO,PROJECT_ID,PRODUCT_ID,PROJECT_NAME,customerid,customername,total,usedlines,relines,plan_money,afact_money,allfact_money,fee_adjust,overmoney,username from (SELECT lci.ID,lci.CONTRACT_NUMBER,lci.CONTRACT_NO,lci.PROJECT_ID,lci.PRODUCT_ID,lci.PROJECT_NAME,lul.customerid,lul.customername,di.total,di.usedlines,di.relines,vlfp.plan_money,IFNULL(lfi.allfact_money, 0) AS afact_money,vlfp.allfact_money,vlfp.fee_adjust,vlfp.overmoney,ui.username FROM LB_CONTRACT_INFO AS lci LEFT JOIN (SELECT lu.contract_id,ci.customerid,ci.customername FROM LB_UNION_LESSEE lu,CUSTOMER_INFO ci WHERE lu.CUSTOMER_ID = ci.customerid AND is_main = 'y') AS lul ON lul.CONTRACT_ID = lci.ID LEFT JOIN (SELECT vl.contract_id,SUM(vl.plan_money) plan_money,SUM(vl.allfact_money) allfact_money,SUM(vl.fee_adjust) fee_adjust,SUM(vl.overmoney) overmoney FROM vi_lc_fund_plan vl WHERE vl.pay_type = 'pay_type_out' AND vl.fee_type NOT IN ('feetype16', 'feetype17') GROUP BY vl.contract_id) vlfp ON vlfp.contract_id = lci.ID LEFT JOIN (SELECT contract_id,SUM(IFNULL(fact_money, 0)) + SUM(IFNULL(fee_adjust, 0)) AS allfact_money FROM lc_fund_income WHERE pay_type = 'pay_type_out' AND roll_back = '0' AND pay_status = 'apply_pass' GROUP BY contract_id) AS lfi ON lfi.contract_id = lci.ID LEFT JOIN user_info AS ui ON lci.PROJECT_MANAGE = ui.userid left join vi_distributor_lines di on lci.distributor_id=di.distributor_no WHERE (lci.contract_status = '21' OR lci.contract_status = '25' OR lci.contract_status = '26')AND lci.BUSINESSTYPE='1' AND lci.INPUTORGID='"+orgID+"' AND IFNULL(lfi.allfact_money, 0) < vlfp.plan_money AND lci.ID NOT IN (SELECT contract_id FROM flow_bussiness_object fbo,flow_object fo WHERE fbo.flow_unid = fo.objectno AND fbo.flow_name = '×ʽ𸶿î' AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0 ";
sql = "select contract_id,CONTRACT_NUMBER,CONTRACT_NO,PROJECT_ID,PRODUCT_ID,PROJECT_NAME,customerid,customername,total,usedlines,relines,plan_money,afact_money,allfact_money,fee_adjust,overmoney,username,customertype,CAR_TYPE from (SELECT lci.ID as contract_id,lci.CONTRACT_NUMBER,lci.CONTRACT_NO,lci.PROJECT_ID,lci.PRODUCT_ID,lci.PROJECT_NAME,lul.customerid,lul.customername,di.total,di.usedlines,di.relines,vlfp.plan_money,IFNULL(lfi.allfact_money, 0) AS afact_money,vlfp.allfact_money,vlfp.fee_adjust,vlfp.overmoney,ui.username,lul.customertype,lci.CAR_TYPE FROM LB_CONTRACT_INFO AS lci LEFT JOIN (SELECT lu.contract_id,ci.customerid,ci.customername,ci.customertype FROM LB_UNION_LESSEE lu,CUSTOMER_INFO ci WHERE lu.CUSTOMER_ID = ci.customerid AND is_main = 'y') AS lul ON lul.CONTRACT_ID = lci.ID LEFT JOIN (SELECT vl.contract_id,SUM(vl.plan_money) plan_money,SUM(vl.allfact_money) allfact_money,SUM(vl.fee_adjust) fee_adjust,SUM(vl.overmoney) overmoney FROM vi_lc_fund_plan vl WHERE vl.pay_type = 'pay_type_out' AND vl.fee_type NOT IN ('feetype16', 'feetype17') GROUP BY vl.contract_id) vlfp ON vlfp.contract_id = lci.ID LEFT JOIN (SELECT contract_id,SUM(IFNULL(fact_money, 0)) + SUM(IFNULL(fee_adjust, 0)) AS allfact_money FROM lc_fund_income WHERE pay_type = 'pay_type_out' AND roll_back = '0' AND pay_status = 'apply_pass' GROUP BY contract_id) AS lfi ON lfi.contract_id = lci.ID LEFT JOIN user_info AS ui ON lci.PROJECT_MANAGE = ui.userid left join vi_distributor_lines di on lci.distributor_id=di.distributor_no WHERE (lci.contract_status = '21' OR lci.contract_status = '25' OR lci.contract_status = '26')AND lci.BUSINESSTYPE='1' AND lci.INPUTORGID='"+orgID+"' AND IFNULL(lfi.allfact_money, 0) < vlfp.plan_money AND lci.ID NOT IN (SELECT contract_id FROM flow_bussiness_object fbo,flow_object fo WHERE fbo.flow_unid = fo.objectno AND fbo.flow_name = '×ʽ𸶿î' AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0 ";
}else{
sql = "select CONTRACT_NUMBER,CONTRACT_NO,PROJECT_ID,PRODUCT_ID,PROJECT_NAME,customerid,customername,total,usedlines,relines,plan_money,afact_money,allfact_money,fee_adjust,overmoney,username from (SELECT lci.ID,lci.CONTRACT_NUMBER,lci.CONTRACT_NO,lci.PROJECT_ID,lci.PRODUCT_ID,lci.PROJECT_NAME,lul.customerid,lul.customername,di.total,di.usedlines,di.relines,vlfp.plan_money,IFNULL(lfi.allfact_money, 0) AS afact_money,vlfp.allfact_money,vlfp.fee_adjust,vlfp.overmoney,ui.username FROM LB_CONTRACT_INFO AS lci LEFT JOIN (SELECT lu.contract_id,ci.customerid,ci.customername FROM LB_UNION_LESSEE lu,CUSTOMER_INFO ci WHERE lu.CUSTOMER_ID = ci.customerid AND is_main = 'y') AS lul ON lul.CONTRACT_ID = lci.ID LEFT JOIN (SELECT vl.contract_id,SUM(vl.plan_money) plan_money,SUM(vl.allfact_money) allfact_money,SUM(vl.fee_adjust) fee_adjust,SUM(vl.overmoney) overmoney FROM vi_lc_fund_plan vl WHERE vl.pay_type = 'pay_type_out' AND vl.fee_type NOT IN ('feetype16', 'feetype17') GROUP BY vl.contract_id) vlfp ON vlfp.contract_id = lci.ID LEFT JOIN (SELECT contract_id,SUM(IFNULL(fact_money, 0)) + SUM(IFNULL(fee_adjust, 0)) AS allfact_money FROM lc_fund_income WHERE pay_type = 'pay_type_out' AND roll_back = '0' AND pay_status = 'apply_pass' GROUP BY contract_id) AS lfi ON lfi.contract_id = lci.ID LEFT JOIN user_info AS ui ON lci.PROJECT_MANAGE = ui.userid left join vi_distributor_lines di on lci.distributor_id=di.distributor_no WHERE (lci.contract_status = '21' OR lci.contract_status = '25' OR lci.contract_status = '26')AND lci.BUSINESSTYPE='1' AND lci.PROJECT_MANAGE='"+userId+"' AND IFNULL(lfi.allfact_money, 0) < vlfp.plan_money AND lci.ID NOT IN (SELECT contract_id FROM flow_bussiness_object fbo,flow_object fo WHERE fbo.flow_unid = fo.objectno AND fbo.flow_name = '×ʽ𸶿î' AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0 ";
sql = "select contract_id,CONTRACT_NUMBER,CONTRACT_NO,PROJECT_ID,PRODUCT_ID,PROJECT_NAME,customerid,customername,total,usedlines,relines,plan_money,afact_money,allfact_money,fee_adjust,overmoney,username,customertype,CAR_TYPE from (SELECT lci.ID as contract_id,lci.CONTRACT_NUMBER,lci.CONTRACT_NO,lci.PROJECT_ID,lci.PRODUCT_ID,lci.PROJECT_NAME,lul.customerid,lul.customername,di.total,di.usedlines,di.relines,vlfp.plan_money,IFNULL(lfi.allfact_money, 0) AS afact_money,vlfp.allfact_money,vlfp.fee_adjust,vlfp.overmoney,ui.username,lul.customertype,lci.CAR_TYPE FROM LB_CONTRACT_INFO AS lci LEFT JOIN (SELECT lu.contract_id,ci.customerid,ci.customername,ci.customertype FROM LB_UNION_LESSEE lu,CUSTOMER_INFO ci WHERE lu.CUSTOMER_ID = ci.customerid AND is_main = 'y') AS lul ON lul.CONTRACT_ID = lci.ID LEFT JOIN (SELECT vl.contract_id,SUM(vl.plan_money) plan_money,SUM(vl.allfact_money) allfact_money,SUM(vl.fee_adjust) fee_adjust,SUM(vl.overmoney) overmoney FROM vi_lc_fund_plan vl WHERE vl.pay_type = 'pay_type_out' AND vl.fee_type NOT IN ('feetype16', 'feetype17') GROUP BY vl.contract_id) vlfp ON vlfp.contract_id = lci.ID LEFT JOIN (SELECT contract_id,SUM(IFNULL(fact_money, 0)) + SUM(IFNULL(fee_adjust, 0)) AS allfact_money FROM lc_fund_income WHERE pay_type = 'pay_type_out' AND roll_back = '0' AND pay_status = 'apply_pass' GROUP BY contract_id) AS lfi ON lfi.contract_id = lci.ID LEFT JOIN user_info AS ui ON lci.PROJECT_MANAGE = ui.userid left join vi_distributor_lines di on lci.distributor_id=di.distributor_no WHERE (lci.contract_status = '21' OR lci.contract_status = '25' OR lci.contract_status = '26')AND lci.BUSINESSTYPE='1' AND lci.PROJECT_MANAGE='"+userId+"' AND IFNULL(lfi.allfact_money, 0) < vlfp.plan_money AND lci.ID NOT IN (SELECT contract_id FROM flow_bussiness_object fbo,flow_object fo WHERE fbo.flow_unid = fo.objectno AND fbo.flow_name = '×ʽ𸶿î' AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0 ";
}
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);

View File

@ -36,9 +36,9 @@ public class AppUndoServiceServiceImpl implements AppUndoService {
"flowunid").toString();
String sql = "select PROJECT_ID,CANCLE_DATE,FLOWUNID,CANCLE_RESON from LB_CANCLE_INFO_TEMP where flowunid='"+flowUnid+"' ";
List<Map<String, String>> lgutList = DataOperatorUtil.getDataBySql(sql);
if(lgutList.size()>0){
for (Map<String, String> map : lgutList) {
body.put("PROJECT_ID",map.get("PROJECT_ID"));
body.put("CANCLE_DATE",map.get("CANCLE_DATE"));
body.put("CANCLE_RESON",map.get("CANCLE_RESON"));
body.put("FLOWUNID",map.get("FLOWUNID"));
@ -77,6 +77,7 @@ public class AppUndoServiceServiceImpl implements AppUndoService {
cat.setAttributeValue("CANCLE_DATE", fieldMap.get("CANCLE_DATE") == null ? "" : fieldMap.get("CANCLE_DATE").toString());
cat.setAttributeValue("CANCLE_RESON", fieldMap.get("CANCLE_RESON") == null ? "" : fieldMap.get("CANCLE_RESON").toString());
cat.setAttributeValue("FLOWUNID", fieldMap.get("FLOWUNID") == null ? "" : fieldMap.get("FLOWUNID").toString());
catManage.saveObject(cat);
ReturnMapUtil.setReturnMap(null,
RestfullConstant.baseProperty.get("success").toString(), "");

View File

@ -27,7 +27,7 @@ public class ApplyChangeServiceImpl implements ApplyChangeService{
.readRequestParam(request, "UTF-8");
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
String sql = "select t.product_id,t.project_no,t.project_name,t.customername,t.Identity,t.certid,t.custkind,t.project_manage_name,t.project_dept,t.status_name,t.customertype,t.car_type,t.leas_form,t.operationType,t.certtype,t.subjectid,t.subjectname,t.project_manage from (SELECT lpi.product_id as product_id,lpi.project_no as project_no,lpi.project_name as project_name,ci.customername as customername,getItemName('CertType',ci.certtype) as Identity,ci.certid as certid,getItemName('cust_kind',lpi.project_industry) as custkind,getUserName(project_manage) as project_manage_name,getOrgName(lpi.project_dept) as project_dept,lcs.status_name as status_name,ci.customertype as customertype,lpi.car_type as car_type,lpi.leas_form as leas_form,psl.operationType as operationType,ci.certtype as certtype,lpi.subjectid as subjectid,lpi.subjectname as subjectname,lpi.project_manage as project_manage FROM LB_PROJECT_INFO lpi left join lb_contract_status lcs on lpi.project_status=lcs.status_code LEFT JOIN LB_UNION_LESSEE lult on lpi.id=lult.project_id and lult.is_main='y' and( lult.contract_id is null or lult.contract_id='') LEFT JOIN CUSTOMER_INFO ci on lult.customer_id=ci.customerid left join PRD_SPECIFIC_LIBRARY psl on psl.productid=lpi.product_id where lpi.project_status='13' and (SELECT COUNT(id) FROM lb_contract_info_temp WHERE project_id=lpi.ID)=0 and lpi.businesstype='1' order by lpi.project_no desc) t where project_manage='"+userId+"' ";
String sql = "select t.product_id,t.project_no,t.project_name,t.customername,t.Identity,t.certid,t.custkind,t.project_manage_name,t.project_dept,t.status_name,t.customertype,t.car_type,t.leas_form,t.operationType,t.certtype,t.SubjectId,t.subjectname,t.project_manage from (SELECT lpi.product_id as product_id,lpi.project_no as project_no,lpi.project_name as project_name,ci.customername as customername,getItemName('CertType',ci.certtype) as Identity,ci.certid as certid,getItemName('cust_kind',lpi.project_industry) as custkind,getUserName(project_manage) as project_manage_name,getOrgName(lpi.project_dept) as project_dept,lcs.status_name as status_name,ci.customertype as customertype,lpi.car_type as car_type,lpi.leas_form as leas_form,psl.operationType as operationType,ci.certtype as certtype,lpi.subjectid as SubjectId,lpi.subjectname as subjectname,lpi.project_manage as project_manage FROM LB_PROJECT_INFO lpi left join lb_contract_status lcs on lpi.project_status=lcs.status_code LEFT JOIN LB_UNION_LESSEE lult on lpi.id=lult.project_id and lult.is_main='y' and( lult.contract_id is null or lult.contract_id='') LEFT JOIN CUSTOMER_INFO ci on lult.customer_id=ci.customerid left join PRD_SPECIFIC_LIBRARY psl on psl.productid=lpi.product_id where lpi.project_status='13' and (SELECT COUNT(id) FROM lb_contract_info_temp WHERE project_id=lpi.ID)=0 and lpi.businesstype='1' order by lpi.project_no desc) t where project_manage='"+userId+"' ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
Map<String, Object> body = new HashMap<String, Object>();

View File

@ -40,30 +40,8 @@ public class ApplyGuarantorServiceImpl implements ApplyGuarantorService {
"flowunid").toString();
String sql = "select PROJECT_ID,CONTRACT_ID,ASSUROR,FULLNAME,ASSURE_RELATION,ASSURE_METHOD,CERTTYPE,CERTID,Marital_status,SEX,MOBILE,ADDRESS,PROPERTY_TYPE,OTHER_INCOME,WORKCORP,WORKTEL,TITLE,WORKADD,FLOWUNID from LB_GUARANTEE_UNIT_TEMP where FLOWUNID='"+flowUnid+"' ";
List<Map<String, String>> lgutList = DataOperatorUtil.getDataBySql(sql);
body.put("datas", lgutList);
if(lgutList.size()>0){
for (Map<String, String> map : lgutList) {
body.put("PROJECT_ID",map.get("PROJECT_ID"));
body.put("CONTRACT_ID",map.get("CONTRACT_ID"));
body.put("ASSUROR",map.get("ASSUROR"));
body.put("FULLNAME",map.get("FULLNAME"));
body.put("ASSURE_RELATION",map.get("ASSURE_RELATION"));
body.put("ASSURE_METHOD",map.get("ASSURE_METHOD"));
body.put("CERTTYPE",map.get("CERTTYPE"));
body.put("CERTID",map.get("CERTID"));
body.put("Marital_status",map.get("Marital_status"));
body.put("SEX",map.get("SEX"));
body.put("MOBILE",map.get("MOBILE"));
body.put("ADDRESS",map.get("ADDRESS"));
body.put("PROPERTY_TYPE",map.get("PROPERTY_TYPE"));
body.put("OTHER_INCOME",map.get("OTHER_INCOME"));
body.put("WORKCORP",map.get("WORKCORP"));
body.put("WORKTEL",map.get("WORKTEL"));
body.put("TITLE",map.get("TITLE"));
body.put("WORKADD",map.get("WORKADD"));
body.put("FLOWUNID",map.get("FLOWUNID"));
}
}
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}