新增逾期金额接口,调整放款单数及金额逻辑接口,每天进单数量审批数量接口调整

This commit is contained in:
zhangjun 2020-07-03 17:30:39 +08:00
parent 125401e615
commit f215398407
3 changed files with 93 additions and 8 deletions

View File

@ -61,8 +61,16 @@ public interface ApplyArchiveService {
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> FlowStatistics(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> StatisticsNumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> OverdueAmount(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
}

View File

@ -178,7 +178,6 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
fromCondtion.put("contract_id", contractId);
otherProperty.put("flowunid", flowunid);
DataOperatorUtil.copyJBOSet(LM_APPROVALOPINION_DOC.CLASS_NAME, fromCondtion,LM_APPROVALOPINION_DOC_TEMP.CLASS_NAME, null, otherProperty,null, tx);
}
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
@ -213,7 +212,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
String contractid = fieldMap.get("contractid") == null ? "" : fieldMap.get("contractid").toString();
String sql = "";
sql = "select O.FULLNAME,O.mobile,O.SEX,O.WORKCORP,O.WORKADD,ca.fulladdress,O.EMERGENCY_CONTACT_PERSON from CUSTOMER_PERSON_TEMP O left join CUSTOMER_ADDRESS_TEMP ca on O.customerid=ca.customerid and O.flowunid=ca.flowunid left join CUSTOMER_CERT_TEMP cct on O.customerid=cct.customerid and O.flowunid=cct.flowunid left join LB_PROJECT_INFO_TEMP lpit on lpit.flowunid=O.flowunid where O.flowunid='"+flowunid+"' and O.customerid='"+contractid+"' ";
sql = "select O.FULLNAME,O.mobile,O.SEX,O.WORKCORP,O.WORKADD,ca.fulladdress,O.EMERGENCY_CONTACT_PERSON from CUSTOMER_PERSON_TEMP O left join CUSTOMER_ADDRESS_TEMP ca on O.customerid=ca.customerid and O.flowunid=ca.flowunid where O.flowunid='"+flowunid+"' ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
Map<String, Object> body = new HashMap<String, Object>();
@ -245,11 +244,9 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
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("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
String contractid = fieldMap.get("contractid") == null ? "" : fieldMap.get("contractid").toString();
String sql = "";
sql = "select sum(lf.fact_money) lfitmoney,count(di.F_I_TYPE) lfitnumber from distributor_info di left join lb_project_info lpi on lpi.distributor_id=di.distributor_no left join PRD_SPECIFIC_LIBRARY ps on ps.productid = lpi.product_id left join LC_FUND_INCOME_TEMP lf on lf.project_id=lpi.id left join FLOW_task ft on ft.objectno=lf.flowunid left join FLOW_OBJECT fo on fo.objectno=lf.flowunid where lf.EBANK_STATUS='05' and fo.flowname='实际付款流程(汽车)' and fo.phasename='结束' and ft.phasename='结束' group by date(lf.fact_date),di.F_I_TYPE,di.PROVINCES,di.DISTRIBUTOR_ADDRESS,di.distributor_name,ps.specificname";
//sql = "select sum(lf.fact_money) lfitmoney,count(di.F_I_TYPE) lfitnumber from distributor_info di left join lb_project_info lpi on lpi.distributor_id=di.distributor_no left join PRD_SPECIFIC_LIBRARY ps on ps.productid = lpi.product_id left join LC_FUND_INCOME_TEMP lf on lf.project_id=lpi.id left join FLOW_task ft on ft.objectno=lf.flowunid left join FLOW_OBJECT fo on fo.objectno=lf.flowunid where lf.EBANK_STATUS='05' and fo.flowname='实际付款流程(汽车)' and fo.phasename='结束' and ft.phasename='结束' group by date(lf.fact_date),di.F_I_TYPE,di.PROVINCES,di.DISTRIBUTOR_ADDRESS,di.distributor_name,ps.specificname";
sql = "SELECT lf.fact_date,lf.contract_id,sum(lf.fact_money) as lfitmoney,count(*) as lfitnumber FROM lc_fund_income lf left join lb_contract_info lc on lc.id=lf.contract_id WHERE lf.pay_status='have_paid' AND lf.ebank_status='05' and lf.fact_date between DATE_ADD(now(),INTERVAL -12 month ) and now() group by lc.distributor_id ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
Map<String, Object> body = new HashMap<String, Object>();
@ -308,6 +305,27 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}
//获取不同流程数量统计 -------未使用
@Override
public Map<String, Object> FlowStatistics(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 sql = "";
sql = "select inputdate,flowno,ifnull(max(apply),0) as applyNum,ifnull(max(audit),0) as auditNum,flowname from (select flowno, count(1) as apply, null as audit,flowname,inputdate from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') group by flowno union all select flowno, null as apply , count(1) as audit,flowname,inputdate from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') and phaseno = '1000' group by flowno ) t group by t.flowno;";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
if(dataList.size()>0){
Map<String, Object> body = new HashMap<String, Object>();
body.put("datas", dataList);
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未有进单合同!!!");
return ReturnMapUtil.getReturnMap();
}
}
//获取每天进单及审批数量数据
@Override
public Map<String, Object> StatisticsNumber(HttpServletRequest request, HttpServletResponse response,
@ -316,7 +334,9 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
.readRequestParam(request, "UTF-8");
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
String sql = "";
sql = "select flowno,ifnull(max(apply),0) as applyNum,ifnull(max(audit),0) as auditNum from (select flowno, count(1) as apply, null as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') group by flowno union all select flowno, null as apply , count(1) as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') and phaseno = '1000' group by flowno ) t group by t.flowno; ";
//sql = "select flowno,ifnull(max(apply),0) as applyNum,ifnull(max(audit),0) as auditNum from (select flowno, count(1) as apply, null as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') group by flowno union all select flowno, null as apply , count(1) as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') and phaseno = '1000' group by flowno ) t group by t.flowno; ";
//sql = "select ved.every_day,IFNULL(FBO1.INPUT_NUM ,0) inputnum,IFNULL(FT1.SP_NUM,0) spnum FROM vi_every_day ved LEFT JOIN (SELECT DATE_FORMAT(ft.begintime,'%Y/%m/%d') TIME_DAY,COUNT(FBO.INPUTTIME) AS INPUT_NUM FROM FLOW_BUSSINESS_OBJECT FBO LEFT JOIN (SELECT MIN(begintime) as begintime, objectno, phaseno FROM flow_task WHERE flowname='业务申请流程' AND phaseno ='0030' GROUP BY objectno) as ft ON FBO.flow_unid=ft.objectno WHERE FBO.FLOW_NAME='业务申请流程' AND ft.phaseno ='0030' GROUP BY TIME_DAY)FBO1 ON FBO1.TIME_DAY=VED.EVERY_DAY LEFT JOIN (SELECT LEFT(ENDTIME,10) AS ENDTIME ,COUNT(ENDTIME) SP_NUM FROM FLOW_TASK WHERE FLOWNAME='业务申请流程' AND (PHASENAME='否决' OR PHASENAME='结束') GROUP BY LEFT(ENDTIME,10))FT1 ON FT1.ENDTIME=VED.EVERY_DAY where every_day between DATE_ADD(now(),INTERVAL -30 DAY ) and now();";
sql = "select ved.every_day,IFNULL(FBO1.INPUT_NUM ,0) inputnum,IFNULL(FT1.SP_NUM,0) spnum FROM vi_every_day ved LEFT JOIN (SELECT DATE_FORMAT(ft.begintime,'%Y/%m/%d') TIME_DAY,COUNT(FBO.INPUTTIME) AS INPUT_NUM FROM FLOW_BUSSINESS_OBJECT FBO LEFT JOIN (SELECT MIN(begintime) as begintime, objectno, phaseno FROM flow_task WHERE flowname='业务申请流程' AND phaseno ='0030' GROUP BY objectno) as ft ON FBO.flow_unid=ft.objectno WHERE FBO.FLOW_NAME='业务申请流程' AND ft.phaseno ='0030' GROUP BY TIME_DAY)FBO1 ON FBO1.TIME_DAY=VED.EVERY_DAY LEFT JOIN (SELECT LEFT(ENDTIME,10) AS ENDTIME ,COUNT(ENDTIME) SP_NUM FROM FLOW_TASK WHERE FLOWNAME='业务申请流程' AND (PHASENAME='否决' OR PHASENAME='结束') GROUP BY LEFT(ENDTIME,10))FT1 ON FT1.ENDTIME=VED.EVERY_DAY where every_day between DATE_ADD(now(),INTERVAL -30 DAY ) and now(); ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
if(dataList.size()>0){
Map<String, Object> body = new HashMap<String, Object>();
@ -324,7 +344,28 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "今天还未有进单合同!!!");
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未有进单合同!!!");
return ReturnMapUtil.getReturnMap();
}
}
//获取逾期金额数量数据
@Override
public Map<String, Object> OverdueAmount(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 sql = "";
sql = "select t.plan_date,t.rent,t.contract_id,sum(t.residue_rent) as residue_rent from (select lrp.plan_date,lrp.rent,lrp.contract_id,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent from lc_rent_plan lrp left join lc_rent_income lri on lri.plan_id=lrp.id WHERE lrp.plan_date <NOW() group by lrp.id ) t where t.residue_rent>=0 group by t.plan_date order by t.plan_date desc limit 0,30 ";
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
if(dataList.size()>0){
Map<String, Object> body = new HashMap<String, Object>();
body.put("datas", dataList);
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未有进单合同!!!");
return ReturnMapUtil.getReturnMap();
}

View File

@ -583,6 +583,42 @@ public class ApplyChangeController {
return ReturnMapUtil.rollback(e);
}
}
//获取不同流程数量统计 -------未使用
@Path("/flow/statistics")
@POST
public Map<String, Object> FlowStatistics(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] ApplyChangeController run .................");
ARE.getLog().info("[Path] /change/flow/statistics" + " run .................");
ApplyArchiveService service = new ApplyArchiveServiceImpl();
try {
return service.FlowStatistics(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
//获取逾期金额数据
@Path("/overdue/amount")
@POST
public Map<String, Object> OverdueAmount(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] ApplyChangeController run .................");
ARE.getLog().info("[Path] /change/overdue/amount" + " run .................");
ApplyArchiveService service = new ApplyArchiveServiceImpl();
try {
return service.OverdueAmount(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
//获取每天进单及审批数量数据
@Path("/statistics/number")
@POST