添加app的流程提醒数据接口
This commit is contained in:
parent
7c033fb65b
commit
d01c9b37cb
@ -508,6 +508,7 @@
|
||||
apx.com.amarsoft.als.business.change.controller,
|
||||
信息校验
|
||||
apx.com.amarsoft.als.business.verification.controller,
|
||||
apx.com.amarsoft.als.apzl.apply.business.data.controller
|
||||
</param-value>
|
||||
</context-param>
|
||||
对整个webapi进行一些通用处理的过滤器
|
||||
|
||||
@ -552,6 +552,7 @@
|
||||
apx.com.amarsoft.als.business.change.controller,
|
||||
<!-- 信息校验-->
|
||||
apx.com.amarsoft.als.business.verification.controller,
|
||||
apx.com.amarsoft.als.apzl.apply.business.data.controller,
|
||||
</param-value>
|
||||
</context-param>
|
||||
<!-- 对整个webapi进行一些通用处理的过滤器 -->
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.data.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.data.service.BusinessDataService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.data.service.impl.BusinessDataServiceImpl;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.delete.service.BusinessDocDeleteService;
|
||||
import apx.com.amarsoft.als.apzl.apply.business.doc.delete.service.impl.BusinessDocDeleteServiceImpl;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
@Path("/business/data")
|
||||
public class BusinessDataController {
|
||||
|
||||
//»ñÈ¡´ú°ìÊý¾Ý
|
||||
@Path("/flow/number")
|
||||
@POST
|
||||
public Map<String, Object> getFlowDraftNumber(@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] /business/data/flow/number" + " run .................");
|
||||
|
||||
BusinessDataService service = new BusinessDataServiceImpl();
|
||||
try {
|
||||
return service.getFlowDraftNumber(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.data.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 BusinessDataService {
|
||||
Map<String, Object> getFlowDraftNumber(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.data.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.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.business.data.service.BusinessDataService;
|
||||
|
||||
public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFlowDraftNumber(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();
|
||||
String sql = "SELECT 'BusinessApplyFlow' as flowname,COUNT(*) as number FROM flow_object fo, (SELECT objectno,userid FROM flow_task GROUP BY objectno,phaseno HAVING phaseno='0010') ft WHERE fo.objectno=ft.objectno AND fo.phaseno='0010' AND fo.flowno='BusinessApplyFlow' AND ft.userid='"+userId+"' "
|
||||
+ "UNION ALL SELECT 'BContractApproveFlow' as flowname,COUNT(*) as number FROM flow_object fo, (SELECT objectno,userid FROM flow_task GROUP BY objectno,phaseno HAVING phaseno='0010') ft WHERE fo.objectno=ft.objectno AND fo.phaseno='0010' AND fo.flowno='BContractApproveFlow' AND ft.userid='"+userId+"' "
|
||||
+ "UNION ALL SELECT 'FundPaymentCarFlow' as flowname,COUNT(*) as number FROM flow_object fo, (SELECT objectno,userid FROM flow_task GROUP BY objectno,phaseno HAVING phaseno='0010') ft WHERE fo.objectno=ft.objectno AND fo.phaseno='0010' AND fo.flowno='FundPaymentCarFlow' AND ft.userid='"+userId+"' "
|
||||
+ "UNION ALL SELECT 'MortgageFileFlow' as flowname,COUNT(*) as number FROM flow_object fo, (SELECT objectno,userid FROM flow_task GROUP BY objectno,phaseno HAVING phaseno='0010') ft WHERE fo.objectno=ft.objectno AND fo.phaseno='0010' AND fo.flowno='MortgageFileFlow' AND ft.userid='"+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.putIfAbsent(map.get("flowname"), map.get("number"));
|
||||
}
|
||||
}
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user