Commit 85ae7579 authored by lisong's avatar lisong

去掉措施分类

parent 0de7aa58
......@@ -187,18 +187,18 @@ public class PointController extends AbstractBaseController {
try {
//增加判断
PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
if(PointClassifyk!=null){
if(PointClassifyk.getId()!=pointClassify.getId()){
return CommonResponseUtil.failure("巡查对象code,不能重复!");
}
}
// PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
// if(PointClassifyk!=null){
// if(PointClassifyk.getId()!=pointClassify.getId()){
// return CommonResponseUtil.failure("巡查对象code,不能重复!");
// }
// }
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify();
newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName());
newPointClassify.setName(ObjectUtils.isEmpty(pointClassify.getName()) ? "系统默认" : pointClassify.getName());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName());
newPointClassify.setCreatorId(user.getUserId());
newPointClassify.setPointId(pointClassify.getPointId());
......@@ -231,7 +231,7 @@ public class PointController extends AbstractBaseController {
}
newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
newPointClassify.setCode(ObjectUtils.isEmpty(pointClassify.getCode()) ? "系统默认":pointClassify.getCode());
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> oldInputItemList = new ArrayList<>();
......@@ -1471,7 +1471,7 @@ public class PointController extends AbstractBaseController {
@GetMapping(value = "/newQueryByIds", produces = "application/json;charset=UTF-8")
public CommonResponse queryItemList4RoutePointNew(
@ApiParam(value = "巡检点ID") @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId", required = false) Long classifyId,
@ApiParam(value = "路线ID") @RequestParam(value = "routeId") Long routeId) {
List list = iPointService.queryItemList4RoutePointNew(routeId, pointId, classifyId);
Object ob=list!=null?ToJson.tojson(list):null;
......
......@@ -746,7 +746,7 @@ public class RouteController extends AbstractBaseController {
@PostMapping(value = "/updateRoutePointInputItemNew", produces = "application/json;charset=UTF-8")
public CommonResponse updateRoutePointInputItemNew(@ApiParam(value = "巡检路线id", required = true) @RequestParam(value = "routeId") Long routeId,
@ApiParam(value = "巡检点id", required = true) @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "巡检点分类id", required = true) @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "巡检点分类id") @RequestParam(value = "classifyId", required = false) Long classifyId,
@ApiParam(value = "巡检点巡检项id", required = true) @RequestParam List<Long> inputItemIds) {
try {
routeService.updateRoutePointInputItemNew(routeId, pointId,classifyId, inputItemIds);
......
......@@ -59,6 +59,6 @@ public interface IPointInputItemDao extends BaseDao<PointInputItem, Long> {
@Modifying
@Transactional
@Query(value = "SELECT * FROM p_point_inputitem WHERE point_id = ?1 and classify_ids =?2", nativeQuery = true)
@Query(value = "SELECT * FROM p_point_inputitem WHERE point_id = ?1 limit 1", nativeQuery = true)
List<PointInputItem> getPointInputItemByPointIdAndClassifyId(Long pointId,Long classifyId);
}
......@@ -927,9 +927,9 @@ public class PointServiceImpl implements IPointService {
@Override
public List queryItemList4RoutePointNew(Long routeId,Long pointId, Long classifyId) {
if (pointId == null || classifyId == null) {
throw new RuntimeException("查询条件有误");
}
// if (pointId == null || classifyId == null) {
// throw new RuntimeException("查询条件有误");
// }
List<Map<String, Object>> resList = pointMapper.queryItemList4RoutePoint(pointId, classifyId);
//查询管控字典值,并替换到返回值
HashMap<String, String> dictMap = new HashMap<>();
......
......@@ -561,22 +561,23 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
RoutePoint RoutePoint = oldRoutePointList.get(0);
if (!"".equals(RoutePoint.getExcludeItems()) && RoutePoint.getExcludeItems() != null){
List<Long> split = Arrays.asList(RoutePoint.getExcludeItems().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
Set<Long> allPointInputItemIdSet = iPointInputItemDao.getPointInputItemByPointIdAndClassifyId(pointId, classifyId)
.stream().map(PointInputItem::getId)
.collect(Collectors.toSet());
List<Long> otherClassify = new ArrayList<>();
split.forEach(x -> {
if (!allPointInputItemIdSet.contains(x)) {
otherClassify.add(x);
}
});
List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList());
RoutePoint.setExcludeItems(StringUtils.join(lastList.toArray(), ","));
}else {
RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),","));
// List<Long> split = Arrays.asList(RoutePoint.getExcludeItems().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
//
// Set<Long> allPointInputItemIdSet = iPointInputItemDao.getPointInputItemByPointIdAndClassifyId(pointId, classifyId)
// .stream().map(PointInputItem::getId)
// .collect(Collectors.toSet());
// List<Long> otherClassify = new ArrayList<>();
// split.forEach(x -> {
// if (!allPointInputItemIdSet.contains(x)) {
// otherClassify.add(x);
// }
// });
// List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList());
RoutePoint.setExcludeItems(StringUtils.join(inputItemIds, ","));
}
// else {
// RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),","));
// }
iRoutePointDao.saveAndFlush(RoutePoint);
}
......
......@@ -1423,7 +1423,7 @@
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
WHERE
ppi.point_id = #{pointId}
AND ppi.classify_ids = #{classifyId}
AND ppi.classify_ids = (select id from p_point_classify where point_id = #{pointId} limit 1)
</select>
<select id="getPointRefItem" parameterType="list" resultType="map">
......
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