优化
This commit is contained in:
parent
d4e870d88d
commit
7dfc8a9e16
@ -99,9 +99,14 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
if (user.getAccountType() == 2) {
|
||||
Expression plainSelectWhere = plainSelect.getWhere();
|
||||
String whereString = plainSelectWhere.toString();
|
||||
if (!whereString.contains(getEngineeringSn() + " =") && !plainSelect.getFromItem().toString().split(" ")[0].equals("engineering")) {
|
||||
equalsTo(getAliasColumn(plainSelect, getEngineeringSn()), "", plainSelect);
|
||||
}
|
||||
// try {
|
||||
// whereString = CCJSqlParserUtil.parseCondExpression(plainSelectWhere.toString());
|
||||
// if (((AndExpression)whereString).getLeftExpression().equals("")) {
|
||||
//
|
||||
// }
|
||||
// } catch (JSQLParserException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
List<String> projectSns = projectService.getSnListForGov(user.getSn());
|
||||
if (projectSns.size() == 0) {
|
||||
projectSns.add("0");
|
||||
|
||||
@ -11,11 +11,9 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevStatDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.entity.EnvironmentDev;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentAlarmService;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentDevService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -45,12 +43,6 @@ public class GovEnvironmentDevController {
|
||||
@Autowired
|
||||
private IEnvironmentDevService environmentDevService;
|
||||
|
||||
@Autowired
|
||||
private IEngineeringService engineeringService;
|
||||
|
||||
@Autowired
|
||||
private IEnvironmentAlarmService environmentAlarmService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
||||
@ -26,11 +26,11 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 扬尘实时数据管理
|
||||
* @author: pds
|
||||
* @date: 2023-03-01
|
||||
* @date: 2023-03-01
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -38,30 +38,47 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "扬尘实时数据")
|
||||
public class DustNoiseDataController {
|
||||
@Autowired
|
||||
private IDustNoiseDataService dustNoiseDataService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "扬尘实时数据管理", operType = "分页查询", operDesc = "分页列表查询扬尘实时数据管理信息")
|
||||
@ApiOperation(value = " 分页列表查询扬尘实时数据管理信息", notes = "分页列表查询扬尘实时数据管理信息", httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "扬尘名称", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<DustNoiseData>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
String name = MapUtils.getString(map, "name");
|
||||
QueryWrapper<DustNoiseData> wrapper = Wrappers.<DustNoiseData>query();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
wrapper.like("ed.name", name);
|
||||
@Autowired
|
||||
private IDustNoiseDataService dustNoiseDataService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "扬尘实时数据管理", operType = "分页查询", operDesc = "分页列表查询扬尘实时数据管理信息")
|
||||
@ApiOperation(value = " 分页列表查询扬尘实时数据管理信息", notes = "分页列表查询扬尘实时数据管理信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "code", value = "设备编码", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "name", value = "扬尘名称", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<DustNoiseData>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
String engineeringSn = MapUtils.getString(map, "engineeringSn");
|
||||
String name = MapUtils.getString(map, "name");
|
||||
String code = MapUtils.getString(map, "code");
|
||||
String startTime = MapUtils.getString(map, "startTime");
|
||||
String endTime = MapUtils.getString(map, "endTime");
|
||||
QueryWrapper<DustNoiseData> wrapper = Wrappers.<DustNoiseData>query();
|
||||
if (StringUtils.isNotBlank(engineeringSn)) {
|
||||
wrapper.eq("ed.engineering_sn", engineeringSn);
|
||||
}
|
||||
wrapper.orderByDesc("d.create_time");
|
||||
Page<DustNoiseData> page = PageUtil.getPage(map);
|
||||
IPage<DustNoiseData> pageList = dustNoiseDataService.pageList(page, wrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
wrapper.like("ed.name", name);
|
||||
}
|
||||
if (StringUtils.isNotBlank(code)) {
|
||||
wrapper.eq("ed.code", code);
|
||||
}
|
||||
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
|
||||
wrapper.between("d.create_time", startTime, endTime);
|
||||
}
|
||||
wrapper.orderByDesc("d.create_time");
|
||||
Page<DustNoiseData> page = PageUtil.getPage(map);
|
||||
IPage<DustNoiseData> pageList = dustNoiseDataService.pageList(page, wrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,6 +94,12 @@ public class InspectRecord implements Serializable {
|
||||
@Excel(name = "执法状态(1:执法中;2:待整改(整改中);3:待审核;4:已闭合(整改完成);5:已驳回)", width = 15)
|
||||
@ApiModelProperty(value = "执法状态(1:执法中;2:待整改(整改中);3:待审核;4:已闭合(整改完成);5:已驳回)")
|
||||
private Integer state;
|
||||
/**
|
||||
* 执法进度延误状态(1:正常;2:临期;3:超期)
|
||||
*/
|
||||
@Excel(name = "执法进度延误状态(1:正常;2:临期;3:超期)", width = 15)
|
||||
@ApiModelProperty(value = "执法进度延误状态(1:正常;2:临期;3:超期)")
|
||||
private Integer slippageState;
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.task;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.zhgd.xmgl.modules.safety.entity.InspectRecord;
|
||||
import com.zhgd.xmgl.modules.safety.entity.ProjectSubItem;
|
||||
import com.zhgd.xmgl.modules.safety.service.IInspectRecordService;
|
||||
import com.zhgd.xmgl.modules.safety.service.IProjectSubItemService;
|
||||
@ -55,24 +56,24 @@ public class SlippageTask {
|
||||
/**
|
||||
* 每天凌晨计算安全质量临期
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 * * ?")
|
||||
// private void inspectRecord() {
|
||||
// List<Integer> states = Arrays.asList(4, 8);
|
||||
// List<InspectRecord> change = new ArrayList<>();
|
||||
// List<InspectRecord> list = inspectRecordService.list();
|
||||
// list.stream().forEach(l -> {
|
||||
// if (l.getState() < 3 && DateUtil.between(new Date(), l.getDeadline(), DateUnit.DAY, false) <= 15) {
|
||||
// l.setState(4);
|
||||
// change.add(l);
|
||||
// }
|
||||
// if (!states.contains(l.getState()) && DateUtil.between(l.getDeadline(), new Date(), DateUnit.DAY, false) > 0) {
|
||||
// l.setState(5);
|
||||
// change.add(l);
|
||||
// }
|
||||
// });
|
||||
// if (change.size() > 0) {
|
||||
// projectSubItemService.updateBatchById(change);
|
||||
// }
|
||||
// log.info("=========定时修改项目进度状态任务执行成功========");
|
||||
// }
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
private void inspectRecord() {
|
||||
List<Integer> states = Arrays.asList(1, 4);
|
||||
List<InspectRecord> change = new ArrayList<>();
|
||||
List<InspectRecord> list = inspectRecordService.list();
|
||||
list.stream().forEach(l -> {
|
||||
if (!states.contains(l.getState()) && DateUtil.between(new Date(), l.getDeadline(), DateUnit.DAY, false) <= 15) {
|
||||
l.setSlippageState(2);
|
||||
change.add(l);
|
||||
}
|
||||
if (!states.contains(l.getState()) && DateUtil.between(l.getDeadline(), new Date(), DateUnit.DAY, false) > 0) {
|
||||
l.setSlippageState(3);
|
||||
change.add(l);
|
||||
}
|
||||
});
|
||||
if (change.size() > 0) {
|
||||
inspectRecordService.updateBatchById(change);
|
||||
}
|
||||
log.info("=========定时修改项目进度状态任务执行成功========");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user