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