diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java index ba86f10..0318679 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java @@ -3,6 +3,7 @@ package com.hnac.hzims.spare.feign; import com.hnac.hzims.operational.census.vo.AreaTimelyVo; import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.vo.ExceedVo; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; @@ -23,6 +24,8 @@ public interface ISpareClient { String EXCEED_LIMIT = API_PREFIX + "/exceedLimit" ; + String SPARE_PART = API_PREFIX + "/sparePart" ; + /** * 保存工单与出库单关联信息 * @param recordEntity @@ -33,4 +36,7 @@ public interface ISpareClient { @PostMapping(EXCEED_LIMIT) List exceedLimit(@RequestParam("deptId") Long deptId); + + @GetMapping(EXCEED_LIMIT) + List sparePart(@RequestParam("basics") List basics); } diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java index 6a55a8e..35e052e 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java @@ -2,6 +2,7 @@ package com.hnac.hzims.spare.feign; import com.hnac.hzims.operational.census.vo.AreaTimelyVo; import com.hnac.hzims.spare.entity.*; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import org.springblade.core.tool.api.R; import org.springframework.stereotype.Component; @@ -24,4 +25,9 @@ public class ISpareClientFallback implements ISpareClient { public List exceedLimit(Long deptId) { return new ArrayList<>(); } + + @Override + public List sparePart(List basics) { + return new ArrayList<>(); + } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/SparePartVO.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SparePartVO.java similarity index 86% rename from hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/SparePartVO.java rename to hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SparePartVO.java index d97b830..52ca7de 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/SparePartVO.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SparePartVO.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.equipment.vo; +package com.hnac.hzims.spare.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -9,6 +9,10 @@ import lombok.Data; */ @Data public class SparePartVO { + + @ApiModelProperty(value = "物资类别编号") + private Long basicId; + @ApiModelProperty(value = "设备名称") private String emName; diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java index 235ccdc..084f3b0 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java @@ -82,6 +82,8 @@ public interface IEmInfoClient { String GET_EM_CREATE_TABLE = API_PREFIX + "/getEmCreateTable"; String GET_VIDEO_DEVICE_BY_EM_CODE = API_PREFIX + "/getVideoDeviceByEmCode"; + String DEVICE_BY_PATH = API_PREFIX + "/deviceByPath"; + @PostMapping(DETAIL) EmInfoEntity getByCode(@RequestParam("code") String id); @@ -161,4 +163,7 @@ public interface IEmInfoClient { @GetMapping(value = GET_VIDEO_DEVICE_BY_EM_CODE) List getVideoDeviceByEmCode(EmInfoEntity emInfo); + + @GetMapping(DEVICE_BY_PATH) + List deviceByPath(@RequestParam("emCode") String emCode); } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java index 02ccc38..9239354 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java @@ -104,4 +104,9 @@ public class IEmInfoClientBack implements IEmInfoClient { public List getVideoDeviceByEmCode(EmInfoEntity emInfo) { return new ArrayList<>(); } + + @Override + public List deviceByPath(String emCode) { + return new ArrayList<>(); + } } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClientFallback.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClientFallback.java new file mode 100644 index 0000000..7acb56b --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClientFallback.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.operational.access.feign; + +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author ysj + */ +@Component +public class AccessMaterialClientFallback implements IAccessMaterialClient { + + @Override + public List materialConsume(List basics) { + return new ArrayList<>(); + } +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/IAccessMaterialClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/IAccessMaterialClient.java new file mode 100644 index 0000000..f77298c --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/IAccessMaterialClient.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.operational.access.feign; + +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.OperationalConstants; +import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * @author ysj + */ +@FeignClient( + value = OperationalConstants.APP_NAME, + fallback = AccessMaterialClientFallback.class +) +public interface IAccessMaterialClient { + + String API_PREFIX = "/feign/accessMaterial"; + + String MATERIAL_CONSUME = API_PREFIX + "/materialConsume"; + + @GetMapping(MATERIAL_CONSUME) + List materialConsume(@RequestParam("basics") List basics); +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/MaterialConsumeVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/MaterialConsumeVO.java new file mode 100644 index 0000000..ed1c28f --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/MaterialConsumeVO.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.operational.access.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class MaterialConsumeVO { + + @ApiModelProperty(value = "物资编号") + private Long basicId; + + @ApiModelProperty(value = "消耗数量") + private Integer expend; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneExportDTO.java deleted file mode 100644 index 4e8298e..0000000 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneExportDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.hnac.hzims.safeproduct.dto; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author liwen - * @date 2023-12-27 - */ -@Data -@ExcelIgnoreUnannotated -@ApiModel(value = "卫生自查数据导出DTO类") -public class HygieneExportDTO { - - @ApiModelProperty("卫生自查状态") - @ExcelProperty(value = "卫生自查状态", index = 8) - private String hygieneStatus; -} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java new file mode 100644 index 0000000..9332d2f --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java @@ -0,0 +1,42 @@ +package com.hnac.hzims.safeproduct.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author liwen + * @date 2024-01-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "卫生自查计划DTO类") +public class HygienePlanDTO extends BaseEntity { + + @ApiModelProperty("编码") + private String code; + + @ApiModelProperty("标准总分值") + private Integer standardScore; + + @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划开始时间") + private Date scheduledStartTime; + + @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划结束时间") + private Date scheduledEndTime; + + @ApiModelProperty("责任区数据列表") + private List zoneList; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneRecordDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneRecordDTO.java new file mode 100644 index 0000000..442e76b --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneRecordDTO.java @@ -0,0 +1,58 @@ +package com.hnac.hzims.safeproduct.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.Date; + +/** + * @author liwen + * @date 2024-01-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "卫生自查记录DTO类") +public class HygieneRecordDTO extends BaseEntity { + + @ApiModelProperty("卫生自查计划id") + private Long hygienePlanId; + + @NotNull + @Size(max = 50, message = "单位字段长度不能超过50") + @ApiModelProperty("单位") + private String unit; + + @Size(max = 50, message = "编码字段长度不能超过50") + @ApiModelProperty("编码") + private String code; + + @ApiModelProperty("实际开始时间") + private Date actualStartTime; + + @ApiModelProperty("实际结束时间") + private Date actualEndTime; + + @ApiModelProperty("检查人") + private String checkUser; + + @ApiModelProperty("责任区id") + private String hygieneZoneIds; + + @ApiModelProperty("检查结果") + private String checkResult; + + @ApiModelProperty("综合评分") + private String comprehensiveScore; + + @ApiModelProperty("周数") + private Integer weekNum; + + @Size(max = 1000, message = "检查图片字段长度不能超过1000") + @ApiModelProperty("检查图片") + private String imgPath; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java index 1f2903b..800f911 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java @@ -26,11 +26,11 @@ public class RehearsalExportDTO { private String subject; @ApiModelProperty("演练计划开始时间") - @ExcelProperty(value = "演练计划开始时间", index = 2) + @ExcelProperty(value = "计划开始时间", index = 2) private Date scheduledStartTime; @ApiModelProperty("演练计划结束时间") - @ExcelProperty(value = "演练计划结束时间", index = 3) + @ExcelProperty(value = "计划结束时间", index = 3) private Date scheduledEndTime; @ApiModelProperty("演练地点") diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java index a7261a9..914c031 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferencePlanEntity.java @@ -1,6 +1,7 @@ package com.hnac.hzims.safeproduct.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -32,10 +33,12 @@ public class ConferencePlanEntity extends BaseEntity { private String theme; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("会议计划开始时间") private Date scheduledStartTime; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("会议计划结束时间") private Date scheduledEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java index 1aa0309..99e3341 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/ConferenceRecordEntity.java @@ -41,7 +41,6 @@ public class ConferenceRecordEntity extends BaseEntity { @ApiModelProperty("记录人") private String recorder; - @Size(max = 250, message = "会议内容字段长度不能超过250") @ApiModelProperty("会议内容") private String content; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java index 84d558f..0379406 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java @@ -22,22 +22,8 @@ import java.util.Date; @ApiModel(value = "卫生自查计划实体类") public class HygienePlanEntity extends BaseEntity { - @NotNull - @Size(max = 50, message = "单位字段长度不能超过50") - @ApiModelProperty("单位") - private String unit; - - @ApiModelProperty("责任区") - private String zone; - - @ApiModelProperty("责任人") - private String principal; - - @ApiModelProperty("检查项") - private String checkItem; - - @ApiModelProperty("检查项分值") - private String checkItemScore; + @ApiModelProperty("编码") + private String code; @ApiModelProperty("标准总分值") private Integer standardScore; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java index 9122e7e..25d7842 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.Date; @@ -23,6 +24,11 @@ public class HygieneRecordEntity extends BaseEntity { @ApiModelProperty("卫生自查计划id") private Long hygienePlanId; + @NotNull + @Size(max = 50, message = "单位字段长度不能超过50") + @ApiModelProperty("单位") + private String unit; + @Size(max = 50, message = "编码字段长度不能超过50") @ApiModelProperty("编码") private String code; @@ -36,11 +42,15 @@ public class HygieneRecordEntity extends BaseEntity { @ApiModelProperty("检查人") private String checkUser; + @ApiModelProperty("责任区id") + private String hygieneZoneIds; + @ApiModelProperty("检查结果") private String checkResult; + @NotNull @ApiModelProperty("综合评分") - private Integer comprehensiveScore; + private String comprehensiveScore; @ApiModelProperty("周数") private Integer weekNum; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java new file mode 100644 index 0000000..415e47b --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +/** + * @author liwen + * @date 2024-01-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_hygiene_zone") +@ApiModel(value = "卫生自查区域实体类") +public class HygieneZoneEntity extends BaseEntity { + + @ApiModelProperty("卫生自查计划id") + private Long hygienePlanId; + + @ApiModelProperty("责任区") + private String zone; + + @ApiModelProperty("责任人") + private String principal; + + @ApiModelProperty("检查项") + private String checkItem; + + @ApiModelProperty("检查项分值") + private String checkItemScore; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java index bdff1a1..4cd4306 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java @@ -1,6 +1,7 @@ package com.hnac.hzims.safeproduct.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -32,10 +33,12 @@ public class RehearsalPlanEntity extends BaseEntity { private String subject; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("演练计划开始时间") private Date scheduledStartTime; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("演练计划结束时间") private Date scheduledEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java index 9b1b0fb..93db233 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java @@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -32,12 +33,14 @@ public class TrainPlanEntity extends BaseEntity { private String unit; @NotNull - @ApiModelProperty("计划培训开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划开始时间") @ExcelProperty(value = "计划开始时间", index = 6) private Date scheduledStartTime; @NotNull - @ApiModelProperty("计划培训结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划结束时间") @ExcelProperty(value = "计划结束时间", index = 7) private Date scheduledEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java index 24f2e2f..b8728dc 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java @@ -41,7 +41,6 @@ public class TrainRecordEntity extends BaseEntity { @ExcelProperty(value = "培训学员", index = 3) private String peopleName; - @Size(max = 5000, message = "培训内容字段长度超出限制范围") @ApiModelProperty("培训内容") @ExcelProperty(value = "培训内容", index = 2) private String content; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java index 62b1c2b..8fdd1cc 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneMonthVO.java @@ -1,5 +1,7 @@ package com.hnac.hzims.safeproduct.vo; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -11,21 +13,27 @@ import java.math.BigDecimal; * @date 2023-12-27 */ @Data +@ExcelIgnoreUnannotated @ApiModel(value = "卫生自查月度统计VO类") public class HygieneMonthVO { @ApiModelProperty("单位") + @ExcelProperty(value = "单位", index = 0) private String unit; @ApiModelProperty("应检查次数") + @ExcelProperty(value = "应检查次数", index = 1) private Long scheduledCheckNum; @ApiModelProperty("已检查次数") + @ExcelProperty(value = "已检查次数", index = 2) private Long finishedCheckNum; @ApiModelProperty("未检查次数") + @ExcelProperty(value = "未检查次数", index = 3) private Long unfinishedCheckNum; @ApiModelProperty("完成率") + @ExcelProperty(value = "完成率/%", index = 4) private BigDecimal completionRate; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygienePlanDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygienePlanDetailVO.java new file mode 100644 index 0000000..a41e72e --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygienePlanDetailVO.java @@ -0,0 +1,39 @@ +package com.hnac.hzims.safeproduct.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author liwen + * @date 2024-01-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "卫生自查计划详情VO类") +public class HygienePlanDetailVO extends BaseEntity { + + @ApiModelProperty("标准总分值") + private Integer standardScore; + + @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划开始时间") + private Date scheduledStartTime; + + @NotNull + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划结束时间") + private Date scheduledEndTime; + + @ApiModelProperty("责任区数据列表") + private List zoneList; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java index 341b402..da9328f 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -14,33 +15,33 @@ import java.util.Date; @ApiModel(value = "卫生自查记录详情VO类") public class HygieneRecordDetailVO { - @ApiModelProperty("责任区") - private String zone; - - @ApiModelProperty("责任人") - private String principal; - - @ApiModelProperty("检查项") - private String checkItem; - - @ApiModelProperty("检查项分值") - private String checkItemScore; - @ApiModelProperty("编码") private String code; - @ApiModelProperty("检查时间") - private Date checkTime; + @ApiModelProperty("实际结束时间") + private Date actualEndTime; @ApiModelProperty("检查人") private String checkUser; + @ApiModelProperty("责任区id") + private String hygieneZoneIds; + @ApiModelProperty("检查结果") private String checkResult; @ApiModelProperty("综合评分") - private Integer comprehensiveScore; + private String comprehensiveScore; @ApiModelProperty("周数") private Integer weekNum; + + @ApiModelProperty("检查图片") + private String imgPath; + + @ApiModelProperty("卫生自查计划id") + private Long hygienePlanId; + + @ApiModelProperty("检查信息列表") + private List checkList; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java new file mode 100644 index 0000000..9cc2f9a --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author liwen + * @date 2024-01-03 + */ +@Data +@ApiModel(value = "卫生自查记录页面VO类") +public class HygieneRecordPageVO { + + @ApiModelProperty("卫生自查记录id") + private Long id; + + @ApiModelProperty("单位") + private String unit; + + @ApiModelProperty("实际开始时间") + private Date actualStartTime; + + @ApiModelProperty("实际结束时间") + private Date actualEndTime; + + @ApiModelProperty("检查人") + private String checkUser; + + @ApiModelProperty("周数") + private Integer weekNum; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneZoneDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneZoneDetailVO.java new file mode 100644 index 0000000..a2b8574 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneZoneDetailVO.java @@ -0,0 +1,41 @@ +package com.hnac.hzims.safeproduct.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liwen + * @date 2024-01-02 + */ +@Data +@ExcelIgnoreUnannotated +@ApiModel(value = "卫生自查详情VO类") +public class HygieneZoneDetailVO { + + @ApiModelProperty("责任区") + @ExcelProperty(value = "责任区", index = 0) + private String zone; + + @ApiModelProperty("责任人") + @ExcelProperty(value = "责任人", index = 1) + private String principal; + + @ApiModelProperty("检查项") + @ExcelProperty(value = "检查项", index = 2) + private String checkItem; + + @ApiModelProperty("检查项分值") + @ExcelProperty(value = "检查项分值", index = 3) + private String checkItemScore; + + @ApiModelProperty("检查结果") + @ExcelProperty(value = "检查结果", index = 4) + private String result; + + @ApiModelProperty("综合评分") + @ExcelProperty(value = "综合评分", index = 5) + private Integer score; +} diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java index e25a44d..5fda1e0 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java @@ -497,4 +497,7 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable { @TableField(exist=false) private Integer isQualified; + @ApiModelProperty("是否线下 : 1-线下,0-线上") + private Boolean isOffline; + } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java index 4711db9..7eaa129 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java @@ -6,6 +6,7 @@ import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.mapper.SpRecordMapper; import com.hnac.hzims.spare.mapper.SpWarehouseOutMapper; import com.hnac.hzims.spare.service.*; +import com.hnac.hzims.spare.vo.SparePartVO; import lombok.RequiredArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -129,4 +130,14 @@ public class SpareClient implements ISpareClient{ } return exceeds; } + + /** + * 备品备件台账 + * @param basics + * @return + */ + @Override + public List sparePart(List basics) { + return wtSpBasicService.sparePart(basics); + } } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java index 74bf8bb..3ec89f4 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java @@ -2,9 +2,11 @@ package com.hnac.hzims.spare.mapper; import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity; import com.hnac.hzims.spare.entity.WtSpBasicEntity; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; import java.util.Map; @@ -46,4 +48,5 @@ public interface WtSpBasicMapper extends UserDataScopeBaseMapper getInList(Long spBasicId); + List sparePart(@RequestParam("basics") List basics); } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml index d832b9d..7db89ac 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml @@ -94,4 +94,20 @@ AND b.type = 5 + + diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java index 64fcef5..0bf27a7 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockEntity; import com.hnac.hzims.spare.entity.WtSpBasicEntity; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; @@ -73,6 +74,8 @@ public interface IWtSpBasicService extends BaseService { R importExcel(MultipartFile file) throws Exception; + List sparePart(List basics); + /** * 获取流程中的用户 * @param deptId diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java index 8955c81..6f40e06 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java @@ -29,6 +29,7 @@ import com.hnac.hzims.spare.service.IWtSpTotalService; import com.hnac.hzims.spare.service.IWtSpWarehouseService; import com.hnac.hzims.spare.utils.ExcelToolListener; import com.hnac.hzims.spare.utils.SheetWriteStyleHandler; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; @@ -580,6 +581,11 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl sparePart(List basics) { + return this.basicMapper.sparePart(basics); + } + private InputStream copyStream(InputStream source) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; diff --git a/hzims-service/equipment/pom.xml b/hzims-service/equipment/pom.xml index 90808d8..e2286e6 100644 --- a/hzims-service/equipment/pom.xml +++ b/hzims-service/equipment/pom.xml @@ -98,6 +98,10 @@ com.hnac.hzims inspect-api + + com.hnac.hzims + assets-api + diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java index 92ab91d..e1346c1 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java @@ -10,14 +10,13 @@ import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.equipment.dto.DeviceTreeDTO; import com.hnac.hzims.equipment.entity.EmInfoEntity; -import com.hnac.hzims.equipment.entity.EmTreeEntity; import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.equipment.vo.EmInfoAddVo; import com.hnac.hzims.equipment.vo.EmInfoContentVO; import com.hnac.hzims.equipment.vo.EmInfoVO; -import com.hnac.hzims.equipment.vo.SparePartVO; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.util.MemoryPagination; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import io.swagger.annotations.Api; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java index fbbef97..ca0e5f3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java @@ -9,11 +9,16 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.equipment.vo.DeviceVO; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.vo.CreateTableVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -131,6 +136,17 @@ public class EmInfoClient implements IEmInfoClient { public List getVideoDeviceByEmCode(EmInfoEntity emInfo) { return service.getVideoDeviceByEmCode(emInfo); } + + /** + * 获取设备路径下的设备 + * @param emCode + * @return + */ + @Override + public List deviceByPath(String emCode) { + return service.deviceByPath(emCode); + } + @PostMapping(GET_EM_CREATE_TABLE) @Override public List getEmCreateTable(List tableNames) { diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java index 3f2cb5c..f9b826b 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java @@ -4,7 +4,7 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.vo.EmInfoExtendVo; import com.hnac.hzims.equipment.vo.DeviceVO; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; -import com.hnac.hzims.equipment.vo.SparePartVO; +import com.hnac.hzims.spare.vo.SparePartVO; import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml index 7b3e34f..e9d738a 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml @@ -120,7 +120,7 @@ select max(em_index) from hzims_em_info where DEPARTMENT = #{department} and em_grade = #{emGrade} and is_deleted = 0 - select info.`NAME` as emName,house.`NAME` as houseName,basic.`NAME` as basicName, mat.number as expend,basic.UPPER_LIMIT,basic.LOWER_LIMIT,total.stock from hzims_em_info info diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java index 8562541..e3527c3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.equipment.dto.DeviceTreeDTO; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.vo.*; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; @@ -91,4 +92,6 @@ public interface IEmInfoService extends BaseService { List getVideoDeviceByEmCode(EmInfoEntity emInfo); List hkVideoDevices(); + + List deviceByPath(String emCode); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index cadc489..c796b39 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -17,9 +17,13 @@ import com.hnac.hzims.equipment.mapper.EmInfoNoScopeMapper; import com.hnac.hzims.equipment.service.*; import com.hnac.hzims.equipment.vo.*; import com.hnac.hzims.fdp.service.IFdpQuestionService; +import com.hnac.hzims.operational.access.feign.IAccessMaterialClient; +import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.spare.feign.ISpareClient; +import com.hnac.hzims.spare.vo.SparePartVO; import com.hnac.hzims.util.TableJsonUtils; import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; @@ -87,12 +91,17 @@ public class EmInfoServiceImpl extends BaseServiceImpl getSparePart(String emCode, String startTime, String endTime) { - EmInfoEntity emInfo = this.getEmInfoByEmCode(emCode); - return baseMapper.getSparePart(emInfo.getPath(), startTime, endTime); + // 查询路径设备 + List devices = deviceByPath(emCode); + if(CollectionUtil.isEmpty(devices)){ + return new ArrayList<>(); + } + // 物资台账记录 + List trees = devices.stream().map(EmInfoEntity::getTreeId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(trees)){ + return new ArrayList<>(); + } + List treeBasics = emTreeBasicService.list(Wrappers.lambdaQuery() + .in(EmTreeBasicEntity::getTreeId,trees)); + if(CollectionUtil.isEmpty(treeBasics)){ + return new ArrayList<>(); + } + List basics = treeBasics.stream().map(EmTreeBasicEntity::getBasicId).filter(ObjectUtil::isNotEmpty).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(basics)){ + return new ArrayList<>(); + } + // 仓库、物资种类、库存上限、库存下限、物资库存 + List spares = spareClient.sparePart(basics); + if(CollectionUtil.isEmpty(spares)){ + return new ArrayList<>(); + } + // 物资消耗 + List consumes = accessMaterialClient.materialConsume(basics); + return spares.stream().peek(spare -> { + List spareConsumes = consumes.stream().filter(consume->consume.getBasicId().equals(spare.getBasicId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(spareConsumes)){ + spare.setExpend(0); + }else{ + spare.setExpend(spareConsumes.get(0).getExpend()); + } + // 设备名称 + List deviceBasics = treeBasics.stream().filter(tree->tree.getBasicId().equals(spare.getBasicId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(deviceBasics)){ + spare.setEmName("未知设备"); + }else{ + List deivceEntitys = devices.stream().filter(device->device.getTreeId().equals(deviceBasics.get(0).getTreeId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(deivceEntitys)){ + spare.setEmName("未知设备"); + }else{ + spare.setEmName(deivceEntitys.get(0).getName()); + } + } + }).collect(Collectors.toList()); } @Override @@ -911,4 +971,23 @@ public class EmInfoServiceImpl extends BaseServiceImpl deviceByPath(String emCode) { + EmInfoEntity device = this.getOne(Wrappers.lambdaQuery(). + eq(EmInfoEntity::getNumber,emCode)); + if(ObjectUtil.isEmpty(device)){ + return new ArrayList<>(); + } + if(StringUtil.isEmpty(device.getPath())){ + return Collections.singletonList(device); + } + String[] deviceCodes = device.getPath().split("/"); + return this.list(Wrappers.lambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes))); + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClient.java new file mode 100644 index 0000000..803857f --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClient.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.operational.access.feign; + +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.access.service.AccessPlanV4Service; +import com.hnac.hzims.operational.access.service.IOperAccessMaterialService; +import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author ysj + */ +@RestController +@RequestMapping("/feign/accessMaterial") +@Slf4j +@RequiredArgsConstructor +public class AccessMaterialClient implements IAccessMaterialClient { + + private final IOperAccessMaterialService accessMaterialService; + + /** + * 备品备件台账-物资消耗 + * @param basics + * @return + */ + @Override + public List materialConsume(@RequestParam("basics") List basics) { + return accessMaterialService.materialConsume(basics); + } +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.java index a7c726c..d68d1f1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.access.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; +import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; @@ -17,4 +18,6 @@ import java.util.List; public interface OperAccessMaterialMapper extends BaseMapper { List getList(@Param(value = "planId") String planId,@Param(value = "taskId") String taskId); + + List materialConsume(@Param(value = "basics") List basics); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml index 60ead9a..1310abb 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml @@ -39,4 +39,19 @@ + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java index b45f846..9cb87d3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java @@ -41,5 +41,5 @@ public interface OperAccessTaskMapper extends UserDataScopeBaseMapper selectAccessTask(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("list")List list); - List getRepairBill(@Param("path") String path, @Param("startTime") String startTime, @Param("endTime") String endTime); + List getRepairBill(@Param("deviceCodes") List deviceCodes,@Param("startTime") String startTime, @Param("endTime") String endTime); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml index 4606b2d..7810d05 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml @@ -207,15 +207,17 @@ - - \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java index 96ac415..b888c54 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java @@ -1,10 +1,14 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; +import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + /** * 卫生自查记录Mapper类 * @@ -20,4 +24,12 @@ public interface HygieneRecordMapper extends BaseMapper { * @return 卫生自查记录详情VO类 */ HygieneRecordDetailVO getRecordDetail(Long id); + + /** + * 卫生自查记录页面 + * @param param 入参 + * @param page 分页类 + * @return 记录数据页 + */ + IPage recordPage(IPage page, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml index 9913b1a..68efbe5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml @@ -3,13 +3,24 @@ + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java new file mode 100644 index 0000000..b3d0e5c --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java @@ -0,0 +1,10 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface HygieneZoneMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.xml new file mode 100644 index 0000000..8113ac8 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java index 6b62e72..6d3e98d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java @@ -2,7 +2,9 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.dto.HygienePlanDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; +import com.hnac.hzims.safeproduct.vo.HygienePlanDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -35,30 +37,43 @@ public interface IHygienePlanService extends IService { /** * 新增卫生自查计划 - * @param hygienePlanEntity 卫生自查计划实体类 + * @param hygienePlanDTO 卫生自查DTO类 * @return 结果封装类 */ - R savePlan(HygienePlanEntity hygienePlanEntity); + R savePlan(HygienePlanDTO hygienePlanDTO); /** * 修改卫生自查计划 - * @param hygienePlanEntity 卫生自查计划实体类 + * @param hygienePlanDTO 卫生自查DTO类 * @return 结果封装类 */ - R updatePlan(HygienePlanEntity hygienePlanEntity); + R updatePlan(HygienePlanDTO hygienePlanDTO); /** * 卫生自查月度数据 * @param month 月份 + * @param unit 单位 * @param query 分页类 * @return 月度统计分页 */ - IPage dataByMonth(String month, Query query); + IPage dataByMonth(String month, String unit, Query query); /** - * 卫生自查数据导出 - * @param param 入参 - * @param response 响应类 + * 卫生自查计划数据详情 + * @param id 卫生自查计划id + * @return 卫生自查计划详情VO类 + */ + HygienePlanDetailVO getPlan(Long id); + + /** + * 根据编码查询卫生自查计划 + * @param code 编码 + * @return 卫生自查计划实体类 + */ + HygienePlanEntity getPlanByCode(String code); + + /** + * 月度数据导出 */ - void exportHygieneData(Map param, HttpServletResponse response); + void exportMonthData(Map param, Query query, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java index 93ac01e..d717ad5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java @@ -1,10 +1,17 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; +import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + /** * 卫生自查记录服务类 * @@ -22,17 +29,17 @@ public interface IHygieneRecordService extends IService { /** * 新增卫生自查记录 - * @param hygieneRecordEntity 卫生自查记录实体类 + * @param hygieneRecordDTO 卫生自查记录DTO类 * @return 封装结果类 */ - R saveRecord(HygieneRecordEntity hygieneRecordEntity); + R saveRecord(HygieneRecordDTO hygieneRecordDTO); /** * 修改卫生自查记录 - * @param hygieneRecordEntity 卫生自查记录实体类 - * @return true-成功,false-失败 + * @param hygieneRecordDTO 卫生自查记录DTO类 + * @return 封装结果类 */ - R updateRecord(HygieneRecordEntity hygieneRecordEntity); + R updateRecord(HygieneRecordDTO hygieneRecordDTO); /** * 查询卫生自查记录详情 @@ -40,4 +47,19 @@ public interface IHygieneRecordService extends IService { * @return 卫生自查记录详情VO类 */ HygieneRecordDetailVO getRecordDetail(Long id); + + /** + * 卫生自查记录页面 + * @param param 入参 + * @param query 分页类 + * @return 记录数据页 + */ + IPage recordPage(Map param, Query query); + + /** + * 卫生自查记录数据导出 + * @param hygieneRecordId 卫生自查记录id + * @param response 响应类 + */ + void exportHygieneData(Long hygieneRecordId, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java new file mode 100644 index 0000000..3c62284 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; + +import java.util.List; + +public interface IHygieneZoneService extends IService { + + /** + * 删除关联责任区数据 + * @param hygienePlanId 卫生自查计划id + * @return true-成功,false-失败 + */ + boolean removeReferenceZone(Long hygienePlanId); + + /** + * 查询关联责任区数据 + * @param hygienePlanId 卫生自查计划id + * @return 关联责任区数据 + */ + List getReferenceZone(Long hygienePlanId); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 2d742ce..803b972 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -62,8 +62,8 @@ public class ConferencePlanServiceImpl extends ServiceImpl planPage(Map param, Query query) { QueryWrapper queryWrapper = new QueryWrapper<>(); String unit = String.valueOf(param.get("unit")); - String startTime = String.valueOf(param.get("startTime")); - String endTime = String.valueOf((param.get("endTime"))); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf((param.get("scheduledEndTime"))); if (!unit.equals("null") && !unit.equals("")) { queryWrapper.lambda().like(ConferencePlanEntity::getUnit, unit); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index 622683c..7350c86 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -4,7 +4,6 @@ import cn.hutool.core.date.DatePattern; import com.alibaba.excel.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; @@ -12,6 +11,7 @@ import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper; import com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; +import com.hnac.hzims.safeproduct.utils.BaseUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -59,21 +59,7 @@ public class ConferenceRecordServiceImpl extends ServiceImpl planPage(Map param, Query query) { QueryWrapper queryWrapper = new QueryWrapper<>(); - String zone = String.valueOf(param.get("zone")); - String principal = String.valueOf(param.get("principal")); - if (!zone.equals("null") && !zone.equals("")) { - queryWrapper.lambda().like(HygienePlanEntity::getZone, zone); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(HygienePlanEntity::getScheduledStartTime, startTime); } - if (!principal.equals("null") && !principal.equals("")) { - queryWrapper.lambda().ge(HygienePlanEntity::getPrincipal, principal); + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime); } return this.page(Condition.getPage(query), queryWrapper); } @@ -77,48 +91,84 @@ public class HygienePlanServiceImpl extends ServiceImpl zoneList = hygienePlanDTO.getZoneList(); + // 若计划新增成功,新增关联责任区数据 + if (savePlan) { + HygienePlanEntity hygienePlan = getPlanByCode(hygienePlanDTO.getCode()); + for (HygieneZoneEntity zone : zoneList) { + // 传计划id + if (hygienePlan != null) { + zone.setHygienePlanId(hygienePlan.getId()); + } + String[] scores = zone.getCheckItemScore().split(",|,"); + // 校验检查项总成绩是否为标准总成绩 + R res = getSumScore(scores, hygienePlanDTO.getStandardScore()); + if (!res.isSuccess()) { + return res; + } + } + // 校验通过则批量新增责任区数据 + return R.status(hygieneZoneService.saveBatch(zoneList)); + } + return R.status(Boolean.FALSE); } /** * 修改卫生自查计划 */ @Override - public R updatePlan(HygienePlanEntity hygienePlanEntity) { - String[] scores = hygienePlanEntity.getCheckItemScore().split(",|,"); - Integer standardScore = hygienePlanEntity.getStandardScore(); - R res = getSumScore(scores, standardScore); - return res.isSuccess() ? R.status(this.updateById(hygienePlanEntity)) : res; + public R updatePlan(HygienePlanDTO hygienePlanDTO) { + // 修改卫生自查计划 + HygienePlanEntity hygienePlanEntity = new HygienePlanEntity(); + BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity); + boolean updatePlan = this.updateById(hygienePlanEntity); + List zoneList = hygienePlanDTO.getZoneList(); + // 若计划修改成功,修改关联责任区数据 + if (updatePlan) { + for (HygieneZoneEntity zone : zoneList) { + String[] scores = zone.getCheckItemScore().split(",|,"); + // 校验检查项总成绩是否为标准总成绩 + R res = getSumScore(scores, hygienePlanDTO.getStandardScore()); + if (!res.isSuccess()) { + return res; + } + } + // 校验通过则批量修改责任区数据 + return R.status(hygieneZoneService.updateBatchById(zoneList)); + } + return R.status(Boolean.FALSE); } /** * 卫生自查月度数据 */ @Override - public IPage dataByMonth(String month, Query query) { + public IPage dataByMonth(String month, String unit, Query query) { // 查询当月各单位的卫生自查总数 IPage page = new Page<>(query.getCurrent(), query.getSize()); - IPage unitPage = baseMapper.selectByMonth(page, month); + IPage unitPage = baseMapper.selectByMonth(page, unit, month); List unitList = unitPage.getRecords(); // 查询当月各单位已完成的卫生自查数据 IPage page1 = new Page<>(query.getCurrent(), query.getSize()); - IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, month); + IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, unit, month); List finishedList = finishedPage.getRecords(); // 处理统计数据 - for (HygieneMonthVO unit : unitList) { - Long taskNum = unit.getScheduledCheckNum(); - Optional finishedHygiene = finishedList.stream().filter(x -> x.getUnit().equals(unit.getUnit())).findFirst(); + for (HygieneMonthVO u : unitList) { + Long taskNum = u.getScheduledCheckNum(); + Optional finishedHygiene = finishedList.stream().filter(x -> x.getUnit().equals(u.getUnit())).findFirst(); Long finishedTaskNum = finishedHygiene.isPresent() ? finishedHygiene.get().getFinishedCheckNum() : 0L; - unit.setFinishedCheckNum(finishedTaskNum); - unit.setUnfinishedCheckNum(taskNum - finishedTaskNum); + u.setFinishedCheckNum(finishedTaskNum); + u.setUnfinishedCheckNum(taskNum - finishedTaskNum); BigDecimal taskDecimal = new BigDecimal(taskNum); BigDecimal finishedDecimal = new BigDecimal(finishedTaskNum); - unit.setCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) + u.setCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) .setScale(2, RoundingMode.HALF_UP)); } unitPage.setRecords(unitList); @@ -126,32 +176,61 @@ public class HygienePlanServiceImpl extends ServiceImpl zoneList = hygieneZoneService.getReferenceZone(id); + hygienePlanDetailVO.setZoneList(zoneList); + return hygienePlanDetailVO; + } + + /** + * 计算累计分值 + * @param scores 各项分值 + * @param standardScore 标准总分值 + * @return 累计分值等于标准总分值时,返回数据,否则返回错误信息 + */ + private R getSumScore(String[] scores, Integer standardScore) { + int sum = 0; + for (String score : scores) { + sum += Integer.parseInt(score); + if (sum > standardScore) { + return R.fail("累计分值已超过标准总分值"); + } + } + return sum < standardScore ? R.fail("标准总分值未全部分配") : R.data(sum); + } + + /** + * 根据编码查询卫生自查计划 + */ + @Override + public HygienePlanEntity getPlanByCode(String code) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygienePlanEntity::getCode, code); + return this.getOne(queryWrapper); + } + + /** + * 月度数据导出 */ @Override - public void exportHygieneData(Map param, HttpServletResponse response) { + public void exportMonthData(Map param, Query query, HttpServletResponse response) { ServletOutputStream outputStream = null; try { outputStream = response.getOutputStream(); String unit = String.valueOf(param.get("unit")); - String startTime = String.valueOf(param.get("scheduledStartTime")); - String endTime = String.valueOf(param.get("scheduledEndTime")); - List rehearsalList = getHygieneByUnitAndDate(unit, startTime, endTime); - // 处理卫生自查状态信息 - rehearsalList.forEach(record -> { - String status; - if (record.getHygieneStatus().equals(HygieneStatusEnum.WAITING.getValue())) { - status = HygieneStatusEnum.WAITING.getDesc(); - } else if (record.getHygieneStatus().equals(HygieneStatusEnum.UNFINISHED.getValue())) { - status = HygieneStatusEnum.UNFINISHED.getDesc(); - } else { - status = HygieneStatusEnum.FINISHED.getDesc(); - } - record.setHygieneStatus(status); - }); + String month = String.valueOf(param.get("month")); + IPage monthPage = dataByMonth(month, unit, query); + List records = monthPage.getRecords(); // 设置响应头 // URLEncoder.encode防止中文乱码 - String fileName = URLEncoder.encode("卫生自查数据表", "UTF-8"); + String fileName = URLEncoder.encode("卫生自查月度统计表", "UTF-8"); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("UTF-8"); @@ -162,52 +241,24 @@ public class HygienePlanServiceImpl extends ServiceImpl standardScore) { - return R.fail("累计分值已超过标准总分值"); - } - } - return sum < standardScore ? R.fail("标准总分值未全部分配") : R.data(sum); - } - - /** - * 根据单位和计划时间查询卫生自查记录 - * @param unit 单位 - * @param startTime 计划开始时间 - * @param endTime 计划结束时间 - * @return 卫生自查记录 - */ - public List getHygieneByUnitAndDate(String unit, String startTime, String endTime) { - return baseMapper.getHygieneByUnitAndDate(unit, startTime, endTime); - } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index 321078c..469d5fa 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -1,26 +1,48 @@ package com.hnac.hzims.safeproduct.service.impl; import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.converters.longconverter.LongStringConverter; import com.alibaba.excel.util.CollectionUtils; +import com.alibaba.excel.write.merge.LoopMergeStrategy; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.common.logs.utils.StringUtils; +import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper; import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper; import com.hnac.hzims.safeproduct.service.IHygieneRecordService; +import com.hnac.hzims.safeproduct.service.IHygieneZoneService; +import com.hnac.hzims.safeproduct.utils.BaseUtil; +import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; +import com.hnac.hzims.safeproduct.vo.HygieneZoneDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.ss.usermodel.CellStyle; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URLEncoder; import java.time.LocalDate; import java.time.ZoneId; import java.time.temporal.WeekFields; -import java.util.Date; -import java.util.List; -import java.util.Locale; +import java.util.*; import java.util.stream.Collectors; /** @@ -35,6 +57,9 @@ public class HygieneRecordServiceImpl extends ServiceImpl 0) { - return R.fail("评分不能大于标准总分值"); + String[] scores = hygieneRecordEntity.getComprehensiveScore().split(",|,"); + for (String score : scores) { + int sc = Integer.parseInt(score); + if (sc > hygienePlanEntity.getStandardScore()) { + return R.fail("评分不能大于标准总分值"); + } } return R.status(this.save(hygieneRecordEntity)); } @@ -94,14 +111,20 @@ public class HygieneRecordServiceImpl extends ServiceImpl 0) { - return R.fail("评分不能大于标准总分值"); + String[] scores = hygieneRecordEntity.getComprehensiveScore().split(",|,"); + for (String score : scores) { + int sc = Integer.parseInt(score); + if (sc > hygienePlanEntity.getStandardScore()) { + return R.fail("评分不能大于标准总分值"); + } } return R.status(this.updateById(hygieneRecordEntity)); } @@ -111,7 +134,80 @@ public class HygieneRecordServiceImpl extends ServiceImpl checkDetailVOList = new ArrayList<>(); + for (int i = 0; i < zoneIds.length ; i++) { + HygieneZoneDetailVO zoneDetailVO = new HygieneZoneDetailVO(); + HygieneZoneEntity hygieneZoneEntity = hygieneZoneService.getById(zoneIds[i]); + BeanUtils.copyProperties(hygieneZoneEntity, zoneDetailVO); + zoneDetailVO.setResult(results[i]); + zoneDetailVO.setScore(Integer.parseInt(scores[i])); + checkDetailVOList.add(zoneDetailVO); + } + recordDetailVO.setCheckList(checkDetailVOList); + return recordDetailVO; + } + + /** + * 卫生自查记录页面 + */ + @Override + public IPage recordPage(Map param, Query query) { + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.recordPage(page, param); + } + + /** + * 卫生自查数据导出 + */ + @Override + public void exportHygieneData(Long hygieneRecordId, HttpServletResponse response) { + ServletOutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + HygieneRecordDetailVO recordDetailVO = getRecordDetail(hygieneRecordId); + List records = recordDetailVO.getCheckList(); + // 设置响应头 + // URLEncoder.encode防止中文乱码 + String fileName = URLEncoder.encode("卫生自查记录数据表", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("UTF-8"); + // ExcelWriter初始化 + ExcelWriter excelWriter = EasyExcel + .write(response.getOutputStream()) + .autoCloseStream(Boolean.TRUE) + .registerConverter(new LongStringConverter()) + .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) + .build(); + Date endTime = recordDetailVO.getActualEndTime(); + String name = DateUtil.format(endTime, "yyyy年mm月") + "第" + recordDetailVO.getWeekNum() + "周卫生自查表"; + List head = new ArrayList<>(); + head.add(name); + WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查记录数据表") + .head(Collections.singletonList(head)) + .head(HygieneZoneDetailVO.class) + .build(); + excelWriter.write(records, writeSheet); + excelWriter.finish(); + } catch (Exception e) { + // 重置response + response.reset(); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + throw new ServiceException("卫生自查记录数据导出异常: " + e.getMessage()); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error("卫生自查记录数据导出输出流关闭异常: " + e.getMessage()); + } + } + } } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneZoneServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneZoneServiceImpl.java new file mode 100644 index 0000000..2cedf06 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneZoneServiceImpl.java @@ -0,0 +1,42 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.alibaba.excel.util.CollectionUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; +import com.hnac.hzims.safeproduct.mapper.HygieneZoneMapper; +import com.hnac.hzims.safeproduct.service.IHygieneZoneService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class HygieneZoneServiceImpl extends ServiceImpl implements IHygieneZoneService { + + /** + * 删除关联责任区数据 + */ + @Override + public boolean removeReferenceZone(Long hygienePlanId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygieneZoneEntity::getHygienePlanId, hygienePlanId); + List zoneList = this.list(queryWrapper); + // 若无关联卫生自查责任区,直接返回true + if (CollectionUtils.isEmpty(zoneList)) { + return true; + } + List ids = zoneList.stream().map(HygieneZoneEntity::getId).collect(Collectors.toList()); + return this.removeByIds(ids); + } + + /** + * 查询关联责任区数据 + */ + @Override + public List getReferenceZone(Long hygienePlanId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygieneZoneEntity::getHygienePlanId, hygienePlanId); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 647fb1f..1d1932c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -24,6 +24,7 @@ import org.springblade.core.mp.support.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -72,6 +73,10 @@ public class RehearsalPlanServiceImpl extends ServiceImpl page = new Page<>(query.getCurrent(), query.getSize()); IPage unitPage = baseMapper.selectByMonth(page, month); List unitList = unitPage.getRecords(); + // 若无数据,返回空页面 + if (CollectionUtils.isEmpty(unitList)) { + return unitPage; + } // 查询当月各单位已完成的演练数据 IPage page1 = new Page<>(query.getCurrent(), query.getSize()); IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, month); @@ -102,7 +107,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl unitPage = baseMapper.selectUnitByYear(page, year); List records = unitPage.getRecords(); // 若无数据,返回空页面 - if (org.springframework.util.CollectionUtils.isEmpty(records)) { + if (CollectionUtils.isEmpty(records)) { return unitPage; } List unitList = records.stream().map(RehearsalYearVO::getUnit).collect(Collectors.toList()); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index b3a6701..6aa0b5d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -12,6 +12,7 @@ import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; +import com.hnac.hzims.safeproduct.utils.BaseUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -42,21 +43,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl impleme // 查询是否存在同月编号 String lastCode = getLastCode(currentMonth); // 若不存在,新增编号 - String code; - if (StringUtils.isNull(lastCode)) { - code = "KSJL" + currentMonth + "001"; - } else { // 若存在,编号递增 - String oldNum = lastCode.substring(lastCode.length() - 3); - int value = Integer.parseInt(oldNum) + 1; - // 根据数位拼接编号 - if (value < 10) { - code = "KSJL" + currentMonth + "00" + value; - } else if (value < 100) { - code = "KSJL" + currentMonth + "0" + value; - } else { - code = "KSJL" + currentMonth + value; - } - } + String code = BaseUtil.getUniqueCode("KSJL", lastCode, currentMonth); testEntity.setCode(code); boolean saveTest = this.save(testEntity); // 若新增考试记录成功,添加相关的参考人员数据 @@ -81,13 +67,7 @@ public class TestServiceImpl extends ServiceImpl impleme String people = test.getPeopleName(); String[] person = people.split(",|,"); // 新增参考人员成绩数据 - List scoreList = new ArrayList<>(); - for(String name : person) { - TestScoreEntity testScoreEntity = new TestScoreEntity(); - testScoreEntity.setTestId(test.getId()); - testScoreEntity.setName(name); - scoreList.add(testScoreEntity); - } + List scoreList = getReferenceTestScore(test, person); return R.status(testScoreService.saveBatch(scoreList)); } return R.fail("新增考试记录失败"); @@ -185,20 +165,31 @@ public class TestServiceImpl extends ServiceImpl impleme if (removeByIds) { String[] person = testEntity.getPeopleName().split(",|,"); // 新增参考人员成绩数据 - List res = new ArrayList<>(); - for (String name : person) { - TestScoreEntity testScoreEntity = new TestScoreEntity(); - testScoreEntity.setTestId(testEntity.getId()); - testScoreEntity.setName(name); - res.add(testScoreEntity); - } - return testScoreService.saveBatch(res); + List scoreList = getReferenceTestScore(testEntity, person); + return testScoreService.saveBatch(scoreList); } } return false; } /** + * 获取成绩列表 + * @param testEntity 考试记录实体类 + * @param person 参考人员 + * @return 成绩列表 + */ + private List getReferenceTestScore(TestEntity testEntity, String[] person) { + List res = new ArrayList<>(); + for (String name : person) { + TestScoreEntity testScoreEntity = new TestScoreEntity(); + testScoreEntity.setTestId(testEntity.getId()); + testScoreEntity.setName(name); + res.add(testScoreEntity); + } + return res; + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index cba9def..27a8d8e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -63,6 +63,10 @@ public class TrainPlanServiceImpl extends ServiceImpl page = new Page<>(query.getCurrent(), query.getSize()); IPage unitPage = baseMapper.selectByMonth(page, month); List unitList = unitPage.getRecords(); + // 若无数据,返回空页面 + if (CollectionUtils.isEmpty(unitList)) { + return unitPage; + } // 查询当月各单位已完成的培训数据 IPage page1 = new Page<>(query.getCurrent(), query.getSize()); IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, month); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 230a4d2..79d9c05 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -10,7 +10,6 @@ import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -20,6 +19,7 @@ import com.hnac.hzims.safeproduct.mapper.TrainPlanMapper; import com.hnac.hzims.safeproduct.mapper.TrainRecordMapper; import com.hnac.hzims.safeproduct.service.ITestService; import com.hnac.hzims.safeproduct.service.ITrainRecordService; +import com.hnac.hzims.safeproduct.utils.BaseUtil; import org.springblade.core.log.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -61,21 +61,7 @@ public class TrainRecordServiceImpl extends ServiceImplfalse - + + org.springframework.boot + spring-boot-maven-plugin + + + true + + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java index 2d38e41..c07e839 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java @@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -32,10 +33,24 @@ public class CensController { return R.data(censService.cens(param)); } + @GetMapping ("/censExport") + @ApiOperation("两票统计导出") + @ApiOperationSupport(order = 2) + public void censExport(HttpServletResponse response,CensParamVo param) { + censService.censExport(response,param); + } + @PostMapping("/censYear") - @ApiOperation("两票统计") - @ApiOperationSupport(order = 1) + @ApiOperation("两票年度统计") + @ApiOperationSupport(order = 3) public R> censYear(@RequestBody CensYearParamVo param) { return R.data(censService.censYear(param)); } + + @GetMapping ("/censYearExport") + @ApiOperation("两票年度统计导出") + @ApiOperationSupport(order = 4) + public void censYearExport(HttpServletResponse response,CensYearParamVo param) { + censService.censYearExport(response,param); + } } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java index b785073..f0819e9 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java @@ -166,6 +166,21 @@ public class WorkTicketFinish implements Serializable { */ private String otherItems; + /** + * 工作终结负责人 + */ + private String endPrincipalName; + + /** + * 工作终结许可人 + */ + private String endLicensorName; + + /** + * 工作票终结许可人 + */ + private String finishLicensorName; + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java index fdc8219..2a8a752 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java @@ -4,7 +4,9 @@ import com.hnac.hzims.ticket.standardTicket.vo.CensParamVo; import com.hnac.hzims.ticket.standardTicket.vo.CensVo; import com.hnac.hzims.ticket.standardTicket.vo.CensYearParamVo; import com.hnac.hzims.ticket.standardTicket.vo.CensYearVo; +import org.springblade.core.tool.api.R; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -15,4 +17,8 @@ public interface CensService { List cens(CensParamVo param); List censYear(CensYearParamVo param); + + void censExport(HttpServletResponse response, CensParamVo param); + + void censYearExport(HttpServletResponse response, CensYearParamVo param); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java index 2c23142..b83958b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java @@ -1,8 +1,6 @@ package com.hnac.hzims.ticket.twoTicket.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; @@ -15,14 +13,26 @@ import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.util.CellRangeAddress; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; import org.springframework.stereotype.Service; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URLEncoder; import java.util.*; import java.util.stream.Collectors; @@ -60,10 +70,21 @@ public class CensServiceImpl implements CensService { } // 获取权限区域机构 - List depts = this.authArea(); - if(CollectionUtil.isEmpty(depts)){ - return new ArrayList<>(); + List depts; + if(ObjectUtil.isEmpty(param.getDeptId())){ + // 获取权限区域机构 + depts = this.authArea(); + if(CollectionUtil.isEmpty(depts)){ + return new ArrayList<>(); + } + }else{ + R result = sysClient.getDept(param.getDeptId()); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData())){ + return new ArrayList<>(); + } + depts = Collections.singletonList(result.getData()); } + // 操作票查询 QueryWrapper wrapper = new QueryWrapper(); if(!StringUtil.isEmpty(param.getFlowTaskName())){ @@ -135,11 +156,19 @@ public class CensServiceImpl implements CensService { if(!StringUtil.isEmpty(param.getState()) && param.getState().equals(1)){ param.setFlowTaskName("结束"); } - - // 获取权限区域机构 - List depts = this.authArea(); - if(CollectionUtil.isEmpty(depts)){ - return new ArrayList<>(); + List depts; + if(ObjectUtil.isEmpty(param.getDeptId())){ + // 获取权限区域机构 + depts = this.authArea(); + if(CollectionUtil.isEmpty(depts)){ + return new ArrayList<>(); + } + }else{ + R result = sysClient.getDept(param.getDeptId()); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData())){ + return new ArrayList<>(); + } + depts = Collections.singletonList(result.getData()); } // 操作票查询 @@ -180,11 +209,417 @@ public class CensServiceImpl implements CensService { }else{ cens.setWorkCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId()) && DateUtil.format(work.getCreateTime(),"yyyy-MM").equals(strMon)).count()); } - cens.setWorkTaskCount((long)new Random().nextInt(10)); censs.add(cens); } - censYear.setCenss(censs); + censYear.setCenss(censs.stream().sorted(Comparator.comparing(CensVo::getMon)).collect(Collectors.toList())); return censYear; }).collect(Collectors.toList()); } + + /** + * 两票统计导出 + * @param response + * @param param + */ + @Override + public void censExport(HttpServletResponse response, CensParamVo param) { + // 创建Excel文件 + HSSFWorkbook hssWB = new HSSFWorkbook(); + // 添加sheet页 + HSSFSheet sheet = hssWB.createSheet("两票统计报表"); + // 行高 + sheet.setDefaultRowHeight((short) (20 * 25)); + // 列宽 + sheet.setDefaultColumnWidth(20); + this.setFirstHeader(hssWB, sheet); + // 第二行/三行 表头格式设置 + this.setWorkHeader(hssWB, sheet); + List censs = this.cens(param); + if (!CollectionUtil.isEmpty(censs)) { + // 数据填充 + this.setWorkData(hssWB, sheet, censs); + } + + // 下载导出 + String filename = "两票统计报表"; + // 设置头信息 + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/vnd.ms-excel"); + ServletOutputStream outputStream; + try { + //设置xlsx格式 + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xls", "UTF-8")); + //创建一个输出流 + outputStream = response.getOutputStream(); + //写入数据 + hssWB.write(outputStream); + // 关闭 + outputStream.close(); + hssWB.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 首行表头样式 + * @param hssWB + * @param sheet + */ + private void setFirstHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { + // 第一行 + HSSFRow fisrtRow = sheet.createRow(0); + this.setTitileStyle(hssWB, fisrtRow, 4, true); + // 第一个单元格 + HSSFCell headCell = fisrtRow.getCell(0); + headCell.setCellValue("两票统计报表"); + // 首行合并情况 + CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 4); + sheet.addMergedRegion(region1); + } + + /** + * 年度统计首行表头样式 + * @param hssWB + * @param sheet + */ + private void setYearFirstHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { + // 第一行 + HSSFRow fisrtRow = sheet.createRow(0); + this.setTitileStyle(hssWB, fisrtRow, 27, true); + // 第一个单元格 + HSSFCell headCell = fisrtRow.getCell(0); + headCell.setCellValue("两票年度统计报表"); + // 首行合并情况 + CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 27); + sheet.addMergedRegion(region1); + } + + /** + * 表头格式设置 + * + * @param hssWB + * @param sheet + */ + private void setWorkHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { + // 创建行 + HSSFRow row_1 = sheet.createRow(1); + this.setTitileStyle(hssWB, row_1, 4, true); + // 第一行 + HSSFCell header_row_1_cell_1 = row_1.getCell(0); + header_row_1_cell_1.setCellValue("序号"); + HSSFCell header_row_1_cell_2 = row_1.getCell(1); + header_row_1_cell_2.setCellValue("单位"); + HSSFCell header_row_1_cell_3 = row_1.getCell(2); + header_row_1_cell_3.setCellValue("工作票数量"); + HSSFCell header_row_1_cell_4 = row_1.getCell(3); + header_row_1_cell_4.setCellValue("操作票数量"); + HSSFCell header_row_1_cell_5 = row_1.getCell(4); + header_row_1_cell_5.setCellValue("工作任务数量"); + } + + /** + * 设置Titile单元格样式 + * + * @param hssWB + * @param row + * @param len + */ + private void setTitileStyle(HSSFWorkbook hssWB, HSSFRow row, int len, boolean isHead) { + HSSFCellStyle cellStyle = getHeadStyle(hssWB, isHead); + for (int i = 0; i <= len; i++) { + HSSFCell hssfcell = row.createCell(i); + hssfcell.setCellStyle(cellStyle); + } + } + + /** + * 获取表头样式 + * + * @param hssWB + * @return + */ + private HSSFCellStyle getHeadStyle(HSSFWorkbook hssWB, boolean isHead) { + HSSFCellStyle headStyle = hssWB.createCellStyle(); + //边框 + headStyle.setBorderLeft(BorderStyle.THIN); + headStyle.setBorderRight(BorderStyle.THIN); + headStyle.setBorderTop(BorderStyle.THIN); + headStyle.setBorderBottom(BorderStyle.THIN); + //居中: + headStyle.setAlignment(HorizontalAlignment.CENTER); // 居中 + headStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中 + //字体: + HSSFFont font = hssWB.createFont(); + font.setFontName("黑体"); + if (isHead) { + //设置字体大小 + font.setFontHeightInPoints((short) 12); + //背景颜色 + headStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + headStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.SKY_BLUE.getIndex()); + } else { + //设置字体大小 + font.setFontHeightInPoints((short) 8); + //背景颜色 + headStyle.setFillPattern(FillPatternType.NO_FILL); + headStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + } + //字体格式 + headStyle.setFont(font); + return headStyle; + } + + /** + * 表格数据填充 + * + * @param hssWB + * @param sheet + * @param censs + */ + private void setWorkData(HSSFWorkbook hssWB, HSSFSheet sheet, List censs) { + int size = censs.size(); + for (int i = 0; i < size; i++) { + HSSFRow row = sheet.createRow(i + 2); + this.setTitileStyle(hssWB, row, 19, false); + CensVo cens = censs.get(i); + // 序号 + HSSFCell header_row_cell_0 = row.getCell(0); + header_row_cell_0.setCellValue(i + 1); + // 单位 + HSSFCell header_row_cell_1 = row.getCell(1); + header_row_cell_1.setCellValue(cens.getDeptName()); + // 工作票数量 + HSSFCell header_row_cell_2 = row.getCell(2); + header_row_cell_2.setCellValue(cens.getWorkCount()); + // 操作票数量 + HSSFCell header_row_cell_3 = row.getCell(3); + header_row_cell_3.setCellValue(cens.getOperateCount()); + // 工作任务数量 + HSSFCell header_row_cell_4 = row.getCell(4); + header_row_cell_4.setCellValue(cens.getWorkTaskCount()); + } + } + + /** + * 两票年度统计导出 + * @param response + * @param param + */ + @Override + public void censYearExport(HttpServletResponse response, CensYearParamVo param) { + if(StringUtil.isEmpty(param.getYear())){ + param.setYear(DateUtil.format(new Date(),"yyyy")); + } + // 创建Excel文件 + HSSFWorkbook hssWB = new HSSFWorkbook(); + // 添加sheet页 + HSSFSheet sheet = hssWB.createSheet(param.getYear() +"两票年度统计报表"); + // 行高 + sheet.setDefaultRowHeight((short) (20 * 25)); + // 列宽 + sheet.setDefaultColumnWidth(20); + this.setYearFirstHeader(hssWB, sheet); + // 第二行/三行 表头格式设置 + this.setYearWorkHeader(hssWB, sheet); + List censYears = this.censYear(param); + if (!CollectionUtil.isEmpty(censYears)) { + // 数据填充 + this.setYearWorkData(hssWB, sheet, censYears); + } + + // 下载导出 + String filename = param.getYear() + "年度两票统计报表"; + // 设置头信息 + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/vnd.ms-excel"); + ServletOutputStream outputStream; + try { + //设置xlsx格式 + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xls", "UTF-8")); + //创建一个输出流 + outputStream = response.getOutputStream(); + //写入数据 + hssWB.write(outputStream); + // 关闭 + outputStream.close(); + hssWB.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 两票年首行表头设置 + * @param hssWB + * @param sheet + */ + private void setYearWorkHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { + // 创建行 + HSSFRow row_1 = sheet.createRow(1); + this.setTitileStyle(hssWB, row_1, 27, true); + // 第一行 + HSSFCell header_row_1_cell_1 = row_1.getCell(0); + header_row_1_cell_1.setCellValue("序号"); + HSSFCell header_row_1_cell_2 = row_1.getCell(1); + header_row_1_cell_2.setCellValue("单位"); + HSSFCell header_row_1_cell_3 = row_1.getCell(2); + header_row_1_cell_3.setCellValue("1月"); + HSSFCell header_row_1_cell_4 = row_1.getCell(4); + header_row_1_cell_4.setCellValue("2月"); + HSSFCell header_row_1_cell_5 = row_1.getCell(6); + header_row_1_cell_5.setCellValue("3月"); + HSSFCell header_row_1_cell_6 = row_1.getCell(8); + header_row_1_cell_6.setCellValue("4月"); + HSSFCell header_row_1_cell_7 = row_1.getCell(10); + header_row_1_cell_7.setCellValue("5月"); + HSSFCell header_row_1_cell_8 = row_1.getCell(12); + header_row_1_cell_8.setCellValue("6月"); + HSSFCell header_row_1_cell_9 = row_1.getCell(14); + header_row_1_cell_9.setCellValue("7月"); + HSSFCell header_row_1_cell_10 = row_1.getCell(16); + header_row_1_cell_10.setCellValue("8月"); + HSSFCell header_row_1_cell_11 = row_1.getCell(18); + header_row_1_cell_11.setCellValue("9月"); + HSSFCell header_row_1_cell_12 = row_1.getCell(20); + header_row_1_cell_12.setCellValue("10月"); + HSSFCell header_row_1_cell_13 = row_1.getCell(22); + header_row_1_cell_13.setCellValue("11月"); + HSSFCell header_row_1_cell_14 = row_1.getCell(24); + header_row_1_cell_14.setCellValue("12月"); + HSSFCell header_row_1_cell_15 = row_1.getCell(26); + header_row_1_cell_15.setCellValue("总计"); + + // 第二行 + HSSFRow row_2 = sheet.createRow(2); + this.setTitileStyle(hssWB, row_2, 27, true); + HSSFCell header_row_2_cell_1 = row_2.getCell(2); + header_row_2_cell_1.setCellValue("工作票"); + HSSFCell header_row_2_cell_2 = row_2.getCell(3); + header_row_2_cell_2.setCellValue("操作票"); + HSSFCell header_row_2_cell_3 = row_2.getCell(4); + header_row_2_cell_3.setCellValue("工作票"); + HSSFCell header_row_2_cell_4 = row_2.getCell(5); + header_row_2_cell_4.setCellValue("操作票"); + HSSFCell header_row_2_cell_5 = row_2.getCell(6); + header_row_2_cell_5.setCellValue("工作票"); + HSSFCell header_row_2_cell_6 = row_2.getCell(7); + header_row_2_cell_6.setCellValue("操作票"); + HSSFCell header_row_2_cell_7 = row_2.getCell(8); + header_row_2_cell_7.setCellValue("工作票"); + HSSFCell header_row_2_cell_8 = row_2.getCell(9); + header_row_2_cell_8.setCellValue("操作票"); + HSSFCell header_row_2_cell_9 = row_2.getCell(10); + header_row_2_cell_9.setCellValue("工作票"); + HSSFCell header_row_2_cell_10 = row_2.getCell(11); + header_row_2_cell_10.setCellValue("操作票"); + HSSFCell header_row_2_cell_11 = row_2.getCell(12); + header_row_2_cell_11.setCellValue("工作票"); + HSSFCell header_row_2_cell_12 = row_2.getCell(13); + header_row_2_cell_12.setCellValue("操作票"); + HSSFCell header_row_2_cell_13 = row_2.getCell(14); + header_row_2_cell_13.setCellValue("工作票"); + HSSFCell header_row_2_cell_14 = row_2.getCell(15); + header_row_2_cell_14.setCellValue("操作票"); + HSSFCell header_row_2_cell_15 = row_2.getCell(16); + header_row_2_cell_15.setCellValue("工作票"); + HSSFCell header_row_2_cell_16 = row_2.getCell(17); + header_row_2_cell_16.setCellValue("操作票"); + HSSFCell header_row_2_cell_17 = row_2.getCell(18); + header_row_2_cell_17.setCellValue("工作票"); + HSSFCell header_row_2_cell_18 = row_2.getCell(19); + header_row_2_cell_18.setCellValue("操作票"); + HSSFCell header_row_2_cell_19 = row_2.getCell(20); + header_row_2_cell_19.setCellValue("工作票"); + HSSFCell header_row_2_cell_20 = row_2.getCell(21); + header_row_2_cell_20.setCellValue("操作票"); + HSSFCell header_row_2_cell_21 = row_2.getCell(22); + header_row_2_cell_21.setCellValue("工作票"); + HSSFCell header_row_2_cell_22 = row_2.getCell(23); + header_row_2_cell_22.setCellValue("操作票"); + HSSFCell header_row_2_cell_23 = row_2.getCell(24); + header_row_2_cell_23.setCellValue("工作票"); + HSSFCell header_row_2_cell_24 = row_2.getCell(25); + header_row_2_cell_24.setCellValue("操作票"); + HSSFCell header_row_2_cell_25 = row_2.getCell(26); + header_row_2_cell_25.setCellValue("工作票"); + HSSFCell header_row_2_cell_26 = row_2.getCell(27); + header_row_2_cell_26.setCellValue("操作票"); + + // 表头一:合并情况 + CellRangeAddress header_region_1 = new CellRangeAddress((short) 1, (short) 2, (short) 0, (short) 0); + CellRangeAddress header_region_2 = new CellRangeAddress((short) 1, (short) 2, (short) 1, (short) 1); + CellRangeAddress header_region_3 = new CellRangeAddress((short) 1, (short) 1, (short) 2, (short) 3); + CellRangeAddress header_region_4 = new CellRangeAddress((short) 1, (short) 1, (short) 4, (short) 5); + CellRangeAddress header_region_5 = new CellRangeAddress((short) 1, (short) 1, (short) 6, (short) 7); + CellRangeAddress header_region_6 = new CellRangeAddress((short) 1, (short) 1, (short) 8, (short) 9); + CellRangeAddress header_region_7 = new CellRangeAddress((short) 1, (short) 1, (short) 10, (short) 11); + CellRangeAddress header_region_8 = new CellRangeAddress((short) 1, (short) 1, (short) 12, (short) 13); + CellRangeAddress header_region_9 = new CellRangeAddress((short) 1, (short) 1, (short) 14, (short) 15); + CellRangeAddress header_region_10 = new CellRangeAddress((short) 1, (short) 1, (short) 16, (short) 17); + CellRangeAddress header_region_11 = new CellRangeAddress((short) 1, (short) 1, (short) 18, (short) 19); + CellRangeAddress header_region_12 = new CellRangeAddress((short) 1, (short) 1, (short) 20, (short) 21); + CellRangeAddress header_region_13 = new CellRangeAddress((short) 1, (short) 1, (short) 22, (short) 23); + CellRangeAddress header_region_14 = new CellRangeAddress((short) 1, (short) 1, (short) 24, (short) 25); + CellRangeAddress header_region_15 = new CellRangeAddress((short) 1, (short) 1, (short) 26, (short) 27); + sheet.addMergedRegion(header_region_1); + sheet.addMergedRegion(header_region_2); + sheet.addMergedRegion(header_region_3); + sheet.addMergedRegion(header_region_4); + sheet.addMergedRegion(header_region_5); + sheet.addMergedRegion(header_region_6); + sheet.addMergedRegion(header_region_7); + sheet.addMergedRegion(header_region_8); + sheet.addMergedRegion(header_region_9); + sheet.addMergedRegion(header_region_10); + sheet.addMergedRegion(header_region_11); + sheet.addMergedRegion(header_region_12); + sheet.addMergedRegion(header_region_13); + sheet.addMergedRegion(header_region_14); + sheet.addMergedRegion(header_region_15); + } + + /** + * 年度数据设置 + * @param hssWB + * @param sheet + * @param censYears + */ + private void setYearWorkData(HSSFWorkbook hssWB, HSSFSheet sheet, List censYears) { + int size = censYears.size(); + for (int i = 0; i < size; i++) { + HSSFRow row = sheet.createRow(i + 3); + this.setTitileStyle(hssWB, row, 27, false); + CensYearVo censYear = censYears.get(i); + // 序号 + HSSFCell header_row_cell_0 = row.getCell(0); + header_row_cell_0.setCellValue(i + 1); + // 单位 + HSSFCell header_row_cell_1 = row.getCell(1); + header_row_cell_1.setCellValue(censYear.getDeptName()); + List censs = censYear.getCenss(); + if(CollectionUtil.isEmpty(censs)){ + return; + } + int workSum = 0,operateSum = 0; + for(int mon = 0; mon < 12; mon ++){ + CensVo cens = censs.get(mon); + // 工作票数量 + HSSFCell work_cell = row.getCell(2 * (mon + 1)); + work_cell.setCellValue(cens.getWorkCount()); + workSum += cens.getWorkCount(); + // 操作票数量 + HSSFCell operate_cell = row.getCell(2 * (mon + 1) + 1); + operate_cell.setCellValue(cens.getOperateCount()); + operateSum += cens.getOperateCount(); + } + // 总计 + HSSFCell work_sum_cell = row.getCell(26); + work_sum_cell.setCellValue(workSum); + HSSFCell operate_sum_cell = row.getCell(27); + operate_sum_cell.setCellValue(operateSum); + } + } + + } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index 677cb96..97f7589 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -395,27 +395,27 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl documents, String savePath) throws IOException { - FileOutputStream out = new FileOutputStream(savePath, true); - Path file = Paths.get(path); - if(Files.exists(file)) { - Files.delete(file); - } - new File(savePath).createNewFile(); + FileOutputStream out = new FileOutputStream(savePath); for (XWPFDocument document : documents) { document.write(out); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 0d1e79c..29cda63 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -506,6 +506,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { } workTicket.setProcessInstanceId(response.getProcessInstanceId()); this.saveWorkTicket(workTicket,response); + firstWorkTicketService.updateById(workTicket); List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); if(CollectionUtil.isNotEmpty(safetyMeasuresList)) { workTicketSafetyMeasureService.saveOrUpdateBatch(safetyMeasuresList); @@ -1366,7 +1367,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); // 开启工作流 - String processInstanceId = this.startOfflineTicketProcess(workTicketVo); + this.startOfflineTicketProcess(workTicketVo); return workTicket.getId(); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java index 5ba0278..e623b2a 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java @@ -67,7 +67,7 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper selectPages(Page pageEntity, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - List getWorkTicketBill(@Param("path") String path, @Param("startTime") String startTime, @Param("endTime") String endTime); + List getWorkTicketBill(@Param("deviceCodes") List deviceCodes, @Param("startTime") String startTime, @Param("endTime") String endTime); @UserDataAuth List selectTicketList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml index 2f686d7..9c57323 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml @@ -86,16 +86,18 @@