Commit a91be29b authored by zhengjiangtao's avatar zhengjiangtao

项目初始化

parent 89de4b99
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea
*.iml
*.settings
*.classpath
*.project
*.springBeans
*.factorypath
target
......@@ -20,6 +20,18 @@ public class CheckInputBusinessResponse {
* 检查项检查id
*/
private Long checkInputitemId;
private Long pointClassifyId;
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public long getPointInputitemId() {
return pointInputitemId;
......
......@@ -3,66 +3,78 @@ package com.yeejoin.amos.patrol.common.core.response;
import java.util.List;
public class PointCheckInfoBusinessRespone {
/**
* 巡检点id
*/
private long id;
/**
* 巡检点名称
*/
private String name;
/**
* 状态1:合格,2:不合格,3:漏检
*/
private String nodeState;
private Long checkId;
/**
* 检查项
*/
private List<CheckInputBusinessResponse> pointInputitems;
/**
* 检查项(新版需要传入items对象)
*/
private List<CheckInputBusinessResponse> items;
public Long getCheckId() {
return checkId;
}
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNodeState() {
return nodeState;
}
public void setNodeState(String nodeState) {
this.nodeState = nodeState;
}
public List<CheckInputBusinessResponse> getPointInputitems() {
return pointInputitems;
}
public void setPointInputitems(List<CheckInputBusinessResponse> pointInputitems) {
this.pointInputitems = pointInputitems;
}
public List<CheckInputBusinessResponse> getItems() {
return items;
}
public void setItems(List<CheckInputBusinessResponse> items) {
this.items = items;
}
/**
* 巡检点id
*/
private long id;
/**
* 巡检点名称
*/
private String name;
/**
* 状态1:合格,2:不合格,3:漏检
*/
private String nodeState;
private Long checkId;
/**
* 检查项
*/
private List<CheckInputBusinessResponse> pointInputitems;
/**
* 检查项(新版需要传入items对象)
*/
private List<CheckInputBusinessResponse> items;
public Long getCheckId() {
return checkId;
}
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNodeState() {
return nodeState;
}
public void setNodeState(String nodeState) {
this.nodeState = nodeState;
}
public List<CheckInputBusinessResponse> getPointInputitems() {
return pointInputitems;
}
public void setPointInputitems(List<CheckInputBusinessResponse> pointInputitems) {
this.pointInputitems = pointInputitems;
}
public List<CheckInputBusinessResponse> getItems() {
return items;
}
public void setItems(List<CheckInputBusinessResponse> items) {
this.items = items;
}
}
......@@ -187,13 +187,13 @@ public class Point extends BasicEntity {
* 归属区域/部门id
*/
@Column(name="charge_dept_id")
private String chargeDeptId = "0";
private String chargeDeptId ;
/**
* 负责人id
*/
@Column(name="charge_person_id")
private String chargePersonId = "0";
private String chargePersonId ;
/**
* 状态:0 未纳入巡检,1 合格;2 不合格;3 漏检
......
......@@ -6,8 +6,8 @@ import java.util.List;
import java.util.Map;
public enum CheckStatusEnum {
QUALIFIED("合格","1",""),
UNQUALIFIED("不合格","2","#DF7400"),
QUALIFIED("正常","1",""),
UNQUALIFIED("异常","2","#DF7400"),
OMISSION("漏检", "3","#FF0000");
/**
......
......@@ -15,7 +15,7 @@ public enum MsgSubscribeTypeEnum {
作业活动推送("taskworkApp", "作业活动", "作业活动移动端推送", false, "default"),
通知公告推送("notifyApp", "通知公告", "通知公告推送", false, "default"),
有检查记录推送("checkRecordPushHavaRecordApp", "检查记录", "有检查记录推送", true, "check"),
不合格记录推送("checkRecordHavaNoPassRecordApp", "不合格记录", "有不合格记录推送", true, "check"),
异常记录推送("checkRecordHavaNoPassRecordApp", "异常记录", "有异常记录推送", true, "check"),
有漏检推送("checkRecordHaveMissRecordApp", "漏检记录", "有漏检才推送", true, "check"),
全部不推送("checkRecordNoPushApp", "全部不推送", "全部不推送", true, "check"),
隐患治理推送("latentDangerApp", "隐患治理", "隐患治理移动端推送", false, "default"),
......
......@@ -8,8 +8,8 @@ import java.util.Map;
public enum PlanTaskDetailStatusEnum {
NOTSTARTED("未开始","0"),
QUALIFIED("合格","1"),
UNQUALIFIED("不合格","2"),
QUALIFIED("正常","1"),
UNQUALIFIED("异常","2"),
OMISSION("漏检","3");
/**
......
......@@ -12,8 +12,8 @@ import java.util.Map;
*/
public enum PointStatusEnum {
UNPLAN("未纳入巡检计划", "0", ""),
QUALIFIED("合格", "1", ""),
UNQUALIFIED("不合格", "2", "#DF7400"),
QUALIFIED("正常", "1", ""),
UNQUALIFIED("异常", "2", "#DF7400"),
OMISSION("漏检", "3", "#FF0000");
/**
......
......@@ -10,7 +10,7 @@ public enum TaskStatisticsTypeEnum {
INSPECTORS("巡检人员",1),
ROUTE("巡检路线",2),
POINT("巡检点",3),
// DEPARTMENT("巡检部门",4),
DEPARTMENT("巡检部门",4),
PLAN("巡检计划",5),
TASKMONTH("任务日期",6),
TASTTIME("任务月份",7);
......
package com.yeejoin.amos.patrol.util;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.common.entity.Constants;
public class CommonResponseUtil
{
public static CommonResponse success()
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
return response;
}
public static CommonResponse success(Object obj)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
response.setDataList(obj);
return response;
}
public static CommonResponse success(Object obj, String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
response.setDataList(obj);
response.setMessage(message);
return response;
}
public static CommonResponse failure()
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
return response;
}
public static CommonResponse failure(String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
response.setMessage(message);
return response;
}
public static CommonResponse failure(Object obj, String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
response.setDataList(obj);
response.setMessage(message);
return response;
}
}
package com.yeejoin.amos.patrol.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
/**
*
* <pre>
* JSON工具类
* </pre>
*
* @author dell
* @version $Id: JSONUtil.java, v 0.1 2017年3月28日 下午9:04:47 dell Exp $
*/
public class JSONUtil
{
private static Gson gson = null;
static
{
gson = new Gson();
}
public static synchronized Gson newInstance()
{
if (gson == null)
{
gson = new Gson();
}
return gson;
}
public static String toJson(Object obj)
{
return gson.toJson(obj);
}
public static <T> T toBean(String json, Class<T> clz)
{
return gson.fromJson(json, clz);
}
public static <T> Map<String, T> toMap(String json, Class<T> clz)
{
Map<String, JsonObject> map = gson.fromJson(json,
new TypeToken<Map<String, JsonObject>>() {
}.getType());
Map<String, T> result = new HashMap<>();
for (String key : map.keySet())
{
result.put(key, gson.fromJson(map.get(key), clz));
}
return result;
}
public static Map<String, Object> toMap(String json)
{
Map<String, Object> map = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
return map;
}
public static <T> List<T> toList(String json, Class<T> clz)
{
JsonArray array = new JsonParser().parse(json).getAsJsonArray();
List<T> list = new ArrayList<>();
for (final JsonElement elem : array)
{
list.add(gson.fromJson(elem, clz));
}
return list;
}
}
package com.yeejoin.amos.patrol.util;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.enums.ValuedEnum;
/**
*
* <pre>
* 操作枚举
* </pre>
*
* @author as-hanshipeng
* @version $Id: QueryOperatorEnum.java, v 0.1 2016-12-10 下午03:07:33 as-hanshipeng Exp $
*/
public final class QueryOperatorEnum extends ValuedEnum
{
private static final long serialVersionUID = -375127751242109017L;
public static final int LESS_VALUE = 1; //小于
public static final int BIGGER_VALUE = 2; //大于
public static final int EQUAL_VALUE = 3; //等于
public static final int LESS_EQUAL_VALUE = 4; // 小于等于
public static final int BIGGER_EQUAL_VALUE = 5; //大于等于
public static final int NOT_EQUAL_VALUE = 6; //不等于
public static final int IN_VALUE = 7; //包含
public static final int LIKE_VALUE = 8; //like
public static final int OR_VALUE = 9; // 或者
public static final int ORDER_VALUE = 10; // 排序
public static final int NOT_IN_VALUE = 11; // 不包含
public static final int IS_VALUE= 12; //是
public static final QueryOperatorEnum LESS = new QueryOperatorEnum("LESS",
1, "<");
public static final QueryOperatorEnum BIGGER = new QueryOperatorEnum(
"BIGGER", 2, ">");
public static final QueryOperatorEnum EQUAL = new QueryOperatorEnum(
"EQUAL", 3, "=");
public static final QueryOperatorEnum LESS_EQUAL = new QueryOperatorEnum(
"LESS_EQUAL", 4, "<=");
public static final QueryOperatorEnum BIGGER_EQUAL = new QueryOperatorEnum(
"BIGGER_EQUAL", 5, ">=");
public static final QueryOperatorEnum NOT_EQUAL = new QueryOperatorEnum(
"NOT_EQUAL", 6, "<>");
public static final QueryOperatorEnum IN = new QueryOperatorEnum("IN", 7,
"IN");
public static final QueryOperatorEnum LIKE = new QueryOperatorEnum("LIKE",
8, "LIKE");
public static final QueryOperatorEnum OR = new QueryOperatorEnum("OR", 9,
"OR");
public static final QueryOperatorEnum ORDER_BY = new QueryOperatorEnum(
"ORDER BY", 10, "ORDER BY");
public static final QueryOperatorEnum NOT_IN = new QueryOperatorEnum(
"NOT IN", 11, "NOT IN");
public static final QueryOperatorEnum IS = new QueryOperatorEnum(
"IS", 12, "IS");
public String condition;
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
protected QueryOperatorEnum(String arg0, int arg1,String condition)
{
super(arg0, arg1);
this.condition = condition;
}
public static QueryOperatorEnum getEnum(String name)
{
try{
return ((QueryOperatorEnum)getEnum(QueryOperatorEnum.class, name));
}catch(Exception ex){return null;}
}
public static QueryOperatorEnum getEnum(int name)
{
try{
return ((QueryOperatorEnum)getEnum(QueryOperatorEnum.class, name));
}catch(Exception ex){return null;}
}
public static Map getMap()
{
try{
return getEnumMap(QueryOperatorEnum.class);
}catch(Exception ex){return null;}
}
public static List getList()
{
try{
return getEnumList(QueryOperatorEnum.class);
}catch(Exception ex){return null;}
}
public static Iterator iterator()
{
try{
return iterator(QueryOperatorEnum.class);
}catch(Exception ex){return null;}
}
}
package com.yeejoin.amos.patrol.util;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
private static Pattern NOT_ZERO_AT_THE_END = Pattern.compile("[1-9]+\\d*[1-9]+");
private static Pattern numericPattern = Pattern.compile("-?[0-9]+\\.?[0-9]*");
/**
* 鍒ゆ柇瀵硅薄鏄惁涓虹┖
*
* @param str
* @return
*/
public static boolean isNotEmpty(Object str) {
boolean flag = true;
if (str != null && !str.equals("")) {
if (str.toString().length() > 0) {
flag = true;
}
} else {
flag = false;
}
return flag;
}
/***************************************************************************
* repeat - 閫氳繃婧愬瓧绗︿覆閲嶅鐢熸垚N娆$粍鎴愭柊鐨勫瓧绗︿覆銆�
*
* @param src
* - 婧愬瓧绗︿覆 渚嬪: 绌烘牸(" "), 鏄熷彿("*"), "娴欐睙" 绛夌瓑...
* @param num
* - 閲嶅鐢熸垚娆℃暟
* @return 杩斿洖宸茬敓鎴愮殑閲嶅瀛楃涓�
* @version 1.0 (2006.10.10) Wilson Lin
**************************************************************************/
public static String repeat(String src, int num) {
StringBuffer s = new StringBuffer();
for (int i = 0; i < num; i++)
s.append(src);
return s.toString();
}
/**
* 鍒ゆ柇鏄惁鏁板瓧琛ㄧず
*
* @param
* @return 鏄惁鏁板瓧鐨勬爣蹇�
*/
public static boolean isNumeric(String str) {
// 璇ユ鍒欒〃杈惧紡鍙互鍖归厤鎵�鏈夌殑鏁板瓧 鍖呮嫭璐熸暟
String bigStr;
try {
bigStr = new BigDecimal(str).toString();
} catch (Exception e) {
return false;//寮傚父 璇存槑鍖呭惈闈炴暟瀛椼��
}
Matcher isNum = numericPattern.matcher(bigStr); // matcher鏄叏鍖归厤
if (!isNum.matches()) {
return false;
}
return true;
}
public static int toInt(String s) {
if (s != null && !"".equals(s.trim())) {
try {
return Integer.parseInt(s);
} catch (Exception e) {
return 0;
}
}
return 0;
}
/**
* 鎴彇鍓嶅悗閮戒笉鏄�0鐨勬暟瀛楀瓧绗︿覆
* <p>
* 12010102 => 12010102
* 12010100 => 120101
* ab1201100b => 12011
*
* @param str
* @return
*/
public static String delEndZero(String str) {
Matcher mat = NOT_ZERO_AT_THE_END.matcher(str);
boolean rs = mat.find();
if (rs) {
return mat.group(0);
}
return null;
}
/**
* <pre>
* 绉婚櫎瀛楃涓插悗闈㈢殑0
* </pre>
*
* @param s
* @return
*/
public static String removeSufixZero(String s) {
if (s == null) {
return "";
}
while (s.endsWith("0")) {
if (s.equals("0")) {
s = "";
break;
}
s = s.substring(0, s.length() - 1);
}
return s;
}
public static String notNull(String s){
return s!=null?s:"";
}
public static boolean isStartWithDigit(String str){
char firstCharacter = str.charAt(0);
return Character.isDigit(firstCharacter);
}
public static void main(String[] args){
System.out.println(isStartWithDigit("a3730e937-17e5-4720-8f69-99e8d87d2ee7"));
}
}
......@@ -252,17 +252,25 @@ public class BaseController {
// }
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
DaoCriteria compDaoCriteria = new DaoCriteria();
DaoCriteria compDaoCriteria = new DaoCriteria();
compDaoCriteria.setPropertyName("userId");
compDaoCriteria.setOperator(QueryOperatorEnum.EQUAL.getName());
compDaoCriteria.setValue(getUserId());
daoCriterias.add(compDaoCriteria);
// 添加子公司下的过滤条件
DaoCriteria childCompDaoCriteria = new DaoCriteria();
childCompDaoCriteria.setPropertyName("orgCode");
childCompDaoCriteria.setOperator(QueryOperatorEnum.LIKE.getName());
childCompDaoCriteria.setValue(orgCode + "*%");
daoCriterias.add(childCompDaoCriteria);
} else {
//管理员
daoCriterias = buildOrgDaoCriteriaInChildren(daoCriterias, orgCode);
}
}
return daoCriterias;
......@@ -288,15 +296,15 @@ public class BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
DaoCriteria compDaoCriteria = new DaoCriteria();
paramMap.put("orgCode", orgCode);
paramMap.put("userId", getUserId());
paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
} else {
//管理员
paramMap.put("orgCode", orgCode);
paramMap.put("roleFlag", XJConstant.DEPART_FLAG);
}
return paramMap;
}
......@@ -318,6 +326,7 @@ public class BaseController {
//一线技术,一线业务只能看自己的
DaoCriteria compDaoCriteria = new DaoCriteria();
paramMap.put("userId", getUserId());
paramMap.put("orgCode", orgCode);
paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
} else {
......
......@@ -81,10 +81,15 @@ public class CatalogTreeController extends BaseController {
map.put("org_code", orgCode);
map.put("user_id", userId);
map.put("param", param);
if(param.getId()>0){
catalogTreeService.addCatalogTree(map);
return CommonResponseUtil.success();
}
List<CatalogTree> catalogTreelist = catalogTreeService.getCatalogListByPid(Long.valueOf(param.getParentId()), orgCode);
catalogTreelist = catalogTreelist.stream().filter(x -> param.getName().equals(x.getName())).collect(Collectors.toList());
if (catalogTreelist.size() == 0) {
catalogTreeService.addCatalogTree(map);
return CommonResponseUtil.success();
} else {
......
......@@ -101,6 +101,7 @@ import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.util.EntityUtils;
@RestController
@RequestMapping(value = "/api/check")
@Api(tags = "巡检记录api")
......@@ -242,9 +243,7 @@ public class CheckController extends BaseController {
if(requestParam.getPlanTaskId()!=null){
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
}
AgencyUserModel user = getUserInfo();
String userId = user.getUserId();
......@@ -296,9 +295,15 @@ public class CheckController extends BaseController {
asyncTask.pushCheckRecordMessage(checkDto.getCheckId(), realName, map);
//推送到风险系统
asyncTask.pushCheckInfoTo3D(checkDto.getCheckId());
//推送首页统计
asyncTask.pushChartResult();
//推送银行首页
//增建已超时,推送
asyncTask.pushChartResulplantask();
// //推送首页统计
// asyncTask.pushChartResult();
if (!CollectionUtils.isEmpty(checkDto.getUnCheckInputList())) {
//取消隐患添加
checkDto.setUnCheckInputList(null);
asyncTask.pushNoPassCheckRecordMessage(checkDto.getCheckId(), realName, map);
}
remoteWebSocketServer.wsDataRefresh("check");
......@@ -489,15 +494,11 @@ public class CheckController extends BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
req.put("userId", getUserId());
req.put("orgCode", loginOrgCode);
} else {
//管理员
req.put("orgCode", loginOrgCode);
}
Map<String, Object> map = checkService.queryRecordByPointId(req);
return CommonResponseUtil.success(map);
}
......@@ -671,8 +672,8 @@ public class CheckController extends BaseController {
dd.setPageSize(pageSize);
dd.setCurrent(current);*/
CommonResponse lis= amosBankFeign.getVideos(pageSize, pageSize, parentId);
CommonResponse lis= amosBankFeign.getVideos(getSelectedOrgInfo().getCompany().getOrgCode(),current, pageSize, parentId);
String resultString = "";
resultString = JSONObject.toJSONString(lis);
......
......@@ -28,8 +28,6 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
......@@ -50,7 +48,6 @@ public class CommonController extends BaseController {
@ApiOperation(value = "任务统计口径类型", notes = "任务统计口径类型")
@RequestMapping(value = "/taskgetStatisticsType", method = RequestMethod.GET)
public CommonResponse getTaskStatisticsType() {
return CommonResponseUtil.success(TaskStatisticsTypeEnum.getEnumList());
}
......
......@@ -44,6 +44,72 @@ public class GroupController extends BaseController {
@Autowired
private RemoteSecurityService remoteSecurityService;
/**
* 部门查询
*
* @return
*/
@ApiOperation(value = "获取当前用户所属公司的所有部门", notes = "获取当前用户所属公司的所有部门")
@RequestMapping(value = "/queryDept1", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryCurrentCompanyDept1() {
ReginParams reginParams = getSelectedOrgInfo();
String dep = reginParams.getCompany().getSequenceNbr();
List<DepartmentModel> departmentModels =null;
//判断当前登录用
if(reginParams.getDepartment()==null){
departmentModels = remoteSecurityService.listDepartmentsByCompanyId(getToken(), getProduct(), getAppKey(), dep);
}else{
departmentModels = remoteSecurityService.listDepartmentsByCompanyId1(getToken(), getProduct(), getAppKey(), reginParams.getDepartment().getSequenceNbr());
}
List<DepartmentBo> departmentBos = ModelToBo(departmentModels);
if(reginParams.getDepartment()!=null){
DepartmentBo ddd=new DepartmentBo();
ddd.setSequenceNbr(reginParams.getDepartment().getSequenceNbr());
ddd.setDepartmentName(reginParams.getDepartment().getDepartmentName());
departmentBos.add(ddd);
}
return CommonResponseUtil.success(departmentBos);
}
/**
* 部门查询
*
* @return
*/
@ApiOperation(value = "获取当前用户所属公司的所有部门", notes = "获取当前用户所属公司的所有部门")
@RequestMapping(value = "/queryDept2", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryCurrentCompanyDept2() {
ReginParams reginParams = getSelectedOrgInfo();
String dep = reginParams.getCompany().getSequenceNbr();
List<DepartmentModel> departmentModels =null;
//判断当前登录用
departmentModels = remoteSecurityService.listDepartmentsByCompanyId(getToken(), getProduct(), getAppKey(), dep);
List<DepartmentBo> departmentBos = ModelToBo(departmentModels);
return CommonResponseUtil.success(departmentBos);
}
/**
* 部门查询
......@@ -53,43 +119,32 @@ public class GroupController extends BaseController {
@ApiOperation(value = "获取当前用户所属公司的所有部门", notes = "获取当前用户所属公司的所有部门")
@RequestMapping(value = "/queryDept", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryCurrentCompanyDept() {
// String loginOrgCode = getLoginOrgCode();
// String[] orgs = loginOrgCode.split("\\*");
// List<SDepartment> list = groupService.findByCompanyId(Long.parseLong(orgs[orgs.length - 1]));
// List<LinkedHashMap<String, Object>> res = new ArrayList<>();
// for (SDepartment d : list) {
// LinkedHashMap<String, Object> dept = new LinkedHashMap<>();
// dept.put("id", d.getId());
// dept.put("key", d.getId());
// dept.put("value", d.getId());
// dept.put("state", "open");
// dept.put("type", "department");
// dept.put("orgCode", loginOrgCode+"-"+d.getDepmCode());
// dept.put("label", d.getDepartmentName());
// dept.put("title", d.getDepartmentName());
// dept.put("name", d.getDepartmentName());
// dept.put("writeable", 0);
// res.add(dept);
// }
// LinkedHashMap<String, Object> dept = new LinkedHashMap<>();
// dept.put("id", -1);
// dept.put("key", -1);
// dept.put("value", -1);
// dept.put("state", "close");
// dept.put("type", "department");
// dept.put("label", "其他");
// dept.put("title", "其他");
// dept.put("name", "其他");
// dept.put("writeable", 0);
// res.add(dept);
// return CommonResponseUtil.success(res);
ReginParams reginParams = getSelectedOrgInfo();
String dep = reginParams.getCompany().getSequenceNbr();
List<DepartmentModel> departmentModels = remoteSecurityService.listDepartmentsByCompanyId(getToken(), getProduct(), getAppKey(), dep);
List<DepartmentBo> departmentModels1=new ArrayList<>();
List<DepartmentBo> departmentBos = ModelToBo(departmentModels);
return CommonResponseUtil.success(departmentBos);
//判断当前登录用
if(reginParams.getDepartment()==null){
departmentModels1=departmentBos;
}else{
for (DepartmentBo departmentModel : departmentBos) {
if(departmentModel.getDepartmentName().equals(reginParams.getDepartment().getDepartmentName())){
departmentModels1.add(departmentModel);
}
}
}
return CommonResponseUtil.success(departmentModels1);
}
//
// /**
......
......@@ -99,6 +99,11 @@ public class InputItemController extends BaseController {
@RequestMapping(value = "/queryItem", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryItemDetail(@ApiParam(value = "巡检项ID") @RequestParam(required = true) Long itemID) {
InputItem bo = inputItemService.queryInputItemDetail(itemID);
if("-0".equals(bo.getLevel())){
bo.setLevel(null);
}
return CommonResponseUtil.success(bo);
}
......@@ -239,7 +244,13 @@ public class InputItemController extends BaseController {
@ApiParam(value = "组合查询条件", required = false, defaultValue = "[]") @RequestBody(required = false) List<CommonRequest> queryRequests) {
// 组织数据权限过滤条件,基础数据不管roleType,全按照选择的公司orgCode过滤
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
//String loginOrgCode = getLoginOrgCode(reginParams);
//放在公司级别
String loginOrgCode =reginParams.getCompany().getOrgCode();
List<InputItem> list = null;
if (ObjectUtils.isEmpty(queryRequests)) {
......@@ -249,11 +260,11 @@ public class InputItemController extends BaseController {
for (CommonRequest quest : queryRequests) {
if (quest.getName().equals("level")) {
if (StringUtil.isNotEmpty(quest.getValue())) {
if (quest.getValue().toString().equals("-0")) { //如果前台传过来等级条件为-0,数据库则存储为空
level = null;
} else {
// if (quest.getValue().toString().equals("-0")) { //如果前台传过来等级条件为-0,数据库则存储为空
// level = null;
// } else {
level = quest.getValue().toString();
}
// }
}
}
......
package com.yeejoin.amos.patrol.service.business.controller;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
//import com.yeejoin.amos.op.core.common.response.CommonResponse;
//import com.yeejoin.amos.op.core.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.common.core.request.CommonPageable;
......@@ -12,6 +13,8 @@ import com.yeejoin.amos.patrol.service.business.service.intfc.IPlanService;
import com.yeejoin.amos.patrol.service.business.util.PlanPageParamUtil;
import com.yeejoin.amos.patrol.service.constants.XJConstant;
import com.yeejoin.amos.patrol.service.framework.ReginParams;
import com.yeejoin.amos.patrol.service.remote.RemoteSecurityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -36,7 +39,8 @@ public class PlanController extends BaseController {
@Autowired
private IPlanService planService;
@Autowired
private RemoteSecurityService remoteSecurityService;
/**
* 巡检计划查询
*/
......@@ -70,8 +74,24 @@ public class PlanController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("org_code", loginOrgCode);
String OrgCode =null;
map.put("user_id", userId);
//根据部门id 获取部门orgcode
if(param.getDeptId()!=null){
DepartmentModel departmentModel = remoteSecurityService.getDepartmentByDeptId(getToken(),getProduct(),getAppKey(), param.getDeptId());
if(departmentModel!=null){
OrgCode =departmentModel.getOrgCode();
}
}
if(OrgCode!=null){
map.put("org_code", OrgCode);
}else{
map.put("org_code", loginOrgCode);
}
map.put("param", param);
planService.addPlan(map);
return CommonResponseUtil.success();
......
......@@ -198,11 +198,14 @@ public class PlanTaskController extends BaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
try {
log.error("定时任务开始生成巡检计划==================================");
planTaskService.taskExecution(null);
log.error("定时任务生成巡检计划成功====================================");
return CommonResponseUtil.success();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
log.error("定时任务生成巡检计划失败==============================");
return CommonResponseUtil.failure();
}
}
......@@ -240,7 +243,8 @@ public class PlanTaskController extends BaseController {
try {
HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
//String loginOrgCode = getLoginOrgCode(reginParams);
String loginOrgCode =reginParams.getCompany().getOrgCode();
params.put("orgCode", loginOrgCode);
String pointNo = serial;
params.put("pointNo", pointNo);
......@@ -385,7 +389,16 @@ public class PlanTaskController extends BaseController {
point1.setUsuallyShot(point.getUsuallyShot()) ;
point1.setChargeDeptId(point.getChargeDeptId()) ;
point1.setChargePersonId(point.getChargePersonId()) ;
response.put("checkItem", inputItems);
List<PointClassify> catalogs = new ArrayList<>();
catalogs = pointService.queryPointClassify(pointId);
......@@ -430,7 +443,7 @@ public class PlanTaskController extends BaseController {
@ApiParam(value = "分页参数", required = false, defaultValue = "current=0&pageSize=10或pageNumber0&pageSize=10") CommonPageable pageable) {
HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode( reginParams);
String loginOrgCode = getLoginOrgCode(reginParams);
String roleTypeName = getRoleTypeName(reginParams);
params = PlanTaskPageParamUtil.fillPlanTask(queryRequests, params);
......@@ -438,13 +451,11 @@ public class PlanTaskController extends BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
params.put("userId", getUserId());
params.put("orgCode", loginOrgCode);
} else {
//二线技术
params.put("orgCode", loginOrgCode);
}
params.put("pageSize", pageable.getPageSize());
params.put("offset", pageable.getPageNumber() * pageable.getPageSize());
if (ObjectUtils.isEmpty(params.get("orderBy"))) {
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.service.business.controller;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
//import com.yeejoin.amos.op.core.common.query.DaoCriteria;
//import com.yeejoin.amos.op.core.common.response.CommonResponse;
//import com.yeejoin.amos.op.core.util.CommonResponseUtil;
......@@ -94,7 +95,19 @@ public class PointController extends BaseController {
try {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
pointParam.getPoint().setOrgCode(loginOrgCode); //点归属于公司
//根据选择的部门获取orgcode
Point point1 = pointParam.getPoint();
DepartmentModel departmentModel = remoteSecurityService.getDepartmentByDeptId(getToken(),getProduct(),getAppKey(), point1.getChargeDeptId());
if(departmentModel!=null){
point1.setOrgCode(departmentModel.getOrgCode());
pointParam.setPoint(point1);
}else{
pointParam.getPoint().setOrgCode(loginOrgCode); //点归属于公司
}
pointParam.getPoint().setCreatorId(user.getUserId());
//默认值防止报错
pointParam.getPoint().setOriginalId("0");
......@@ -160,6 +173,16 @@ public class PointController extends BaseController {
@PutMapping(value = "/updatePoint", produces = "application/json;charset=UTF-8")
public CommonResponse updatePoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) {
try {
//根据选择的部门获取orgcode
Point point1 = pointParam.getPoint();
DepartmentModel departmentModel = remoteSecurityService.getDepartmentByDeptId(getToken(),getProduct(),getAppKey(), point1.getChargeDeptId());
if(departmentModel!=null){
point1.setOrgCode(departmentModel.getOrgCode());
pointParam.setPoint(point1);
}
Point point = iPointService.updatePoint(pointParam);
List<Long> ids = new ArrayList<>();
ids.add(point.getId());
......@@ -279,7 +302,10 @@ public class PointController extends BaseController {
public CommonResponse exportTemplate(HttpServletResponse response) {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
//String loginOrgCode = getLoginOrgCode(reginParams);
//放到公司级
String loginOrgCode =reginParams.getCompany().getOrgCode();
String fileName = "巡检点导入模板"; //模板名称
String[] handers = {"点编号(必填)", "点名称(必填)", "是否为移动点", "计划外巡检是否评分", "是否允许离线巡检", "参考地址", "3维地图坐标", "3维地图楼层", "最少拍照数量", "最多拍照数量", "风险等级(必填)", "备注说明", "所属分类目录", "检查项目", "是否室内"}; //列标题
List<String[]> downData = new ArrayList();
......@@ -330,7 +356,9 @@ public class PointController extends BaseController {
HttpServletResponse response) {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getLoginOrgCode(reginParams);
// String orgCode = getLoginOrgCode(reginParams);
//公司级
String orgCode =reginParams.getCompany().getOrgCode();
try {
PointImportQueryParam pointImportQueryParam = PointParamUtils.fillPointImportQuery(queryRequests);
pointImportQueryParam.setOrgCode(orgCode);
......@@ -340,7 +368,8 @@ public class PointController extends BaseController {
} else if (exportType == 1) {
FileHelper.exportQRCode(pointList, "巡检点二维码", response);
}
return CommonResponseUtil.success("导出成功");
return null;
// return CommonResponseUtil.success("导出成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检点信息失败");
......@@ -382,7 +411,9 @@ public class PointController extends BaseController {
@ApiParam(value = "分页参数", required = true, defaultValue = "pageNumber=0&pageSize=10") CommonPageable commonPageable) {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getLoginOrgCode(reginParams);
//点放到公司下
//String orgCode = getLoginOrgCode(reginParams);
String orgCode = reginParams.getCompany().getOrgCode();
try {
CommonRequest commonRequest = new CommonRequest();
commonRequest.setName("orgCode");
......@@ -425,7 +456,9 @@ public class PointController extends BaseController {
@ApiParam(value = "巡检点名称", required = false) @RequestParam("name") String name) {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getLoginOrgCode(reginParams);
//公司级别
// String orgCode = getLoginOrgCode(reginParams);
String orgCode = reginParams.getCompany().getOrgCode();
try {
List<HashMap<String, Object>> list = iPointService.findPointList(code, name, orgCode);
return CommonResponseUtil.success(list);
......@@ -565,6 +598,7 @@ public class PointController extends BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
params.put("userId", getUserId());
params.put("orgCode", loginOrgCode);
} else {
//二线技术
......@@ -593,6 +627,7 @@ public class PointController extends BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
params.put("userId", getUserId());
params.put("orgCode", loginOrgCode);
} else {
//二线技术
......
......@@ -305,7 +305,6 @@ public class RouteController extends BaseController {
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
//一线技术,一线业务只能看自己的
userId = userModel.getUserId();
} else {
//二线技术
loginOrgCode = reginParams.getCompany().getOrgCode();
......@@ -316,6 +315,7 @@ public class RouteController extends BaseController {
List<HashMap<String, Object>> routeList = routeService.queryRouteListByOrgCode(loginOrgCode, userId, departmentId);
return CommonResponseUtil.success(routeList);
} catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure(e.getMessage());
}
}
......@@ -331,7 +331,9 @@ public class RouteController extends BaseController {
try {
String uid = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getLoginOrgCode(reginParams);
//公司 级别
// String loginOrgCode = getLoginOrgCode(reginParams);
String loginOrgCode =reginParams.getCompany().getOrgCode();
HashMap<String, Object> reqParam = new HashMap<>();
reqParam.put("orgCode", loginOrgCode);
RoutePageParamUtil.fillRouteInfo(queryRequests, reqParam);
......
......@@ -380,11 +380,9 @@ public class SafetyPreCtrlController extends BaseController {
String roleTypeName = getRoleTypeName(reginParams);
HashMap<String, Object> paramMap = buildMybatisDaoCriterias(loginOrgCode, roleTypeName);
CheckPtListPageParam params = CheckPageParamUtil.fillChkPtParam(queryRequests, null, paramMap);
List<PlanRoutePointBo> checkChkExListBo = checkService.getRoutePlanPointList(params);
List<PlanRoutePointBo> checkChkExListBo = checkService.getRoutePlanPointList(params);
return CommonResponseUtil.success(checkChkExListBo);
}
......
......@@ -479,6 +479,7 @@ public class TaskController extends BaseController {
//一线技术,一线业务只能看自己的
request.put("executorId", getUserId());
request.put("publisher", getUserId());
request.put("orgCode", orgCode);
} else {
//二线技术
......@@ -536,6 +537,7 @@ public class TaskController extends BaseController {
//一线技术,一线业务只能看自己的
request.put("executorId", getUserId());
request.put("publisher", getUserId());
request.put("orgCode", orgCode);
} else {
//二线技术
......@@ -676,7 +678,7 @@ public class TaskController extends BaseController {
// }
if (XJConstant.CCPC_PERSONAL.equals(roleTypeName)) {
return CommonResponseUtil.success(resp);
}
}
if (!ObjectUtils.isEmpty(reginParams.getDepartment())) {
params.put("departmentId", departmentId);
Map<String, Object> deptResp = taskService.getTaskForAppPie(params);
......
......@@ -9,13 +9,13 @@ import java.util.List;
@Repository("inputItemDao")
public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "select * from p_input_item where org_code = ?1 and level = ?2 and is_delete =0", nativeQuery = true)
@Query(value = "select * from p_input_item where org_code LIKE CONCAT( ?1,'%') and level = ?2 and is_delete =0", nativeQuery = true)
public List<InputItem> findByLevel(String orgCode, String level);
@Query(value = "select * from p_input_item where org_code = ?1 and level is null and is_delete =0", nativeQuery = true)
@Query(value = "select * from p_input_item where org_code LIKE CONCAT( ?1,'%') and level is null and is_delete =0", nativeQuery = true)
public List<InputItem> findByLevelNull(String orgCodel);
@Query(value = "select * from p_input_item where org_code = ?1 and is_delete =0", nativeQuery = true)
@Query(value = "select * from p_input_item where org_code LIKE CONCAT( ?1,'%') and is_delete =0", nativeQuery = true)
public List<InputItem> findAllByLevel(String orgCode);
InputItem findByOriginalId(String originalId);
......
......@@ -25,4 +25,6 @@ public interface IPointDao extends BaseDao<Point, Long> {
@Query(value = "select * from p_point where original_id in ?1 and is_delete =0", nativeQuery = true)
List<Point> listByOriginalIds(List<String> originalIds);
@Query(value = "SELECT * FROM p_point p WHERE is_delete = 0 AND p.point_no = (?1) AND p.org_code like CONCAT(?2,'%')", nativeQuery = true)
Point findByOrgCodeAndPointNo(String pointNo, String orgCode);
}
......@@ -82,7 +82,7 @@ public class AppServiceImpl implements IAppService {
|| type.equals(MsgSubscribeTypeEnum.计划漏检推送)) {
msgSub.setAttribute1("False");
msgSub.setAttribute2("10");
} else if (type.equals(MsgSubscribeTypeEnum.不合格记录推送)) {
} else if (type.equals(MsgSubscribeTypeEnum.异常记录推送)) {
msgSub.setAttribute1("True");
} else {
msgSub.setAttribute1("False");
......
......@@ -152,9 +152,7 @@ public class CatalogTreeServiceImpl implements ICatalogTreeService {
userIds = String.join(",", list1);
List<AgencyUserModel> listd = remoteSecurityService.listUserByUserIds(toke, product, appKey, userIds);
//新安全
content.forEach(s -> {
......@@ -171,9 +169,6 @@ public class CatalogTreeServiceImpl implements ICatalogTreeService {
if (s.get("createBy").toString().equals(s1.getUserId())) {
s.put("createName", s1.getUserName());
}
});
}
});
......
......@@ -390,7 +390,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
//2.4.删除今天可能重做生成的数据(计划重做后进行了计划的编辑)
if (iplanTaskDao.findById(plan.getPlanTaskId()) != null && plan.getFirstFlag() == XJConstant.PLAN_FIRST_STATUS_YES)
iplanTaskDao.deleteById(plan.getPlanTaskId());
if(iplanTaskDao.existsById(plan.getPlanTaskId())){
iplanTaskDao.deleteById(plan.getPlanTaskId());
}
//2.5.插入planTask及planTaskDetail
insertPlanTaskAndDet(list, plan, XJConstant.SCHED_FLAG, now);
......
......@@ -194,7 +194,17 @@ public class PointServiceImpl implements IPointService {
point.setIsScore(param.getIsScore());
// point.setLatitude(param.getLatitude());
// point.setLongitude(param.getLongitude());
point.setLevel(param.getLevel());
if(param.getLevel()!=null){
point.setLevel(param.getLevel().substring(0, 1));
}
point.setName(param.getName());
point.setOffline("1".equals(param.getOffline()) ? true : false);
point.setPointNo(param.getPointNo());
......@@ -872,22 +882,23 @@ public class PointServiceImpl implements IPointService {
@Override
public Point queryPointByPointNo(HashMap<String, Object> params) {
return iPointDao.findOne(new Specification<Point>() {
@Override
public Predicate toPredicate(Root<Point> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
List<Predicate> predicate = new ArrayList<>();
if (!ObjectUtils.isEmpty(params.get("pointNo"))) {
predicate.add(cb.equal(root.get("pointNo").as(String.class), params.get("pointNo")));
}
if (!ObjectUtils.isEmpty(params.get("orgCode"))) {
predicate.add(cb.equal(root.get("orgCode").as(String.class), params.get("orgCode").toString()));
}
Predicate[] pre = new Predicate[predicate.size()];
return query.where(predicate.toArray(pre)).getRestriction();
}
}).get();
Point point = iPointDao.findByOrgCodeAndPointNo(params.get("pointNo").toString(), params.get("orgCode").toString());
return point;
// return iPointDao.findOne(new Specification<Point>() {
//
// @Override
// public Predicate toPredicate(Root<Point> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
// List<Predicate> predicate = new ArrayList<>();
// if (!ObjectUtils.isEmpty(params.get("pointNo"))) {
// predicate.add(cb.equal(root.get("pointNo").as(String.class), params.get("pointNo")));
// }
// if (!ObjectUtils.isEmpty(params.get("orgCode"))) {
// predicate.add(cb.like(root.get("orgCode").as(String.class), params.get("orgCode").toString() + "%"));
// }
// Predicate[] pre = new Predicate[predicate.size()];
// return query.where(predicate.toArray(pre)).getRestriction();
// }
// }).get();
}
@Override
......
......@@ -128,32 +128,56 @@ public class QueryStatsServiceImpl implements IQueryStatsService {
List<Map<String, Object> > listmap=new ArrayList<Map<String, Object> >();
List<StatisticPieBo> levelBoListdate=new ArrayList<StatisticPieBo>();
if(list!=null&&list.size()>0){
for (int i = 0; i < list.size(); i++) {
for (int i = 0; i < list.size(); i++) {
Map<String, Object> map=new HashMap<>();
map.put("key", list.getJSONObject(i).get("dictDataKey"));
map.put("name", "level"+list.getJSONObject(i).get("dictDataKey"));
listmap.add(map);
StatisticPieBo dd=new StatisticPieBo();
dd.setName(list.getJSONObject(i).get("dictDataValue")+"");
dd.setPercent("0%");
dd.setTotal(0L);
dd.setValue("0");
levelBoListdate.add(dd);
}
}
List<StatisticPieBo> levelBoList = queryStatsMapper.getRiskPieDetailInfo(orgCode);
for (int i = 0; i < levelBoListdate.size(); i++) {
if(levelBoList!=null&&levelBoList.size()>0){
for (int j = 0; j < levelBoList.size(); j++) {
if(levelBoListdate.get(i).getName().equals(levelBoList.get(j).getName())){
}
}
List<StatisticPieBo> levelBoList = queryStatsMapper.getRiskPieDetailInfo(orgCode);
for (int i = 0; i < levelBoListdate.size(); i++) {
if(levelBoList!=null&&levelBoList.size()>0){
for (int j = 0; j < levelBoList.size(); j++) {
if(levelBoListdate.get(i).getName().equals(levelBoList.get(j).getName())){
levelBoListdate.get(i).setPercent(levelBoList.get(j).getPercent());
levelBoListdate.get(i).setTotal(levelBoList.get(j).getTotal());
levelBoListdate.get(i).setValue(levelBoList.get(j).getValue());
levelBoListdate.get(i).setValue(levelBoList.get(j).getValue());
continue;
}
}
}
}
}
}
}
Long total = 0l;
for (StatisticPieBo bo : levelBoListdate) {
total += Long.parseLong(bo.getValue());
......@@ -162,6 +186,8 @@ public class QueryStatsServiceImpl implements IQueryStatsService {
bo.setTotal(total);
}
detailMap.put("byRiskLevel", levelBoListdate);
List<Map<String, String>> departmentMap = queryStatsMapper.queryRiskByDepartment(orgCode,listmap);
departmentMap.forEach(d -> {
String departmentId = d.get("belongDepartmentId");
......@@ -209,6 +235,9 @@ public class QueryStatsServiceImpl implements IQueryStatsService {
}
private void getTaskworkStatistics(String toke,String product,String appKey,String orgCode, Map<String, Object> detailMap) {
JSONArray list= remoteSecurityService.listDictionaryByDictCode( toke, product, appKey,"FXDJ_TYPE");
String typesql="";
List<StatisticPieBo> levelBoListdate=new ArrayList<StatisticPieBo>();
......@@ -222,21 +251,38 @@ public class QueryStatsServiceImpl implements IQueryStatsService {
dd.setTotal(0L);
dd.setValue("0");
levelBoListdate.add(dd);
}
}
List<StatisticPieBo> levelBoList = queryStatsMapper.getPieInfoByTaskworkRiskLevel(orgCode, beginDateOfThisYear);
for (int i = 0; i < levelBoListdate.size(); i++) {
if(levelBoList!=null&&levelBoList.size()>0){
for (int j = 0; j < levelBoList.size(); j++) {
if(levelBoListdate.get(i).getName().equals(levelBoList.get(j).getName())){
}
}
List<StatisticPieBo> levelBoList = queryStatsMapper.getPieInfoByTaskworkRiskLevel(orgCode, beginDateOfThisYear);
for (int i = 0; i < levelBoListdate.size(); i++) {
if(levelBoList!=null&&levelBoList.size()>0){
for (int j = 0; j < levelBoList.size(); j++) {
if(levelBoListdate.get(i).getName().equals(levelBoList.get(j).getName())){
levelBoListdate.get(i).setPercent(levelBoList.get(j).getPercent());
levelBoListdate.get(i).setTotal(levelBoList.get(j).getTotal());
levelBoListdate.get(i).setValue(levelBoList.get(j).getValue());
levelBoListdate.get(i).setValue(levelBoList.get(j).getValue());
continue;
}
}
}
}
}
}
}
List<StatisticPieBo> statusBoList = queryStatsMapper.getPieInfoByTaskworkStatus(orgCode, beginDateOfThisYear);
List<StatisticPieBo> violateStatusBoList = queryStatsMapper.getPieInfoByTaskworkViolateStatus(orgCode, beginDateOfThisYear);
List<StatisticPieBo> typeBoList = queryStatsMapper.getPieInfoByTaskworkType(orgCode, beginDateOfThisYear);
......
......@@ -2,33 +2,11 @@
package com.yeejoin.amos.patrol.service.business.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.service.remote.feign.AmosRiskFeign;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.common.core.request.CheckResultPushSpcRequest;
import com.yeejoin.amos.patrol.common.core.response.CheckInputResponse;
import com.yeejoin.amos.patrol.common.core.response.PatrolUserRespone;
import com.yeejoin.amos.patrol.common.core.response.PointCheckInfoBusinessRespone;
import com.yeejoin.amos.patrol.common.core.response.PointCheckInfoRespone;
import com.yeejoin.amos.patrol.common.core.response.PointInfoSyn3DRespone;
import com.yeejoin.amos.patrol.common.core.response.PointPositionInfoSyn3DRespone;
import com.yeejoin.amos.patrol.common.core.response.PointUserSyn3DRespone;
import com.yeejoin.amos.patrol.common.core.response.RouteResponse;
import com.yeejoin.amos.patrol.common.core.response.TaskInfoRespone;
import com.yeejoin.amos.patrol.common.core.response.*;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.common.entity.Point;
import com.yeejoin.amos.patrol.common.entity.UserModel;
import com.yeejoin.amos.patrol.common.enums.CheckStatusEnum;
import com.yeejoin.amos.patrol.service.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.patrol.service.business.dao.mapper.PointMapper;
......@@ -39,6 +17,17 @@ import com.yeejoin.amos.patrol.service.business.service.intfc.ISafety3DDataSendS
import com.yeejoin.amos.patrol.service.core.util.DateUtil;
import com.yeejoin.amos.patrol.service.remote.RemoteSecurityService;
import com.yeejoin.amos.patrol.service.remote.RemoteSpcService;
import com.yeejoin.amos.patrol.service.remote.feign.AmosRiskFeign;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
//import com.yeejoin.amos.security.common.model.UserModel;
@Service("safety3DDataSend")
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.service.business.vo.MsgVo;
import org.springframework.data.domain.Page;
import java.util.List;
import java.util.Map;
public interface IMessageService {
......@@ -54,9 +55,9 @@ public interface IMessageService {
public Msg pushMsg1(Msg msg);
/**
* 添加信息
* @param msg
* 风险预警推送
* @param msgMap
* @return
*/
public void saveMsg(Msg msg);
public void pushRiskMsg(Map<String, Object> msgMap);
}
......@@ -112,7 +112,9 @@ public class CheckPageParamUtil {
*/
public static CheckPtListPageParam fillChkPtParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
HashMap<String, Object> roleMap) {
CheckPtListPageParam paramMap = new CheckPtListPageParam();
paramMap.setOrgCode(roleMap.get("orgCode") == null ? null : roleMap.get("orgCode").toString());
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
if ("checkType".equals(name)) {
......@@ -131,13 +133,19 @@ public class CheckPageParamUtil {
paramMap.setLevel(toString(queryRequests.get(i).getValue()));
} else if ("pointID".equals(name)) {
paramMap.setPointId(toInteger(queryRequests.get(i).getValue()));
}else if ("orgCode".equals(name)) {
paramMap.setOrgCode(queryRequests.get(i).getValue() == null ? null : queryRequests.get(i).getValue().toString());
}
}
if (null != commonPageable) {
paramMap.setPageNumber(commonPageable.getPageNumber());
paramMap.setPageSize(commonPageable.getPageSize());
}
paramMap.setOrgCode(roleMap.get("orgCode") == null ? null : roleMap.get("orgCode").toString());
// paramMap.setUserId(roleMap.get("userId") == null ? null : roleMap.get("userId").toString());
return paramMap;
}
......
......@@ -21,6 +21,8 @@ import java.net.URLEncoder;
import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -1074,6 +1076,20 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
}
public static void downloadQRCodeZip(String baseDir, ZipOutputStream zos, List<PointVo> pointList) {
Map<String, Object> map1= new HashMap<String, Object>();
for (PointVo map : pointList) {
map1.put(map.getPointNo(), map);
}
pointList.clear();
for(String key:map1.keySet()){
pointList.add((PointVo)map1.get(key));
}
for (PointVo map : pointList) {
String pointName = map.getName();
//文件名称(带后缀)
......
package com.yeejoin.amos.patrol.service.constants;
/**
* @Author: xinglei
* @Description: 常量
* @Date: 2020/4/3 10:52
*/
public class CommonConstant {
public static String TOKEN = "TOKE";
}
......@@ -22,7 +22,7 @@ public class XJConstant {
public static final String CM_CATEGORY_DIC_CODE = "CM_CATEGORY";
public static final String CM_TYPE_DIC_CODE = "CM_TYPE";
public static final String JPUSH_USER_KEY ="BANK";
public static final String JPUSH_USER_KEY ="BANK_NEW";
/**
* 网络服务ip
*/
......@@ -401,5 +401,8 @@ public class XJConstant {
public static final String COMBINE_DATA = "2";
public static final String INPUT_ITEM_DEXT = "大额";
public static final String INPUT_ITEM_XEXT= "小额";
public static final String INPUT_ITEM_WYXT = "网银";
public static final String INPUT_ITEM_JWXT = "境外";
}
......@@ -155,8 +155,6 @@ public class AsyncTask {
*/
@Async("asyncTaskExecutor")
public Future<Boolean> pushCheckInfoTo3D(Long checkId) throws InterruptedException {
//巡检结果推送至业务
safety3DDataSend.pointCheckInfoPushToB(checkId);
//获取缓存
CacheMap cacheMap= CacheFactory.newChacheMap();
Toke toke= cacheMap.getValue(TOKE);
......@@ -165,9 +163,9 @@ public class AsyncTask {
Long times= (long) (20*24*60*60);
cacheMap.setex(TOKE, toke, times);
}
safety3DDataSend.pointCheckInfoPush( toke.getToke(),toke.getProduct(),toke.getAppKey(),checkId);
//巡检结果推送至业务
safety3DDataSend.pointCheckInfoPushToB(checkId);
safety3DDataSend.pointCheckInfoPush(toke.getToke(),toke.getProduct(),toke.getAppKey(),checkId);
return new AsyncResult<Boolean>(true);
}
......@@ -506,7 +504,7 @@ public class AsyncTask {
// }
Set<String> userIds=new HashSet<>();
//查询当前点的责任人
//查询当前点的责任人1547041
String id= "".equals(map.get("pointId")+"")?null:(map.get("pointId")+"");
Map<String, String> mapi= msgMapper.getuserid(id);
if(mapi!=null&&!mapi.isEmpty()){
......@@ -535,8 +533,8 @@ public class AsyncTask {
havaRecordBody += "点编号:" + checkPointBo.getPointNo() + TAB;
havaRecordBody += "巡检点名称:" + checkPointBo.getPointName() + TAB;
havaRecordBody += "当前状态:" +CheckStatusEnum.getEnum(checkPointBo.getState()).getName() + TAB;
if("不合格".equals(CheckStatusEnum.getEnum(checkPointBo.getState()).getName())){
havaRecordBody += "不合格项:" + checkPointBo.getErrorItem() + TAB;
if("异常".equals(CheckStatusEnum.getEnum(checkPointBo.getState()).getName())){
havaRecordBody += "异常项:" + checkPointBo.getErrorItem() + TAB;
}
......@@ -584,15 +582,15 @@ public class AsyncTask {
MsgSubscribeTypeEnum eamilMsgTypeEnum = MsgSubscribeTypeEnum.推送检查记录消息;
//不合格推送
MsgSubscribeTypeEnum noPassMsgTypeEnum = MsgSubscribeTypeEnum.不合格记录推送;
MsgSubscribeTypeEnum noPassMsgTypeEnum = MsgSubscribeTypeEnum.异常记录推送;
Set<String> noPassRecordUserIds = userIdFilter(userIds, noPassMsgTypeEnum.getMsgType());
String noPassBody = "";
noPassBody += "巡检时间:" + DateUtil.formatDatrToStr(checkPointBo.getCheckTime(), DateUtil.LONG_PATTERN) + TAB;
noPassBody += "巡检人员:" + userName + TAB;
noPassBody += "巡检点名称:" + checkPointBo.getPointName() + TAB;
noPassBody += "点编号:" + checkPointBo.getPointNo() + TAB;
noPassBody += "当前状态:不合格" + TAB;
noPassBody += "不合格项:" + checkPointBo.getErrorItem() + TAB;
noPassBody += "当前状态:异常" + TAB;
noPassBody += "异常项:" + checkPointBo.getErrorItem() + TAB;
saveAndSendMsg(checkPointBo.getOrgCode(), noPassRecordUserIds, noPassMsgTypeEnum.getTitle(), noPassBody, noPassMsgTypeEnum.getMsgType(), checkId, null);
Set<String> noPassRecordEmailAfterFilterUserIds = userIdFilter(noPassRecordUserIds, eamilMsgTypeEnum.getMsgType());
sendEmail(noPassRecordEmailAfterFilterUserIds, noPassMsgTypeEnum.getTitle(), noPassBody);
......@@ -765,6 +763,37 @@ public class AsyncTask {
sendEmail(noPassRecordEmailAfterFilterUserIds, msgTypeEnum.getTitle(), body);
}
//巡检计划状态变化推送
public void pushChartResulplantask() {
//发送数据 0:刷新
WebsocketParam param = new WebsocketParam("plantask", "planTaskRefresh");
client.sendMessage(param);
}
/**
* 巡检计划涉及支付业务推送
*/
public void pushChartResulPaytask() {
//发送数据 payRefresh:支付业务刷新
WebsocketParam param = new WebsocketParam("plantask", "payRefresh");
client.sendMessage(param);
}
public void pushChartResult() {
HashMap<String, Object> res = msgMapper.queryRouteChartResult();
if(res != null) {
......
......@@ -12,12 +12,14 @@ import cn.jpush.api.push.model.notification.Notification;
import com.fasterxml.jackson.databind.annotation.JsonAppend.Attr;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.common.enums.JPushTypeEnum;
import com.yeejoin.amos.patrol.service.business.param.PushMsgParam;
import com.yeejoin.amos.patrol.service.constants.XJConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
......@@ -38,6 +40,11 @@ public class AppMessagePushService {
protected static final Logger log = LoggerFactory
.getLogger(AppMessagePushService.class);
@Autowired
private com.yeejoin.amos.patrol.service.remote.feign.PushFeign PushFeign;
// private static String APP_KEY;
//
// private static String MASTER_SECRET;
......@@ -79,90 +86,102 @@ public class AppMessagePushService {
public static String buildJpushUserKey(String userId) {
return XJConstant.JPUSH_USER_KEY + "_" + userId;
}
public void sendMessage(List<PushMsgParam> responses) {
try {
if (responses != null && "true".equals(isPush)) {
for (PushMsgParam response : responses) {
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
e.printStackTrace();
}
PushFeign.sendMessage(responses);
// try {
// if (responses != null && "true".equals(isPush)) {
// for (PushMsgParam response : responses) {
// PushPayload payload = buildPushPayload(response);
// jpushClient.sendPush(payload);
// }
// }
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// e.printStackTrace();
// }
}
public PushPayload buildPushPayload(PushMsgParam response) {
CommonResponse commonResponse = PushFeign.buildPushPayload(response);
return (PushPayload)commonResponse.getDataList();
// if (JPushTypeEnum.ALL.getCode().equals(response.getType())) {
// return PushPayload.newBuilder()
// .setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// } else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) {
//
// List<String> recivers = response.getRecivers();
// List<String> users = Lists.newArrayList();
// recivers.forEach(e -> users.add(buildJpushUserKey(e)));
//
// return PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.tag(users))
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// } else {
//
// List<String> recivers = response.getRecivers();
// List<String> users = Lists.newArrayList();
// recivers.forEach(e -> users.add(buildJpushUserKey(e)));
// return PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.alias(users)).
// setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// }
}
private static PushPayload buildPushPayload(PushMsgParam response) {
if (JPushTypeEnum.ALL.getCode().equals(response.getType())) {
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.all())
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
} else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) {
List<String> recivers = response.getRecivers();
List<String> users = Lists.newArrayList();
recivers.forEach(e -> users.add(buildJpushUserKey(e)));
return PushPayload.newBuilder().setPlatform(Platform.android())
.setAudience(Audience.tag(users))
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
public boolean pushNoticeManyMethod(PushMsgParam response) {
CommonResponse commonResponse = PushFeign.pushNoticeMany(response);
if (commonResponse.getResult().equals("SUCCESS")){
return true;
} else {
List<String> recivers = response.getRecivers();
List<String> users = Lists.newArrayList();
recivers.forEach(e -> users.add(buildJpushUserKey(e)));
return PushPayload.newBuilder().setPlatform(Platform.android())
.setAudience(Audience.alias(users)).
setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
return false;
}
}
public void sendMessage(PushMsgParam response) {
try {
if (null != response && "true".equals(isPush)) {
PushPayload payload = PushPayload.newBuilder().setPlatform(Platform.android())
.setAudience(Audience.all())
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
jpushClient.sendPush(payload);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
e.printStackTrace();
}
CommonResponse commonResponse = PushFeign.sendMessageone(response);
// try {
// if (null != response && "true".equals(isPush)) {
// PushPayload payload = PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// jpushClient.sendPush(payload);
// }
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// e.printStackTrace();
//
// }
}
/**
* ͵ָ
* ���͵�ָ������
*
* */
public static void pushNoticeMany( PushMsgParam response){
PushPayload payload = buildPushPayload(response);
try {
jpushClient.sendPush(payload);
} catch (APIConnectionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (APIRequestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
public void pushNoticeMany( PushMsgParam response){
CommonResponse commonResponse = PushFeign.pushNoticeMany(response);
// PushPayload payload = (PushPayload)commonResponse.getDataList();
// try {
// jpushClient.sendPush(payload);
// } catch (APIConnectionException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (APIRequestException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
}
......@@ -157,7 +157,10 @@ public class JobService implements IJobService {
planTaskAddJob(planTask);
} else if (beginTime.getTime() < timestamp && endTime.getTime() > timestamp) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.save(planTask);
iPlanTaskDao.save(planTask);
//增加推送进行中
asyncTask.pushChartResulplantask();
planTaskAddJob(planTask);
} else if (endTime.getTime() < timestamp) {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
......@@ -190,6 +193,10 @@ public class JobService implements IJobService {
private void updatePlanTaskStatus(PlanTask planTask, int status) {
planTask.setFinishStatus(status);
iPlanTaskDao.saveAndFlush(planTask);
//增建已超时,已完成,推送
asyncTask.pushChartResulplantask();
List<PlanTaskDetail> planTaskDetails = iPlanTaskDetailDao.findAllByTaskNoAndStatus(planTask.getId(), PlanTaskDetailStatusEnum.NOTSTARTED.getValue());
if (!planTaskDetails.isEmpty()) {
planTaskDetails.stream()
......@@ -226,7 +233,7 @@ public class JobService implements IJobService {
check.setOrgCode(arg.getOrgCode());
check.setUserId(arg.getUserId());
check.setPointId(arg.getPointId());
check.setUploadTime(new Date());
check.setUploadTime(arg.getEndTime());
check.setPlanId(arg.getPlanId());
check.setPlanTaskId(arg.getPlanTaskId());
check.setPlanTaskDetailId(arg.getPlanTaskDetailId());
......@@ -235,7 +242,6 @@ public class JobService implements IJobService {
check.setIsOk(CheckStatusEnum.OMISSION.getCode());
//新增加部门id
check.setDepId(arg.getDepId());
check = iCheckDao.saveAndFlush(check);
checkMap.put(arg.getPointId(), check);
......@@ -424,6 +430,8 @@ public class JobService implements IJobService {
if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.saveAndFlush(planTask);
//增加推送进行中
asyncTask.pushChartResulplantask();
}
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) {
......
......@@ -29,8 +29,9 @@ public interface AmosBankFeign {
@RequestMapping(value = "/rtsp/listVideoByPage", method = RequestMethod.POST ,consumes="application/json")
CommonResponse getVideos( @RequestBody MultiValueMap<String, Object> param);
@RequestMapping(value = "/rtsp/listVideoByPage/{parentId}/{current}/{pageSize}", method = RequestMethod.POST)
@RequestMapping(value = "/rtsp/listVideoByPage/{orgCode}/{parentId}/{current}/{pageSize}", method = RequestMethod.POST)
CommonResponse getVideos(
@PathVariable("orgCode") String orgCode,
@PathVariable("current") Integer current,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("parentId") Long parentId);
......
package com.yeejoin.amos.patrol.service.remote.feign;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.patrol.common.core.response.PointCheckInfoBusinessRespone;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* 风险系统
......
package com.yeejoin.amos.patrol.service.remote.feign;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
......@@ -7,9 +9,6 @@ import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
/**
* @Author: xinglei
* @Description:
......@@ -25,4 +24,13 @@ public class MultipartSupportConfig {
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
}
package com.yeejoin.amos.patrol.service.remote.feign;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.yeejoin.amos.patrol.common.core.request.CheckResultPushSpcRequest;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.util.MultiValueMap;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.service.business.param.PushMsgParam;
//推送
@FeignClient(name = "${Push.fegin.name}", configuration={MultipartSupportConfig.class})
public interface PushFeign {
@RequestMapping(value = "/api/user/sendMessage", method = RequestMethod.POST)
CommonResponse sendMessage( @RequestBody List<PushMsgParam> responses);
@RequestMapping(value = "/api/user/sendMessageone", method = RequestMethod.POST)
CommonResponse sendMessageone( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/pushNoticeMany", method = RequestMethod.POST)
CommonResponse pushNoticeMany( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/buildPushPayload", method = RequestMethod.POST)
CommonResponse buildPushPayload( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/pushDevice", method = RequestMethod.GET)
CommonResponse PushDevice( @RequestParam("alias") String alias);
@RequestMapping(value = "/api/user/PushDeviceRegistration", method = RequestMethod.GET)
CommonResponse PushDeviceRegistration( @RequestParam("registrationId") String registrationId,@RequestParam("alias") String alias);
}
package com.yeejoin.amos.patrol.service.remote.feign;
import com.yeejoin.amos.patrol.service.business.util.CacheFactory;
import com.yeejoin.amos.patrol.service.business.util.CacheMap;
import com.yeejoin.amos.patrol.service.business.util.Toke;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
* @Author: xinglei
* @Description: Feign请求拦截器(设置请求头,传递登录信息)
* @Date: 2020/4/8 10:59
*/
public class RequestContextListener implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.getRequestAttributes();
if (attributes != null) {
HttpServletRequest request = attributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String values = request.getHeader(name);
template.header(name, values);
}
}
} else {
//获取缓存
CacheMap cacheMap= CacheFactory.newChacheMap();
Toke toke= cacheMap.getValue("TOKE");
if (!ObjectUtils.isEmpty(toke)){
template.header("token", toke.getToke());
template.header("appKey", toke.getAppKey());
template.header("product", toke.getProduct());
}
}
}
}
......@@ -6,8 +6,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.yeejoin.amos.patrol.common.entity.CommonResponse;
import com.yeejoin.amos.patrol.service.remote.feign.MultipartSupportConfig;
@FeignClient(name = "AmosWebsocket",fallback=AmosWsClientFallback.class)
@FeignClient(name = "AmosWebsocket", configuration={MultipartSupportConfig.class},fallback=AmosWsClientFallback.class)
public interface AmosWsClient {
@PostMapping("/generic/sendMessage")
......
......@@ -9,14 +9,18 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
......@@ -43,6 +47,14 @@ public class YeeAMOSPatrolStart {
private static final Logger logger = LoggerFactory.getLogger(YeeAMOSPatrolStart.class);
@Bean
@LoadBalanced
RestTemplate initRestTemplate() {
return new RestTemplate();
}
/**
* 启动amosop-server
*/
......
#\u7aef\u53e3
server.port=9000
#springcloud\u914d\u7f6e
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://172.16.10.175:10001/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.healthcheck.enabled=true
......@@ -12,10 +11,14 @@ ribbon.ReadTimeout=60000
ribbon.OkToRetryOnAllOperations=true
ribbon.MaxAutoRetriesNextServer=2
ribbon.MaxAutoRetries=1
server.port=9001
#\u6570\u636e\u5e93\u914d\u7f6e
spring.datasource.url=jdbc:mysql://172.16.10.66:3306/amos_xian_bank?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8
#spring.datasource.url=jdbc:mysql://172.16.10.66:3306/amos_xian_bank?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8
#spring.datasource.username=root
#spring.datasource.password=root_123
spring.datasource.url=jdbc:mysql://172.16.10.101:3306/amos_xian_bank?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT%2b8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
......@@ -39,6 +42,8 @@ security.productWeb=YH-PATROL_WEB
security.appKeyWeb=YH-PATROL
security.productApp=YH-PATROL_APP
security.appKeyApp=YH-PATROL
AmosBank.fegin.name=AmosBank-xian12238
Security.fegin.name=AMOS-API-PRIVILEGE
#redis\u914d\u7f6e
spring.redis.database=1
......@@ -74,6 +79,8 @@ spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.properties.mail.smtp.ssl.enable=true
mail.fromMail.addr=amospm@yeejoin.com
management.health.mail.enabled=false
#\u6781\u5149\u63a8\u9001\u914d\u7f6e
params.isPush=true
#params.jpush.appKey=1b3f7b961200f4b236811dfe
......@@ -84,7 +91,7 @@ params.isPush=true
#\u5b89\u5168\u670d\u52a1\u540d\u79f0\uff08\u6ce8\u518c\u4e2d\u5fc3\u540d\u79f0\uff09
#security.fegin.name=AmosSecurity-xjZjt
#websocket\u670d\u52a1\u5730\u5740
params.remoteWebsocketUrl=http://47.108.89.109:10600/
params.remoteWebsocketUrl=http://172.16.10.101:10600/
#\u5de5\u4f5c\u6d41\u5730\u5740
#params.work.flow.address=
#\u4ea4\u5927\u670d\u52a1\u5730\u5740
......@@ -97,4 +104,4 @@ params.token=http://yeejoin.3322.org:3302/demo.html?token=
spring.servlet.multipart.max-file-size=10480000
spring.http.multipart.MaxRequestSize=50480000
upload.root.path=C:/upload
upload.server.address=http://172.16.11.12:9999/
\ No newline at end of file
upload.server.address=http://172.16.3.41:9999/
\ No newline at end of file
#\u7aef\u53e3
server.port=9001
server.port=9000
#springcloud\u914d\u7f6e
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.register-with-eureka=true
......@@ -21,7 +21,7 @@ eureka.instance.metadata-map.management.context-path=/actuator
eureka.instance.status-page-url=http://172.16.11.20:${server.port}/actuator/info
#\u6570\u636e\u5e93\u914d\u7f6e
spring.datasource.url=jdbc:mysql://172.16.10.66:3306/amos_xian_bank?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.10.66:3306/amos_xian_bank?useSSL=false&&allowMultiQueries=true&serverTimezone=GMT%2b8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
......@@ -41,23 +41,24 @@ mybatis.configuration.mapUnderscoreToCamelCase=true
security.password=tw123456
security.loginId=tw3
security.productWeb=YH-PATROL2_WEB
security.appKeyWeb=YH-PATROL2
security.productApp=YH-PATROL2_APP
security.appKeyApp=YH-PATROL2
security.productWeb=YH-PATROL_WEB
security.appKeyWeb=YH-PATROL
security.productApp=YH-PATROL_APP
security.appKeyApp=YH-PATROL
#redis
spring.redis.database=3
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.password=
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=1000
AmosBank.fegin.name=AmosBank-xian12238
Security.fegin.name=AMOS-API-PRIVILEGE
spring.jackson.serialization.write-dates-as-timestamps=true
#liquibase
......
server.port=9000
spring.application.name=YeeAMOSPatrol-zjt9999
spring.profiles.active=dev
#spring.profiles.active = prod
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
AmosBank.fegin.name=AmosBank-xian12238
AmosRisk.fegin.name=YeeAmosRiskMode-237
\ No newline at end of file
#spring.application.name=bank-api-patrol
spring.application.name=YEEAMOSPATROL-2378
#server.port=9001
#spring.profiles.active=dev
spring.profiles.active = prod
spring.jackson.dateFormat=yyyy-MM-dd HH:mm:ss
AmosRisk.fegin.name=YeeAmosRiskMode-237
Push.fegin.name=AppMessagePushService15
\ No newline at end of file
......@@ -12,7 +12,7 @@
a.route_point_item_id as routePointItemId,
a.id as checkInputId,
b.point_id as pointId,
b.route_id as route_id,
b.route_id as routeId,
c.point_classify_id as pointClassifyId,
e.evaluate_id as evaluateId
from
......
......@@ -52,7 +52,7 @@
p_catalog_tree a
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
<if test="parentId!=null"> and a.parentId = #{parentId} </if>
<if test="parentId!=null"> and a.parent_id = #{parentId} </if>
<if test="orgCode!=null"> and a.org_Code like concat(#{orgCode},"%")</if>
</trim>
order by a.id desc
......
......@@ -1193,7 +1193,7 @@
FROM
`p_check` a
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="orgCode!=null">and a.org_code like #{orgCode}</if>
<if test="orgCode!=null">and a.org_code like concat(#{orgCode},"%")</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if>
</trim>
GROUP BY
......@@ -1845,15 +1845,19 @@
<result property="pointInputitemName" column="pointInputitemName"/>
<result property="pointInputitemId" column="pointInputitemId"/>
<result property="checkInputitemId" column="checkInputitemId"/>
<result property="pointClassifyId" column="pointClassifyId"/>
</resultMap>
<select id="queryPointInputBu" resultMap="CheckInputBuMap">
SELECT
pci.is_ok inputStatus,
pii.`name` pointInputitemName,
pii.id pointInputitemId,
pci.id checkInputitemId
ppi.id pointInputitemId,
pci.id checkInputitemId,
pci.point_classify_id pointClassifyId
FROM
`p_check_input` pci
LEFT join p_check pc on pc.id = pci.check_id
LEFT JOIN p_point_inputitem ppi on ppi.point_id = pc.point_id and input_item_id = pci.input_id
LEFT JOIN p_input_item pii ON pii.id = pci.input_id
WHERE
pci.check_id = #{checkId}
......
......@@ -89,7 +89,7 @@
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="level!=null"> and a.level = #{level} </if>
<if test="level!=null"> and a.level = #{level} </if>
<if test="orgCode!=null"> and a.org_Code like concat(#{orgCode},"%") </if>
<if test="catalogId > 0 "> and a.catalog_id = #{catalogId}</if>
<!-- <choose>
......
......@@ -749,7 +749,7 @@
LEFT JOIN p_point_classify ppc ON ppc.point_id = p.id
WHERE 1=1 and p.is_delete='0'
<if test="orgCode !=null and orgCode !=''">
and p.org_code = #{orgCode}
and p.org_code like concat(#{orgCode},"%")
</if>
<if test="pointNo !=null and pointNo !=''">
and p.point_no like concat(concat("%",#{pointNo}),"%")
......
......@@ -179,7 +179,7 @@
</delete>
<select id="queryRouteListByOrgCode" resultType="Map">
<if test="userId != null and userId != ''">
SELECT
DISTINCT
r.id,
......@@ -187,11 +187,16 @@
FROM
p_plan ppl
LEFT JOIN p_route r ON r.id = ppl.route_id
WHERE
find_in_set(#{userId}, ppl.user_id) > 0
WHERE 1=1
<if test="userId != null and userId != ''">
and find_in_set(#{userId}, ppl.user_id) > 0
</if>
AND r.is_delete = 0
</if>
<if test="(orgCode != null and orgCode != '') or (deptId != null and deptId != '')">
<if test="orgCode != null and orgCode != ''">
AND r.org_code like CONCAT(#{orgCode}, '%')
</if>
<!-- <if test="(orgCode != null and orgCode != '') or (deptId != null and deptId != '')">
<if test="userId != null and userId != ''">
UNION
</if>
......@@ -209,7 +214,7 @@
AND r.dept_id = #{deptId}
</if>
AND r.is_delete = 0
</if>
</if> -->
<!-- SELECT r.id, r.`name` FROM p_route r where 1 =1 and r.org_code like #{orgCode} and r.is_delete = 0 -->
</select>
......@@ -222,7 +227,7 @@
where 1=1
AND p.is_delete = 0
AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode}
AND p.org_code like CONCAT(#{orgCode}, '%')
</select>
<select id="queryRoutePoints" resultType="Map">
SELECT
......@@ -301,7 +306,7 @@
where 1=1
AND p.is_delete = 0
AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode}
AND p.org_code like CONCAT(#{orgCode}, '%')
order by rp.order_no
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if>
......
......@@ -69,6 +69,14 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!-- Swagger2模块 -->
<dependency>
<groupId>io.springfox</groupId>
......@@ -359,6 +367,19 @@
<name>maven-snapshot</name>
<url>http://repo.typroject.org:8081/repository/maven-snapshots/</url>
</repository>
<!-- <repository>
<id>maven-public</id>
<name>maven-public</name>
<url>http://repo.typroject.org:8081/repository/maven-public/</url>
</repository>
<repository>
<id>maven-snapshot</id>
<name>maven-snapshot</name>
<url>http://repo.typroject.org:8081/repository/maven-snapshots/</url>
</repository> -->
</repositories>
<pluginRepositories>
<pluginRepository>
......
人民银行巡检项目。
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment