起重机械设备

This commit is contained in:
pengjie 2023-09-01 16:05:16 +08:00
parent 91e3b362ad
commit 8b36da209c
12 changed files with 385 additions and 18 deletions

View File

@ -73,6 +73,8 @@ public class DataScopeHandler implements DataPermissionHandler {
Integer type = Integer.parseInt(obj.toString());
if (type == 1) {
return dataScopeFilterByProject(plainSelect, user);
} else if (type == 2 && user.getAccountType() == 4) {
return dataScopeFilterByProject(plainSelect, user);
} else if (type == 2) {
return dataScopeFilterByEnt(plainSelect, user);
}

View File

@ -67,7 +67,7 @@ public class EntTowerCraneAlarmController {
Page<TowerCraneAlarm> page = PageUtil.getPage(map);
Integer dayRange = MapUtils.getInteger(map, "dayRange");
if (dayRange != null) {
queryWrapper.lambda().between(TowerCraneAlarm::getCreateTime, DateUtil.offsetDay(new Date(), dayRange), DateUtil.endOfDay(new Date()));
queryWrapper.lambda().between(TowerCraneAlarm::getCreateTime, DateUtil.offsetDay(new Date(), -dayRange), DateUtil.endOfDay(new Date()));
}
queryWrapper.lambda().orderByDesc(TowerCraneAlarm::getCreateTime);
IPage<TowerCraneAlarm> pageList = towerCraneAlarmService.page(page, queryWrapper);

View File

@ -147,7 +147,7 @@ public class GovLiftingDeviceController {
if (liftingDevice == null) {
result.error500("未找到对应实体");
} else {
result.setResult(liftingDeviceService.examine(liftingDevice, liftingDeviceExamineVo));
result.setResult(liftingDeviceService.examine(liftingDeviceExamineVo));
result.setSuccess(true);
}
return result;

View File

@ -65,7 +65,7 @@ public class GovTowerCraneAlarmController {
Page<TowerCraneAlarm> page = PageUtil.getPage(map);
Integer dayRange = MapUtils.getInteger(map, "dayRange");
if (dayRange != null) {
queryWrapper.lambda().between(TowerCraneAlarm::getCreateTime, DateUtil.offsetDay(new Date(), dayRange), DateUtil.endOfDay(new Date()));
queryWrapper.lambda().between(TowerCraneAlarm::getCreateTime, DateUtil.offsetDay(new Date(), -dayRange), DateUtil.endOfDay(new Date()));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, ParamConstants.PROJECT_SN))) {
queryWrapper.lambda().eq(TowerCraneAlarm::getEngineeringSn, StrUtil.EMPTY);

View File

@ -0,0 +1,134 @@
package com.zhgd.xmgl.modules.basicdata.controller.project;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.basicdata.constant.ParamConstants;
import com.zhgd.xmgl.modules.safety.entity.LiftingDevice;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceService;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
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 springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 起重机械设备
* @author pengj
* @date 2023-04-27
* @version V1.0
*/
@RestController
@RequestMapping("/project/liftingDevice")
@Slf4j
@Api(tags = "起重机械设备管理")
public class LiftingDeviceController {
@Autowired
private ILiftingDeviceService liftingDeviceService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "分页查询", operDesc = "分页列表查询起重机械设备信息")
@ApiOperation(value = " 分页列表查询起重机械设备信息", notes = "分页列表查询起重机械设备信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
@ApiImplicitParam(name = "projectInspectNumber", value = "注册登记编号", paramType = "body", dataType = "Integer"),
@ApiImplicitParam(name = "enterpriseName", value = "产权单位", paramType = "body", dataType = "String"),
@ApiImplicitParam(name = "type", value = "设备类型", paramType = "body", dataType = "Integer"),
@ApiImplicitParam(name = "equipmentUse", value = "设备使用状态", paramType = "body", dataType = "Integer"),
})
@PostMapping(value = "/page")
public Result<IPage<LiftingDevice>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<LiftingDevice> queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDevice.class, map);
Page<LiftingDevice> page = PageUtil.getPage(map);
if (StringUtils.isNotBlank(MapUtils.getString(map, ParamConstants.PROJECT_SN))) {
queryWrapper.lambda().eq(LiftingDevice::getEngineeringSn, StrUtil.EMPTY);
}
IPage<LiftingDevice> pageList = liftingDeviceService.page(page, queryWrapper);
return Result.success(pageList);
}
/**
* 列表查询
*
* @param liftingDevice
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "列表查询", operDesc = "列表查询起重机械设备信息")
@ApiOperation(value = " 列表查询起重机械设备信息", notes = "列表查询起重机械设备信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<LiftingDevice>> queryList(@RequestBody LiftingDevice liftingDevice) {
QueryWrapper<LiftingDevice> queryWrapper = QueryGenerator.initQueryWrapper(liftingDevice);
if (StringUtils.isNotBlank(liftingDevice.getProjectSn())) {
queryWrapper.lambda().eq(LiftingDevice::getEngineeringSn, StrUtil.EMPTY);
}
List<LiftingDevice> list = liftingDeviceService.list(queryWrapper);
return Result.success(list);
}
/**
* 通过id查询
*
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "查询", operDesc = "通过id查询起重机械设备信息")
@ApiOperation(value = "通过id查询起重机械设备信息", notes = "通过id查询起重机械设备信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "起重机械设备ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<LiftingDevice> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<LiftingDevice> result = new Result<LiftingDevice>();
LiftingDevice liftingDevice = liftingDeviceService.getById(MapUtils.getString(map, "id"));
if (liftingDevice == null) {
result.error500("未找到对应实体");
} else {
result.setResult(liftingDevice);
result.setSuccess(true);
}
return result;
}
/**
* 通过id查询详细信息
*
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "查询", operDesc = "通过id查询起重机械设备详细信息")
@ApiOperation(value = "通过id查询起重机械设备详细信息", notes = "通过id查询起重机械设备详细信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "项目工程表ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryDetailById")
public Result<LiftingDeviceVo> queryDetailById(@ApiIgnore @RequestBody LiftingDevice liftingDeviceEntity) {
Result<LiftingDeviceVo> result = new Result<LiftingDeviceVo>();
LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceEntity.getId());
if (liftingDevice == null) {
result.error500("未找到对应实体");
} else {
LiftingDeviceVo liftingDeviceVo = liftingDeviceService.queryDetailById(liftingDeviceEntity.getId());
result.setResult(liftingDeviceVo);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,103 @@
package com.zhgd.xmgl.modules.basicdata.controller.project;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceExamineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
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 springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 起重机械审批
* @author pengj
* @date 2023-05-06
* @version V1.0
*/
@RestController
@RequestMapping("/project/liftingDeviceExamine")
@Slf4j
@Api(tags = "起重机械审批管理")
public class LiftingDeviceExamineController {
@Autowired
private ILiftingDeviceExamineService liftingDeviceExamineService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "起重机械审批管理", operType = "分页查询", operDesc = "分页列表查询起重机械审批信息")
@ApiOperation(value = " 分页列表查询起重机械审批信息", notes = "分页列表查询起重机械审批信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
@ApiImplicitParam(name = "type", value = "审批类型(1:产权备案;2:设备延期;3:遗失补证;4:设备报废;5:设备注销;)", paramType = "body", dataType = "Integer"),
@ApiImplicitParam(name = "deviceId", value = "设备ID", paramType = "body", dataType = "String")
})
@PostMapping(value = "/page")
public Result<IPage<LiftingDeviceExamine>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<LiftingDeviceExamine> queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceExamine.class, map);
Page<LiftingDeviceExamine> page = PageUtil.getPage(map);
if (MapUtils.getInteger(map, "type") == 6) {
queryWrapper.in("type", "6,7");
}
IPage<LiftingDeviceExamine> pageList = liftingDeviceExamineService.page(page, queryWrapper);
return Result.success(pageList);
}
/**
* 列表查询
*
* @param liftingDeviceExamine
* @return
*/
@OperLog(operModul = "起重机械审批管理", operType = "列表查询", operDesc = "列表查询起重机械审批信息")
@ApiOperation(value = " 列表查询起重机械审批信息", notes = "列表查询起重机械审批信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<LiftingDeviceExamine>> queryList(@RequestBody LiftingDeviceExamine liftingDeviceExamine) {
QueryWrapper<LiftingDeviceExamine> queryWrapper = QueryGenerator.initQueryWrapper(liftingDeviceExamine);
List<LiftingDeviceExamine> list = liftingDeviceExamineService.list(queryWrapper);
return Result.success(list);
}
/**
* 通过id查询附件信息
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "查询", operDesc = "通过id查询附件信息")
@ApiOperation(value = "通过id查询附件信息", notes = "通过id查询附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "审批ID", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/queryAnnexFile")
public Result<List<AnnexFile>> queryAnnexFile(@ApiIgnore @RequestBody LiftingDeviceExamine liftingDeviceExamine) {
Result<List<AnnexFile>> result = new Result<List<AnnexFile>>();
LiftingDeviceExamine liftingDeviceExamineEntity = liftingDeviceExamineService.getById(liftingDeviceExamine.getId());
if (liftingDeviceExamineEntity == null) {
result.error500("未找到对应实体");
} else {
result.setResult(liftingDeviceExamineService.queryAnnexFile(liftingDeviceExamine.getId()));
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,100 @@
package com.zhgd.xmgl.modules.basicdata.controller.project;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceUseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
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 springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 起重机械设备安拆记录
* @author pengj
* @date 2023-04-28
* @version V1.0
*/
@RestController
@RequestMapping("/project/liftingDeviceUse")
@Slf4j
@Api(tags = "起重机械设备安拆记录管理")
public class LiftingDeviceUseController {
@Autowired
private ILiftingDeviceUseService liftingDeviceUseService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "起重机械设备安拆记录管理", operType = "分页查询", operDesc = "分页列表查询起重机械设备安拆记录信息")
@ApiOperation(value = " 分页列表查询起重机械设备安拆记录信息", notes = "分页列表查询起重机械设备安拆记录信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
@ApiImplicitParam(name = "deviceId", value = "设备ID", paramType = "body", dataType = "String")
})
@PostMapping(value = "/page")
public Result<IPage<LiftingDeviceUse>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<LiftingDeviceUse> queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceUse.class, map);
Page<LiftingDeviceUse> page = PageUtil.getPage(map);
IPage<LiftingDeviceUse> pageList = liftingDeviceUseService.page(page, queryWrapper);
return Result.success(pageList);
}
/**
* 列表查询
*
* @param liftingDeviceUse
* @return
*/
@OperLog(operModul = "起重机械设备安拆记录管理", operType = "列表查询", operDesc = "列表查询起重机械设备安拆记录信息")
@ApiOperation(value = " 列表查询起重机械设备安拆记录信息", notes = "列表查询起重机械设备安拆记录信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<LiftingDeviceUse>> queryList(@RequestBody LiftingDeviceUse liftingDeviceUse) {
QueryWrapper<LiftingDeviceUse> queryWrapper = QueryGenerator.initQueryWrapper(liftingDeviceUse);
List<LiftingDeviceUse> list = liftingDeviceUseService.list(queryWrapper);
return Result.success(list);
}
/**
* 通过id查询
*
* @return
*/
@OperLog(operModul = "起重机械设备安拆记录管理", operType = "查询", operDesc = "通过id查询起重机械设备安拆记录信息")
@ApiOperation(value = "通过id查询起重机械设备安拆记录信息", notes = "通过id查询起重机械设备安拆记录信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "起重机械设备安拆记录ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<LiftingDeviceUse> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<LiftingDeviceUse> result = new Result<LiftingDeviceUse>();
LiftingDeviceUse liftingDeviceUse = liftingDeviceUseService.getById(MapUtils.getString(map, "id"));
if (liftingDeviceUse == null) {
result.error500("未找到对应实体");
} else {
result.setResult(liftingDeviceUse);
result.setSuccess(true);
}
return result;
}
}

View File

@ -401,4 +401,16 @@ public class LiftingDevice implements Serializable {
@Excel(name = "许可证发放机关", width = 15)
@ApiModelProperty(value = "许可证发放机关")
private String licensingAuthority;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private String projectSn;
/**
* 工程sn
*/
@Excel(name = "工程sn", width = 15)
@ApiModelProperty(value = "工程sn")
private String engineeringSn;
}

View File

@ -266,5 +266,12 @@ public class LiftingDeviceUse implements Serializable {
*/
@Excel(name = "监测单位id", width = 15)
@ApiModelProperty(value = "监测单位id")
private Integer monitoringUnitid;
private Integer monitoringUnitId;
/**
* 安装区域
*/
@Excel(name = "安装区域", width = 15)
@ApiModelProperty(value = "安装区域")
private String installRegion;
}

View File

@ -17,7 +17,7 @@ public interface ILiftingDeviceService extends IService<LiftingDevice> {
boolean saveInfo(LiftingDeviceVo liftingDeviceVo);
boolean examine(LiftingDevice liftingDevice, LiftingDeviceExamineVo liftingDeviceExamineVo);
boolean examine(LiftingDeviceExamineVo liftingDeviceExamineVo);
boolean apply(LiftingDeviceExamineDto liftingDeviceExamineVo);

View File

@ -72,21 +72,26 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
}
@Override
public boolean examine(LiftingDevice liftingDevice, LiftingDeviceExamineVo liftingDeviceExamineVo) {
public boolean examine(LiftingDeviceExamineVo liftingDeviceExamineVo) {
LambdaUpdateWrapper<LiftingDevice> updateWrapper = Wrappers.<LiftingDevice>lambdaUpdate();
SecurityUser user = SecurityUtil.getUser();
if (liftingDeviceExamineVo.getType() > 5) {
//安拆审批
LambdaUpdateWrapper<LiftingDeviceUse> wrapper = Wrappers.<LiftingDeviceUse>lambdaUpdate();
wrapper.set(LiftingDeviceUse::getExamineState, liftingDeviceExamineVo.getState());
wrapper.set(LiftingDeviceUse::getWhy, liftingDeviceExamineVo.getExamineResult());
wrapper.set(LiftingDeviceUse::getAuditName, user.getRealName());
wrapper.set(LiftingDeviceUse::getAuditId, user.getUserId());
wrapper.eq(LiftingDeviceUse::getDeviceId, liftingDeviceExamineVo.getDeviceId());
wrapper.eq(LiftingDeviceUse::getExamineState, 0);
liftingDeviceUseService.update(wrapper);
LiftingDeviceUse liftingDeviceUse = liftingDeviceUseService.getOne(Wrappers.<LiftingDeviceUse>lambdaQuery().eq(LiftingDeviceUse::getDeviceId,
liftingDeviceExamineVo.getDeviceId()).eq(LiftingDeviceUse::getExamineState, 0));
liftingDeviceUse.setExamineState(liftingDeviceExamineVo.getState());
liftingDeviceUse.setWhy(liftingDeviceExamineVo.getExamineResult());
liftingDeviceUse.setAuditName(user.getRealName());
liftingDeviceUse.setAuditId(user.getUserId());
liftingDeviceUseService.updateById(liftingDeviceUse);
if (liftingDeviceExamineVo.getState() == 1) {
liftingDevice.setEquipmentType(getEquipmentType(liftingDeviceExamineVo.getType()));
liftingDevice.setEquipmentUse(liftingDeviceExamineVo.getType() == 6 ? 1 : 0);
updateWrapper.set(LiftingDevice::getEquipmentType, getEquipmentType(liftingDeviceExamineVo.getType()));
updateWrapper.set(LiftingDevice::getEquipmentUse, liftingDeviceExamineVo.getType() == 6 ? 1 : 0);
if (liftingDeviceExamineVo.getType() == 6) {
updateWrapper.set(LiftingDevice::getEngineeringSn, liftingDeviceUse.getEngineeringSn());
} else {
updateWrapper.set(LiftingDevice::getEngineeringSn, null);
}
}
} else {
// 其他审批
@ -99,10 +104,10 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
wrapper.eq(LiftingDeviceExamine::getState, 0);
liftingDeviceExamineService.update(wrapper);
if (liftingDeviceExamineVo.getState() == 1) {
liftingDevice.setEquipmentType(getEquipmentType(liftingDeviceExamineVo.getType()));
updateWrapper.set(LiftingDevice::getEquipmentType, getEquipmentType(liftingDeviceExamineVo.getType()));
}
}
return this.updateById(liftingDevice);
return this.update(updateWrapper);
}
@Override

View File

@ -1,8 +1,10 @@
package com.zhgd.xmgl.modules.wisdom.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
@ -41,6 +43,8 @@ public class TowerCraneOperationDto implements Serializable {
@ApiModelProperty(value = "塔身高度")
private Double towerHeight;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "安装时间")
private Date installTime;