合并
This commit is contained in:
parent
2c4ce9d768
commit
63f3d1cd39
@ -86,6 +86,17 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
||||
FromItem fromItem = plainSelect.getFromItem();
|
||||
if (fromItem instanceof Table) {
|
||||
this.dataScopeHandler.getSqlSegment(plainSelect, obj);
|
||||
} else {
|
||||
processFromItem(fromItem, obj);
|
||||
}
|
||||
}
|
||||
|
||||
protected void processFromItem(FromItem fromItem, Object obj) {
|
||||
if (fromItem instanceof SubSelect) {
|
||||
SubSelect subSelect = (SubSelect) fromItem;
|
||||
if (subSelect.getSelectBody() != null) {
|
||||
processSelectBody(subSelect.getSelectBody(), obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -120,10 +121,32 @@ public class HardWareCallbackController {
|
||||
param = dustNoiseData.getEngineeringSn();
|
||||
}
|
||||
redisRepository.set(CacheConstants.DUST_NOISE_DATA + param, dustNoiseData);
|
||||
DustNoiseData dustNoiseDataAlarm = dustNoiseDataService.setAlarm(dustNoiseData);
|
||||
if (dustNoiseDataAlarm.getPm25Alarm()) {
|
||||
checkAlarm(dustNoiseDataAlarm.getDeviceCode(), dustNoiseDataAlarm.getPm25(), "PM2.5");
|
||||
}
|
||||
if (dustNoiseDataAlarm.getPm10Alarm()) {
|
||||
checkAlarm(dustNoiseDataAlarm.getDeviceCode(), dustNoiseDataAlarm.getPm10(), "PM10");
|
||||
}
|
||||
if (dustNoiseDataAlarm.getTspAlarm()) {
|
||||
checkAlarm(dustNoiseDataAlarm.getDeviceCode(), dustNoiseDataAlarm.getTsp(), "TSP");
|
||||
}
|
||||
if (dustNoiseDataAlarm.getNoiseAlarm()) {
|
||||
checkAlarm(dustNoiseDataAlarm.getDeviceCode(), dustNoiseDataAlarm.getNoise(), "噪音");
|
||||
}
|
||||
// sendMessage(ParamEnum.KafkaTopic.DUST_NOISE.getValue(), JSON.toJSONString(dustNoiseData));
|
||||
return Result.ok("操作成功!");
|
||||
}
|
||||
|
||||
private void checkAlarm(String code, BigDecimal alarmValue, String type) {
|
||||
EnvironmentAlarm environmentAlarm = new EnvironmentAlarm();
|
||||
environmentAlarm.setDeviceCode(code);
|
||||
environmentAlarm.setType(type);
|
||||
environmentAlarm.setAlarmValue(alarmValue);
|
||||
// environmentAlarm.setCause("系统判定");
|
||||
addEnvironmentAlarm(environmentAlarm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扬尘报警数据上报
|
||||
* @param environmentAlarm
|
||||
@ -142,17 +165,13 @@ public class HardWareCallbackController {
|
||||
environmentAlarm.setEngineeringSn(environmentDev.getEngineeringSn());
|
||||
environmentAlarm.setState(0);
|
||||
|
||||
Integer dictLabel = 0;
|
||||
for (ParamEnum.EnvironmentAlarmTypeThreshold value : ParamEnum.EnvironmentAlarmTypeThreshold.values()) {
|
||||
if (environmentAlarm.getType().equals(value.getDesc())) {
|
||||
dictLabel = value.getValue();
|
||||
}
|
||||
}
|
||||
if(dictLabel == 0) {
|
||||
SystemDictData alarmType = systemDictDataService.getOne(Wrappers.<SystemDictData>lambdaQuery().eq(SystemDictData::getDictType,
|
||||
ParamEnum.SysDictType.ENVIRONMENT_ALARM_TYPE).eq(SystemDictData::getDictValue, environmentAlarm.getType()));
|
||||
if(alarmType == null) {
|
||||
return Result.error("未知报警类型!");
|
||||
}
|
||||
environmentAlarm.setThresholdValue(Double.valueOf(systemDictDataService.getOne(Wrappers.<SystemDictData>lambdaQuery().eq(SystemDictData::getDictType,
|
||||
ParamEnum.SysDictType.ENVIRONMENT_ALARM_TYPE_THRESHOLD).eq(SystemDictData::getDictLabel, dictLabel)).getDictValue()));
|
||||
environmentAlarm.setThresholdValue(new BigDecimal(systemDictDataService.getOne(Wrappers.<SystemDictData>lambdaQuery().eq(SystemDictData::getDictType,
|
||||
ParamEnum.SysDictType.ENVIRONMENT_ALARM_TYPE_THRESHOLD).eq(SystemDictData::getDictLabel, alarmType.getDictLabel())).getDictValue()));
|
||||
environmentAlarm.setOffsetValue(CommonUtil.offset(environmentAlarm.getAlarmValue(), environmentAlarm.getThresholdValue()));
|
||||
environmentAlarmService.save(environmentAlarm);
|
||||
long num = redisRepository.leftPush(CacheConstants.ENVIRONMENT_ALARM_LIST + environmentDev.getCode(), environmentAlarm);
|
||||
|
||||
@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -238,13 +237,10 @@ public class SystemUserAuthController {
|
||||
String account = "";
|
||||
if (userId.equals("myy")) {
|
||||
account = "hzxmgl";
|
||||
}
|
||||
if (userId.equals("test")) {
|
||||
} else if (userId.equals("test")) {
|
||||
account = "hzxm";
|
||||
}
|
||||
if (StringUtils.isBlank(account)) {
|
||||
result.error500("用户不存在");
|
||||
return result;
|
||||
} else {
|
||||
account = userId;
|
||||
}
|
||||
SystemUser user = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery()
|
||||
.eq(SystemUser::getAccount, account));
|
||||
|
||||
@ -58,7 +58,6 @@ public class GovEnterpriseScoreStandardController {
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<EnterpriseScoreStandard>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<EnterpriseScoreStandard> queryWrapper = QueryGenerator.initPageQueryWrapper(EnterpriseScoreStandard.class, map);
|
||||
queryWrapper.lambda().eq(EnterpriseScoreStandard::getCreateBy, SecurityUtil.getUser().getSn());
|
||||
Page<EnterpriseScoreStandard> page = PageUtil.getPage(map);
|
||||
IPage<EnterpriseScoreStandard> pageList = enterpriseScoreStandardService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
@ -74,7 +73,6 @@ public class GovEnterpriseScoreStandardController {
|
||||
@ApiOperation(value = " 列表查询企业类型评分标准信息", notes = "列表查询企业类型评分标准信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<EnterpriseScoreStandard>> queryList(@RequestBody EnterpriseScoreStandard enterpriseScoreStandard) {
|
||||
enterpriseScoreStandard.setCreateBy(SecurityUtil.getUser().getSn());
|
||||
QueryWrapper<EnterpriseScoreStandard> queryWrapper = QueryGenerator.initQueryWrapper(enterpriseScoreStandard);
|
||||
List<EnterpriseScoreStandard> list = enterpriseScoreStandardService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller.government;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.safety.entity.Remind;
|
||||
import com.zhgd.xmgl.modules.safety.service.IRemindService;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 待办提醒
|
||||
* @author: pengj
|
||||
* @date: 2023-08-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/gov/remind")
|
||||
@Slf4j
|
||||
@Api(tags = "待办提醒管理")
|
||||
public class GovRemindController {
|
||||
@Autowired
|
||||
private IRemindService remindService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @param remind
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "待办提醒管理", operType = "列表查询", operDesc = "列表查询待办提醒信息")
|
||||
@ApiOperation(value = " 列表查询待办提醒信息", notes = "列表查询待办提醒信息", httpMethod="POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<Remind>> queryList(@RequestBody Remind remind) {
|
||||
QueryWrapper<Remind> queryWrapper = QueryGenerator.initQueryWrapper(remind);
|
||||
queryWrapper.lambda().isNull(Remind::getUpdateTime);
|
||||
queryWrapper.lambda().eq(Remind::getUserId, SecurityUtil.getUser().getUserId());
|
||||
List<Remind> list = remindService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param remind
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "待办提醒管理", operType = "修改", operDesc = "编辑待办提醒信息")
|
||||
@ApiOperation(value = "编辑待办提醒信息", notes = "编辑待办提醒信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<Remind> edit(@RequestBody Remind remind) {
|
||||
Result<Remind> result = new Result<Remind>();
|
||||
Remind remindEntity = remindService.getById(remind.getId());
|
||||
if(remindEntity==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = remindService.updateById(remind);
|
||||
if(ok) {
|
||||
result.success("修改成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -41,6 +41,12 @@ public class EngineeringMain implements Serializable {
|
||||
@Excel(name = "企业sn", width = 15)
|
||||
@ApiModelProperty(value = "企业sn")
|
||||
private String enterpriseSn;
|
||||
/**
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private String projectSn;
|
||||
/**
|
||||
* 工程sn
|
||||
*/
|
||||
|
||||
@ -104,7 +104,7 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
|
||||
// 查询当前账号角色下的菜单,管理员账号默认全部菜单
|
||||
SecurityUser user = SecurityUtil.getUser();
|
||||
List<BaseMenu> baseMenus = new ArrayList<>();
|
||||
if (user.isManager()) {
|
||||
if (user.isManager() && user.getAccountType() != 3) {
|
||||
// 查询相对应的菜单
|
||||
baseMenus = baseMenuMapper.selectList(Wrappers.<BaseMenu>lambdaQuery().in(BaseMenu::getModuleId, moduleId)
|
||||
.eq(BaseMenu::getStatus, 1).orderByAsc(BaseMenu::getPriority));
|
||||
@ -159,10 +159,9 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
|
||||
if (userId.equals("myy")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxmgl"));
|
||||
moduleId = 1670639811581595650L;
|
||||
}
|
||||
if (userId.equals("test")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxm"));
|
||||
moduleId = 1670603312504918018L;
|
||||
} else {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, userId));
|
||||
moduleId = 1681837103227502594L;
|
||||
}
|
||||
if (systemUser == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
|
||||
@ -69,7 +69,7 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
List<Long> allIds = moduleTemplateService.list(Wrappers.<ModuleTemplate>lambdaQuery()
|
||||
.eq(ModuleTemplate::getModuleType, user.getAccountType())
|
||||
.eq(ModuleTemplate::getGovernmentSn, governmentSn)).stream().map(b -> b.getModuleId()).collect(Collectors.toList());
|
||||
if (user.isManager()) {
|
||||
if (user.isManager() && user.getAccountType() != 3) {
|
||||
ids = allIds;
|
||||
} else {
|
||||
SystemUserRole systemUserRole = systemUserRoleService.getOne(Wrappers.<SystemUserRole>lambdaQuery().eq(SystemUserRole::getUserId, user.getUserId()));
|
||||
|
||||
@ -236,7 +236,7 @@ public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engin
|
||||
@Override
|
||||
public List<Engineering> getList(Engineering engineering) {
|
||||
QueryWrapper<Engineering> queryWrapper = QueryGenerator.initQueryWrapper(engineering);
|
||||
queryWrapper.eq("examine_state", 3);
|
||||
queryWrapper.lambda().eq(Engineering::getExamineState, 3);
|
||||
List<Engineering> list = this.list(queryWrapper);
|
||||
for (Engineering eng : list) {
|
||||
// AI报警信息
|
||||
|
||||
@ -103,7 +103,7 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||
systemUser.setPassword(Aes.encrypt(enterpriseVo.getPassword()));
|
||||
systemUser.setShowPassword(enterpriseVo.getPassword());
|
||||
systemUser.setRealName(enterpriseVo.getRealName());
|
||||
systemUser.setIsManager(false);
|
||||
systemUser.setIsManager(true);
|
||||
systemUser.setState(enterpriseVo.getState());
|
||||
systemUser.setUserTel(enterpriseVo.getPhone());
|
||||
systemUser.setSn(enterpriseVo.getEnterpriseSn());
|
||||
|
||||
@ -82,4 +82,11 @@ public class InspectQuestion implements Serializable {
|
||||
@Excel(name = "状态(1:待整改;2:已整改;3:已闭合;4:已驳回)", width = 15)
|
||||
@ApiModelProperty(value = "状态(1:待整改;2:已整改;3:已闭合;4:已驳回)")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 审核级别(1:初审;2:复审)
|
||||
*/
|
||||
@Excel(name = "审核级别(1:初审;2:复审)", width = 15)
|
||||
@ApiModelProperty(value = "审核级别(1:初审;2:复审)")
|
||||
private Integer level;
|
||||
}
|
||||
|
||||
@ -83,4 +83,11 @@ public class InspectQuestionExamine implements Serializable {
|
||||
@Excel(name = "措施建议", width = 15)
|
||||
@ApiModelProperty(value = "措施建议")
|
||||
private String recommend;
|
||||
|
||||
/**
|
||||
* 审核级别(1:初审;2:复审)
|
||||
*/
|
||||
@Excel(name = "审核级别(1:初审;2:复审)", width = 15)
|
||||
@ApiModelProperty(value = "审核级别(1:初审;2:复审)")
|
||||
private Integer level;
|
||||
}
|
||||
|
||||
@ -126,6 +126,13 @@ public class InspectRecord implements Serializable {
|
||||
@ApiModelProperty(value = "监督执法类型(1:安全监督执法;2:质量监督执法;3:专项检查)")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 审核级别(1:初审;2:复审)
|
||||
*/
|
||||
@Excel(name = "审核级别(1:初审;2:复审)", width = 15)
|
||||
@ApiModelProperty(value = "审核级别(1:初审;2:复审)")
|
||||
private Integer level;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "检查人员名称(多个用逗号隔开)")
|
||||
private String inspectUserName;
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
package com.zhgd.xmgl.modules.safety.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 待办提醒
|
||||
* @author: pengj
|
||||
* @date: 2023-08-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("remind")
|
||||
@ApiModel(value = "Remind实体类", description = "Remind")
|
||||
public class Remind implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 待办事项ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "待办事项ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 提醒类型(1:进度监测)
|
||||
*/
|
||||
@Excel(name = "提醒类型(1:进度监测)", width = 15)
|
||||
@ApiModelProperty(value = "提醒类型(1:进度监测)")
|
||||
private Integer type;
|
||||
/**
|
||||
* 提醒描述
|
||||
*/
|
||||
@Excel(name = "提醒描述", width = 15)
|
||||
@ApiModelProperty(value = "提醒描述")
|
||||
private String remindDesc;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
@Excel(name = "确认时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "确认时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 提醒用户ID
|
||||
*/
|
||||
@Excel(name = "提醒用户ID", width = 15)
|
||||
@ApiModelProperty(value = "提醒用户ID")
|
||||
private String userId;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话", width = 15)
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String userPhone;
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.modules.safety.dto.EnterpriseScoreDto;
|
||||
import com.zhgd.xmgl.modules.safety.entity.EnterpriseScore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -18,6 +19,7 @@ import java.util.List;
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope
|
||||
public interface EnterpriseScoreMapper extends BaseMapper<EnterpriseScore> {
|
||||
|
||||
Page<EnterpriseScoreDto> pageList(Page page, @Param(Constants.WRAPPER)Wrapper<EnterpriseScore> wrapper);
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.safety.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhgd.xmgl.modules.safety.entity.Remind;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 待办提醒
|
||||
* @author: pengj
|
||||
* @date: 2023-08-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface RemindMapper extends BaseMapper<Remind> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.safety.mapper.RemindMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.safety.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.safety.entity.Remind;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 待办提醒
|
||||
* @author: pengj
|
||||
* @date: 2023-08-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IRemindService extends IService<Remind> {
|
||||
|
||||
}
|
||||
@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.handler.exception.CustomException;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringMain;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemDictData;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringMainService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemDictDataService;
|
||||
import com.zhgd.xmgl.modules.safety.dto.EnterpriseScoreDto;
|
||||
import com.zhgd.xmgl.modules.safety.entity.EnterpriseScore;
|
||||
@ -39,6 +41,9 @@ public class EnterpriseScoreServiceImpl extends ServiceImpl<EnterpriseScoreMappe
|
||||
@Autowired
|
||||
private IEngineeringMainService engineeringMainService;
|
||||
|
||||
@Autowired
|
||||
private IEngineeringService engineeringService;
|
||||
|
||||
@Autowired
|
||||
private ISystemDictDataService systemDictDataService;
|
||||
|
||||
@ -78,7 +83,8 @@ public class EnterpriseScoreServiceImpl extends ServiceImpl<EnterpriseScoreMappe
|
||||
if (StringUtils.isNotBlank(enterpriseScore.getEnterpriseSn())) {
|
||||
EngineeringMain engineeringMain = new EngineeringMain();
|
||||
engineeringMain.setEnterpriseSn(enterpriseScore.getEnterpriseSn());
|
||||
engineeringMain.setEngineeringSn(enterpriseScore.getEngineeringSn());
|
||||
engineeringMain.setProjectSn(engineeringService.getOne(Wrappers.<Engineering>lambdaQuery()
|
||||
.eq(Engineering::getEngineeringSn, enterpriseScore.getEngineeringSn())).getProjectSn());
|
||||
engineeringMain.setType(enterpriseScore.getEnterpriseType());
|
||||
engineeringMainService.save(engineeringMain);
|
||||
}
|
||||
|
||||
@ -33,9 +33,11 @@ public class InspectQuestionExamineServiceImpl extends ServiceImpl<InspectQuesti
|
||||
|
||||
@Override
|
||||
public boolean examine(InspectQuestionExamine inspectQuestionExamine) {
|
||||
Integer level = inspectQuestionExamine.getExamineState() == 1 ? inspectQuestionExamine.getLevel() : 1;
|
||||
// 修改问题状态
|
||||
LambdaUpdateWrapper<InspectQuestion> wrapperQuestion = Wrappers.<InspectQuestion>lambdaUpdate();
|
||||
wrapperQuestion.set(InspectQuestion::getState, inspectQuestionExamine.getExamineState() == 1 ? 3 : 4);
|
||||
wrapperQuestion.set(InspectQuestion::getLevel, level);
|
||||
wrapperQuestion.eq(InspectQuestion::getId, inspectQuestionExamine.getInspectQuestionId());
|
||||
inspectQuestionService.update(wrapperQuestion);
|
||||
// 查询是否全部整改完成
|
||||
@ -49,6 +51,7 @@ public class InspectQuestionExamineServiceImpl extends ServiceImpl<InspectQuesti
|
||||
}
|
||||
if (state != 3) {
|
||||
LambdaUpdateWrapper<InspectRecord> recordWrapper = Wrappers.<InspectRecord>lambdaUpdate();
|
||||
recordWrapper.set(InspectRecord::getLevel, level);
|
||||
recordWrapper.set(InspectRecord::getState, state);
|
||||
recordWrapper.eq(InspectRecord::getId, inspectQuestion.getRecordId());
|
||||
inspectRecordService.update(recordWrapper);
|
||||
|
||||
@ -145,6 +145,7 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
|
||||
// 审批通过---闭合
|
||||
Integer questionState = 4;
|
||||
Integer questionExamineState = 2;
|
||||
Integer level = 1;
|
||||
String suggest = "驳回";
|
||||
if (inspectRecord.getState() == 4) {
|
||||
List<Integer> list = Arrays.asList(1,4);
|
||||
@ -156,12 +157,14 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
|
||||
questionState = 3;
|
||||
questionExamineState = 1;
|
||||
suggest = "同意";
|
||||
level = inspectRecord.getLevel();
|
||||
}
|
||||
// 修改问题状态
|
||||
LambdaUpdateWrapper<InspectQuestion> wrapperQuestion = Wrappers.<InspectQuestion>lambdaUpdate();
|
||||
wrapperQuestion.set(InspectQuestion::getState, questionState);
|
||||
wrapperQuestion.set(InspectQuestion::getLevel, level);
|
||||
wrapperQuestion.eq(InspectQuestion::getRecordId, inspectRecord.getId());
|
||||
wrapperQuestion.eq(InspectQuestion::getState, 2);
|
||||
wrapperQuestion.eq(InspectQuestion::getState, inspectRecord.getLevel() == 1 ? 2 : 3);
|
||||
boolean flag = inspectQuestionService.update(wrapperQuestion);
|
||||
if (flag) {
|
||||
List<InspectQuestion> list = inspectQuestionService.list(Wrappers.<InspectQuestion>lambdaQuery()
|
||||
@ -171,6 +174,7 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
|
||||
LambdaUpdateWrapper<InspectQuestionExamine> wrapper = Wrappers.<InspectQuestionExamine>lambdaUpdate();
|
||||
wrapper.set(InspectQuestionExamine::getExamineState, questionExamineState);
|
||||
wrapper.set(InspectQuestionExamine::getSuggest, suggest);
|
||||
wrapper.set(InspectQuestionExamine::getLevel, level);
|
||||
wrapper.in(InspectQuestionExamine::getInspectQuestionId, questionId);
|
||||
wrapper.eq(InspectQuestionExamine::getExamineState, 0);
|
||||
inspectQuestionExamineService.update(wrapper);
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.safety.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.safety.entity.Remind;
|
||||
import com.zhgd.xmgl.modules.safety.mapper.RemindMapper;
|
||||
import com.zhgd.xmgl.modules.safety.service.IRemindService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 待办提醒
|
||||
* @author: pengj
|
||||
* @date: 2023-08-02
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class RemindServiceImpl extends ServiceImpl<RemindMapper, Remind> implements IRemindService {
|
||||
|
||||
}
|
||||
@ -10,6 +10,7 @@ import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -53,43 +54,43 @@ public class DustNoiseData implements Serializable {
|
||||
*/
|
||||
@Excel(name = "PM10", width = 15)
|
||||
@ApiModelProperty(value = "PM10")
|
||||
private Float pm10;
|
||||
private BigDecimal pm10;
|
||||
/**
|
||||
* PM25
|
||||
*/
|
||||
@Excel(name = "PM25", width = 15)
|
||||
@ApiModelProperty(value = "PM25")
|
||||
private Float pm25;
|
||||
private BigDecimal pm25;
|
||||
/**
|
||||
* 噪音
|
||||
*/
|
||||
@Excel(name = "噪音", width = 15)
|
||||
@ApiModelProperty(value = "噪音")
|
||||
private Float noise;
|
||||
private BigDecimal noise;
|
||||
/**
|
||||
* tsp测试值
|
||||
*/
|
||||
@Excel(name = "tsp测试值", width = 15)
|
||||
@ApiModelProperty(value = "tsp测试值")
|
||||
private Float tsp;
|
||||
private BigDecimal tsp;
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
@Excel(name = "温度", width = 15)
|
||||
@ApiModelProperty(value = "温度")
|
||||
private Float temperature;
|
||||
private BigDecimal temperature;
|
||||
/**
|
||||
* 湿度
|
||||
*/
|
||||
@Excel(name = "湿度", width = 15)
|
||||
@ApiModelProperty(value = "湿度")
|
||||
private Float humidity;
|
||||
private BigDecimal humidity;
|
||||
/**
|
||||
* 风速
|
||||
*/
|
||||
@Excel(name = "风速", width = 15)
|
||||
@ApiModelProperty(value = "风速")
|
||||
private Float windspeed;
|
||||
private BigDecimal windspeed;
|
||||
/**
|
||||
* 风向
|
||||
*/
|
||||
@ -101,25 +102,25 @@ public class DustNoiseData implements Serializable {
|
||||
*/
|
||||
@Excel(name = "大气压", width = 15)
|
||||
@ApiModelProperty(value = "大气压")
|
||||
private Float pressure;
|
||||
private BigDecimal pressure;
|
||||
/**
|
||||
* 电压
|
||||
*/
|
||||
@Excel(name = "电压", width = 15)
|
||||
@ApiModelProperty(value = "电压")
|
||||
private Float voltage;
|
||||
private BigDecimal voltage;
|
||||
/**
|
||||
* 板载温度
|
||||
*/
|
||||
@Excel(name = "板载温度", width = 15)
|
||||
@ApiModelProperty(value = "板载温度")
|
||||
private Float plateTemperature;
|
||||
private BigDecimal plateTemperature;
|
||||
/**
|
||||
* 板载湿度
|
||||
*/
|
||||
@Excel(name = "板载湿度", width = 15)
|
||||
@ApiModelProperty(value = "板载湿度")
|
||||
private Float plateHumidity;
|
||||
private BigDecimal plateHumidity;
|
||||
/**
|
||||
* 工程sn
|
||||
*/
|
||||
|
||||
@ -10,6 +10,7 @@ import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -62,13 +63,13 @@ public class EnvironmentAlarm implements Serializable {
|
||||
*/
|
||||
@Excel(name = "阈值", width = 15)
|
||||
@ApiModelProperty(value = "阈值")
|
||||
private Double thresholdValue;
|
||||
private BigDecimal thresholdValue;
|
||||
/**
|
||||
* 超标数据
|
||||
*/
|
||||
@Excel(name = "超标数据", width = 15)
|
||||
@ApiModelProperty(value = "超标数据")
|
||||
private Double alarmValue;
|
||||
private BigDecimal alarmValue;
|
||||
/**
|
||||
* 超标原因
|
||||
*/
|
||||
|
||||
@ -12,6 +12,7 @@ import com.zhgd.xmgl.util.ParamEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -54,12 +55,12 @@ public class DustNoiseDataServiceImpl extends ServiceImpl<DustNoiseDataMapper, D
|
||||
return dustNoiseData;
|
||||
}
|
||||
|
||||
private Float dictValue(List<SystemDictData> systemDictDataList, Integer type) {
|
||||
private BigDecimal dictValue(List<SystemDictData> systemDictDataList, Integer type) {
|
||||
String thresholdValue = "0";
|
||||
List<SystemDictData> systemDictData = systemDictDataList.stream().filter(d -> d.getDictLabel().equals(type)).collect(Collectors.toList());
|
||||
if (systemDictData.size() > 0) {
|
||||
thresholdValue = systemDictData.get(0).getDictValue();
|
||||
}
|
||||
return Float.valueOf(thresholdValue);
|
||||
return new BigDecimal(thresholdValue);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,10 +2,17 @@ package com.zhgd.xmgl.task;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringMain;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringMainService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.safety.entity.InspectRecord;
|
||||
import com.zhgd.xmgl.modules.safety.entity.ProjectSubItem;
|
||||
import com.zhgd.xmgl.modules.safety.entity.Remind;
|
||||
import com.zhgd.xmgl.modules.safety.service.IInspectRecordService;
|
||||
import com.zhgd.xmgl.modules.safety.service.IProjectSubItemService;
|
||||
import com.zhgd.xmgl.modules.safety.service.IRemindService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
@ -29,10 +36,19 @@ public class SlippageTask {
|
||||
@Autowired
|
||||
private IInspectRecordService inspectRecordService;
|
||||
|
||||
@Autowired
|
||||
private IRemindService remindService;
|
||||
|
||||
@Autowired
|
||||
private IEngineeringMainService engineeringMainService;
|
||||
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
/**
|
||||
* 每天凌晨计算项目进度是否逾期、临期
|
||||
*/
|
||||
@Scheduled(cron = "0 0 2 * * ?")
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
private void projectSubItem() {
|
||||
List<Integer> states = Arrays.asList(3, 6, 7);
|
||||
List<ProjectSubItem> change = new ArrayList<>();
|
||||
@ -45,6 +61,7 @@ public class SlippageTask {
|
||||
if (!states.contains(l.getState()) && DateUtil.between(l.getPlanEndTime(), new Date(), DateUnit.DAY, false) > 0) {
|
||||
l.setState(5);
|
||||
change.add(l);
|
||||
saveRemind(1, "施工进度逾期", l.getEngineeringSn());
|
||||
}
|
||||
});
|
||||
if (change.size() > 0) {
|
||||
@ -53,6 +70,21 @@ public class SlippageTask {
|
||||
log.info("=========定时修改项目进度状态任务执行成功========");
|
||||
}
|
||||
|
||||
private void saveRemind(Integer type, String desc, String engineeringSn) {
|
||||
Remind remind = new Remind();
|
||||
EngineeringMain jsUser = engineeringMainService.getOne(Wrappers.<EngineeringMain>lambdaQuery()
|
||||
.eq(EngineeringMain::getEnterpriseSn, engineeringSn).eq(EngineeringMain::getType, 1));
|
||||
if (jsUser != null) {
|
||||
SystemUser manager = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getSn, jsUser.getEnterpriseSn()).eq(SystemUser::getIsManager, true));
|
||||
remind.setType(type);
|
||||
remind.setRemindDesc(desc);
|
||||
remind.setCreateTime(new Date());
|
||||
remind.setUserId(manager.getUserId());
|
||||
remind.setUserPhone(manager.getUserTel());
|
||||
remindService.save(remind);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 每天凌晨计算安全质量临期
|
||||
*/
|
||||
|
||||
@ -27,10 +27,8 @@ public class CommonUtil {
|
||||
return "";
|
||||
}
|
||||
|
||||
public Double offset(Double value1, Double value2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(value1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(value2));
|
||||
double v = b1.subtract(b2).doubleValue();
|
||||
public Double offset(BigDecimal value1, BigDecimal value2) {
|
||||
double v = value1.subtract(value2).doubleValue();
|
||||
return v > 0 ? v : 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user