APP法人自然人接口

This commit is contained in:
yexuan 2018-08-14 15:40:52 +08:00
parent 471f105b9d
commit 26f86a7fa9
3 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package apx.com.amarsoft.als.apzl.apply.business.query.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.query.service.CustomerQueryService;
import apx.com.amarsoft.als.apzl.apply.business.query.service.impl.CustomerQueryServiceImpl;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.util.ReturnMapUtil;
@Path("/customer")
public class CustomerQueryController {
@Path("/query/info")
@POST
public Map<String, Object> info(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] CustomerQueryController run .................");
ARE.getLog().info("[Path] /customer/query/info" + " run .................");
CustomerQueryService service = new CustomerQueryServiceImpl();
try {
return service.info(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
}

View File

@ -0,0 +1,17 @@
package apx.com.amarsoft.als.apzl.apply.business.query.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 CustomerQueryService {
Map<String, Object> info(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
}

View File

@ -0,0 +1,66 @@
package apx.com.amarsoft.als.apzl.apply.business.query.service.impl;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
import apx.com.amarsoft.als.apzl.apply.business.query.service.CustomerQueryService;
import apx.com.amarsoft.als.base.awe.controller.DefaultDoManage;
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
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.util.MultipartDataUtil;
import com.base.util.ReturnMapUtil;
public class CustomerQueryServiceImpl implements CustomerQueryService {
private Map<String, Object> fieldMap;
@SuppressWarnings("unchecked")
public Map<String, Object> info(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();
BusinessCustomerMethod mm = new BusinessCustomerMethod();
String customerId = mm.getCustomerIdByFlowUnid(flowUnid);
BizObjectManager bom = JBOFactory
.getBizObjectManager(CUSTOMER_INFO_TEMP.CLASS_NAME);
String customerType = ((BizObject) bom
.createQuery("customerid=:customerid")
.setParameter("customerid", customerId).getResultList(false))
.getAttribute("CUSTOMERTYPE").toString();
fieldMap.put("flowUnid".toLowerCase(), flowUnid);
fieldMap.put("flowUnid".toUpperCase(), flowUnid);
fieldMap.put("flow_Unid".toLowerCase(), flowUnid);
fieldMap.put("flow_Unid".toUpperCase(), flowUnid);
fieldMap.put("objectno".toLowerCase(), flowUnid);
fieldMap.put("objectno".toUpperCase(), flowUnid);
fieldMap.put("customerid".toLowerCase(), customerId);
fieldMap.put("customerid".toUpperCase(), customerId);
String dono = "";
if ("01".equals(customerType)) {
dono = "AppBusinessApplyInfo3";
} else if ("03".equals(customerType)) {
dono = "AppBusinessApplyInfo2";
}
DefaultDoManage manage = new DefaultDoManage();
manage.setDono(dono);
manage.setFieldMap(fieldMap);
return manage.queryDefaultDo(request, sqlca, tx, ReturnMapUtil);
}
}