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. 17
      hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml
  20. 62
      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. 5
      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. 151
      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. 120
      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. 12
      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. 14
      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();
}

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

@ -14,8 +14,6 @@
</resultMap>
<!-- 根据type统计数量-->
<select id="smsPushStat" resultType="com.hnac.hzims.message.vo.msgpushrecord.MessagePushRecordVo">
select count(1) power,
@ -26,7 +24,7 @@
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
@ -65,7 +63,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
@ -80,7 +78,6 @@
</select>
<!-- 推送成功失败统计-->
<resultMap id="PushStatResultMap" type="com.hnac.hzims.message.vo.msgpushrecord.PushStatTypeVo">
<result column="businessClassify" property="businessClassify"/>
@ -99,7 +96,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
@ -112,4 +109,10 @@
</where>
group by businessClassify,status
</select>
<!-- 查询出状态信息-->
<select id="selectByStatus" resultType="java.lang.Integer">
select STATUS
from hzims_message_push_record
group by STATUS
</select>
</mapper>

62
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,11 +57,12 @@ 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) {
@ -71,18 +73,16 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
throw new ServiceException("发送消息失败!");
});
// 更新推送状态以及推送时间
LambdaUpdateWrapper<MessagePushRecordEntity> luw = Wrappers.<MessagePushRecordEntity>lambdaUpdate()
.set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
.set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
.eq(MessagePushRecordEntity::getId, id);
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)
@ -96,17 +96,16 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
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
*/
@ -121,6 +120,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
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;
}

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;
}

5
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,7 +18,6 @@ import java.util.List;
public interface OperAccessStatisticsMapper extends UserDataScopeBaseMapper<OperAccessStatisticsEntity> {
/**
* 自定义分页
*
@ -27,5 +26,5 @@ public interface OperAccessStatisticsMapper extends UserDataScopeBaseMapper<Oper
* @return
*/
@UserDataAuth
List<OperAccessStatisticsEntity> selectPageList(IPage page, OperAccessStatisticsDTO dto);
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);
}

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

@ -2,7 +2,10 @@ package com.hnac.hzims.operational.defect.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessPlanEntity;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
@ -36,6 +39,7 @@ import org.apache.poi.ss.util.CellRangeAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
@ -90,6 +94,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 开始问题处理流程
* 问题处理流程的第一个处理节点人key 必须是 problemUser
*
* @param
*/
@Override
@ -103,10 +108,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
defectEntity.setTenantId(phenomenonEntity.getTenantId());
save(defectEntity);
Kv variables = Kv.create()
.set(ProcessConstant.TASK_VARIABLE_CREATE_USER, "taskUser_" + phenomenonEntity.getCreateUser())
.set(DefectConstant.PROCESS_VARIABLE_HANDLE_USER, "taskUser_" + phenomenonEntity.getHandler())
;
Kv variables = Kv.create().set(ProcessConstant.TASK_VARIABLE_CREATE_USER, "taskUser_" + phenomenonEntity.getCreateUser()).set(DefectConstant.PROCESS_VARIABLE_HANDLE_USER, "taskUser_" + phenomenonEntity.getHandler());
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(defectEntity.getProcDefId(), FlowUtil.getBusinessKey("hzims_oper_defect", String.valueOf(defectEntity.getId())), processName, variables);
if (result.isSuccess()) {
BladeFlow flow = result.getData();
@ -124,6 +126,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 处理问题
*
* @param flow
* @return
*/
@ -175,6 +178,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取缺陷的统计月报
*
* @param month 格式"2021-01"
*/
@Override
@ -249,6 +253,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
public List<OperDefectEntity> getDefectList(String emCode, List<String> list) {
return this.baseMapper.selectDefectList(emCode, list);
}
@Override
public List<OperDefectEntity> getDefectByEmCodeList(String emCode) {
return this.baseMapper.selectDefectByEmCodeList(emCode);
@ -262,8 +267,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
defectReportsVOList = operDefectVOS.stream().map(operDefectVO -> {
User finder = UserCache.getUser(operDefectVO.getFinder());
String finderAndTime = (ObjectUtil.isNotEmpty(finder) && StringUtil.isNotBlank(finder.getName()) ? finder.getName() : operDefectVO.getFinder().toString())
+ ":" + DateFormatUtils.format(operDefectVO.getFindTime(), DateUtil.PATTERN_DATETIME);
String finderAndTime = (ObjectUtil.isNotEmpty(finder) && StringUtil.isNotBlank(finder.getName()) ? finder.getName() : operDefectVO.getFinder().toString()) + ":" + DateFormatUtils.format(operDefectVO.getFindTime(), DateUtil.PATTERN_DATETIME);
String handlerAndTime = "";
if (Func.isNotEmpty(operDefectVO.getHandler())) {
User handler = UserCache.getUser(operDefectVO.getHandler());
@ -272,8 +276,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
handlerAndTime = String.format("%s:%s", handlerName, handleTime);
}
String seriousSituation = DictCache.getValue(DefectConstant.LEVEL_CODE_DICT_KEY, operDefectVO.getDefectLevel());
return DefectReportsVO.builder().faultName(operDefectVO.getFaultName()).seriousSituation(seriousSituation)
.finderAndTime(finderAndTime).handlerAndTime(handlerAndTime).handleSituation(operDefectVO.getConclusion()).build();
return DefectReportsVO.builder().faultName(operDefectVO.getFaultName()).seriousSituation(seriousSituation).finderAndTime(finderAndTime).handlerAndTime(handlerAndTime).handleSituation(operDefectVO.getConclusion()).build();
}).collect(Collectors.toList());
return defectReportsVOList;
@ -300,15 +303,12 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
operDefectVO = OperDefectWrapper.build().entityVO(detail);
//获取检修计划
IOperAccessPlanService planService = SpringUtil.getBean(OperAccessPlanServiceImpl.class);
OperAccessPlanEntity accessPlanEntity = planService.getOne(Wrappers.<OperAccessPlanEntity>lambdaQuery()
.eq(OperAccessPlanEntity::getDefectId,detail.getId())
);
OperAccessPlanEntity accessPlanEntity = planService.getOne(Wrappers.<OperAccessPlanEntity>lambdaQuery().eq(OperAccessPlanEntity::getDefectId, detail.getId()));
if (ObjectUtil.isNotEmpty(accessPlanEntity)) {
operDefectVO.setAccessPlanId(accessPlanEntity.getId());
if (ObjectUtil.isNotEmpty(accessPlanEntity.getStatus()) && accessPlanEntity.getStatus() > AccessConstants.PLAN_DRAFT) {
operDefectVO.setEditStatus(0);
}
else {
} else {
operDefectVO.setEditStatus(1);
}
}
@ -318,6 +318,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取安全检查消缺项统计
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param dept 机构ID
@ -328,18 +329,13 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
public SafeCheckStatisticVO getDefectCheck(String startDate, String endDate, Long dept, String defectType) {
SafeCheckStatisticVO vo = new SafeCheckStatisticVO();
//获取消缺总数
LambdaQueryWrapper<OperPhenomenonEntity> wrapper = Wrappers.<OperPhenomenonEntity>lambdaQuery()
.eq(OperPhenomenonEntity::getCreateDept,dept)
.ge(OperPhenomenonEntity::getPlanStartTime,startDate)
.le(OperPhenomenonEntity::getPlanStartTime,endDate)
.eq(OperPhenomenonEntity::getIsDefect,1);
LambdaQueryWrapper<OperPhenomenonEntity> wrapper = Wrappers.<OperPhenomenonEntity>lambdaQuery().eq(OperPhenomenonEntity::getCreateDept, dept).ge(OperPhenomenonEntity::getPlanStartTime, startDate).le(OperPhenomenonEntity::getPlanStartTime, endDate).eq(OperPhenomenonEntity::getIsDefect, 1);
//缺陷等级为Ⅰ级缺陷时为重大缺陷 其他为一般缺陷
if ("1".equals(defectType)) {
vo.setProjectType(Constants.SafeCheckProjectEnum.SERIOUS_DEFECT.getType());
vo.setProjectTypeName(Constants.SafeCheckProjectEnum.SERIOUS_DEFECT.getName());
wrapper.eq(OperPhenomenonEntity::getDefectLevel, DefectConstant.DefectLevelEnum.ONE.getStatus());
}
else if("2".equals(defectType)){
} else if ("2".equals(defectType)) {
vo.setProjectType(Constants.SafeCheckProjectEnum.NORMAL_DEFECT.getType());
vo.setProjectTypeName(Constants.SafeCheckProjectEnum.NORMAL_DEFECT.getName());
wrapper.ne(OperPhenomenonEntity::getDefectLevel, DefectConstant.DefectLevelEnum.ONE.getStatus());
@ -347,9 +343,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
List<OperPhenomenonEntity> operPhenomenonEntities = operPhenomenonMapper.selectList(wrapper);
if (CollectionUtil.isNotEmpty(operPhenomenonEntities)) {
//获取消缺率
List<OperPhenomenonEntity> finishDefects = operPhenomenonEntities.stream().filter(
p-> ObjectUtil.isNotEmpty(p.getConclusionStatus()) && "1".equals(p.getConclusionStatus())
).collect(Collectors.toList());
List<OperPhenomenonEntity> finishDefects = operPhenomenonEntities.stream().filter(p -> ObjectUtil.isNotEmpty(p.getConclusionStatus()) && "1".equals(p.getConclusionStatus())).collect(Collectors.toList());
vo.setTotal(operPhenomenonEntities.size());
vo.setQualified(finishDefects.size());
vo.setQualifiedRate(new BigDecimal(finishDefects.size() / (double) operPhenomenonEntities.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
@ -359,6 +353,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 根据流程ID判断该缺陷是否能执行
*
* @param processInstanceId 流程ID
* @return
*/
@ -397,6 +392,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 创建标题单元格样式
*
* @param wb
* @return
*/
@ -425,6 +421,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 创建表格内容单元格样式
*
* @param wb
* @return
*/
@ -449,6 +446,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 设置缺陷月报表excel导出-本月与前几月缺陷报表内单元格
*
* @param sheet
* @param currentRow
*/
@ -509,14 +507,11 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
HSSFCell compare_content_cell1 = row.getCell(0);
if ("1".equals(currentRatioDTO.getDefectLevel())) {
compare_content_cell1.setCellValue("一类缺陷");
}
else if("2".equals(currentRatioDTO.getDefectLevel())){
} else if ("2".equals(currentRatioDTO.getDefectLevel())) {
compare_content_cell1.setCellValue("二类缺陷");
}
else if("3".equals(currentRatioDTO.getDefectLevel())){
} else if ("3".equals(currentRatioDTO.getDefectLevel())) {
compare_content_cell1.setCellValue("三类缺陷");
}
else if("合计".equals(currentRatioDTO.getDefectLevel())){
} else if ("合计".equals(currentRatioDTO.getDefectLevel())) {
compare_content_cell1.setCellValue(currentRatioDTO.getDefectLevel());
}
HSSFCell compare_content_cell2 = row.getCell(1);
@ -543,6 +538,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 设置缺陷月报表excel导出-管理指标本月表内单元格
*
* @param wb
* @param sheet
* @param currentRow 记录表格中叠加后的数据
@ -617,6 +613,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 设置缺陷月报表excel导出-重复分类缺陷汇总表内单元格
*
* @param wb
* @param sheet
* @param currentRow 记录表格中叠加后的数据
@ -665,14 +662,11 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
sheet.addMergedRegion(repeat_content_religon);
if ("1".equals(repeat.get(i).getDefectLevel())) {
repeat_cell1.setCellValue("一类缺陷");
}
else if("2".equals(repeat.get(i).getDefectLevel())){
} else if ("2".equals(repeat.get(i).getDefectLevel())) {
repeat_cell1.setCellValue("二类缺陷");
}
else if("3".equals(repeat.get(i).getDefectLevel())){
} else if ("3".equals(repeat.get(i).getDefectLevel())) {
repeat_cell1.setCellValue("三类缺陷");
}
else if("合计".equals(repeat.get(i).getDefectLevel())){
} else if ("合计".equals(repeat.get(i).getDefectLevel())) {
repeat_cell1.setCellValue(repeat.get(i).getDefectLevel());
}
//第二列
@ -699,6 +693,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 补全合并单元格时 表格行所有单元格
*
* @param headRow
* @param rowLen
* @param status 0:设置表头样式 1设置内容样式
@ -708,8 +703,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
HSSFCell hssfcell = headRow.createCell(i);
if (status == 0) {
hssfcell.setCellStyle(this.setHeadCellStyle(wb));
}
else if(status == 1){
} else if (status == 1) {
hssfcell.setCellStyle(this.setContentCellStyle(wb));
}
}
@ -717,6 +711,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 处理double数据保留两位小数
*
* @param num
* @return
*/
@ -730,6 +725,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取当前月统计数据
*
* @param month
* @return
*/
@ -740,6 +736,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 当年1月 - 当前月获取缺陷等级统计数据
*
* @param month "2021-01"
* @return
*/
@ -765,6 +762,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取按月管理指标统计数据
*
* @param month
* @return
*/
@ -785,6 +783,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 获取重复缺陷等级统计数据
*
* @param month
* @return
*/
@ -795,16 +794,9 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
//总缺陷数
int total = repetStatistics.stream().mapToInt(OperDefectStatisticsCodeDTO::getDefectNum).sum();
//总重复缺陷数
int totalRepeat = repetStatistics
.stream()
.filter(s-> s.getDefectNum() > 1 && s.getDefectLevel() != null )
.collect(Collectors.summingInt(OperDefectStatisticsCodeDTO::getDefectNum));
int totalRepeat = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.summingInt(OperDefectStatisticsCodeDTO::getDefectNum));
//等级重复统计
Map<String, IntSummaryStatistics> repeatList = repetStatistics
.stream()
.filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null )
.collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel,
Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
Map<String, IntSummaryStatistics> repeatList = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
OperDefectRepeatRatioDTO one = new OperDefectRepeatRatioDTO();
one.setDefectLevel(DefectConstant.DefectLevelEnum.ONE.getStatus());
@ -830,12 +822,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
three.setRepeatRatio(three.getHappenNum() / Double.valueOf(totalRepeat));
}
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder()
.defectLevel("合计")
.happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum())
.happenRatio(one.getHappenRatio() + two.getHappenRatio() + three.getHappenRatio())
.repeatRatio(1.00)
.build();
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder().defectLevel("合计").happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum()).happenRatio(one.getHappenRatio() + two.getHappenRatio() + three.getHappenRatio()).repeatRatio(1.00).build();
if (addUp.getHappenNum().equals(0L)) {
addUp.setRepeatRatio(0.0);
}
@ -856,13 +843,11 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
three.setDefectLevel(DefectConstant.DefectLevelEnum.THREE.getStatus());
//等级统计
Map<String, IntSummaryStatistics> collectLevel = dtos.stream().filter(s-> s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsStatusDTO::getDefectLevel,
Collectors.summarizingInt(OperDefectStatisticsStatusDTO::getDefectNum)));
Map<String, IntSummaryStatistics> collectLevel = dtos.stream().filter(s -> s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsStatusDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsStatusDTO::getDefectNum)));
//总缺陷数
int total = dtos.stream().mapToInt(OperDefectStatisticsStatusDTO::getDefectNum).sum();
//状态统计
Map<String, IntSummaryStatistics> collectStatus = dtos.stream().collect(Collectors.groupingBy(OperDefectStatisticsStatusDTO::getHandleStatus,
Collectors.summarizingInt(OperDefectStatisticsStatusDTO::getDefectNum)));
Map<String, IntSummaryStatistics> collectStatus = dtos.stream().collect(Collectors.groupingBy(OperDefectStatisticsStatusDTO::getHandleStatus, Collectors.summarizingInt(OperDefectStatisticsStatusDTO::getDefectNum)));
for (OperDefectStatisticsStatusDTO dto : dtos) {
if (dto.getDefectLevel() != null) {
@ -882,20 +867,13 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
}
}
int solveNum = collectStatus.get(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()) == null ? 0 : (int) collectStatus.get(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()).getSum();
OperDefectRatioDTO addUp = OperDefectRatioDTO.builder()
.happenNum(total)
.happenRatio(total == 0 ? 0 : 1.00)
.defectLevel("合计")
.sovleRatio(solveNum == 0 ? 0 : 1.00)
.sovleNum(solveNum)
.build();
OperDefectRatioDTO addUp = OperDefectRatioDTO.builder().happenNum(total).happenRatio(total == 0 ? 0 : 1.00).defectLevel("合计").sovleRatio(solveNum == 0 ? 0 : 1.00).sovleNum(solveNum).build();
re.addAll(Arrays.asList(one, two, three, addUp));
return re;
}
private void setReturnRatio(int total, OperDefectRatioDTO ratio, OperDefectStatisticsStatusDTO dto,
Map<String, IntSummaryStatistics> collectLevel, Map<String, IntSummaryStatistics> collectStatus){
private void setReturnRatio(int total, OperDefectRatioDTO ratio, OperDefectStatisticsStatusDTO dto, Map<String, IntSummaryStatistics> collectLevel, Map<String, IntSummaryStatistics> collectStatus) {
if (dto.getHandleStatus().equals(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus())) {
ratio.setSovleNum(dto.getDefectNum());
ratio.setSovleRatio(Double.valueOf(dto.getDefectNum()) / collectStatus.get(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()).getSum());
@ -909,24 +887,49 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
/**
* 更新缺陷信息
*
* @param entity
* @return
*/
@Override
public boolean updateDefectInfo(OperDefectEntity entity) {
return this.update(Wrappers.<OperDefectEntity>lambdaUpdate()
.set(OperDefectEntity::getActHours, entity.getActHours())
.set(OperDefectEntity::getActStartTime,entity.getActStartTime())
.set(OperDefectEntity::getActEndTime,entity.getActEndTime())
.set(OperDefectEntity::getDisposeDesc,entity.getDisposeDesc())
.eq(OperDefectEntity::getDefectCode,entity.getDefectCode()));
return this.update(Wrappers.<OperDefectEntity>lambdaUpdate().set(OperDefectEntity::getActHours, entity.getActHours()).set(OperDefectEntity::getActStartTime, entity.getActStartTime()).set(OperDefectEntity::getActEndTime, entity.getActEndTime()).set(OperDefectEntity::getDisposeDesc, entity.getDisposeDesc()).eq(OperDefectEntity::getDefectCode, entity.getDefectCode()));
}
@Override
public boolean updateDefectHanderState(OperDefectEntity entity) {
return this.update(Wrappers.<OperDefectEntity>lambdaUpdate()
.set(OperDefectEntity::getHandleStatus, entity.getHandleStatus())
.eq(OperDefectEntity::getDefectCode,entity.getDefectCode()));
return this.update(Wrappers.<OperDefectEntity>lambdaUpdate().set(OperDefectEntity::getHandleStatus, entity.getHandleStatus()).eq(OperDefectEntity::getDefectCode, entity.getDefectCode()));
}
/**
* 分页查询
*
* @param operDefectEntityPage
* @param defect
* @return
*/
@Override
public IPage<OperDefectEntity> selectPage(Page<OperDefectEntity> operDefectEntityPage, OperDefectEntity defect) {
LambdaQueryWrapper<OperDefectEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtils.isNotBlank(defect.getDefectCode()), OperDefectEntity::getDefectCode, defect.getDefectCode());
//缺陷编号
queryWrapper.ge(defect.getActStartTime() != null, OperDefectEntity::getActStartTime, defect.getActStartTime());
queryWrapper.le(defect.getActEndTime() != null, OperDefectEntity::getActEndTime, defect.getActEndTime());
queryWrapper.ge(defect.getStartTime() != null, OperDefectEntity::getCreateTime, defect.getStartTime());
queryWrapper.le(defect.getEndTime() != null, OperDefectEntity::getCreateTime, defect.getEndTime());
//区域Id
queryWrapper.eq(BaseEntity::getCreateDept, defect.getCreateDept());
//年月查询
queryWrapper.apply(defect.getYearMonth() != null, "date_format(CREATE_TIME,'%Y-%m') = '" +
defect.getYearMonth() + "'");
queryWrapper.orderByDesc(OperDefectEntity::getActStartTime);
return baseMapper.selectPage(operDefectEntityPage, queryWrapper);
}

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);
}

120
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();
@ -69,8 +84,7 @@ public class AreaMonthlyDetailsServiceImpl implements AreaMonthlyDetailsService
*/
@Override
public BladePage<StandardWorkVo> workTicketListByMonthAndArea(Long page, Long size, StandardTicketWithAreaVo areaMonthlyVo) {
R<BladePage<StandardWorkVo>> pageR =
ticketFeignClient.workTicketListByMonthAndArea(page, size, 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);

12
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;
@ -128,7 +131,7 @@ public class CheckCompanyServiceImpl extends BaseServiceImpl<CheckCompanyMapper,
}
@Override
public R<IPage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query) {
public R<BladePage<CheckCompanyVo>> pageCondition(CheckCompanyEntity req, Query query) {
Wrapper<CheckCompanyEntity> queryWrapper = new LambdaQueryWrapper<CheckCompanyEntity>() {{
orderByDesc(CheckCompanyEntity::getCreateTime);
if (ObjectUtil.isNotEmpty(req.getStartTime())) {
@ -140,9 +143,14 @@ public class CheckCompanyServiceImpl extends BaseServiceImpl<CheckCompanyMapper,
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()));
return R.data(page);
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);
}
}

14
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;
@ -28,12 +30,13 @@ public class SafeEquipmentTrialServiceImpl extends BaseServiceImpl<SafeEquipment
/**
* 分页查询
*
* @param param
* @param query
* @return
*/
@Override
public R<IPage<SafeEquipmentTrialVO>> pageCondition(SafeEquipmentTrialDTO param, Query query) {
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());
@ -47,16 +50,22 @@ public class SafeEquipmentTrialServiceImpl extends BaseServiceImpl<SafeEquipment
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());
return R.data(pages.setRecords(list));
pages.setRecords(list);
BladePage bladePage = BladePage.of(pages);
return R.data(bladePage);
}
/**
* 获取设备试验次数
*
* @param param
* @return
*/
@ -85,6 +94,7 @@ public class SafeEquipmentTrialServiceImpl extends BaseServiceImpl<SafeEquipment
/**
* 查询设备列表
*
* @param entity
* @return
*/

Loading…
Cancel
Save