添加申请数据在业务申请和经销商中流转时间,修改banner图和新闻列表接口
This commit is contained in:
parent
32d5e3f61b
commit
dafc46ee60
@ -123,7 +123,7 @@ public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
sb.append(map.get("contract_no")).append(",");
|
||||
}
|
||||
}
|
||||
if(sb!=null){
|
||||
if(sb.length()>0){
|
||||
message = fullcertid+"该身份证下的"+sb+"合同已经逾期!";
|
||||
}
|
||||
}
|
||||
@ -149,10 +149,10 @@ public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
//message = BeforeApplicationCheckUtil.checkPengYuan(fullname, fullcertid,fullphone, subjectid,asUser,null,sqlca,tx);
|
||||
}
|
||||
if(message==null){
|
||||
body.put("status", "通过");
|
||||
body.put("status", "Y");
|
||||
body.put("message", "");
|
||||
}else{
|
||||
body.put("status", "通过");
|
||||
body.put("status", "N");
|
||||
body.put("message", message);
|
||||
}
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
|
||||
@ -636,5 +636,23 @@ public class ApplyChangeController {
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
//»ñÈ¡ÉóÅúʱ¼ä
|
||||
@Path("/flow/approvaltime")
|
||||
@POST
|
||||
public Map<String, Object> flowApprovalTime(@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/approvaltime" + " run .................");
|
||||
|
||||
ApplyChangeService service = new ApplyChangeServiceImpl();
|
||||
try {
|
||||
return service.flowApprovalTime(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,5 +15,10 @@ public interface ApplyChangeService {
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
Map<String, Object> flowApprovalTime(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@ -37,4 +37,36 @@ public class ApplyChangeServiceImpl implements ApplyChangeService{
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> flowApprovalTime(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String month = fieldMap.get("month") == null ? "" : fieldMap.get("month").toString();
|
||||
String disSql = "SELECT distributor_no FROM distributor_info WHERE orgid=(SELECT belongorg FROM user_info WHERE userid='"+userId+"' )";
|
||||
List<Map<String, String>> disList = DataOperatorUtil.getDataBySql(disSql);
|
||||
if(disList.size()>0){
|
||||
String listSql = "SELECT lci.contract_no contract_no,dis.distributorTime distime,cus.distributorTime custime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' ORDER BY dis.distributorTime DESC ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(listSql);
|
||||
body.put("listdatas", dataList);
|
||||
String averageSql = "SELECT LEFT(lpi.INPUTTIME,7) yearmonth,SUM(dis.distributorTime)/COUNT(lpi.INPUTTIME) averagedistim,SUM(cus.distributorTime)/COUNT(lpi.INPUTTIME) averagecustime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND LEFT(lpi.INPUTTIME,7)<='"+month+"' AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' GROUP BY LEFT(lpi.INPUTTIME,7) ORDER BY LEFT(lpi.INPUTTIME,7) DESC LIMIT 0,6";
|
||||
List<Map<String, String>> averageSqldataList = DataOperatorUtil.getDataBySql(averageSql);
|
||||
body.put("averagedatas", averageSqldataList);
|
||||
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
}else{
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("fail").toString(), "该用户没有找到对应的经销商!");
|
||||
}
|
||||
|
||||
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
@ -55,16 +56,16 @@ public class AppUserLogonController {
|
||||
}
|
||||
}
|
||||
|
||||
@Path("/get/token")
|
||||
@GET
|
||||
public Map<String, Object> getToken(
|
||||
@Path("/get/bannerornews")
|
||||
@POST
|
||||
public Map<String, Object> getBannerOrNews(
|
||||
@Context HttpServletRequest request, @Context Transaction sqlca,@Context JBOTransaction tx)
|
||||
throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info("[CONTROLLER] AppUserLogonController run .................");
|
||||
ARE.getLog().info("[Path] /logon/manager/get/token run .................");
|
||||
try {
|
||||
return loginService.getToken(request, sqlca, tx, ReturnMapUtil);
|
||||
return loginService.getBannerOrNews(request, sqlca, tx, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public interface AppUserLoginService {
|
||||
Map<String, Object> login(@Context HttpServletRequest request,
|
||||
@Context Transaction sqlca, @Context JBOTransaction tx,
|
||||
ReturnMapUtil ReturnMapUtil) throws JBOException;
|
||||
Map<String, Object> getToken(@Context HttpServletRequest request,
|
||||
Map<String, Object> getBannerOrNews(@Context HttpServletRequest request,
|
||||
@Context Transaction sqlca, @Context JBOTransaction tx,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
}
|
||||
|
||||
@ -6,12 +6,15 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import jbo.app.PRD_NODEINFO_CATALOG_APP;
|
||||
import jbo.sys.FLOW_CATALOG;
|
||||
import jbo.sys.FLOW_MODEL;
|
||||
@ -20,7 +23,6 @@ import jbo.sys.USER_ROLE;
|
||||
import apx.com.amarsoft.als.user.logon.service.AppUserLoginService;
|
||||
import cn.bean.Org;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
@ -36,8 +38,11 @@ import com.base.tool.ExpireTool;
|
||||
//import com.base.util.BizObjectUtil;
|
||||
import com.base.util.DES;
|
||||
import com.base.util.DateUtil;
|
||||
import com.base.util.HttpClientUtil;
|
||||
import com.base.util.MD5Util;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.utils.rsa.RSAPublicUtils;
|
||||
|
||||
public class AppUserLoginServiceImpl implements AppUserLoginService {
|
||||
@ -344,21 +349,61 @@ public class AppUserLoginServiceImpl implements AppUserLoginService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getToken(HttpServletRequest request,
|
||||
public Map<String, Object> getBannerOrNews(HttpServletRequest request,
|
||||
Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception{
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
Map<String, Object> fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String date = fieldMap.get("date") == null ? "" : fieldMap.get("date").toString();
|
||||
String type = fieldMap.get("type") == null ? "" : fieldMap.get("type").toString();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("userId",request.getParameter("userid"));
|
||||
param.put("date",request.getParameter("date"));
|
||||
String message = param.toJSONString();
|
||||
param.put("userId",userId);
|
||||
param.put("date",date);
|
||||
String message = param.toString();
|
||||
System.out.println("ÔÎÄ:" + message);
|
||||
String messageEn;
|
||||
messageEn = RSAPublicUtils.encrypt(message);
|
||||
System.out.println("ÃÜÎÄ:" + messageEn);
|
||||
|
||||
String token = RSAPublicUtils.encrypt(message);
|
||||
System.out.println("ÃÜÎÄ:" + token);
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
body.put("token", messageEn);
|
||||
ReturnMapUtil.setReturnMap(body, (String) RestfullConstant.baseProperty
|
||||
.get("SUCCESS".toLowerCase()), "");
|
||||
// body.put("token", token);
|
||||
JsonObject parms=new JsonObject();
|
||||
parms.addProperty("operateTime",date);
|
||||
parms.addProperty("userId", userId);
|
||||
parms.addProperty("token", token);
|
||||
String returnData = HttpClientUtil.getNewsData(type, parms.toString());
|
||||
|
||||
JSONObject json = JSONObject.fromObject(returnData);
|
||||
Map<String, String> data = new HashMap<String, String>();
|
||||
List<Map<String, String>> returnStr = new LinkedList<Map<String,String>>();
|
||||
String code = json.containsKey("code") ? json.getString("code") : "" ;
|
||||
if("200".equals(code)){
|
||||
JSONObject json1 = JSONObject.fromObject(json.get("data"));
|
||||
|
||||
/*JSONArray jsonArray = json1.getJSONArray("list");
|
||||
System.out.println(jsonArray.size());
|
||||
for (Object object2 : jsonArray) {
|
||||
JSONObject jsonObject = (JSONObject) object2;
|
||||
data.put("artTitle", jsonObject.getString("artTitle"));
|
||||
data.put("artDescription", jsonObject.getString("artDescription"));
|
||||
data.put("artImage", jsonObject.getString("artImage"));
|
||||
data.put("artIsHref", jsonObject.getString("artIsHref"));
|
||||
data.put("artLink", jsonObject.getString("artLink"));
|
||||
returnStr.add(data);
|
||||
data.clear();
|
||||
|
||||
}*/
|
||||
//body.put("returnStr", json1.getJSONArray("list"));
|
||||
body.put("returnStr", json1.get("list"));
|
||||
ReturnMapUtil.setReturnMap(body, (String) RestfullConstant.baseProperty
|
||||
.get("SUCCESS".toLowerCase()), "");
|
||||
}else{
|
||||
ReturnMapUtil.setReturnMap(body, (String) RestfullConstant.baseProperty
|
||||
.get("fail".toLowerCase()), "»ñȡʧ°Ü");
|
||||
}
|
||||
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
|
||||
46
src_app_fresh/com/base/util/HttpClientUtil.java
Normal file
46
src_app_fresh/com/base/util/HttpClientUtil.java
Normal file
@ -0,0 +1,46 @@
|
||||
package com.base.util;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
public class HttpClientUtil {
|
||||
|
||||
public static String getNewsData(String type,String parms) throws Exception{
|
||||
String url = "";
|
||||
if("bannerList".equals(type)){
|
||||
url="http://47.94.109.18/apzl/art/bannerList";
|
||||
}else if ("artList".equals(type)){
|
||||
url="http://47.94.109.18:8082/apzl/art/artList";
|
||||
}
|
||||
//创建连接对象
|
||||
HttpClient httpClient = new HttpClient();
|
||||
//创建请求
|
||||
PostMethod method = new PostMethod(url);
|
||||
RequestEntity entity=new StringRequestEntity(parms,"application/json","UTF-8");
|
||||
//设置请求体信息
|
||||
method.setRequestEntity(entity);
|
||||
//设置请求头信息
|
||||
//method.setRequestHeader("APPKEY", "C6C6E17AC153ED8DF8D61207");
|
||||
httpClient.executeMethod(method);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
//获取返回信息
|
||||
InputStream in = method.getResponseBodyAsStream();
|
||||
InputStreamReader isr = new InputStreamReader(in, "UTF-8");
|
||||
char[] b = new char[4096];
|
||||
for(int n; (n = isr.read(b)) != -1;) {
|
||||
sb.append(new String(b, 0, n));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user