Commit b05aa847 authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/develop_tzs_patrol' into develop_tzs_patrol

parents ac8d5ed5 f2a63fa7
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil; import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper; import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IInputItemDao; import com.yeejoin.amos.patrol.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao; import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao;
...@@ -91,6 +93,9 @@ public class InputItemController extends AbstractBaseController { ...@@ -91,6 +93,9 @@ public class InputItemController extends AbstractBaseController {
private static final String ITEMTYPE = "选择,文本:"; private static final String ITEMTYPE = "选择,文本:";
//管控形式 字典
private static final String formOfManagementAndControl= "riskForm";
/** /**
* 新加接口***************************************************************************** * 新加接口*****************************************************************************
...@@ -152,6 +157,9 @@ public class InputItemController extends AbstractBaseController { ...@@ -152,6 +157,9 @@ public class InputItemController extends AbstractBaseController {
for (Map<String, String> map : allCategoryNameList) { for (Map<String, String> map : allCategoryNameList) {
resultMap.put(map.get("code"), map.get("name")); resultMap.put(map.get("code"), map.get("name"));
} }
HashMap<String, String> dictMap = new HashMap<>();
List<DictionarieValueModel> result = Systemctl.dictionarieClient.dictValues(formOfManagementAndControl).getResult();
result.forEach(x-> dictMap.put(x.getDictDataKey(),x.getDictDataValue()));
for (InputItemVo inputItemVo : page.getContent()) { for (InputItemVo inputItemVo : page.getContent()) {
String finalTypeName = ""; String finalTypeName = "";
finalTypeName = StringUtils.isNotEmpty(inputItemVo.getCustomType())? "自定义巡检点" : ""; finalTypeName = StringUtils.isNotEmpty(inputItemVo.getCustomType())? "自定义巡检点" : "";
...@@ -174,6 +182,8 @@ public class InputItemController extends AbstractBaseController { ...@@ -174,6 +182,8 @@ public class InputItemController extends AbstractBaseController {
finalTypeName = facilitiesTypeName; finalTypeName = facilitiesTypeName;
} }
inputItemVo.setTypeName(finalTypeName); inputItemVo.setTypeName(finalTypeName);
//匹配 管控形式 字典值
inputItemVo.setInputClassify(dictMap.getOrDefault(inputItemVo.getInputClassify(),null));
} }
return CommonResponseUtil.success(page); return CommonResponseUtil.success(page);
} }
......
package com.yeejoin.amos.patrol.business.controller; package com.yeejoin.amos.patrol.business.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dto.UserDetailsDto;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.feign.TzsFeign; import com.yeejoin.amos.patrol.business.feign.TzsFeign;
import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam; import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam;
...@@ -12,6 +10,7 @@ import com.yeejoin.amos.patrol.business.service.intfc.IPlanService; ...@@ -12,6 +10,7 @@ import com.yeejoin.amos.patrol.business.service.intfc.IPlanService;
import com.yeejoin.amos.patrol.business.util.CommonResponse; import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil; import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.PlanPageParamUtil; import com.yeejoin.amos.patrol.business.util.PlanPageParamUtil;
import com.yeejoin.amos.patrol.business.util.StringUtil;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson; import com.yeejoin.amos.patrol.core.common.request.ToJson;
...@@ -23,12 +22,14 @@ import org.slf4j.Logger; ...@@ -23,12 +22,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
@RestController @RestController
@RequestMapping(value = "/api/plan") @RequestMapping(value = "/api/plan")
...@@ -153,39 +154,31 @@ public class PlanController extends AbstractBaseController { ...@@ -153,39 +154,31 @@ public class PlanController extends AbstractBaseController {
return CommonResponseUtil.failure("工作时长超出结束时间"); return CommonResponseUtil.failure("工作时长超出结束时间");
} }
} }
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("org_code", loginOrgCode); map.put("org_code", loginOrgCode);
map.put("user_id", userId);
// Map<String, String> deptMap = new HashMap<>(); List<String> userGroupIds = Objects.nonNull(param.getUserGroupId()) ? Arrays.asList(param.getUserGroupId().split(",")) : Collections.emptyList();
// Set<String> departmentIds = new HashSet<>(); StringBuilder userIdSB = new StringBuilder(), userDeptSB = new StringBuilder(), userNameSB = new StringBuilder();
// List<String> groupIds = Arrays.asList(param.getUserGroupId().split(",")); ResponseModel<List<UserDetailsDto>> response;
// depts.stream().forEach(dept -> { for (String userGroupId : userGroupIds) {
// deptMap.put(dept.substring(0, dept.indexOf("@")), dept.substring(dept.indexOf("@") + 1)); response = tzsFeign.getGroupAndPersonInfo(Long.valueOf(userGroupId));
// }); if (response.getStatus() == 200) {
// for (String entry : deptMap.keySet()) { List<UserDetailsDto> resultList = response.getResult();
// String entryValue = deptMap.get(entry); for (UserDetailsDto udd : resultList) {
// departmentIds.add(entryValue); userIdSB.append(",").append(udd.getUserId());
// } userDeptSB.append(",").append(udd.getUserId()).append("@").append(udd.getUnitCode());
userNameSB.append(",").append(udd.getUserName());
// StringBuffer departmentIdBuffer = new StringBuffer(); }
// Iterator<String> it = departmentIds.iterator(); }
// while (it.hasNext()) { }
// departmentIdBuffer.append(it.next()).append(","); String userId = StringUtils.hasText(userIdSB) ? userIdSB.substring(1) : "";
// } String userDept = StringUtils.hasText(userDeptSB) ? userDeptSB.substring(1) : "";
String userName = StringUtils.hasText(userNameSB) ? userNameSB.substring(1) : "";
// if(departmentIds.size() > 0){ param.setUserId(userId);
// FeignClientResult<List<Map<String, Object>>> departmentModeldate= jcsFeignClient.selectByIdDeptList param.setUserDept(userDept);
// (departmentIdBuffer.toString().substring(0, departmentIdBuffer.toString().length() - 1));
// List<Map<String, Object>> departmentModels = departmentModeldate.getResult();
// if(departmentModels!=null&&departmentModels.size()>0){
// Map<String, Object> mapj= departmentModels.get(0);
// param.setBizOrgCode(mapj.get("bizOrgCode").toString());
// param.setBizOrgName(mapj.get("bizOrgName").toString());
// }
// }
param.setBizOrgCode(loginOrgCode); param.setBizOrgCode(loginOrgCode);
param.setBizOrgName(getCompanyName(reginParams)); param.setBizOrgName(getCompanyName(reginParams));
map.put("param", param); map.put("param", param);
......
...@@ -276,7 +276,8 @@ public class PointController extends AbstractBaseController { ...@@ -276,7 +276,8 @@ public class PointController extends AbstractBaseController {
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString()); pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
// pointInputItem.setId(0); // pointInputItem.setId(0);
pointInputItem.setOrderNo(pItemVo.getpOrderNo()); pointInputItem.setOrderNo(pItemVo.getpOrderNo());
pointInputItemMapper.insert(pointInputItem); iPointInputItemDao.saveAndFlush(pointInputItem);
// pointInputItemMapper.insert(pointInputItem);
// PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem); // PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
//更新巡检路线 //更新巡检路线
if(routePointList.size()>0){ if(routePointList.size()>0){
...@@ -300,7 +301,8 @@ public class PointController extends AbstractBaseController { ...@@ -300,7 +301,8 @@ public class PointController extends AbstractBaseController {
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString()); pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(pItemVo.getPointItemId()); pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setOrderNo(pItemVo.getpOrderNo()); pointInputItem.setOrderNo(pItemVo.getpOrderNo());
pointInputItemMapper.insert(pointInputItem); // pointInputItemMapper.insert(pointInputItem);
iPointInputItemDao.saveAndFlush(pointInputItem);
// iPointInputItemDao.save(pointInputItem); // iPointInputItemDao.save(pointInputItem);
} }
} }
......
...@@ -29,6 +29,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService; ...@@ -29,6 +29,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import liquibase.pro.packaged.S;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -804,8 +805,14 @@ public class RouteController extends AbstractBaseController { ...@@ -804,8 +805,14 @@ public class RouteController extends AbstractBaseController {
@PutMapping(value = "/relevancyPoint", produces = "application/json;charset=UTF-8") @PutMapping(value = "/relevancyPoint", produces = "application/json;charset=UTF-8")
public CommonResponse relevancyPoint(@ApiParam(value = "巡检路线", required = true) @RequestBody JSONObject map) { public CommonResponse relevancyPoint(@ApiParam(value = "巡检路线", required = true) @RequestBody JSONObject map) {
Route route = new Route(); Route route = new Route();
List<Long> ids = (List<Long>) map.get("ids"); List<String> ids = (List<String>) map.get("ids");
List<RoutePoint> routePoint = pointMapper.getRoutePoint(ids); List<RoutePoint> routePoint = new ArrayList<>();
for (String id : ids) {
RoutePoint routePointItem = new RoutePoint();
routePointItem.setPointId(Long.parseLong(id));
routePoint.add(routePointItem);
}
// if (!ObjectUtils.isEmpty(ids)){ // if (!ObjectUtils.isEmpty(ids)){
// ids.forEach(item ->{ // ids.forEach(item ->{
// RoutePoint routePoint = new RoutePoint(); // RoutePoint routePoint = new RoutePoint();
......
...@@ -20,7 +20,6 @@ import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; ...@@ -20,7 +20,6 @@ import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.param.*; import com.yeejoin.amos.patrol.business.param.*;
import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService; import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService;
import com.yeejoin.amos.patrol.business.service.intfc.IPointService; import com.yeejoin.amos.patrol.business.service.intfc.IPointService;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.DaoCriteria; import com.yeejoin.amos.patrol.business.util.DaoCriteria;
import com.yeejoin.amos.patrol.business.vo.*; import com.yeejoin.amos.patrol.business.vo.*;
import com.yeejoin.amos.patrol.common.enums.PointStatusEnum; import com.yeejoin.amos.patrol.common.enums.PointStatusEnum;
...@@ -2039,6 +2038,10 @@ public class PointServiceImpl implements IPointService { ...@@ -2039,6 +2038,10 @@ public class PointServiceImpl implements IPointService {
throw new RuntimeException("查询条件有误"); throw new RuntimeException("查询条件有误");
} }
List<Map<String, Object>> resList = pointMapper.queryEquipListByPointId(pointId); List<Map<String, Object>> resList = pointMapper.queryEquipListByPointId(pointId);
resList.stream().forEach(item -> {
item.put("classifyId", ObjectUtils.isEmpty(item.get("classifyId")) ? "" : String.valueOf(item.get("classifyId")));
});
return resList; return resList;
} }
......
...@@ -97,6 +97,11 @@ public class InputItemVo { ...@@ -97,6 +97,11 @@ public class InputItemVo {
private String riskDesc; private String riskDesc;
/** /**
*管控形式
*/
private String inputClassify;
/**
* 新加字段 * 新加字段
* *
* */ * */
...@@ -334,5 +339,12 @@ public class InputItemVo { ...@@ -334,5 +339,12 @@ public class InputItemVo {
public void setRiskDesc(String riskDesc) { public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc; this.riskDesc = riskDesc;
} }
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
} }
...@@ -294,6 +294,7 @@ ...@@ -294,6 +294,7 @@
a.is_score, a.is_score,
b.name as catalog_name, b.name as catalog_name,
a.remark, a.remark,
a.input_classify,
(CASE a.level (CASE a.level
WHEN 1 THEN WHEN 1 THEN
'1级' '1级'
......
...@@ -12,18 +12,19 @@ ...@@ -12,18 +12,19 @@
FROM FROM
p_point_inputitem pi p_point_inputitem pi
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_point_classify pc ON pi.classify_ids REGEXP CONCAT( LEFT JOIN p_point_classify pc ON find_in_set(pc.id, pi.classify_ids)
'^', -- pi.classify_ids REGEXP CONCAT(
pc.id, -- '^',
',|,', -- pc.id,
pc.id, -- ',|,',
',|,', -- pc.id,
pc.id, -- ',|,',
'$', -- pc.id,
'|^', -- '$',
pc.id, -- '|^',
'$' -- pc.id,
) -- '$'
-- )
<where> <where>
<if test="pointId!=null">AND pi.point_id = #{pointId}</if> <if test="pointId!=null">AND pi.point_id = #{pointId}</if>
<if test="classifyId!=null"> AND pc.id = #{classifyId} </if> <if test="classifyId!=null"> AND pc.id = #{classifyId} </if>
...@@ -1210,57 +1211,33 @@ ...@@ -1210,57 +1211,33 @@
<!-- </select>--> <!-- </select>-->
<select id="queryEquipPointInputItem" resultType="java.util.Map"> <select id="queryEquipPointInputItem" resultType="java.util.Map">
SELECT SELECT
ppc.id, ppc.id,
ppc.point_id pointId, ppc.point_id pointId,
ppc.name, ppc.name,
ppc.code, ppc.code,
ppc.creator_id creatorId, ppc.creator_id creatorId,
ppc.create_date createDate, ppc.create_date createDate,
ppc.order_no orderNo, ppc.order_no orderNo,
ppc.original_id originalId, ppc.original_id originalId,
ppc.equipment_id equipmentId, ppc.equipment_id equipmentId,
ppc.inspection_spec_name inspectionSpecName, ppc.inspection_spec_name inspectionSpecName,
ppc.category_name categoryName, ppc.category_name categoryName,
ppc.address, ppc.address,
ppc.data_source_code dataSourceCode, ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName, ppc.data_source_name dataSourceName,
ppc.building_id buildingId, ppc.building_id buildingId,
ppc.building_name buildingName, ppc.building_name buildingName,
ppc.category_code categoryCode, ppc.category_code categoryCode,
ppc.check_style checkStryle, ppc.check_style checkStryle,
ppi.order_no pOrderNo, '' inputClassify,
ppi.id pointItemId, ppc.data_source_name equipIputDetailDataNum,
pii.input_classify inputClassify, '是' isScore,
pii.name, '选择' itemType
pii.risk_desc riskDesc,
pii.order_no orderNo,
pii.item_type itemType,
pii.is_must isMust,
pii.is_score isScore,
pii.default_value defaultValue,
pii.is_multiline isMultiline,
pii.catalog_id originalId,
pii.input_json inputJson,
pii.data_json dataJson,
pii.remark,
pii.picture_json pictureJson,
pii.create_by createBy,
pii.create_date createDate,
pii.is_delete isDelete,
pii.level,
pii.item_no itemNo,
pii.original_id originalId,
pii.basis_json basisJson,
pii.org_code orgCode
FROM FROM
p_point_inputitem ppi p_point_classify ppc
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
LEFT JOIN p_point_classify ppc ON FIND_IN_SET(ppc.id, ppi.classify_ids) > 0
WHERE WHERE
ppc.is_delete = 0 ppc.is_delete = 0
<if test = "pointId!=''" > AND ppi.point_id = #{pointId} </if> <if test = "pointId!=''" > AND ppc.point_id = #{pointId} </if>
ORDER BY
ppi.order_no
</select> </select>
<select id="queryPointCount4Route" parameterType="long" resultType="int"> <select id="queryPointCount4Route" parameterType="long" resultType="int">
...@@ -1464,18 +1441,19 @@ ...@@ -1464,18 +1441,19 @@
</select> </select>
<select id="selectRoutePointList" resultType="com.yeejoin.amos.patrol.dao.entity.Point"> <select id="selectRoutePointList" resultType="com.yeejoin.amos.patrol.dao.entity.Point">
SELECT * from p_point SELECT * from p_point
WHERE route_id is null WHERE route_id is null and is_delete = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND name like concat('%', #{name}, '%') AND name like concat('%', #{name}, '%')
</if> </if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND point_no like concat('%', #{pointNo}, '%') AND point_no like concat('%', #{pointNo}, '%')
</if> </if>
LIMIT #{number}, #{size} ORDER BY create_date desc
LIMIT #{number}, #{size}
</select> </select>
<select id="countRoutePointList" resultType="java.lang.Integer"> <select id="countRoutePointList" resultType="java.lang.Integer">
SELECT count(1) from p_point SELECT count(1) from p_point
WHERE route_id is null WHERE route_id is null and is_delete = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND name like concat('%', #{name}, '%') AND name like concat('%', #{name}, '%')
</if> </if>
...@@ -1501,7 +1479,7 @@ ...@@ -1501,7 +1479,7 @@
AND pp.name like concat('%', #{pointName}::varchar, '%') AND pp.name like concat('%', #{pointName}::varchar, '%')
</if> </if>
<if test="pointId != null"> <if test="pointId != null">
AND pp.id = #{pointId} AND pp.id != #{pointId}
</if> </if>
</select> </select>
...@@ -1513,7 +1491,7 @@ ...@@ -1513,7 +1491,7 @@
AND pp.point_no = #{pointNo} AND pp.point_no = #{pointNo}
</if> </if>
<if test="pointId != null"> <if test="pointId != null">
AND pp.id = #{pointId} AND pp.id != #{pointId}
</if> </if>
</select> </select>
</mapper> </mapper>
\ 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