From e472005fd50ed3c7aa58c8d34d8aba300c646dfa Mon Sep 17 00:00:00 2001 From: pengjie <17373303529@163.com> Date: Thu, 31 Aug 2023 17:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=B7=E9=87=8D=E6=9C=BA=E6=A2=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhgd/mybatis/DataScopeInterceptor.java | 2 +- .../admin/SystemUserAuthController.java | 4 +- .../EntLiftingDeviceController.java | 41 ++++++++--- .../EntLiftingDeviceExamineController.java | 4 ++ .../GovAcceptInspectRecordController.java | 2 + .../government/GovLifterController.java | 8 +-- .../GovLiftingDeviceExamineController.java | 4 ++ .../government/GovTowerCraneController.java | 8 +-- .../GovTowerCraneCurrentDataController.java | 1 + .../safety/dto/LiftingDeviceExamineDto.java | 17 +++++ .../modules/safety/entity/LiftingDevice.java | 8 ++- .../mapper/LiftingDeviceExamineMapper.java | 1 - .../safety/service/ILiftingDeviceService.java | 9 ++- .../impl/LiftingDeviceServiceImpl.java | 70 +++++++++++++------ .../modules/safety/vo/LiftingDeviceVo.java | 17 +++++ .../xmgl/modules/wisdom/entity/Lifter.java | 6 ++ .../api/惠州项目管理政务版/在建项目指标.ms | 4 +- 17 files changed, 160 insertions(+), 46 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/safety/dto/LiftingDeviceExamineDto.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safety/vo/LiftingDeviceVo.java diff --git a/src/main/java/com/zhgd/mybatis/DataScopeInterceptor.java b/src/main/java/com/zhgd/mybatis/DataScopeInterceptor.java index 72e0aec..7d14229 100644 --- a/src/main/java/com/zhgd/mybatis/DataScopeInterceptor.java +++ b/src/main/java/com/zhgd/mybatis/DataScopeInterceptor.java @@ -39,7 +39,7 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte if (sct == SqlCommandType.INSERT) { Class clazz = Class.forName(ms.getId().substring(0, ms.getId().lastIndexOf(StringPool.DOT))); DataScope annotation = clazz.getAnnotation(DataScope.class); - if (annotation == null) { + if (annotation == null || annotation.type() == 2) { return; } if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return; diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/admin/SystemUserAuthController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/admin/SystemUserAuthController.java index f7c4b2d..9396359 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/admin/SystemUserAuthController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/admin/SystemUserAuthController.java @@ -174,7 +174,7 @@ public class SystemUserAuthController { if(user==null) { result.error500("登录名或密码错误"); } else if(userInfo.getState() == 0) { - result.error500("账号已被禁用,请联系管理员"); + result.error500("账号未启用,请联系管理员"); } else if(userInfo.getAccountType() != 1) { Government government = governmentService.getGovByUser(userInfo.getAccountType(), userInfo.getSn()); if (government.getExpireTime() != null && DateUtil.endOfDay(government.getExpireTime()).before(new Date())) { @@ -187,7 +187,7 @@ public class SystemUserAuthController { if (!userInfo.getIsManager()) { Long roleId = systemRoleService.getByUserId(userInfo.getUserId()); if (roleId == null) { - result.error500("角色已被禁用,请联系管理员"); + result.error500("角色未启用,请联系管理员"); } } userInfo.setProjectDateAuth(government.getProjectDateAuth()); diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceController.java index 93dc608..3f88ec9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceController.java @@ -7,10 +7,11 @@ 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.dto.LiftingDeviceExamineDto; import com.zhgd.xmgl.modules.safety.entity.LiftingDevice; -import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine; import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse; 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; @@ -85,35 +86,37 @@ public class EntLiftingDeviceController { /** * 添加 * - * @param liftingDevice + * @param liftingDeviceVo * @return */ @OperLog(operModul = "起重机械设备管理", operType = "新增", operDesc = "设备产权备案申请") @ApiOperation(value = " 设备产权备案申请", notes = "设备产权备案申请", httpMethod = "POST") @PostMapping(value = "/add") - public Result add(@RequestBody LiftingDevice liftingDevice) { - liftingDeviceService.saveInfo(liftingDevice); + public Result add(@RequestBody LiftingDeviceVo liftingDeviceVo) { + liftingDeviceService.saveInfo(liftingDeviceVo); return Result.success("申请成功!"); } /** * 申请 - * @param liftingDeviceExamine + * @param liftingDeviceExamineVo * @return */ @OperLog(operModul = "起重机械设备管理", operType = "新增", operDesc = "设备提交审批申请") @ApiOperation(value = " 设备提交审批申请", notes = "设备提交审批申请", httpMethod = "POST") @PostMapping(value = "/apply") - public Result apply(@RequestBody LiftingDeviceExamine liftingDeviceExamine) { + public Result apply(@RequestBody LiftingDeviceExamineDto liftingDeviceExamineVo) { Result result = new Result(); - LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceExamine.getDeviceId()); + LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceExamineVo.getDeviceId()); if (liftingDevice == null) { result.error500("未找到对应实体"); + return result; } if (liftingDevice.getIdentification() != 0) { result.error500("有未通过的申请,请通过后再提交申请"); + return result; } - boolean apply = liftingDeviceService.apply(liftingDeviceExamine); + boolean apply = liftingDeviceService.apply(liftingDeviceExamineVo); if (apply) { result.success("修改成功!"); } else { @@ -218,4 +221,26 @@ public class EntLiftingDeviceController { } 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 queryDetailById(@ApiIgnore @RequestBody LiftingDevice liftingDeviceEntity) { + Result result = new Result(); + 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; + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceExamineController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceExamineController.java index bb3c545..a8b6bcc 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceExamineController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/enterprise/EntLiftingDeviceExamineController.java @@ -14,6 +14,7 @@ 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; @@ -57,6 +58,9 @@ public class EntLiftingDeviceExamineController { public Result> queryPageList(@ApiIgnore @RequestBody Map map) { QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceExamine.class, map); Page page = PageUtil.getPage(map); + if (MapUtils.getInteger(map, "type") == 6) { + queryWrapper.in("type", "6,7"); + } IPage pageList = liftingDeviceExamineService.page(page, queryWrapper); return Result.success(pageList); } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovAcceptInspectRecordController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovAcceptInspectRecordController.java index cb5b508..9db24d7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovAcceptInspectRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovAcceptInspectRecordController.java @@ -225,6 +225,8 @@ public class GovAcceptInspectRecordController { if (acceptInspectRecordEntity == null) { result.error500("未找到对应实体"); } else { + acceptInspectRecord.setCheckAcceptId(acceptInspectRecordEntity.getCheckAcceptId()); + acceptInspectRecord.setDeadline(acceptInspectRecordEntity.getDeadline()); boolean ok = acceptInspectRecordService.examine(acceptInspectRecord); if (ok) { result.success("审批成功!"); diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLifterController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLifterController.java index 7f86814..9811612 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLifterController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLifterController.java @@ -48,8 +48,8 @@ public class GovLifterController { * * @return */ - @OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据工程信息") - @ApiOperation(value = " 分页列表查询塔吊实时数据工程信息", notes = "分页列表查询塔吊实时数据工程信息", httpMethod = "POST") + @OperLog(operModul = "升降机管理", operType = "分页查询", operDesc = "分页列表查询升降机工程信息") + @ApiOperation(value = " 分页列表查询升降机工程信息", notes = "分页列表查询升降机工程信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "engineeringName", value = "工程名称", paramType = "body", dataType = "String"), @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), @@ -65,8 +65,8 @@ public class GovLifterController { * * @return */ - @OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据项目信息") - @ApiOperation(value = " 分页列表查询塔吊实时数据项目信息", notes = "分页列表查询塔吊实时数据项目信息", httpMethod = "POST") + @OperLog(operModul = "升降机管理", operType = "分页查询", operDesc = "分页列表查询升降机项目信息") + @ApiOperation(value = " 分页列表查询升降机项目信息", notes = "分页列表查询升降机项目信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectName", value = "工程名称", paramType = "body", dataType = "String"), @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLiftingDeviceExamineController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLiftingDeviceExamineController.java index 2caed7f..5918abd 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLiftingDeviceExamineController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovLiftingDeviceExamineController.java @@ -14,6 +14,7 @@ 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; @@ -58,6 +59,9 @@ public class GovLiftingDeviceExamineController { public Result> queryPageList(@ApiIgnore @RequestBody Map map) { QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceExamine.class, map); Page page = PageUtil.getPage(map); + if (MapUtils.getInteger(map, "type") == 6) { + queryWrapper.in("type", "6,7"); + } IPage pageList = liftingDeviceExamineService.page(page, queryWrapper); return Result.success(pageList); } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneController.java index da71695..51657d5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneController.java @@ -46,8 +46,8 @@ public class GovTowerCraneController { * * @return */ - @OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据工程信息") - @ApiOperation(value = " 分页列表查询塔吊实时数据工程信息", notes = "分页列表查询塔吊实时数据工程信息", httpMethod = "POST") + @OperLog(operModul = "塔吊起重机管理", operType = "分页查询", operDesc = "分页列表查询塔吊工程信息") + @ApiOperation(value = " 分页列表查询塔吊工程信息", notes = "分页列表查询塔吊工程信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "engineeringName", value = "工程名称", paramType = "body", dataType = "String"), @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), @@ -63,8 +63,8 @@ public class GovTowerCraneController { * * @return */ - @OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据项目信息") - @ApiOperation(value = " 分页列表查询塔吊实时数据项目信息", notes = "分页列表查询塔吊实时数据项目信息", httpMethod = "POST") + @OperLog(operModul = "塔吊起重机管理", operType = "分页查询", operDesc = "分页列表查询塔吊项目信息") + @ApiOperation(value = " 分页列表查询塔吊项目信息", notes = "分页列表查询塔吊项目信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectName", value = "工程名称", paramType = "body", dataType = "String"), @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneCurrentDataController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneCurrentDataController.java index e9287c8..6f3df77 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneCurrentDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/government/GovTowerCraneCurrentDataController.java @@ -72,6 +72,7 @@ public class GovTowerCraneCurrentDataController { if (StringUtils.isNotBlank(MapUtils.getString(map, ParamConstants.PROJECT_SN))) { queryWrapper.lambda().eq(TowerCraneCurrentData::getEngineeringSn, StrUtil.EMPTY); } + queryWrapper.lambda().orderByDesc(TowerCraneCurrentData::getCreateTime); IPage pageList = towerCraneCurrentDataService.page(page, queryWrapper); return Result.success(pageList); } diff --git a/src/main/java/com/zhgd/xmgl/modules/safety/dto/LiftingDeviceExamineDto.java b/src/main/java/com/zhgd/xmgl/modules/safety/dto/LiftingDeviceExamineDto.java new file mode 100644 index 0000000..0310652 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safety/dto/LiftingDeviceExamineDto.java @@ -0,0 +1,17 @@ +package com.zhgd.xmgl.modules.safety.dto; + +import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile; +import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value = "起重机械设备审批信息(DTO)", description = "LiftingDeviceExamineDto") +public class LiftingDeviceExamineDto extends LiftingDeviceExamine { + + @ApiModelProperty(value="起重机械设备附件") + private List annexFiles; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safety/entity/LiftingDevice.java b/src/main/java/com/zhgd/xmgl/modules/safety/entity/LiftingDevice.java index 60e3a2e..f3244a6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safety/entity/LiftingDevice.java +++ b/src/main/java/com/zhgd/xmgl/modules/safety/entity/LiftingDevice.java @@ -202,7 +202,7 @@ public class LiftingDevice implements Serializable { */ @Excel(name = "特种设备制造许可证", width = 15) @ApiModelProperty(value = "特种设备制造许可证") - private Object specialEquipment; + private Object specialEquipment; /** * 产品质量出厂合格证明 */ @@ -395,4 +395,10 @@ public class LiftingDevice implements Serializable { @Excel(name = "升降机区市负责人现场查看承诺书", width = 15) @ApiModelProperty(value = "升降机区市负责人现场查看承诺书") private String lifterPrincipalCommitment; + /** + * 许可证发放机关 + */ + @Excel(name = "许可证发放机关", width = 15) + @ApiModelProperty(value = "许可证发放机关") + private String licensingAuthority; } diff --git a/src/main/java/com/zhgd/xmgl/modules/safety/mapper/LiftingDeviceExamineMapper.java b/src/main/java/com/zhgd/xmgl/modules/safety/mapper/LiftingDeviceExamineMapper.java index 2850761..dd6810b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safety/mapper/LiftingDeviceExamineMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/safety/mapper/LiftingDeviceExamineMapper.java @@ -12,7 +12,6 @@ import org.apache.ibatis.annotations.Mapper; * @version: V1.0 */ @Mapper -@DataScope(type = 2) public interface LiftingDeviceExamineMapper extends BaseMapper { } diff --git a/src/main/java/com/zhgd/xmgl/modules/safety/service/ILiftingDeviceService.java b/src/main/java/com/zhgd/xmgl/modules/safety/service/ILiftingDeviceService.java index 74c210f..4df8ba9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safety/service/ILiftingDeviceService.java +++ b/src/main/java/com/zhgd/xmgl/modules/safety/service/ILiftingDeviceService.java @@ -1,10 +1,11 @@ package com.zhgd.xmgl.modules.safety.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.zhgd.xmgl.modules.safety.dto.LiftingDeviceExamineDto; import com.zhgd.xmgl.modules.safety.entity.LiftingDevice; -import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine; import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse; import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo; +import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo; /** * @Description: 起重机械设备 @@ -14,11 +15,13 @@ import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo; */ public interface ILiftingDeviceService extends IService { - boolean saveInfo(LiftingDevice liftingDevice); + boolean saveInfo(LiftingDeviceVo liftingDeviceVo); boolean examine(LiftingDevice liftingDevice, LiftingDeviceExamineVo liftingDeviceExamineVo); - boolean apply(LiftingDeviceExamine liftingDeviceExamine); + boolean apply(LiftingDeviceExamineDto liftingDeviceExamineVo); boolean useApply(LiftingDeviceUse liftingDeviceUse); + + LiftingDeviceVo queryDetailById(Long id); } diff --git a/src/main/java/com/zhgd/xmgl/modules/safety/service/impl/LiftingDeviceServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/safety/service/impl/LiftingDeviceServiceImpl.java index b271f37..b15d69c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safety/service/impl/LiftingDeviceServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/safety/service/impl/LiftingDeviceServiceImpl.java @@ -4,18 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile; import com.zhgd.xmgl.modules.basicdata.entity.Enterprise; +import com.zhgd.xmgl.modules.basicdata.service.IAnnexFileService; +import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService; +import com.zhgd.xmgl.modules.safety.dto.LiftingDeviceExamineDto; import com.zhgd.xmgl.modules.safety.entity.LiftingDevice; import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine; import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse; import com.zhgd.xmgl.modules.safety.mapper.LiftingDeviceMapper; -import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService; import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceExamineService; import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceService; import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceUseService; import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo; +import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo; import com.zhgd.xmgl.security.SecurityUser; import com.zhgd.xmgl.security.SecurityUtil; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,15 +47,23 @@ public class LiftingDeviceServiceImpl extends ServiceImpllambdaQuery().eq(Enterprise::getEnterpriseSn, user.getSn())).getEnterpriseName()); - this.save(liftingDevice); + liftingDeviceVo.setIdentification(1); + liftingDeviceVo.setEnterpriseSn(user.getSn()); + liftingDeviceVo.setEnterpriseName(enterpriseService.getOne(Wrappers.lambdaQuery().eq(Enterprise::getEnterpriseSn, user.getSn())).getEnterpriseName()); + this.save(liftingDeviceVo); + List annexFiles = liftingDeviceVo.getAnnexFiles(); + annexFiles.stream().forEach(a -> { + a.setRelevanceId(liftingDeviceVo.getId().toString()); + }); + annexFileService.saveBatch(annexFiles); LiftingDeviceExamine liftingDeviceExamine = new LiftingDeviceExamine(); - liftingDeviceExamine.setDeviceId(liftingDevice.getId()); + liftingDeviceExamine.setDeviceId(liftingDeviceVo.getId()); liftingDeviceExamine.setApplyBy(user.getUserId()); liftingDeviceExamine.setApplyName(user.getRealName()); liftingDeviceExamine.setApplyTime(new Date()); @@ -93,19 +106,27 @@ public class LiftingDeviceServiceImpl extends ServiceImpl wrapper = Wrappers.lambdaUpdate(); - wrapper.set(LiftingDevice::getIdentification, liftingDeviceExamine.getType()); - wrapper.eq(LiftingDevice::getId, liftingDeviceExamine.getDeviceId()); - this.update(wrapper); - liftingDeviceExamine.setApplyBy(user.getUserId()); - liftingDeviceExamine.setApplyName(user.getRealName()); - liftingDeviceExamine.setApplyTime(new Date()); - return liftingDeviceExamineService.save(liftingDeviceExamine); + liftingDeviceExamineVo.setApplyBy(user.getUserId()); + liftingDeviceExamineVo.setApplyName(user.getRealName()); + liftingDeviceExamineVo.setApplyTime(new Date()); + boolean flag = liftingDeviceExamineService.save(liftingDeviceExamineVo); + if (flag) { + LambdaUpdateWrapper wrapper = Wrappers.lambdaUpdate(); + wrapper.set(LiftingDevice::getIdentification, liftingDeviceExamineVo.getType()); + wrapper.eq(LiftingDevice::getId, liftingDeviceExamineVo.getDeviceId()); + this.update(wrapper); + List annexFiles = liftingDeviceExamineVo.getAnnexFiles(); + annexFiles.stream().forEach(a -> { + a.setRelevanceId(liftingDeviceExamineVo.getId().toString()); + }); + annexFileService.saveBatch(annexFiles); + } + return flag; } @Override @@ -121,6 +142,15 @@ public class LiftingDeviceServiceImpl extends ServiceImpllambdaQuery().eq(AnnexFile::getRelevanceId, liftingDeviceVo.getId()))); + return liftingDeviceVo; + } + private Integer getEquipmentType(Integer examineType) { Integer equipmentType = 1; switch (examineType) { @@ -143,8 +173,8 @@ public class LiftingDeviceServiceImpl extends ServiceImpl annexFiles; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/wisdom/entity/Lifter.java b/src/main/java/com/zhgd/xmgl/modules/wisdom/entity/Lifter.java index 9aab791..2aea7d5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/wisdom/entity/Lifter.java +++ b/src/main/java/com/zhgd/xmgl/modules/wisdom/entity/Lifter.java @@ -171,6 +171,12 @@ public class Lifter implements Serializable { @Excel(name = "升级机所在楼层总层数", width = 15) @ApiModelProperty(value = "升级机所在楼层总层数") private Integer totalFloor; + /** + * 在线状态(0:离线;1:在线) + */ + @Excel(name = "在线状态(0:离线;1:在线)", width = 15) + @ApiModelProperty(value = "在线状态(0:离线;1:在线)") + private Integer online; /** * 创建时间 */ diff --git a/src/main/resources/magic/api/惠州项目管理政务版/在建项目指标.ms b/src/main/resources/magic/api/惠州项目管理政务版/在建项目指标.ms index e229bfd..6e933cd 100644 --- a/src/main/resources/magic/api/惠州项目管理政务版/在建项目指标.ms +++ b/src/main/resources/magic/api/惠州项目管理政务版/在建项目指标.ms @@ -5,7 +5,7 @@ "groupId" : "1f3d3e5b9fe340bab84de67b0de08f44", "name" : "在建项目指标", "createTime" : null, - "updateTime" : 1689678565388, + "updateTime" : 1693376503935, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -34,4 +34,4 @@ "responseBodyDefinition" : null } ================================ -return db.selectOne("SELECT IFNULL(SUM(IF(major_project_type = 1 AND state = 1, 1, 0)), 0) importance, IFNULL(SUM(IF(project_type = 1 AND state = 1, 1, 0)), 0) bridge, IFNULL(SUM(IF(project_type = 2 AND state = 1, 1, 0)), 0) tunnel, IFNULL(SUM(IF(project_type = 3 AND state = 1, 1, 0)), 0) station, IFNULL(SUM(IF(build_status in (0,1) AND state = 1, 1, 0)), 0) newBuild, IFNULL(SUM(IF(build_status = 5, 1, 0)), 0) reBuild, IFNULL(SUM(IF(build_status = 6, 1, 0)), 0) extension, IFNULL(SUM(IF(build_status in (0, 1, 5, 6) AND state = 1, 1, 0)), 0) total, IFNULL(SUM(IF(build_status = 4, 1, 0)), 0) finished, IFNULL(SUM(IF(build_status = 2, 1, 0)), 0) shutdown, IFNULL(SUM(IF(build_status in (1, 2, 4), 1, 0)), 0) total1 FROM project WHERE #project ") \ No newline at end of file +return db.selectOne("SELECT IFNULL(SUM(IF(is_important = 1 AND examine_state = 3, 1, 0)), 0) importance, IFNULL(SUM(IF(engineering_type = 2 AND state = 2 AND examine_state = 3, 1, 0)), 0) bridge, IFNULL(SUM(IF(engineering_type = 3 AND state = 2 AND examine_state = 3, 1, 0)), 0) tunnel, IFNULL(SUM(IF(engineering_type = 4 AND state = 2 AND examine_state = 3, 1, 0)), 0) station, IFNULL(SUM(IF(state = 8, 1, 0)), 0) reBuild, IFNULL(SUM(IF(state = 9, 1, 0)), 0) extension, IFNULL(SUM(IF(state IN(2, 8, 9), 1, 0)), 0) total, IFNULL(SUM(IF(state = 7, 1, 0)), 0) finished, IFNULL(SUM(IF(state in (3, 4), 1, 0)), 0) shutdown, IFNULL(SUM(IF(state in (2, 3, 4, 7), 1, 0)), 0) total1,(SELECT COUNT( * ) FROM engineering WHERE YEAR(examine_time) = YEAR(CURDATE()) AND examine_state = 3) newBuild FROM engineering WHERE #project ") \ No newline at end of file