Commit 54a328e5 authored by kongfm's avatar kongfm

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

parents 0b68d6eb a2a48d3d
package com.yeejoin.amos.boot.module.command.api.dto;
import org.springframework.web.bind.annotation.PathVariable;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
public class CarTaskDto {
private Long carid;
private Long alertCalledId;
private String code;
private int type;
private String remarks;
public Long getCarid() {
return carid;
}
public void setCarid(Long carid) {
this.carid = carid;
}
public Long getAlertCalledId() {
return alertCalledId;
}
public void setAlertCalledId(Long alertCalledId) {
this.alertCalledId = alertCalledId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
......@@ -160,7 +160,7 @@ public interface IMaintenanceCompanyService {
* 将所有的维保人员导入到excle中
* @return
*/
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel();
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map);
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
......
......@@ -46,6 +46,10 @@ public class PowerTransferCompanyResources extends BaseEntity {
@ApiModelProperty(value = "车辆任务状态")
private String carStatus;
@ApiModelProperty(value = "任务备注")
private String remarks;
@ApiModelProperty(value = "任务状态")
@TableField(exist = false)
private String statusName;
......
......@@ -18,6 +18,6 @@ public interface IPowerTransferCompanyResourcesService {
PowerTransferCompanyResources getByAlertCalledIdCarId(Long alertCalledId,Long carId);
void updatePowerTransferCompanyResourcesService(Long alertCalledId,Long carId,String code,int type);
void updatePowerTransferCompanyResourcesService(Long alertCalledId,Long carId,String code,int type,String remarks);
}
......@@ -27,6 +27,7 @@
d.rec_user_id,
d.rec_date,
d.car_status,
d.remarks,
d.is_delete,
CASE d.status
WHEN 'executing' THEN '未完成'
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.biz.common.enums.HomePageEnum;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils;
import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao;
import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*;
......@@ -1274,14 +1275,16 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(powerTransferCompanyResources);
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "updatePowerTransferCompanyResourcesService/{carid}/{alertCalledId}/{code}/{type}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "修改任务,车辆状态", notes = "修改任务,车辆状态")
public ResponseModel<Object> updatePowerTransferCompanyResourcesService(@PathVariable Long carid,
@PathVariable Long alertCalledId,
@PathVariable String code,
@PathVariable int type) {
@RequestMapping(value = "updatePowerTransferCompanyResourcesService", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "修改任务,车辆状态", notes = "修改任务,车辆状态")
public ResponseModel<Object> updatePowerTransferCompanyResourcesService(@RequestBody CarTaskDto carTaskDto) {
//获取正在进行的灾情
powerTransferCompanyResourcesService.updatePowerTransferCompanyResourcesService(alertCalledId,carid,code,type);
powerTransferCompanyResourcesService.updatePowerTransferCompanyResourcesService(
carTaskDto.getAlertCalledId(),
carTaskDto.getCarid(),
carTaskDto.getCode(),
carTaskDto.getType(),
carTaskDto.getRemarks());
return ResponseHelper.buildResponse(null);
}
......
......@@ -3,25 +3,27 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
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.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
......@@ -138,7 +140,7 @@ public class FireStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "微型消防站列表全部数据查询", notes = "微型消防站列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false));
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false,null,null));
}
/**
......
......@@ -134,7 +134,11 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
Map<String, String> params = this.getRequestParamMap();
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page(current, size);
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
page.setSize(size);
}
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -8,23 +19,12 @@ import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
/**
* 微型消防站服务实现类
......@@ -53,8 +53,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
/**
* 列表查询 示例
*/
public List<FireStationDto> queryForFireStationList(@Condition(Operator.eq) Boolean isDelete) {
return this.queryForList("", false, isDelete);
public List<FireStationDto> queryForFireStationList(@Condition(Operator.eq) Boolean isDelete,@Condition(Operator.eq) Long bizCompanyId,@Condition(Operator.like) String name) {
return this.queryForList("", false, isDelete,bizCompanyId,name);
}
/**
......
......@@ -35,6 +35,8 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
......@@ -290,10 +292,55 @@ public class MaintenanceCompanyServiceImpl
});
return dynamicFormList;
}
public List<Map<String, Object>> getAllMaintenanceEexcleList(String maintenanceType,Map parms) {
String type = null;
switch (maintenanceType.toUpperCase()) {
case PERSON:
type = MAINTENANCE_PERSON;
break;
case DEPARTMENT:
type = MAINTENANCE_DEPARTMENT;
break;
default:
type = MAINTENANCE_COMPANY;
}
if (StringUtils.isBlank(type)) {
return null;
}
List<Map<String, Object>> dynamicFormList = dynamicFormInstanceService.listAll(type);
LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>();
wrapper.eq(MaintenanceCompany::getType, maintenanceType.toUpperCase());
wrapper.eq(MaintenanceCompany::getIsDelete, false);
if(parms!=null && parms.size()>0) {
String name =parms.containsKey("name")?parms.get("name").toString():null;
String parentId =parms.containsKey("parentId")?parms.get("parentId").toString():null;
if(name!=null) {
wrapper.like(MaintenanceCompany::getName, name);
}
if(parentId!=null) {
wrapper.eq(MaintenanceCompany::getParentId, parentId);
}
}
List<MaintenanceCompany> maintenanceCompany = this.list(wrapper);
Map<Long, MaintenanceCompany> maintenanceCompanyMap = maintenanceCompany.stream()
.collect(Collectors.toMap(MaintenanceCompany::getInstanceId, Function.identity()));
dynamicFormList.forEach(r -> {
MaintenanceCompany detail = maintenanceCompanyMap.get(Long.parseLong(r.get("instanceId").toString()));
if (!ObjectUtils.isEmpty(detail)) {
if(detail.getParentId()!=null && detail.getName()!=null) {
MaintenanceCompany map = maintenanceCompanyMapper.selectById(detail.getParentId());
r.put("parentName", map.getName());
r.putAll(Bean.BeantoMap(detail));
}
}
});
return dynamicFormList.stream().filter(i-> i.containsKey("name")).collect(Collectors.toList());
}
@Override
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel() {
List<Map<String, Object>> list = this.getAllMaintenanceList(PERSON);
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map) {
List<Map<String, Object>> list = this.getAllMaintenanceEexcleList(PERSON,map);
return JSONArray.parseArray(JSONArray.toJSONString(list), MaintenancePersonExcleDto.class);
}
......
......@@ -107,6 +107,9 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import static org.hamcrest.CoreMatchers.nullValue;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -249,7 +252,13 @@ public class ExcelServiceImpl {
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
String nameString =null;
Long bizCompanyId =null;
if(par!=null && par.size()>0) {
nameString =par.containsKey("name")?par.get("name").toString():null;
bizCompanyId =par.containsKey("bizCompanyId")?Long.parseLong(par.get("bizCompanyId").toString()):null;;
}
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false, bizCompanyId,nameString);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
FireStationDto.class, null, false);
break;
......@@ -260,7 +269,7 @@ public class ExcelServiceImpl {
break;
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
.exportToMaintenancePersonExcel();
.exportToMaintenancePersonExcel(par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break;
......@@ -1556,7 +1565,7 @@ public class ExcelServiceImpl {
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false,null,null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
FireStationDto.class, null, false);
break;
......@@ -1567,7 +1576,7 @@ public class ExcelServiceImpl {
break;
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
.exportToMaintenancePersonExcel();
.exportToMaintenancePersonExcel(null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break;
......
......@@ -51,27 +51,30 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
return powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId,carId);
}
@Override
@Transactional
public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code,int type) {
public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code,int type , String remarks) {
PowerTransferCompanyResources powerTransferCompanyResources= powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId,carId);
try {
if(1==type){
powerTransferCompanyResources.setCarStatus(code);
powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources);
}else{
if(type==2){
powerTransferCompanyResources.setStatus(code);
powerTransferCompanyResources.setRemarks(remarks);
powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources);
List<Object> carStatusInfoDtoList = new ArrayList();
//修改装备信息
CarStatusInfoDto carStatusInfo = new CarStatusInfoDto();
carStatusInfo.setSequenceNbr(carId.toString());
carStatusInfo.setSequenceNbr(carId+"");
carStatusInfo.setStatus(FireCarStatusEnum.执勤.getCode());
carStatusInfoDtoList.add(carStatusInfo);
// 更新所有车辆状态为执勤
equipFeignClient.updateCarStatus(carStatusInfoDtoList);
}else{
powerTransferCompanyResources.setCarStatus(code);
powerTransferCompanyResources.setRemarks(remarks);
powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources);
}
} catch (Exception e) {
throw new RuntimeException("修改失败!");
......
......@@ -240,6 +240,9 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
pageParam.put("orgCode", loginOrgCode);
IPage<LatentDanger> result = iLatentDangerService.pageListDanger(pageParam);
return ResponseHelper.buildResponse(result);
}
......@@ -294,6 +297,9 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/list/all")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<List<LatentDanger>> listAllDanger(@RequestBody LatentDangerListParam searchParam) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
searchParam.setOrgCode(loginOrgCode);
return ResponseHelper.buildResponse(iLatentDangerService.listAllDanger(searchParam));
}
......@@ -336,6 +342,9 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/supervision/page/reviewList")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel reviewListDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
pageParam.put("orgCode", loginOrgCode);
IPage<LatentDanger> result = iLatentDangerService.reviewListDanger(pageParam);
return ResponseHelper.buildResponse(result);
}
......
......@@ -39,4 +39,6 @@ public class LatentDangerListParam extends CommonPageable {
private String userId;
private String dangerIds;
private String orgCode;
}
......@@ -106,11 +106,22 @@ public class PageParam<K, V> extends HashMap<K, V> implements Pageable {
return false;
}
public int getParamCurrent() {
if (!ValidationUtil.isEmpty(this.get("current"))) {
public int getParamPageCurrent() {
if (ValidationUtil.isEmpty(this.get("current"))) {
return current;
}
if (this.get("current") instanceof String && this.get("size") instanceof String) {
if (this.get("current") instanceof String) {
return Integer.parseInt((String) this.get("current"));
} else {
return (Integer)(this.get("current"));
}
}
public int getParamPageSize() {
if (ValidationUtil.isEmpty(this.get("size"))) {
return size;
}
if (this.get("size") instanceof String) {
return Integer.parseInt((String) this.get("current"));
} else {
return (Integer)(this.get("current"));
......
......@@ -49,7 +49,20 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo;
import com.yeejoin.amos.latentdanger.common.enums.*;
import com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerBizTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerOvertimeStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerProcessStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.OwerEnum;
import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWebSocketServer;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWorkFlowService;
......@@ -81,9 +94,17 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
......@@ -107,6 +128,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Autowired
SupervisionFeignClient supervisionFeignClient;
@Autowired
JcsFeignClient jcsFeignClient;
@Autowired
private RemoteWorkFlowService remoteWorkFlowService;
@Autowired
private RemoteSecurityService remoteSecurityService;
......@@ -120,7 +143,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private RemoteSpcService remoteSpcService;
@Autowired
private AsyncTask asyncTask;
// @Autowired
// private Business business;
@Autowired
......@@ -145,14 +167,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private WorkflowExcuteServiceImpl workflowExecuteService;
@Autowired
private WorkflowFeignService workflowFeignService;
// 有启动后执行现场确认的角色名称
@Value("${onSite.confirm.roleName}")
private String onSiteConfirmRole;
@Autowired
JcsFeignClient jcsFeignClient;
@Transactional(rollbackFor = Exception.class)
@Override
public CommonResponse saveNormal(LatentDangerDto latentDangerDto, String userId, String userRealName,
......@@ -1813,18 +1831,17 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!ValidationUtil.isEmpty(dangerIdList)) {
pageParam.put("dangerIds", dangerIdList);
}
Page page = new Page();
initPage(pageParam, page);
if (ValidationUtil.isEmpty(pageParam.get("order"))) {
pageParam.put("order", "1");
}
Page page = new Page(pageParam.getParamPageCurrent(), pageParam.getParamPageSize());
IPage<LatentDanger> iPage = this.baseMapper.selectPageByParam(page, (Map<String, Object>) pageParam);
if (iPage.getCurrent() != pageParam.getParamCurrent()) {
if (iPage.getCurrent() != pageParam.getParamPageCurrent()) {
iPage.setRecords(Lists.newArrayList());
iPage.setTotal(0);
iPage.setCurrent(pageParam.getParamCurrent());
iPage.setCurrent(pageParam.getParamPageCurrent());
return iPage;
}
Map<String, Object> buildingAbsolutePositionMap = new HashMap<>();
......@@ -1865,18 +1882,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return iPage;
}
public void initPage(PageParam pageParam, Page page) {
if (pageParam.get("current") instanceof String && pageParam.get("size") instanceof String) {
int current = Integer.valueOf((String) pageParam.get("current"));
int size = Integer.valueOf((String) pageParam.get("size"));
page.setCurrent(current);
page.setSize(size);
} else {
page.setCurrent((Integer)(pageParam.get("current")));
page.setSize((Integer)(pageParam.get("size")));
}
}
private List<Map<String, Object>> getAllNodes(List<Map<String, Object>> buildingTree) {
List<Map<String, Object>> res = new LinkedList<>();
if (buildingTree != null && !buildingTree.isEmpty()) {
......@@ -1983,6 +1988,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!ValidationUtil.isEmpty(searchParam.getDangerIds())) {
lambdaQueryWrapper.in(LatentDanger::getId, Lists.newArrayList(searchParam.getDangerIds().split(",")));
}
lambdaQueryWrapper.and(o ->
o.likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "*")
.or().likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "-")
.or().eq(LatentDanger::getOrgCode, searchParam.getOrgCode()));
List<LatentDanger> latentDangers = this.baseMapper.selectList(lambdaQueryWrapper);
return latentDangers;
......
......@@ -17,8 +17,8 @@ public interface IPlanDao extends BaseDao<Plan, Long> {
@Modifying
@Transactional
@Query(value = "select * from p_plan WHERE next_gen_date = ?1 and status = ?2", nativeQuery = true)
List<Plan> queryScheduledPlan(String strDate, String status);
@Query(value = "select * from p_plan WHERE next_gen_date = ?1 and (status = ?2 or status = ?3)", nativeQuery = true)
List<Plan> queryScheduledPlan(String strDate, String status, String status1);
@Modifying
@Transactional
......
......@@ -331,7 +331,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String strDate = df.format(now);
String tomorrow = DateUtil.getIntervalDateStr(now, 1, "yyyy-MM-dd");//下一天
List<Plan> planList = iplanDao.queryScheduledPlan(strDate, String.valueOf(PlanStatusEnum.EXAMINE_DEVELOPED.getValue()));
// 根据计划状态5,6和next_gen_date查询需要生成任务的计划
List<Plan> planList = iplanDao.queryScheduledPlan(strDate, String.valueOf(PlanStatusEnum.EXAMINE_DEVELOPED.getValue()), String.valueOf(PlanStatusEnum.IN_EXECUTION.getValue()));
if (planList == null || planList.size() <= 0) {
log.info(strDate + " " + " 暂无待生成执行数据的计划");
return;
......@@ -359,9 +360,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planMapper.updPlanStatusOrGenDate(paramMap);//更新为明天
continue;
}
//计划已过期,则更新status = 1,停用
//计划已过期,则更新status = 7,已完成
if (!vo.getIsGenData()) {
paramMap.put("status", XJConstant.PLAN_STATUS_STOP);
paramMap.put("status", PlanStatusEnum.COMPLETED.getValue());
planMapper.updPlanStatusOrGenDate(paramMap);
continue;
}
......
......@@ -1895,5 +1895,19 @@
</sql>
</changeSet>
<changeSet author="tw" id="2021-10-20-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_power_transfer_company_resources"/>
</preConditions>
<comment>增加车辆状态</comment>
<sql>
ALTER TABLE `jc_power_transfer_company_resources` add remarks varchar(5000) DEFAULT NULL COMMENT '任务备注'
</sql>
</changeSet>
</databaseChangeLog>
......@@ -963,6 +963,10 @@
<where>
deleted = 0
<foreach collection="paramMap" index="key" item="value">
<if test="key == 'orgCode' and value != null and value != ''">
and (a.org_code like concat(#{value}, "*%") or a.org_code like concat(#{value}, "-%") or
a.org_code = #{value})
</if>
<if test="key == 'bizType' and value != null and value != ''">
and a.biz_type = #{value}
</if>
......
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