Browse Source

根据区域编号查询设备试验

根据区域编号查询安全检查
月度自查 技能培训 安全生产会议次数
zhongwei
段飞宇 2 years ago
parent
commit
ecb6cf634f
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  2. 2
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageSmsClient.java
  3. 2
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IPushMsgClient.java
  4. 1
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/PushStatTypeVo.java
  5. 3
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/PushStatVo.java
  6. 48
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java
  7. 35
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java
  8. 48
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java
  9. 41
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/CheckCompanyFeignClientFallback.java
  10. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/SafeEquipmentTrialFeignClientFallback.java
  11. 40
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/SafeproductFeignClientFallback.java
  12. 33
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/CheckCompanyVo.java
  13. 34
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/CheckMonthVo.java
  14. 23
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/SafeEquipmentTrialVO.java
  15. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/SafeEquipmentTrialDTO.java
  16. 13
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CheckCompanyEntity.java
  17. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CheckMonthEntity.java
  18. 7
      hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java
  19. 43
      hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml
  20. 130
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
  21. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
  22. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.java
  23. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  24. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessStatisticsService.java
  25. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java
  26. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java
  27. 1707
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  28. 175
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java
  29. 47
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/AreaMonthlyDetailsService.java
  30. 122
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthlyDetailsServiceImpl.java
  31. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckCompanyController.java
  32. 27
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java
  33. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java
  34. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckMonthMapper.java
  35. 27
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckMonthMapper.xml
  36. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICheckCompanyService.java
  37. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICheckMonthService.java
  38. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/SafeEquipmentTrialService.java
  39. 206
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckCompanyServiceImpl.java
  40. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckMonthServiceImpl.java
  41. 162
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafeEquipmentTrialServiceImpl.java

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java

@ -104,9 +104,11 @@ public class OperDefectEntity extends TenantEntity {
/**
* 区域Id
*/
@TableField(exist = false)
private String areaId;
/**
* 年月
*/
@TableField(exist = false)
private YearMonth yearMonth;
}

2
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageSmsClient.java

@ -4,6 +4,8 @@ package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.req.SmsReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

2
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IPushMsgClient.java

@ -7,6 +7,8 @@ import com.hnac.hzims.message.dto.SmsPushDto;
import com.hnac.hzims.message.dto.WsPushDto;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

1
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/PushStatTypeVo.java

@ -27,7 +27,6 @@ public class PushStatTypeVo {
*/
private String businessClassifyName;
/**
* 业务分类统计
*/

3
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/PushStatVo.java

@ -29,15 +29,12 @@ public class PushStatVo {
*/
private Integer status;
/**
* 状态名称
*/
private String statusName;
/**
* 统计数量
*/

48
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java

@ -0,0 +1,48 @@
package com.hnac.hzims.safeproduct.areamonthly.feign;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.areamonthly.feign.fallback.CheckCompanyFeignClientFallback;
import com.hnac.hzims.safeproduct.areamonthly.feign.fallback.SafeproductFeignClientFallback;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 19:35
*/
@FeignClient(value = Constants.APP_NAME, fallback = CheckCompanyFeignClientFallback.class)
public interface CheckCompanyFeignClient {
/**
* 查询安全检查
*
* @param req
* @param query
* @return
*/
@GetMapping("/CheckCompany/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:startDate,endDate,status")
R<BladePage<CheckCompanyVo>> list(CheckCompanyEntity req, Query query);
/**
* 详情
* @param id
* @return
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入id")
public R<CheckCompanyVo> detail(@RequestParam Long id);
}

35
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java

@ -0,0 +1,35 @@
package com.hnac.hzims.safeproduct.areamonthly.feign;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.areamonthly.feign.fallback.CheckCompanyFeignClientFallback;
import com.hnac.hzims.safeproduct.areamonthly.feign.fallback.SafeEquipmentTrialFeignClientFallback;
import com.hnac.hzims.safeproduct.areamonthly.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 19:50
*/
@FeignClient(value = Constants.APP_NAME, fallback = SafeEquipmentTrialFeignClientFallback.class)
public interface SafeEquipmentTrialFeignClient {
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
public R<BladePage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) ;
}

48
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java

@ -0,0 +1,48 @@
package com.hnac.hzims.safeproduct.areamonthly.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.areamonthly.feign.fallback.SafeproductFeignClientFallback;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckMonthVo;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 18:06
*/
@FeignClient(value = Constants.APP_NAME, fallback = SafeproductFeignClientFallback.class)
public interface SafeproductFeignClient {
/**
* 分页查询安全生产会议次数
*/
@GetMapping("/checkMonth/listconferenceScope/{page}/{size}")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:month,status,createDept")
public R<BladePage<CheckMonthVo>> listconferenceScope(@PathVariable Long page, @PathVariable Long size, CheckMonthEntity req);
/**
* 详情
*/
@GetMapping("/checkMonth/detail")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入id")
public R<CheckMonthVo> detail(@RequestParam Long id);
}

41
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/CheckCompanyFeignClientFallback.java

@ -0,0 +1,41 @@
package com.hnac.hzims.safeproduct.areamonthly.feign.fallback;
import com.hnac.hzims.safeproduct.areamonthly.feign.CheckCompanyFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 19:35
*/
@Service
public class CheckCompanyFeignClientFallback implements CheckCompanyFeignClient {
/**
* 查询安全检查
*
* @param req
* @param query
* @return
*/
@Override
public R<BladePage<CheckCompanyVo>> list(CheckCompanyEntity req, Query query) {
return R.fail("远程调用失败");
}
/**
* 详情
*
* @param id
* @return
*/
@Override
public R<CheckCompanyVo> detail(Long id) {
return null;
}
}

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/SafeEquipmentTrialFeignClientFallback.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.areamonthly.feign.fallback;
import com.hnac.hzims.safeproduct.areamonthly.feign.SafeEquipmentTrialFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 19:50
*/
@Service
public class SafeEquipmentTrialFeignClientFallback implements SafeEquipmentTrialFeignClient {
/**
* 分页
*
* @param safeEquipmentTrialDTO
* @param query
*/
@Override
public R<BladePage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) {
return R.fail("远程调用失败");
}
}

40
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/fallback/SafeproductFeignClientFallback.java

@ -0,0 +1,40 @@
package com.hnac.hzims.safeproduct.areamonthly.feign.fallback;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.areamonthly.feign.SafeproductFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckMonthVo;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 18:07
*/
@Service
public class SafeproductFeignClientFallback implements SafeproductFeignClient {
/**
* 分页查询安全生产会议次数
*
* @param page
* @param size
* @param req
*/
@Override
public R<BladePage<CheckMonthVo>> listconferenceScope(Long page, Long size, CheckMonthEntity req) {
return R.fail("远程调用失败");
}
/**
* 详情
*
* @param id
*/
@Override
public R<CheckMonthVo> detail(Long id) {
return R.fail("远程调用失败");
}
}

33
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/CheckCompanyVo.java

@ -0,0 +1,33 @@
package com.hnac.hzims.safeproduct.areamonthly.vo;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 19:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class CheckCompanyVo extends CheckCompanyEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("状态文本值")
private String statusText;
@ApiModelProperty(value = "检查项实例")
List<Map<String, Object>> items;
//
// @ApiModelProperty(value = "检查项实例")
// List<Map<String, Object>> list;
}

34
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/CheckMonthVo.java

@ -0,0 +1,34 @@
package com.hnac.hzims.safeproduct.areamonthly.vo;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 18:09
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class CheckMonthVo extends CheckMonthEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("部门名称")
private String deptName;
@ApiModelProperty("状态文本值")
private String statusText;
@ApiModelProperty(value = "检查项实例")
List<CheckItemInstanceEntity> items;
}

23
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/vo/SafeEquipmentTrialVO.java

@ -0,0 +1,23 @@
package com.hnac.hzims.safeproduct.areamonthly.vo;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/4/12 20:04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SafeEquipmentTrialVO extends SafeEquipmentTrialEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人名称")
private String createUserName;
}

10
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/SafeEquipmentTrialDTO.java

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.YearMonth;
import java.util.List;
@ -36,4 +37,13 @@ public class SafeEquipmentTrialDTO extends SafeEquipmentTrialEntity {
@ApiModelProperty("创建部门集合")
private List<Long> deptList;
@ApiModelProperty(value = "区域id")
private String areaId;
@ApiModelProperty(value = "年月")
private YearMonth yearMonth;
}

13
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CheckCompanyEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@ -11,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.YearMonth;
/**
* Created by Sam Huang 2022/5/6 8:16
@ -47,4 +49,15 @@ public class CheckCompanyEntity extends TenantEntity implements Serializable {
@ApiModelProperty(value = "检查机构")
private String orgId;
@TableField(exist = false)
@ApiModelProperty(value = "区域id")
private String areaId;
@TableField(exist = false)
@ApiModelProperty(value = "年月")
private YearMonth yearMonth;
}

25
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CheckMonthEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
@ -10,6 +11,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
import java.time.YearMonth;
/**
* Created by Sam Huang 2022/5/6 8:16
@ -32,4 +34,27 @@ public class CheckMonthEntity extends TenantEntity implements Serializable {
@ApiModelProperty(value = "核查建议")
private String suggest;
/**
* 区域Id
*/
@TableField(exist = false)
@ApiModelProperty(value = "区域Id")
private String areaId;
/**
* 年月
*/
@TableField(exist = false)
private YearMonth yearMonth;
@TableField(exist = false)
private String itemName;
}

7
hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java

@ -36,4 +36,11 @@ public interface MessagePushRecordMapper extends UserDataScopeBaseMapper<Message
*/
List<PushStatTypeVo> pushStat(@Param("vo") MessagePushRecordEntityVo vo);
/**
* 查询出状态信息
* @return
*/
List<Integer> selectByStatus();
}

43
hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml

@ -5,28 +5,26 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hnac.hzims.message.vo.msgpushrecord.UserPushStatTypeVo">
<result column="pusherName" property="pusherName"/>
<collection property="pushStatList" ofType="com.hnac.hzims.message.vo.msgpushrecord.UserPushStatVo" >
<result column="pusherName" property="pusherName"/>
<result column="businessClassify" property="businessClassify"/>
<result column="count" property="power"/>
<result column="pusherName" property="pusherName"/>
<collection property="pushStatList" ofType="com.hnac.hzims.message.vo.msgpushrecord.UserPushStatVo">
<result column="pusherName" property="pusherName"/>
<result column="businessClassify" property="businessClassify"/>
<result column="count" property="power"/>
</collection>
</resultMap>
<!-- 根据type统计数量-->
<select id="smsPushStat" resultType="com.hnac.hzims.message.vo.msgpushrecord.MessagePushRecordVo">
select count(1) power,
date_format(PLAN_TIME, '%Y-%m') strMonth,
type
date_format(PLAN_TIME, '%Y-%m') strMonth,
type
from hzims_message_push_record
<where>
IS_DELETED = 0
<if test="vo.stationCode != null and vo.stationCode != ''">
and
STATION_CODE = #{vo.stationCode}
DEPT_ID = #{vo.stationCode}
</if>
</where>
group by strMonth, TYPE
@ -41,7 +39,7 @@
IS_DELETED = 0
<if test="vo.stationCode != null and vo.stationCode != ''">
and
STATION_CODE = #{vo.stationCode}
DEPT_ID = #{vo.stationCode}
</if>
<if test="vo.yearMonth != null">
and
@ -57,15 +55,15 @@
<!-- 人员发送统计-->
<select id="userPushStat" resultMap="BaseResultMap">
select PUSHER_NAME pusherName,
BUSINESS_CLASSIFY businessClassify,
count(1) count
select PUSHER_NAME pusherName,
BUSINESS_CLASSIFY businessClassify,
count(1) count
from hzims_message_push_record
<where>
IS_DELETED = 0
<if test="vo.stationCode != null and vo.stationCode != ''">
and
STATION_CODE = #{vo.stationCode}
DEPT_ID = #{vo.stationCode}
</if>
<if test="vo.yearMonth != null">
and
@ -80,11 +78,10 @@
</select>
<!-- 推送成功失败统计-->
<resultMap id="PushStatResultMap" type="com.hnac.hzims.message.vo.msgpushrecord.PushStatTypeVo">
<result column="businessClassify" property="businessClassify"/>
<collection property="pushStatList" ofType="com.hnac.hzims.message.vo.msgpushrecord.PushStatVo" >
<collection property="pushStatList" ofType="com.hnac.hzims.message.vo.msgpushrecord.PushStatVo">
<result column="businessClassify" property="businessClassify"/>
<result column="status" property="status"/>
<result column="count" property="power"/>
@ -93,13 +90,13 @@
<select id="pushStat" resultMap="PushStatResultMap">
select BUSINESS_CLASSIFY businessClassify,STATUS status,count(1) count
select BUSINESS_CLASSIFY businessClassify,STATUS status,count(1) count
from hzims_message_push_record
<where>
IS_DELETED = 0
<if test="vo.stationCode != null and vo.stationCode != ''">
and
STATION_CODE = #{vo.stationCode}
DEPT_ID = #{vo.stationCode}
</if>
<if test="vo.yearMonth != null">
and
@ -110,6 +107,12 @@
type = #{vo.type}
</if>
</where>
group by businessClassify,status
group by businessClassify,status
</select>
<!-- 查询出状态信息-->
<select id="selectByStatus" resultType="java.lang.Integer">
select STATUS
from hzims_message_push_record
group by STATUS
</select>
</mapper>

130
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.common.utils.CacheUtil;
@ -56,71 +57,70 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
return this.page(Condition.getPage(query), this.getQueryWrapper(request));
}
/** @Author hx
/**
* @return java.lang.Boolean 推送结果
* @Author hx
* @Description 根据ID发送短信
* @Date 2023/4/12 10:22
* @Param [id] 短信记录ID
* @return java.lang.Boolean 推送结果
**/
@Override
public Boolean send(Long id) {
MessagePushRecordEntity record = this.getById(id);
IMessageService messageSend = MessageFactory.getMessageSend(record.getType());
Boolean result = messageSend.send(record);
Assert.isTrue(result , ()-> {
throw new ServiceException("发送消息失败!");
});
// 更新推送状态以及推送时间
LambdaUpdateWrapper<MessagePushRecordEntity> luw = Wrappers.<MessagePushRecordEntity>lambdaUpdate()
.set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
.set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
.eq(MessagePushRecordEntity::getId, id);
return this.update(luw);
}
@Override
public Boolean send(Long id) {
MessagePushRecordEntity record = this.getById(id);
IMessageService messageSend = MessageFactory.getMessageSend(record.getType());
Boolean result = messageSend.send(record);
Assert.isTrue(result, () -> {
throw new ServiceException("发送消息失败!");
});
// 更新推送状态以及推送时间
LambdaUpdateWrapper<MessagePushRecordEntity> luw = Wrappers.<MessagePushRecordEntity>lambdaUpdate().set(MessagePushRecordEntity::getPushTime, LocalDateTime.now()).set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS).eq(MessagePushRecordEntity::getId, id);
return this.update(luw);
}
/** @Author hx
/**
* @return java.lang.Boolean 推送解雇
* @Author hx
* @Description 保存并推送消息
* @Date 2023/4/12 10:23
* @Param [request] 消息记录
* @return java.lang.Boolean 推送解雇
**/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveAndSend(MessagePushRecordEntity request) {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveAndSend(MessagePushRecordEntity request) {
LocalDateTime now = LocalDateTime.now();
if(MessageConstants.IMMEDIATELY.equals(request.getPushType())) {
if (MessageConstants.IMMEDIATELY.equals(request.getPushType())) {
request.setPlanTime(now);
request.setPushTime(now);
// 立即推送消息
if(this.save(request) && Func.isNotEmpty(request.getId())) {
if (this.save(request) && Func.isNotEmpty(request.getId())) {
return this.send(request.getId());
}
throw new ServiceException("保存消息失败!");
}
else if(MessageConstants.PLAN.equals(request.getPushType())) {
} else if (MessageConstants.PLAN.equals(request.getPushType())) {
return this.save(request);
}
else {
} else {
throw new ServiceException("推送类型只能为即时推送或计划推送");
}
}
/**
* 获取 QueryWrapper
* @param request 查询条件
* @return QueryWrapper
*/
private LambdaQueryWrapper<MessagePushRecordEntity> getQueryWrapper(MessagePushRecordEntity request) {
LambdaQueryWrapper<MessagePushRecordEntity> lambda = Condition.getQueryWrapper(request).lambda();
if(Func.isNotEmpty(request.getStartTime())) {
lambda.ge(MessagePushRecordEntity::getPushTime,request.getStartTime());
}
if(Func.isNotEmpty(request.getEndTime())) {
lambda.le(MessagePushRecordEntity::getPushTime,request.getEndTime());
}
lambda.orderByDesc(MessagePushRecordEntity::getPushTime);
return lambda;
}
/**
* 获取 QueryWrapper
*
* @param request 查询条件
* @return QueryWrapper
*/
private LambdaQueryWrapper<MessagePushRecordEntity> getQueryWrapper(MessagePushRecordEntity request) {
LambdaQueryWrapper<MessagePushRecordEntity> lambda = Condition.getQueryWrapper(request).lambda();
if (Func.isNotEmpty(request.getStartTime())) {
lambda.ge(MessagePushRecordEntity::getPushTime, request.getStartTime());
}
if (Func.isNotEmpty(request.getEndTime())) {
lambda.le(MessagePushRecordEntity::getPushTime, request.getEndTime());
}
lambda.orderByDesc(MessagePushRecordEntity::getPushTime);
return lambda;
}
/**
* 短信推送统计
*/
@ -136,8 +136,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
});
//按类型分组
Map<String, List<MessagePushRecordVo>> collect =
messagePushRecordVos.stream().collect(Collectors.groupingBy(MessagePushRecordVo::getType));
Map<String, List<MessagePushRecordVo>> collect = messagePushRecordVos.stream().collect(Collectors.groupingBy(MessagePushRecordVo::getType));
List<MessagePushRecordTypeVo> messagePushRecordTypeVos = new ArrayList<>();
//封装数据
@ -195,21 +194,44 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
public List<PushStatTypeVo> pushStat(MessagePushRecordEntityVo vo) {
List<PushStatTypeVo> pushStatTypeVos = baseMapper.pushStat(vo);
pushStatTypeVos.forEach(item -> {
//查询出状态信息
List<Integer> statusList = baseMapper.selectByStatus();
//业务类型名称
String businessClassify = item.getBusinessClassify();
String businessTypeName = this.getBusinessClassifyByName(businessClassify);
item.setBusinessClassifyName(businessTypeName);
List<PushStatVo> pushStatList = item.getPushStatList();
pushStatList.forEach(pushStat -> {
Integer status = pushStat.getStatus();
//状态名称
String name = this.getStatusByName(status);
pushStat.setStatusName(name);
List<PushStatVo> newPushStatList = new ArrayList<>();
for (PushStatVo pushStat : pushStatList) {
//业务类型名称
String businessClassifyPushStat = pushStat.getBusinessClassify();
String businessTypeNamePushStat = this.getBusinessClassifyByName(businessClassifyPushStat);
pushStat.setBusinessClassifyName(businessTypeNamePushStat);
});
Integer status = pushStat.getStatus();
//如果list 包含这条数删除
if (statusList.contains(status)) {
statusList.remove(status);
}
//状态名称
String name = this.getStatusByName(status);
pushStat.setStatusName(name);
newPushStatList.add(pushStat);
}
//如何list不为空补0
if (CollectionUtils.isNotEmpty(statusList)) {
for (int i = 0; i < statusList.size(); i++) {
PushStatVo pushStat = new PushStatVo();
int status = statusList.get(i);
pushStat.setStatus(status);
pushStat.setPower(0L);
pushStat.setBusinessClassify(businessClassify);
pushStat.setBusinessClassifyName(businessTypeName);
pushStat.setStatusName(this.getStatusByName(status));
newPushStatList.add(pushStat);
}
}
item.setPushStatList(newPushStatList);
});
return pushStatTypeVos;
}
@ -218,12 +240,12 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
public List<UnreadMessageVO> getPersonalUnreadMessage() {
QueryWrapper<MessagePushRecordEntity> query = Wrappers.query();
query.select("business_classify businessClassify,count(0) todoNum");
query.eq("account",AuthUtil.getUserId());
query.eq("account", AuthUtil.getUserId());
query.groupBy("business_classify");
List<Map<String, Object>> list = this.listMaps(query);
return list.stream().map(map -> {
UnreadMessageVO unreadMessageVO = Func.toBean(map, UnreadMessageVO.class);
unreadMessageVO.setBusinessName(DictCache.getValue("businessClassify",unreadMessageVO.getBusinessClassify()));
unreadMessageVO.setBusinessName(DictCache.getValue("businessClassify", unreadMessageVO.getBusinessClassify()));
return unreadMessageVO;
}).collect(Collectors.toList());
}

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import java.time.YearMonth;
import java.util.List;
/**
@ -25,4 +26,16 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity {
@ApiModelProperty(value = "创建机构集合")
private List<Long> deptIds;
/**
* 年月
*/
private YearMonth yearMonth;
/**
* 区域Id
*/
private String areaId;
}

21
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.java

@ -3,13 +3,13 @@ package com.hnac.hzims.operational.access.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/**
*
* Mapper 接口
*
* @author xiashandong
@ -18,14 +18,13 @@ import java.util.List;
public interface OperAccessStatisticsMapper extends UserDataScopeBaseMapper<OperAccessStatisticsEntity> {
/**
* 自定义分页
*
* @param page
* @param dto
* @return
*/
@UserDataAuth
List<OperAccessStatisticsEntity> selectPageList(IPage page, OperAccessStatisticsDTO dto);
/**
* 自定义分页
*
* @param page
* @param dto
* @return
*/
@UserDataAuth
List<OperAccessStatisticsEntity> selectPageList(IPage page, @Param("dto") OperAccessStatisticsDTO dto);
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -37,6 +37,12 @@
<if test="dto.planEndTime != null">
and OS.PLAN_END_TIME &lt;= #{dto.planEndTime}
</if>
<if test="dto.areaId != null and dto.areaId != ''">
and OS.CREATE_DEPT = #{dto.areaId}
</if>
<if test="dto.yearMonth != null">
and date_format(os.CREATE_TIME,'%Y-%m') = #{dto.yearMonth}
</if>
ORDER BY OS.CREATE_TIME DESC
</select>

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessStatisticsService.java

@ -5,7 +5,6 @@ import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java

@ -85,11 +85,6 @@ public class OperDefectController extends BladeController {
if (defect.getEndTime() != null) {
queryWrapper.le(OperDefectEntity::getCreateTime, defect.getEndTime());
}
queryWrapper.eq(StringUtils.isNotBlank(defect.getAreaId()), BaseEntity::getCreateDept, defect.getCreateDept());
queryWrapper.apply(defect.getYearMonth() != null,"date_format(CREATE_TIME,'%Y-%m')", defect.getYearMonth());
queryWrapper.orderByDesc(OperDefectEntity::getActStartTime);
IPage<OperDefectEntity> pages = defectService.page(Condition.getPage(query), queryWrapper);
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages);

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java

@ -1,5 +1,7 @@
package com.hnac.hzims.operational.defect.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.vo.OperDefectVO;
@ -88,4 +90,12 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
boolean updateDefectInfo(OperDefectEntity entity);
boolean updateDefectHanderState(OperDefectEntity entity);
/**
* 分页查询
* @param operDefectEntityPage
* @param defect
* @return
*/
IPage<OperDefectEntity> selectPage(Page<OperDefectEntity> operDefectEntityPage, OperDefectEntity defect);
}

1707
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

File diff suppressed because it is too large Load Diff

175
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java

@ -1,11 +1,26 @@
package com.hnac.hzims.operational.main.controller.web;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO;
import com.hnac.hzims.operational.access.service.IOperAccessStatisticsService;
import com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.vo.OperDefectVO;
import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper;
import com.hnac.hzims.operational.main.service.AreaMonthlyDetailsService;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckMonthVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoEvaluateVO;
import com.hnac.hzims.ticket.areamonthly.dto.TicketInfoEvaluateDto;
@ -16,7 +31,9 @@ import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.SpringQueryMap;
@ -43,6 +60,10 @@ public class AreaMonthlyDetailsController {
private final IOperMaintenanceTaskService taskService;
private final IOperDefectService defectService;
private final IOperAccessStatisticsService accessStatisticsService;
/**
* 操作票 根据月份区域 获取操作详情数据
@ -143,4 +164,158 @@ public class AreaMonthlyDetailsController {
return R.data(task);
}
/**
* 根据区域和月份分页查询缺陷库
*/
@ApiOperationSupport(order = 70)
@ApiOperation(value = "分页查询")
@GetMapping("/queryDefectPageList/{page}/{size}")
public R<IPage<OperDefectVO>> queryDefectPageList(
@PathVariable Long page,
@PathVariable Long size,
OperDefectEntity defect) {
Page<OperDefectEntity> operDefectEntityPage = new Page<>(page, size);
IPage<OperDefectEntity> pages = defectService.selectPage(operDefectEntityPage, defect);
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages);
return R.data(vos);
}
/**
* 根据区域和月份分页查询缺陷库 详情
*/
@GetMapping("queryDefectPageDetail/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入defect")
public R<OperDefectVO> queryDefectPageDetail(OperDefectEntity defect) {
return defectService.detail(defect);
}
/**
* 根据区域和月份分页查询检修任务
*/
@ApiOperationSupport(order = 80)
@ApiOperation(value = "根据区域和月份分页查询检修任务")
@GetMapping("/queryReconditionPageList/{page}/{size}")
public R<IPage<OperAccessStatisticsVO>> queryReconditionPageList(
@PathVariable Long page, @PathVariable Long size,
OperAccessStatisticsDTO result) {
Page<OperAccessStatisticsVO> dbPage = new Page<>(page, size);
R<IPage<OperAccessStatisticsVO>> r = accessStatisticsService.list(result, dbPage);
return r;
}
/**
* 根据区域 编号查询检修任务详情
*/
@GetMapping("/queryReconditionPageDetail/detail")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "根据区域 编号查询检修任务详情")
public R<OperAccessStatisticsVO> queryReconditionPageDetail(@RequestParam Long id) {
R<OperAccessStatisticsVO> detail = accessStatisticsService.detail(id);
return detail;
}
/**
* 根据区域编号查询安全生产会议次数
*/
@GetMapping("/queryProduceNumByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 90)
@ApiOperation(value = "根据区域编号查询安全生产会议次数")
public R<BladePage<CheckMonthVo>> queryProduceNumByAreaCode(@PathVariable Long page, @PathVariable Long size,
CheckMonthEntity req) {
req.setItemName("现场每月1次安全生产会议");
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
req);
return R.data(checkMonthVoBladePage);
}
/**
* 根据区域编号查询技能培训
*/
@GetMapping("/querySkillByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询技能培训")
public R<BladePage<CheckMonthVo>> querySkillByAreaCode(@PathVariable Long page, @PathVariable Long size, CheckMonthEntity req) {
req.setItemName("每月开展1次技能培训");
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
req);
return R.data(checkMonthVoBladePage);
}
/**
* 根据区域编号查询月度自查
*/
@GetMapping("/queryProduceByAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询技能培训")
public R<BladePage<CheckMonthVo>> queryProduceByAreaCode(@PathVariable Long page, @PathVariable Long size, CheckMonthEntity req) {
BladePage<CheckMonthVo> checkMonthVoBladePage = areaMonthlyDetailsService.queryProduceByAreaCode(page, size,
req);
return R.data(checkMonthVoBladePage);
}
/**
* 根据区域编号查询 月度自查 技能培训 安全生产会议次数
*/
@GetMapping("/queryProduceByAreaCodeDetail/detail/{id}")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入id")
public R<CheckMonthVo> queryProduceByAreaCodeDetail(@PathVariable Long id){
CheckMonthVo checkMonthVo = areaMonthlyDetailsService.queryProduceByAreaCodeDetail(id);
return R.data(checkMonthVo);
}
/**
* 根据区域编号查询安全检查
*/
@GetMapping("/querySecurityAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询安全检查")
public R<BladePage<CheckCompanyVo>> querySecurityAreaCode(@PathVariable Long page,
@PathVariable Long size,
CheckCompanyEntity req) {
BladePage<CheckCompanyVo> checkMonthVoBladePage = areaMonthlyDetailsService.querySecurityAreaCode(page, size,
req);
return R.data(checkMonthVoBladePage);
}
/**
* 根据区域编号查询安全检查 详情
*/
@GetMapping("/querySecurityAreaCode/detail/{id}")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询安全检查 详情")
public R<CheckCompanyVo> querySecurityAreaCodeDetail(@PathVariable Long id) {
CheckCompanyVo checkMonthVoBladePage = areaMonthlyDetailsService.querySecurityAreaCodeDetail(id);
return R.data(checkMonthVoBladePage);
}
/**
* 根据区域编号查询设备试验
*/
@GetMapping("/queryEquipmentAreaCode/{page}/{size}")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "根据区域编号查询设备试验")
public R<BladePage<SafeEquipmentTrialVO>> queryEquipmentAreaCode(
@PathVariable Long page,
@PathVariable Long size,
SafeEquipmentTrialDTO safeEquipmentTrialDTO) {
BladePage<SafeEquipmentTrialVO> checkMonthVoBladePage = areaMonthlyDetailsService.queryEquipmentAreaCode(page
,size,safeEquipmentTrialDTO);
return R.data(checkMonthVoBladePage);
}
}

47
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/AreaMonthlyDetailsService.java

@ -1,6 +1,12 @@
package com.hnac.hzims.operational.main.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckMonthVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoEvaluateVO;
import com.hnac.hzims.ticket.areamonthly.dto.TicketInfoEvaluateDto;
@ -75,4 +81,45 @@ public interface AreaMonthlyDetailsService {
* @return
*/
TaskEntity queryCheckTaskById(Long id);
/**
* 根据区域编号查询安全生产会议次数 技能培训
* @param page
* @param size
* @param req
* @return
*/
BladePage<CheckMonthVo> queryProduceByAreaCode(Long page, Long size, CheckMonthEntity req);
/**
* 根据区域编号查询 月度自查 技能培训 安全生产会议次数
*/
CheckMonthVo queryProduceByAreaCodeDetail(Long id);
/**
* 根据区域编号查询安全检查
* @param page
* @param size
* @param req
* @return
*/
BladePage<CheckCompanyVo> querySecurityAreaCode(Long page, Long size, CheckCompanyEntity req);
/**
* 根据区域编号查询安全检查 详情
* @param id
* @return
*/
CheckCompanyVo querySecurityAreaCodeDetail(Long id);
/**
* 根据区域编号查询设备试验
* @param page
* @param size
* @param safeEquipmentTrialDTO
* @return
*/
BladePage<SafeEquipmentTrialVO> queryEquipmentAreaCode(Long page, Long size, SafeEquipmentTrialDTO safeEquipmentTrialDTO);
}

122
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthlyDetailsServiceImpl.java

@ -1,6 +1,15 @@
package com.hnac.hzims.operational.main.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.areamonthly.feign.CheckCompanyFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.feign.SafeEquipmentTrialFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.feign.SafeproductFeignClient;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.CheckMonthVo;
import com.hnac.hzims.safeproduct.areamonthly.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoEvaluateVO;
import com.hnac.hzims.ticket.areamonthly.dto.TicketInfoEvaluateDto;
@ -38,6 +47,13 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
private final TaskFeignClient taskFeignClient;
private final SafeproductFeignClient safeproductFeignClient;
private final CheckCompanyFeignClient checkCompanyFeignClient;
private final SafeEquipmentTrialFeignClient safeEquipmentTrialFeignClient;
/**
* 根据月份区域 获取操作详情数据
@ -49,8 +65,7 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
*/
@Override
public BladePage<StandardTicketVo> areaMonthlyWithOperation(Long page, Long size, StandardTicketWithAreaVo areaMonthly) {
R<BladePage<StandardTicketVo>> pageR =
ticketFeignClient.areaMonthlyWithOperation(page, size, areaMonthly);
R<BladePage<StandardTicketVo>> pageR = ticketFeignClient.areaMonthlyWithOperation(page, size, areaMonthly);
if (pageR.isSuccess()) {
log.info("获取操作详情数据成功");
return pageR.getData();
@ -68,9 +83,8 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
* @return
*/
@Override
public BladePage<StandardWorkVo> workTicketListByMonthAndArea(Long page, Long size,StandardTicketWithAreaVo areaMonthlyVo) {
R<BladePage<StandardWorkVo>> pageR =
ticketFeignClient.workTicketListByMonthAndArea(page, size, areaMonthlyVo);
public BladePage<StandardWorkVo> workTicketListByMonthAndArea(Long page, Long size, StandardTicketWithAreaVo areaMonthlyVo) {
R<BladePage<StandardWorkVo>> pageR = ticketFeignClient.workTicketListByMonthAndArea(page, size, areaMonthlyVo);
if (pageR.isSuccess()) {
log.info("获取操作详情数据成功");
return pageR.getData();
@ -149,6 +163,7 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
/**
* 根据id查询巡检任务
*
* @param id
* @return
*/
@ -162,4 +177,101 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
log.error("获取检查巡检任务详情失败", detail.getMsg());
return null;
}
/**
* 根据区域编号查询安全生产会议次数 技能培训
*
* @param page
* @param size
* @param req
* @return
*/
@Override
public BladePage<CheckMonthVo> queryProduceByAreaCode(Long page, Long size, CheckMonthEntity req) {
R<BladePage<CheckMonthVo>> detail = safeproductFeignClient.listconferenceScope(page, size, req);
if (detail.isSuccess()) {
log.info("获取安全生产会议次数 技能培训成功");
return detail.getData();
}
log.error("获取安全生产会议次数 技能培训失败", detail.getMsg());
return null;
}
/**
* 根据区域编号查询 月度自查 技能培训 安全生产会议次数
*
* @param id
*/
@Override
public CheckMonthVo queryProduceByAreaCodeDetail(Long id) {
R<CheckMonthVo> detail = safeproductFeignClient.detail(id);
if (detail.isSuccess()) {
log.info("根据区域编号查询 月度自查 技能培训 安全生产会议次数成功");
return detail.getData();
}
log.error("根据区域编号查询 月度自查 技能培训 安全生产会议次数失败", detail.getMsg());
return null;
}
/**
* 根据区域编号查询安全检查
*
* @param page
* @param size
* @param req
* @return
*/
@Override
public BladePage<CheckCompanyVo> querySecurityAreaCode(Long page, Long size, CheckCompanyEntity req) {
Query query = new Query();
query.setCurrent(page.intValue());
query.setSize(size.intValue());
R<BladePage<CheckCompanyVo>> list = checkCompanyFeignClient.list(req, query);
if (list.isSuccess()) {
log.info("根据区域编号查询安全检查成功");
return list.getData();
}
log.error("根据区域编号查询安全检查失败", list.getMsg());
return null;
}
/**
* 根据区域编号查询安全检查详情
*
* @param id
* @return
*/
@Override
public CheckCompanyVo querySecurityAreaCodeDetail(Long id) {
R<CheckCompanyVo> detailed = checkCompanyFeignClient.detail(id);
if (detailed.isSuccess()) {
log.info(" 根据区域编号查询安全检查详情成功");
return detailed.getData();
}
log.error(" 根据区域编号查询安全检查详情失败", detailed.getMsg());
return null;
}
/**
* 根据区域编号查询设备试验
*
* @param page
* @param size
* @param safeEquipmentTrialDTO
* @return
*/
@Override
public BladePage<SafeEquipmentTrialVO> queryEquipmentAreaCode(Long page, Long size, SafeEquipmentTrialDTO safeEquipmentTrialDTO) {
Query query = new Query();
query.setCurrent(page.intValue());
query.setSize(size.intValue());
R<BladePage<SafeEquipmentTrialVO>> list = safeEquipmentTrialFeignClient.list(safeEquipmentTrialDTO, query);
if (list.isSuccess()) {
log.info("根据区域编号查询设备试验成功");
return list.getData();
}
log.error("根据区域编号查询设备试验失败", list.getMsg());
return null;
}
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckCompanyController.java

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Dept;
@ -76,7 +77,7 @@ public class CheckCompanyController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:startDate,endDate,status")
public R<IPage<CheckCompanyVo>> list(CheckCompanyEntity req, Query query) {
public R<BladePage<CheckCompanyVo>> list(CheckCompanyEntity req, Query query) {
return CheckCompanyService.pageCondition(req, query);
}

27
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java

@ -1,6 +1,7 @@
package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.dto.CheckMonthDTO;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Dept;
@ -108,4 +110,29 @@ public class CheckMonthController extends BladeController {
return R.data(page);
}
/**
* 分页查询安全生产会议次数
*/
@GetMapping("/listconferenceScope/{page}/{size}")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页", notes = "查询条件:month,status,createDept")
public R<BladePage<CheckMonthVo>> listconferenceScope(
@PathVariable Long page, @PathVariable Long size,
CheckMonthEntity req) {
Page<CheckMonthEntity> objectPage = new Page<>(page, size);
R<IPage<CheckMonthVo>> pageR = checkMonthlyService.listconferenceScope(req,objectPage);
IPage<CheckMonthVo> pages = pageR.getData();
pages.getRecords().forEach(monthlyVo -> {
R<Dept> deptR = sysClient.getDept(monthlyVo.getCreateDept());
if (deptR.isSuccess()) {
monthlyVo.setDeptName(Optional.ofNullable(deptR.getData()).map(Dept::getDeptName).orElse(null));
}
});
BladePage<CheckMonthVo> bladePage = BladePage.of(pages);
return R.data(bladePage);
}
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafeEquipmentTrialController.java

@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
@ -58,7 +59,7 @@ public class SafeEquipmentTrialController extends BladeController {
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
@OperationAnnotation(title = "设备试验",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "分页条件")
public R<IPage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) {
public R<BladePage<SafeEquipmentTrialVO>> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) {
return service.pageCondition(safeEquipmentTrialDTO, query);
}

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckMonthMapper.java

@ -2,7 +2,9 @@ package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.safeproduct.vo.CheckMonthVo;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import org.springblade.core.mp.support.Query;
@ -21,4 +23,11 @@ public interface CheckMonthMapper extends UserDataScopeBaseMapper<CheckMonthEnti
*/
IPage<CheckMonthEntity> pageNotDataScope(IPage page, @Param("req") CheckMonthEntity req);
/**
* 分页查询安全生产会议次数
* @param objectPage
* @param req
* @return
*/
IPage<CheckMonthEntity> listconferenceScope(IPage<CheckMonthEntity> objectPage, @Param("req") CheckMonthEntity req);
}

27
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckMonthMapper.xml

@ -15,5 +15,32 @@
</if>
order by CREATE_TIME desc
</select>
<!-- 分页查询安全生产会议次数-->
<select id="listconferenceScope" resultType="com.hnac.hzims.safeproduct.entity.CheckMonthEntity">
select p.* from hzims_safe_check_month p LEFT JOIN
hzims_safe_check_item_instance c
on p.id = c.CHECK_ID
<where>
<if test="req.itemName!=null and req.itemName!=''">
c.item = #{req.itemName}
</if>
<if test="req.month!=null and req.month!=''">
AND p.MONTH = #{req.month}
</if>
<if test="req.status!=null">
AND p.STATUS = #{req.status}
</if>
<if test="req.createDept!=null">
AND p.CREATE_DEPT = #{req.createDept}
</if>
<if test="req.areaId !=null">
AND p.CREATE_DEPT = #{req.areaId}
</if>
<if test="req.yearMonth !=null">
AND p.month = #{req.yearMonth}
</if>
</where>
</select>
</mapper>

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICheckCompanyService.java

@ -8,6 +8,7 @@ import com.hnac.hzims.safeproduct.entity.CheckQuarterEntity;
import com.hnac.hzims.safeproduct.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.vo.CheckQuarterVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
@ -24,6 +25,6 @@ public interface ICheckCompanyService extends BaseService<CheckCompanyEntity> {
R<CheckCompanyVo> detail(Long id);
R<IPage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query);
R<BladePage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query);
}

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICheckMonthService.java

@ -1,6 +1,7 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.safeproduct.dto.CheckMonthDTO;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.safeproduct.vo.CheckMonthVo;
@ -25,4 +26,12 @@ public interface ICheckMonthService extends BaseService<CheckMonthEntity> {
R<IPage<CheckMonthVo>> pageNotDataScope(CheckMonthEntity req, Query query);
/**
* 分页查询安全生产会议次数
* @param req
* @param objectPage
* @return
*/
R<IPage<CheckMonthVo>> listconferenceScope(CheckMonthEntity req, Page<CheckMonthEntity> objectPage);
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/SafeEquipmentTrialService.java

@ -6,6 +6,7 @@ import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import com.hnac.hzims.safeproduct.vo.SafeEquipmentTrialVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
@ -16,7 +17,7 @@ import java.util.List;
*/
public interface SafeEquipmentTrialService extends BaseService<SafeEquipmentTrialEntity> {
R<IPage<SafeEquipmentTrialVO>> pageCondition(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query);
R<BladePage<SafeEquipmentTrialVO>> pageCondition(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query);
int getSafeEquipmentCount(SafeEquipmentTrialDTO dto);

206
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckCompanyServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.hnac.hzims.safeproduct.dto.CheckCompanyDTO;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckItemEntity;
@ -15,7 +16,9 @@ import com.hnac.hzims.safeproduct.vo.CheckCompanyVo;
import com.hnac.hzims.safeproduct.wrapper.CheckCompanyWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
@ -37,112 +40,117 @@ import java.util.stream.Collectors;
@Slf4j
public class CheckCompanyServiceImpl extends BaseServiceImpl<CheckCompanyMapper, CheckCompanyEntity> implements ICheckCompanyService {
private final CheckCompanyMapper CheckCompanyMapper;
private final CheckCompanyMapper CheckCompanyMapper;
private final ICheckItemInstanceService itemInstanceService;
private final ICheckItemInstanceService itemInstanceService;
private final ISysClient sysClient;
private final ISysClient sysClient;
@Override
public boolean doSave(CheckCompanyDTO req) {
boolean result = save(req);
if (result) {
Long checkId = req.getId();
List<CheckItemInstanceEntity> items = req.getItems();
items.forEach(item -> {
item.setOid(item.getId());
item.setId(null);
item.setCheckId(checkId);
});
itemInstanceService.saveBatch(items);
}
return result;
}
@Override
public boolean doSave(CheckCompanyDTO req) {
boolean result = save(req);
if (result) {
Long checkId = req.getId();
List<CheckItemInstanceEntity> items = req.getItems();
items.forEach(item -> {
item.setOid(item.getId());
item.setId(null);
item.setCheckId(checkId);
});
itemInstanceService.saveBatch(items);
}
return result;
}
@Override
public boolean doUpdate(CheckCompanyDTO req) {
boolean result = updateById(req);
if (result) {
List<CheckItemInstanceEntity> items = req.getItems();
items.forEach(itemInstanceService::updateById);
}
return result;
}
@Override
public boolean doUpdate(CheckCompanyDTO req) {
boolean result = updateById(req);
if (result) {
List<CheckItemInstanceEntity> items = req.getItems();
items.forEach(itemInstanceService::updateById);
}
return result;
}
@Override
public R<CheckCompanyVo> detail(Long id) {
CheckCompanyEntity entity = CheckCompanyMapper.selectById(id);
CheckCompanyVo vo = CheckCompanyWrapper.build().entityVO(entity);
//查询检查项
QueryWrapper<CheckItemInstanceEntity> queryMapper = new QueryWrapper<>();
queryMapper.eq("CHECK_ID", vo.getId());
queryMapper.orderByAsc("ORG_ID", "SORT");
List<CheckItemInstanceEntity> items = itemInstanceService.list(queryMapper);
//查询子项,用于前端判断
items.forEach(item -> item.setChildren(findChildren(item, items)));
//按部门分组
List<Map<String, Object>> list = new ArrayList<>();
Map<Long, List<CheckItemInstanceEntity>> map = items.stream().collect(Collectors.groupingBy(CheckItemInstanceEntity::getOrgId));
for (Map.Entry<Long, List<CheckItemInstanceEntity>> entry : map.entrySet()) {
Map<String, Object> data = new HashMap<>();
data.put("deptId", entry.getKey());
R<Dept> deptR = sysClient.getDept(entry.getKey());
if (deptR.isSuccess()) {
data.put("deptName", Optional.ofNullable(deptR.getData()).map(Dept::getDeptName).orElse(null));
} else {
data.put("deptName", null);
}
data.put("items", entry.getValue());
list.add(data);
}
vo.setItems(list);
return R.data(vo);
}
@Override
public R<CheckCompanyVo> detail(Long id) {
CheckCompanyEntity entity = CheckCompanyMapper.selectById(id);
CheckCompanyVo vo = CheckCompanyWrapper.build().entityVO(entity);
//查询检查项
QueryWrapper<CheckItemInstanceEntity> queryMapper = new QueryWrapper<>();
queryMapper.eq("CHECK_ID", vo.getId());
queryMapper.orderByAsc("ORG_ID", "SORT");
List<CheckItemInstanceEntity> items = itemInstanceService.list(queryMapper);
//查询子项,用于前端判断
items.forEach(item -> item.setChildren(findChildren(item, items)));
//按部门分组
List<Map<String, Object>> list = new ArrayList<>();
Map<Long, List<CheckItemInstanceEntity>> map = items.stream().collect(Collectors.groupingBy(CheckItemInstanceEntity::getOrgId));
for (Map.Entry<Long, List<CheckItemInstanceEntity>> entry : map.entrySet()) {
Map<String, Object> data = new HashMap<>();
data.put("deptId", entry.getKey());
R<Dept> deptR = sysClient.getDept(entry.getKey());
if (deptR.isSuccess()) {
data.put("deptName", Optional.ofNullable(deptR.getData()).map(Dept::getDeptName).orElse(null));
} else {
data.put("deptName", null);
}
data.put("items", entry.getValue());
list.add(data);
}
vo.setItems(list);
return R.data(vo);
}
private List<CheckItemEntity> findChildren(CheckItemInstanceEntity entity, List<CheckItemInstanceEntity> list) {
List<CheckItemEntity> child = new ArrayList<>();
for (CheckItemInstanceEntity itemEntity : list) {
if (null != itemEntity.getParentItem()
&& itemEntity.getParentItem().equals(entity.getOid())
&& itemEntity.getOrgId().equals(entity.getOrgId())) {
child.add(itemEntity);
itemEntity.setChildren(findChildren(itemEntity, list));
}
}
return child;
}
private List<CheckItemEntity> findChildren(CheckItemInstanceEntity entity, List<CheckItemInstanceEntity> list) {
List<CheckItemEntity> child = new ArrayList<>();
for (CheckItemInstanceEntity itemEntity : list) {
if (null != itemEntity.getParentItem()
&& itemEntity.getParentItem().equals(entity.getOid())
&& itemEntity.getOrgId().equals(entity.getOrgId())) {
child.add(itemEntity);
itemEntity.setChildren(findChildren(itemEntity, list));
}
}
return child;
}
@Override
public boolean doDelete(String ids) {
List<Long> list = Func.toLongList(ids);
boolean result = deleteLogic(list);
if (result) {
list.forEach(id -> {
QueryWrapper<CheckItemInstanceEntity> queryMapper = new QueryWrapper<>();
queryMapper.eq("CHECK_ID", id);
itemInstanceService.remove(queryMapper);
});
}
return result;
}
@Override
public boolean doDelete(String ids) {
List<Long> list = Func.toLongList(ids);
boolean result = deleteLogic(list);
if (result) {
list.forEach(id -> {
QueryWrapper<CheckItemInstanceEntity> queryMapper = new QueryWrapper<>();
queryMapper.eq("CHECK_ID", id);
itemInstanceService.remove(queryMapper);
});
}
return result;
}
@Override
public R<IPage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query) {
Wrapper<CheckCompanyEntity> queryWrapper = new LambdaQueryWrapper<CheckCompanyEntity>() {{
orderByDesc(CheckCompanyEntity::getCreateTime);
if (ObjectUtil.isNotEmpty(req.getStartTime())) {
ge(CheckCompanyEntity::getStartTime, req.getStartTime());
}
if (ObjectUtil.isNotEmpty(req.getEndTime())) {
le(CheckCompanyEntity::getEndTime, req.getEndTime());
}
if (ObjectUtil.isNotEmpty(req.getStatus())) {
eq(CheckCompanyEntity::getStatus, req.getStatus());
}
}};
IPage page = page(Condition.getPage(query), queryWrapper);
page.setRecords(CheckCompanyWrapper.build().listVO(page.getRecords()));
return R.data(page);
}
@Override
public R<BladePage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query) {
Wrapper<CheckCompanyEntity> queryWrapper = new LambdaQueryWrapper<CheckCompanyEntity>() {{
orderByDesc(CheckCompanyEntity::getCreateTime);
if (ObjectUtil.isNotEmpty(req.getStartTime())) {
ge(CheckCompanyEntity::getStartTime, req.getStartTime());
}
if (ObjectUtil.isNotEmpty(req.getEndTime())) {
le(CheckCompanyEntity::getEndTime, req.getEndTime());
}
if (ObjectUtil.isNotEmpty(req.getStatus())) {
eq(CheckCompanyEntity::getStatus, req.getStatus());
}
eq(StringUtils.isNotBlank(req.getAreaId()), BaseEntity::getCreateDept, req.getAreaId());
apply(req.getYearMonth() != null, "date_format(start_time ,'%Y-%m') = '"
+ req.getYearMonth() + "'" + "and date_format(end_time,'%Y-%m') = '" + req.getYearMonth() + "'");
}};
IPage page = page(Condition.getPage(query), queryWrapper);
page.setRecords(CheckCompanyWrapper.build().listVO(page.getRecords()));
BladePage bladePage = BladePage.of(page);
return R.data(bladePage);
}
}

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckMonthServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.hnac.hzims.safeproduct.dto.CheckMonthDTO;
import com.hnac.hzims.safeproduct.entity.CheckItemEntity;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
@ -140,4 +141,17 @@ public class CheckMonthServiceImpl extends BaseServiceImpl<CheckMonthMapper, Che
page.setRecords(CheckMonthWrapper.build().listVO(page.getRecords()));
return R.data(page);
}
/**
* 分页查询安全生产会议次数
* @param req
* @param objectPage
* @return
*/
@Override
public R<IPage<CheckMonthVo>> listconferenceScope(CheckMonthEntity req, Page<CheckMonthEntity> objectPage) {
IPage page = checkMonthMapper.listconferenceScope(objectPage, req);
page.setRecords(CheckMonthWrapper.build().listVO(page.getRecords()));
return R.data(page);
}
}

162
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafeEquipmentTrialServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentDTO;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
@ -11,6 +12,7 @@ import com.hnac.hzims.safeproduct.vo.SafeEquipmentTrialVO;
import com.hnac.hzims.safeproduct.wrapper.SafeEquipmentTrialWrapper;
import lombok.RequiredArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
@ -26,83 +28,91 @@ import java.util.Optional;
@RequiredArgsConstructor
public class SafeEquipmentTrialServiceImpl extends BaseServiceImpl<SafeEquipmentTrialMapper, SafeEquipmentTrialEntity> implements SafeEquipmentTrialService {
/**
* 分页查询
* @param param
* @param query
* @return
*/
@Override
public R<IPage<SafeEquipmentTrialVO>> pageCondition(SafeEquipmentTrialDTO param, Query query) {
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if(Optional.ofNullable(param.getCreateDept()).isPresent()){
eq("create_dept",param.getCreateDept());
}
if(Optional.ofNullable(param.getFileName()).isPresent()){
like("file_name","%".concat(param.getFileName()).concat("%"));
}
if(Optional.ofNullable(param.getStartTime()).isPresent()){
gt("create_time", param.getStartTime());
}
if(Optional.ofNullable(param.getEndTime()).isPresent()){
lt("create_time", param.getEndTime());
}
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = SafeEquipmentTrialWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));
}
/**
* 分页查询
*
* @param param
* @param query
* @return
*/
@Override
public R<BladePage<SafeEquipmentTrialVO>> pageCondition(SafeEquipmentTrialDTO param, Query query) {
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if (Optional.ofNullable(param.getCreateDept()).isPresent()) {
eq("create_dept", param.getCreateDept());
}
if (Optional.ofNullable(param.getFileName()).isPresent()) {
like("file_name", "%".concat(param.getFileName()).concat("%"));
}
if (Optional.ofNullable(param.getStartTime()).isPresent()) {
gt("create_time", param.getStartTime());
}
if (Optional.ofNullable(param.getEndTime()).isPresent()) {
lt("create_time", param.getEndTime());
}
lambda().eq(StringUtils.isNotBlank(param.getAreaId()), SafeEquipmentTrialEntity::getCreateDept,
param.getAreaId());
eq(param.getYearMonth() != null, "date_format(CREATE_TIME,'%Y-%m)", param.getYearMonth());
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = SafeEquipmentTrialWrapper.build().listVO(pages.getRecords());
pages.setRecords(list);
BladePage bladePage = BladePage.of(pages);
return R.data(bladePage);
}
/**
* 获取设备试验次数
* @param param
* @return
*/
@Override
public int getSafeEquipmentCount(SafeEquipmentTrialDTO param) {
if(ObjectUtil.isEmpty(param)){
return 0;
}
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if(CollectionUtil.isEmpty(param.getDeptList())){
if(Optional.ofNullable(param.getCreateDept()).isPresent()){
eq("create_dept",param.getCreateDept());
}
} else {
in("create_dept",param.getDeptList());
}
if(Optional.ofNullable(param.getStartTime()).isPresent()){
gt("create_time", param.getStartTime());
}
if(Optional.ofNullable(param.getEndTime()).isPresent()){
lt("create_time", param.getEndTime());
}
}};
return this.baseMapper.selectCount(queryWrapper);
}
/**
* 获取设备试验次数
*
* @param param
* @return
*/
@Override
public int getSafeEquipmentCount(SafeEquipmentTrialDTO param) {
if (ObjectUtil.isEmpty(param)) {
return 0;
}
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if (CollectionUtil.isEmpty(param.getDeptList())) {
if (Optional.ofNullable(param.getCreateDept()).isPresent()) {
eq("create_dept", param.getCreateDept());
}
} else {
in("create_dept", param.getDeptList());
}
if (Optional.ofNullable(param.getStartTime()).isPresent()) {
gt("create_time", param.getStartTime());
}
if (Optional.ofNullable(param.getEndTime()).isPresent()) {
lt("create_time", param.getEndTime());
}
}};
return this.baseMapper.selectCount(queryWrapper);
}
/**
* 查询设备列表
* @param entity
* @return
*/
@Override
public List<SafeEquipmentTrialEntity> getList(SafeEquipmentDTO entity) {
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if(CollectionUtil.isEmpty(entity.getDeptList())){
if(Optional.ofNullable(entity.getCreateDept()).isPresent()){
eq("create_dept",entity.getCreateDept());
}
} else {
in("create_dept",entity.getDeptList());
}
if(Optional.ofNullable(entity.getTime()).isPresent()){
gt("create_time", entity.getTime());
lt("create_time", entity.getTime());
}
}};
return this.baseMapper.selectList(queryWrapper);
}
/**
* 查询设备列表
*
* @param entity
* @return
*/
@Override
public List<SafeEquipmentTrialEntity> getList(SafeEquipmentDTO entity) {
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if (CollectionUtil.isEmpty(entity.getDeptList())) {
if (Optional.ofNullable(entity.getCreateDept()).isPresent()) {
eq("create_dept", entity.getCreateDept());
}
} else {
in("create_dept", entity.getDeptList());
}
if (Optional.ofNullable(entity.getTime()).isPresent()) {
gt("create_time", entity.getTime());
lt("create_time", entity.getTime());
}
}};
return this.baseMapper.selectList(queryWrapper);
}
}

Loading…
Cancel
Save