添加 发起 请求
This commit is contained in:
parent
f0543cd1c3
commit
398a2086b5
@ -9,7 +9,9 @@ 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.ApplyStartService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.ApplyCancelServiceImpl;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.impl.ApplyStartServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
@ -35,4 +37,22 @@ public class ApplyCancelController {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Path("/start/enable")
|
||||
@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] ApplyCancelController run .................");
|
||||
ARE.getLog().info("[Path] /apply/start/enable" + " run .................");
|
||||
|
||||
ApplyStartService service = new ApplyStartServiceImpl();
|
||||
try {
|
||||
return service.applyStart(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 ApplyStartService {
|
||||
Map<String, Object> applyStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -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 com.amarsoft.are.ARE;
|
||||
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.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck;
|
||||
|
||||
import apx.com.amarsoft.als.apzl.apply.business.start.service.ApplyStartService;
|
||||
|
||||
public class ApplyStartServiceImpl implements ApplyStartService {
|
||||
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");
|
||||
String applyType = fieldMap.get("applytype") == null ? "" : fieldMap
|
||||
.get("applytype").toString();
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("applyResult", "true");
|
||||
if (!StringX.isSpace(applyType)) {
|
||||
if ("BusinessApplyApply".equals(applyType)) {
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap
|
||||
.get("userid").toString();
|
||||
ASUser CurUser = new ASUser(userid, sqlca);
|
||||
|
||||
ARE.getLog().info(
|
||||
"用户:" + CurUser.getUserName() + ", 部门:"
|
||||
+ CurUser.getOrgName() + "请求发起申请!");
|
||||
|
||||
CustomerInfoCheck applyStartEnable = new CustomerInfoCheck();
|
||||
applyStartEnable.setId(CurUser.getOrgID());
|
||||
String result = applyStartEnable.checkDistributorStatus(tx);
|
||||
result = result == null ? "" : result.trim();
|
||||
body.put("applyResult", result);
|
||||
}
|
||||
}
|
||||
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user