Commit 1711358a authored by zhangsen's avatar zhangsen

bug xiugai1102

parent ead9443e
...@@ -10,6 +10,11 @@ import java.util.Set; ...@@ -10,6 +10,11 @@ import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.component.robot.BadRequest;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -50,6 +55,8 @@ import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService; ...@@ -50,6 +55,8 @@ import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService; import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import javax.annotation.Resource;
/** /**
* 重点部位服务实现类 * 重点部位服务实现类
* *
...@@ -83,6 +90,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -83,6 +90,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Resource
DataDictionaryMapper dataDictionaryMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -279,6 +290,19 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -279,6 +290,19 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
return keySiteMapper.getSequenceNbr(sequenceNbr); return keySiteMapper.getSequenceNbr(sequenceNbr);
} }
private String[] getDataDictionary(String type) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
List<DataDictionary> list = dataDictionaryMapper.selectList(queryWrapper);
List<String> names = list.stream().map(dataDictionary -> {
return dataDictionary.getName() + "@" + dataDictionary.getCode();
}).collect(Collectors.toList());
String[] str = names.toArray(new String[names.size()]);
return str;
}
@Override @Override
public boolean saveExcel(List<KeySiteExcleDto> excelDtoList) { public boolean saveExcel(List<KeySiteExcleDto> excelDtoList) {
Map<String, String> maps = getAllBuildingIdForParentBuilingIds(excelDtoList); Map<String, String> maps = getAllBuildingIdForParentBuilingIds(excelDtoList);
...@@ -291,6 +315,11 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -291,6 +315,11 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
List<OrgUsr> comDeptList = orgUsrMapper.companyTreeByUserAndType(param); List<OrgUsr> comDeptList = orgUsrMapper.companyTreeByUserAndType(param);
Map<Long, OrgUsr> comDeptMap = comDeptList.stream() Map<Long, OrgUsr> comDeptMap = comDeptList.stream()
.collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity())); .collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity()));
//耐火等级
String[] nhdjs = getDataDictionary("NHDJ");
//使用性质
String[] jzwsyxzs = getDataDictionary("JZWSYXZ");
for (KeySiteExcleDto keySiteExcleDto : excelDtoList) { for (KeySiteExcleDto keySiteExcleDto : excelDtoList) {
KeySite keySiteDto = new KeySite(); KeySite keySiteDto = new KeySite();
Bean.copyExistPropertis(keySiteExcleDto, keySiteDto); Bean.copyExistPropertis(keySiteExcleDto, keySiteDto);
...@@ -315,6 +344,9 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -315,6 +344,9 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} }
if (StringUtils.isNotBlank(keySiteExcleDto.getFireEnduranceRate()) if (StringUtils.isNotBlank(keySiteExcleDto.getFireEnduranceRate())
&& keySiteExcleDto.getFireEnduranceRate().contains("@")) { && keySiteExcleDto.getFireEnduranceRate().contains("@")) {
if (!ArrayUtils.contains(nhdjs, keySiteExcleDto.getFireEnduranceRate())) {
throw new BadRequest("请检查耐火等级选择是否正确");
}
String[] fireEnduranceRateArray = keySiteExcleDto.getFireEnduranceRate().split("@"); String[] fireEnduranceRateArray = keySiteExcleDto.getFireEnduranceRate().split("@");
if (fireEnduranceRateArray.length > 1) { if (fireEnduranceRateArray.length > 1) {
keySiteDto.setFireEnduranceRate(fireEnduranceRateArray[1]); keySiteDto.setFireEnduranceRate(fireEnduranceRateArray[1]);
...@@ -323,6 +355,9 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -323,6 +355,9 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} }
if (StringUtils.isNotBlank(keySiteExcleDto.getUseNature()) if (StringUtils.isNotBlank(keySiteExcleDto.getUseNature())
&& keySiteExcleDto.getUseNature().contains("@")) { && keySiteExcleDto.getUseNature().contains("@")) {
if (!ArrayUtils.contains(jzwsyxzs, keySiteExcleDto.getUseNature())) {
throw new BadRequest("请检查使用性质选择是否正确");
}
String[] useNatureArray = keySiteExcleDto.getUseNature().split("@"); String[] useNatureArray = keySiteExcleDto.getUseNature().split("@");
if (useNatureArray.length > 1) { if (useNatureArray.length > 1) {
keySiteDto.setUseNature(useNatureArray[1]); keySiteDto.setUseNature(useNatureArray[1]);
......
...@@ -181,8 +181,7 @@ public class PlanController extends AbstractBaseController { ...@@ -181,8 +181,7 @@ public class PlanController extends AbstractBaseController {
} }
} }
map.put("param", param); map.put("param", param);
planService.addPlan(map); return CommonResponseUtil.success(planService.addPlan(map));
return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检计划新增失败"); return CommonResponseUtil.failure("巡检计划新增失败");
......
...@@ -340,6 +340,10 @@ public class PointController extends AbstractBaseController { ...@@ -340,6 +340,10 @@ public class PointController extends AbstractBaseController {
if(pointClassify.getId()!=null){ if(pointClassify.getId()!=null){
newPointClassify.setId(pointClassify.getId()); newPointClassify.setId(pointClassify.getId());
} }
List<PointClassify> pointClassifies = iPointClassifyDao.queryByPointIdAndEquipmentId(pointClassify.getPointId(), pointClassify.getEquipmentId());
if (pointClassifies.size() > 0) {
return CommonResponseUtil.failure("该巡查对象已存在,不可再添加!");
}
iPointService.addPointClassifyByPointId(newPointClassify); iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项 List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
......
...@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper; import com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper; import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IRouteDao;
import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao; import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.service.impl.RouteServiceImpl; import com.yeejoin.amos.patrol.business.service.impl.RouteServiceImpl;
...@@ -91,6 +92,9 @@ public class RouteController extends AbstractBaseController { ...@@ -91,6 +92,9 @@ public class RouteController extends AbstractBaseController {
private IRoutePointDao iRoutePointDao; private IRoutePointDao iRoutePointDao;
@Autowired @Autowired
private RouteServiceImpl routeServiceImpl; private RouteServiceImpl routeServiceImpl;
@Autowired
private IRouteDao iRouteDao;
/** /**
* *
* 新增接口 * 新增接口
...@@ -104,15 +108,16 @@ public class RouteController extends AbstractBaseController { ...@@ -104,15 +108,16 @@ public class RouteController extends AbstractBaseController {
@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) RoutePageParam queryRequests, @ApiParam(value = "查询条件", required = false) @RequestBody(required = false) RoutePageParam queryRequests,
@ApiParam(value = "分页参数", required = true, defaultValue = "pageNumber=0&pageSize=10") CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true, defaultValue = "pageNumber=0&pageSize=10") CommonPageable commonPageable) {
try { try {
ReginParams reginParams = getSelectedOrgInfo(); if (StringUtils.isEmpty(queryRequests.getBizOrgCode())) {
//获取所在公司code ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode=reginParams.getPersonIdentity().getBizOrgCode(); //获取所在公司code
queryRequests.setBizOrgCode(bizOrgCode); String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
if(commonPageable !=null){ queryRequests.setBizOrgCode(bizOrgCode);
queryRequests.setPageNumber(commonPageable.getPageNumber()-1); }
if (commonPageable != null) {
queryRequests.setPageNumber(commonPageable.getPageNumber() - 1);
queryRequests.setPageSize(commonPageable.getPageSize()); queryRequests.setPageSize(commonPageable.getPageSize());
} }
Page<HashMap<String, Object>> routeList = routeService.getRouteInfo(null,null,null,queryRequests); Page<HashMap<String, Object>> routeList = routeService.getRouteInfo(null,null,null,queryRequests);
return CommonResponseUtil.success(routeList); return CommonResponseUtil.success(routeList);
...@@ -179,9 +184,7 @@ public class RouteController extends AbstractBaseController { ...@@ -179,9 +184,7 @@ public class RouteController extends AbstractBaseController {
route.setOrgCode(loginOrgCode); route.setOrgCode(loginOrgCode);
if(!StringUtils.isEmpty(route.getName())){ if(!StringUtils.isEmpty(route.getName())){
LambdaQueryWrapper<Route> wrapper = new LambdaQueryWrapper<>(); List<Route> list = iRouteDao.getListByName(route.getName());
wrapper.eq(Route::getName,route.getName());
List<Route> list = routeServiceImpl.list(wrapper);
if (!ObjectUtils.isEmpty(list) || list.size()>0){ if (!ObjectUtils.isEmpty(list) || list.size()>0){
throw new BadRequest("该名称路线已存在"); throw new BadRequest("该名称路线已存在");
} }
......
...@@ -22,4 +22,7 @@ public interface IRouteDao extends BaseDao<Route, Long> { ...@@ -22,4 +22,7 @@ public interface IRouteDao extends BaseDao<Route, Long> {
@Query(value = "select * from p_route where original_id in ?1 and is_delete =0", nativeQuery = true) @Query(value = "select * from p_route where original_id in ?1 and is_delete =0", nativeQuery = true)
List<Route> listByOriginalIds(List<String> originalIds); List<Route> listByOriginalIds(List<String> originalIds);
@Query(value = "select * from p_route where `name` = ?1 and is_delete =0", nativeQuery = true)
List<Route> getListByName(String name);
} }
...@@ -45,7 +45,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -45,7 +45,7 @@ public class PlanServiceImpl implements IPlanService {
} }
@Override @Override
public void addPlan(HashMap<String, Object> map) { public Plan addPlan(HashMap<String, Object> map) {
Plan param = (Plan) map.get("param"); Plan param = (Plan) map.get("param");
String userDept = param.getUserDept(); String userDept = param.getUserDept();
...@@ -84,7 +84,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -84,7 +84,7 @@ public class PlanServiceImpl implements IPlanService {
param.setDayBegin(DateUtil.formatStrToTime("00:00:00")); param.setDayBegin(DateUtil.formatStrToTime("00:00:00"));
param.setDayEnd(DateUtil.formatStrToTime("23:59:59")); param.setDayEnd(DateUtil.formatStrToTime("23:59:59"));
} }
planDao.save(param); return planDao.save(param);
} }
@Override @Override
......
...@@ -21,7 +21,7 @@ public interface IPlanService { ...@@ -21,7 +21,7 @@ public interface IPlanService {
* 巡检计划新增及维护 * 巡检计划新增及维护
* @param map * @param map
*/ */
void addPlan(HashMap<String, Object> map); Plan addPlan(HashMap<String, Object> map);
/** /**
* 巡检计划删除 * 巡检计划删除
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
from from
f_fire_fighting_system as sys f_fire_fighting_system as sys
left join wl_warehouse_structure wws on wws.id = sys.contro_box_build left join wl_warehouse_structure wws on wws.id = sys.contro_box_build
LEFT JOIN wl_equipment_category wec ON wec.id = sys.system_type
<where> <where>
<if test="equimentName != null and equimentName !='' and equimentCode !='null' "> <if test="equimentName != null and equimentName !='' and equimentCode !='null' ">
AND sys.name like CONCAT('%',#{equimentName},'%') AND sys.name like CONCAT('%',#{equimentName},'%')
......
...@@ -61,5 +61,6 @@ public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport> ...@@ -61,5 +61,6 @@ public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport>
return map; return map;
} }
return null;
} }
}
\ 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