diff --git a/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java b/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java index f8397aa..f68fade 100644 --- a/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java +++ b/inventory-dao/src/main/java/com/rzyc/enums/RedisKeys.java @@ -12,7 +12,13 @@ public enum RedisKeys { POST("entPost"), //企业设备 - DEVICE("entDevice"); + DEVICE("entDevice"), + + //岗位Id + POSTID("postId"), + + //用户Id + USERID("userId"); /*******分界线********/ diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java index 410f85f..6f87e30 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceInsCycleMapper.java @@ -55,4 +55,12 @@ public interface EntDeviceInsCycleMapper extends BaseMapper { * @return 周期巡检 * */ EntDeviceInsCycle selectByDeviceId(String deviceId); + + + /** + * 删除周期巡检 + * @param deviceInspectionCycleId 周期巡检id + * @return int + * */ + int updateDelState(String deviceInspectionCycleId); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java index 9503c4b..d997b40 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java @@ -35,5 +35,11 @@ public interface EntDeviceMaintenancePlanMapper extends BaseMapperselectEntDeviceMaintenanceRecord(String deviceId); + /** + * 设备保养记录软删除 + * @param deviceEntInsRecordId + * @return int + * */ + int updateDelState(String deviceEntInsRecordId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java index f8609b7..6d45d00 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMapper.java @@ -22,9 +22,10 @@ public interface EntDeviceMapper extends BaseMapper { * 查询企业设备表 * @param enterpriseId 企业id * @param typeId 设备类型id + * @param keyWord 关键字 * @return list * */ - ListselectEntEquipmentList(@Param("enterpriseId") String enterpriseId,@Param("typeId") String typeId); + ListselectEntEquipmentList(@Param("enterpriseId") String enterpriseId,@Param("typeId") String typeId,@Param("keyWord") String keyWord); /** @@ -62,4 +63,19 @@ public interface EntDeviceMapper extends BaseMapper { * */ List selectEntEquipmentOverdue(String enterpriseId); + + /** + * 软删除设备 + * @param deviceId 设备id + * @return int + * */ + int updateDelState(String deviceId); + + /** + * 小程序企业设备 + * @param modelState 设备状态 + * @return int + * */ + ListmobileEntDevice(String modelState); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntEmExpertMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntEmExpertMapper.java index 0d398b4..ad48d15 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntEmExpertMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntEmExpertMapper.java @@ -24,10 +24,11 @@ public interface EntEmExpertMapper extends BaseMapper { * @param enterpriseId 企业id * @param entEmExpertClass 企业应急专家领域 * @param entEmExpertCategory 企业应急专家分类 + * @param name 专家名 * @return list * */ ListselectEntEmExpertList(@Param("enterpriseId") String enterpriseId, @Param("entEmExpertClass")String entEmExpertClass, - @Param("entEmExpertCategory") String entEmExpertCategory); + @Param("entEmExpertCategory") String entEmExpertCategory,@Param("name") String name); /** * 企业应急专家修改 diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java index 56675ad..4a5eb78 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntInsRecordMapper.java @@ -35,5 +35,12 @@ public interface EntInsRecordMapper extends BaseMapper { * */ List selectInspectionRecord(@Param("deviceId") String deviceId,@Param("inspectionRecordName") String inspectionRecordName); + /** + * 软删除巡检记录 + * @param deviceEntInsRecordId 巡检记录主键 + * @return int + * */ + int updateDelState(String deviceEntInsRecordId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntInspectionRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntInspectionRecordMapper.java index 152287c..b0bff11 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntInspectionRecordMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntInspectionRecordMapper.java @@ -36,4 +36,12 @@ public interface EntInspectionRecordMapper extends BaseMapper + * 企业履职记录 + Mapper 接口 + *

+ * + * @author + * @since 2022-12-08 + */ +@Repository +public interface EntPostListDetailMapper extends BaseMapper { + + /** + * 查询用户履职 + * @param postListId 岗位清单id + * @param userId 用户id + * @return list + * */ + List selectListDetail(@Param("postListId") String postListId,@Param("userId") String userId); + +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java index 29913db..0354a69 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostListMapper.java @@ -61,4 +61,12 @@ public interface EntPostListMapper extends BaseMapper { * @return int 企业清单(类型) */ ListselectEntListGroupByListId(@Param("enterpriseId") String enterpriseId,@Param("listId")String listId,@Param("userId")String userId); + + + /** + * 删除企业用户岗位清单 + * @param entUserId 用户id + * @return int + */ + Integer deleteEntPostList(String entUserId); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java index 4f4c776..0af2edd 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java @@ -73,4 +73,11 @@ public interface EntPostTaskMapper extends BaseMapper { * */ int insertList(@Param("entTasks") List entTasks); + + /** + * 删除企业岗位任务 + * @return int + * @param userId 用户id + * */ + int deleteEntPostTaskList(String userId); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairPlanMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairPlanMapper.java index 7245b4d..20b7b0a 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairPlanMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairPlanMapper.java @@ -33,4 +33,11 @@ public interface EntRepairPlanMapper extends BaseMapper { * */ int updateRepairPlan(@Param("data") EntRepairPlan entRepairPlan); + /** + * 软删除维修计划 + * @param repairPlanId 企业维修计划主键 + * @return int + * */ + int updateDelState(@Param("repairPlanId")String repairPlanId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java index c56167b..c50fd08 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java @@ -32,4 +32,11 @@ public interface EntRepairRecordMapper extends BaseMapper { * */ int repairRecordUpdate(EntRepairRecord entRepairRecord); + /** + * 软删除维修记录 + * @param repairRecordId + * @return int + * */ + int updateDelState(String repairRecordId ); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java index 1c09867..390f115 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntReportRepairMapper.java @@ -33,4 +33,11 @@ public interface EntReportRepairMapper extends BaseMapper { int updateReportRecord(@Param("data") EntReportRepair entReportRepair); + /** + * 软删除报修列表 + * @return int + * @param reportRepairId 报修对象ID + * */ + int updateDelState(String reportRepairId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntUserCredentialMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntUserCredentialMapper.java index 89839cb..5d60a11 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntUserCredentialMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntUserCredentialMapper.java @@ -53,4 +53,12 @@ public interface EntUserCredentialMapper extends BaseMapper { * */ int entUserCredentialDelete(@Param("credentialId") String credentialId); + + /** + * 企业用户证件照删除 + * @param userId 企业用户id + * @return int + * */ + int delEntUserCredential(@Param("userId")String userId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/NoticeMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/NoticeMapper.java index 558837c..380f50c 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/NoticeMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/NoticeMapper.java @@ -45,4 +45,32 @@ public interface NoticeMapper { /*接收文件下达*/ List receiveList(@Param("companyId") String companyId, @Param("entId") String entId); + + /** + * 通知消息 + * @date 2022/11/29 + * @param userId 用户id + * @param type 通知消息 + * @return list + * */ + ListselectNotices(@Param("type") String type,@Param("userId") String userId); + + + /** + * 通知消息已读未读数量 + * @param userId 用户id + * @date 2022/11/30 + * @return notice + * */ + Notice selectEntNoticeNumber(String userId); + + + + /** + * 一键已读 + * @param userId 用户id + * @date 2022/12/2 + * @return int + * */ + int oneButtonRead(String userId); } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java b/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java index 7215b37..3886671 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntDevice.java @@ -158,6 +158,18 @@ public class EntDevice implements Serializable { @TableField(exist = false) private EntDeviceType deviceType; + @ApiModelProperty("巡检人名") + @TableField(exist = false) + private String insRecordPerson; + + public String getInsRecordPerson() { + return insRecordPerson; + } + + public void setInsRecordPerson(String insRecordPerson) { + this.insRecordPerson = insRecordPerson; + } + public EntDeviceType getDeviceType() { return deviceType; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntEmExpert.java b/inventory-dao/src/main/java/com/rzyc/model/EntEmExpert.java index 339ee30..931778c 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntEmExpert.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntEmExpert.java @@ -73,6 +73,17 @@ public class EntEmExpert implements Serializable { @TableField("modify_time") private Date modifyTime; + @TableField("ent_em_work_unit") + private String entEmWorkUnit; + + public String getEntEmWorkUnit() { + return entEmWorkUnit; + } + + public void setEntEmWorkUnit(String entEmWorkUnit) { + this.entEmWorkUnit = entEmWorkUnit; + } + public Integer getAge() { return age; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java b/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java new file mode 100644 index 0000000..fe15075 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java @@ -0,0 +1,252 @@ +package com.rzyc.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + *

+ * 企业履职记录 + + *

+ * + * @author + * @since 2022-12-08 + */ +@TableName("ent_post_list_detail") +@ApiModel(value="EntPostListDetail对象", description="企业履职记录") +public class EntPostListDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "履职记录id") + @TableId("ListDetailId") + private String ListDetailId; + + @ApiModelProperty(value = "履职清单id") + @TableField("ListFactorId") + private String ListFactorId; + + @ApiModelProperty(value = "用户id") + @TableField("SysUserId") + private String SysUserId; + + @ApiModelProperty(value = "工作摘要") + @TableField("WorkTitle") + private String WorkTitle; + + @ApiModelProperty(value = "清单内容") + @TableField("WorkCnt") + private String WorkCnt; + + @TableField("WorkFile") + private String WorkFile; + + @ApiModelProperty(value = "开始时间") + @TableField("StartTime") + private Date StartTime; + + @ApiModelProperty(value = "结束时间") + @TableField("EndTime") + private Date EndTime; + + @TableField("OTCType") + private String OTCType; + + @TableField("OTCId") + private String OTCId; + + @ApiModelProperty(value = "企业id") + @TableField("enterprise_id") + private String enterpriseId; + + @ApiModelProperty(value = "任务id") + @TableField("ent_post_task_id") + private String entPostTaskId; + + @TableField("IsFinish") + private String IsFinish; + + @ApiModelProperty(value = "完成时间") + @TableField("FinishTime") + private Date FinishTime; + + @ApiModelProperty(value = "删除状态 1:正常 2:已删除") + @TableField("del_state") + private Integer delState; + + @TableField("CreatedOn") + private Date CreatedOn; + + @TableField("CreatedBy") + private String CreatedBy; + + @TableField("ModifiedOn") + private Date ModifiedOn; + + @TableField("ModifiedBy") + private String ModifiedBy; + + public String getListDetailId() { + return ListDetailId; + } + + public void setListDetailId(String ListDetailId) { + this.ListDetailId = ListDetailId; + } + public String getListFactorId() { + return ListFactorId; + } + + public void setListFactorId(String ListFactorId) { + this.ListFactorId = ListFactorId; + } + public String getSysUserId() { + return SysUserId; + } + + public void setSysUserId(String SysUserId) { + this.SysUserId = SysUserId; + } + public String getWorkTitle() { + return WorkTitle; + } + + public void setWorkTitle(String WorkTitle) { + this.WorkTitle = WorkTitle; + } + public String getWorkCnt() { + return WorkCnt; + } + + public void setWorkCnt(String WorkCnt) { + this.WorkCnt = WorkCnt; + } + public String getWorkFile() { + return WorkFile; + } + + public void setWorkFile(String WorkFile) { + this.WorkFile = WorkFile; + } + public Date getStartTime() { + return StartTime; + } + + public void setStartTime(Date StartTime) { + this.StartTime = StartTime; + } + public Date getEndTime() { + return EndTime; + } + + public void setEndTime(Date EndTime) { + this.EndTime = EndTime; + } + public String getOTCType() { + return OTCType; + } + + public void setOTCType(String OTCType) { + this.OTCType = OTCType; + } + public String getOTCId() { + return OTCId; + } + + public void setOTCId(String OTCId) { + this.OTCId = OTCId; + } + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + public String getEntPostTaskId() { + return entPostTaskId; + } + + public void setEntPostTaskId(String entPostTaskId) { + this.entPostTaskId = entPostTaskId; + } + public String getIsFinish() { + return IsFinish; + } + + public void setIsFinish(String IsFinish) { + this.IsFinish = IsFinish; + } + public Date getFinishTime() { + return FinishTime; + } + + public void setFinishTime(Date FinishTime) { + this.FinishTime = FinishTime; + } + public Integer getDelState() { + return delState; + } + + public void setDelState(Integer delState) { + this.delState = delState; + } + public Date getCreatedOn() { + return CreatedOn; + } + + public void setCreatedOn(Date CreatedOn) { + this.CreatedOn = CreatedOn; + } + public String getCreatedBy() { + return CreatedBy; + } + + public void setCreatedBy(String CreatedBy) { + this.CreatedBy = CreatedBy; + } + public Date getModifiedOn() { + return ModifiedOn; + } + + public void setModifiedOn(Date ModifiedOn) { + this.ModifiedOn = ModifiedOn; + } + public String getModifiedBy() { + return ModifiedBy; + } + + public void setModifiedBy(String ModifiedBy) { + this.ModifiedBy = ModifiedBy; + } + + @Override + public String toString() { + return "EntPostListDetail{" + + "ListDetailId=" + ListDetailId + + ", ListFactorId=" + ListFactorId + + ", SysUserId=" + SysUserId + + ", WorkTitle=" + WorkTitle + + ", WorkCnt=" + WorkCnt + + ", WorkFile=" + WorkFile + + ", StartTime=" + StartTime + + ", EndTime=" + EndTime + + ", OTCType=" + OTCType + + ", OTCId=" + OTCId + + ", enterpriseId=" + enterpriseId + + ", entPostTaskId=" + entPostTaskId + + ", IsFinish=" + IsFinish + + ", FinishTime=" + FinishTime + + ", delState=" + delState + + ", CreatedOn=" + CreatedOn + + ", CreatedBy=" + CreatedBy + + ", ModifiedOn=" + ModifiedOn + + ", ModifiedBy=" + ModifiedBy + + "}"; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/Notice.java b/inventory-dao/src/main/java/com/rzyc/model/Notice.java index 5889083..1c810e6 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/Notice.java +++ b/inventory-dao/src/main/java/com/rzyc/model/Notice.java @@ -1,5 +1,6 @@ package com.rzyc.model; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -57,8 +58,41 @@ public class Notice implements Serializable { @ApiModelProperty("查看记录") private List records; + @TableField(exist = false) + private Long total; + + @TableField(exist = false) + private Long read; + + @TableField(exist = false) + private Long unread; + private static final long serialVersionUID = 1L; + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public Long getRead() { + return read; + } + + public void setRead(Long read) { + this.read = read; + } + + public Long getUnread() { + return unread; + } + + public void setUnread(Long unread) { + this.unread = unread; + } + public Integer getDownloadNum() { return downloadNum; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java new file mode 100644 index 0000000..6647e99 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java @@ -0,0 +1,178 @@ +package com.rzyc.model.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + + +/** + * 企业履职记录dto + * @author Xuwanxin + * @date 2022/12/8 + * */ +public class EntPostListDetailDto { + + @ApiModelProperty(value = "履职记录id") + private String ListDetailId; + + @ApiModelProperty(value = "履职清单id") + private String ListFactorId; + + @ApiModelProperty(value = "用户id") + private String SysUserId; + + @ApiModelProperty(value = "工作摘要") + private String WorkTitle; + + @ApiModelProperty(value = "清单内容") + private String WorkCnt; + + private String WorkFile; + + @ApiModelProperty(value = "开始时间") + private Date StartTime; + + @ApiModelProperty(value = "结束时间") + private Date EndTime; + + + private String OTCType; + + private String OTCId; + + @ApiModelProperty(value = "企业id") + private String enterpriseId; + + @ApiModelProperty(value = "任务id") + private String entPostTaskId; + + private String IsFinish; + + @ApiModelProperty(value = "完成时间") + private Date FinishTime; + + @ApiModelProperty(value = "删除状态 1:正常 2:已删除") + private Integer delState; + + public String getListDetailId() { + return ListDetailId; + } + + public void setListDetailId(String listDetailId) { + ListDetailId = listDetailId; + } + + public String getListFactorId() { + return ListFactorId; + } + + public void setListFactorId(String listFactorId) { + ListFactorId = listFactorId; + } + + public String getSysUserId() { + return SysUserId; + } + + public void setSysUserId(String sysUserId) { + SysUserId = sysUserId; + } + + public String getWorkTitle() { + return WorkTitle; + } + + public void setWorkTitle(String workTitle) { + WorkTitle = workTitle; + } + + public String getWorkCnt() { + return WorkCnt; + } + + public void setWorkCnt(String workCnt) { + WorkCnt = workCnt; + } + + public String getWorkFile() { + return WorkFile; + } + + public void setWorkFile(String workFile) { + WorkFile = workFile; + } + + public Date getStartTime() { + return StartTime; + } + + public void setStartTime(Date startTime) { + StartTime = startTime; + } + + public Date getEndTime() { + return EndTime; + } + + public void setEndTime(Date endTime) { + EndTime = endTime; + } + + public String getOTCType() { + return OTCType; + } + + public void setOTCType(String OTCType) { + this.OTCType = OTCType; + } + + public String getOTCId() { + return OTCId; + } + + public void setOTCId(String OTCId) { + this.OTCId = OTCId; + } + + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEntPostTaskId() { + return entPostTaskId; + } + + public void setEntPostTaskId(String entPostTaskId) { + this.entPostTaskId = entPostTaskId; + } + + public String getIsFinish() { + return IsFinish; + } + + public void setIsFinish(String isFinish) { + IsFinish = isFinish; + } + + public Date getFinishTime() { + return FinishTime; + } + + public void setFinishTime(Date finishTime) { + FinishTime = finishTime; + } + + public Integer getDelState() { + return delState; + } + + public void setDelState(Integer delState) { + this.delState = delState; + } +} diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml index 28b7a7d..23ac795 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceInsCycleMapper.xml @@ -30,7 +30,7 @@ + + update ent_device_ins_cycle set del_state = 2 where inspection_id = #{deviceInspectionCycleId} + + + diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml index 78265b5..7246a0f 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenancePlanMapper.xml @@ -34,6 +34,10 @@ + + + update ent_device_maintenance_plan set del_state = 2 where maintenance_plan_id = #{maintenancePlanId} + diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMaintenanceRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenanceRecordMapper.xml index 78c2674..51b4f46 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceMaintenanceRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMaintenanceRecordMapper.xml @@ -21,6 +21,7 @@ + @@ -31,11 +32,18 @@ update ent_device_maintenance_record set maintenance_status = #{data.maintenanceStatus} , maintenance_level = #{data.maintenanceLevel}, start_time = #{data.startTime},ent_time = #{data.entTime},maintenance_time_hour = #{data.maintenanceTimeHour}, maintenance_time_minute = #{data.maintenanceTimeMinute},maintenance_cost = #{data.maintenanceCost},shutdown_or_not = #{shutdownOrNot},down_time = #{data.downTime},maintenance_charge_person = #{data.maintenanceChargePerson}, - maintenance_requirement = #{data.maintenanceRequirement},job_description = #{data.jobDescription},modify_by = #{data.modifyBy},modify_time = #{modifyTime} + maintenance_requirement = #{data.maintenanceRequirement},job_description = #{data.jobDescription},modify_by = #{data.modifyBy},modify_time = #{data.modifyTime} where record_id = #{data.recordId} + + + update ent_device_maintenance_record set del_state = 2 where record_id = #{deviceEntInsRecordId} + diff --git a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml index 79026d0..86c1b26 100644 --- a/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml @@ -28,10 +28,15 @@ @@ -72,19 +77,38 @@ + + + + + + + + + + update ent_device set type_path = #{entDevice.typePath},enterprise_id = #{entDevice.enterpriseId},qr_code = #{entDevice.qrCode},installation_time = #{entDevice.installationTime}, enable_time = #{entDevice.enableTime},scrap_time = #{entDevice.scrapTime},factory_number = #{entDevice.factoryNumber},longitude = #{entDevice.longitude},latitude = #{entDevice.latitude}, @@ -95,4 +119,8 @@ update ent_device set overdue_inspection = #{overdueState} where device_id = #{deviceId} + + + update ent_device set del_state = 2 where device_id = #{deviceId} + diff --git a/inventory-dao/src/main/resources/mapper/EntEmExpertMapper.xml b/inventory-dao/src/main/resources/mapper/EntEmExpertMapper.xml index 0b19191..1beaf04 100644 --- a/inventory-dao/src/main/resources/mapper/EntEmExpertMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntEmExpertMapper.xml @@ -33,6 +33,9 @@ and ent_em_expert_category like concat('%',#{entEmExpertCategory},'%') + + and ent_em_expert_name like concat('%',#{name},'%') + diff --git a/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml index 8e6a058..303fa66 100644 --- a/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntInsRecordMapper.xml @@ -32,10 +32,14 @@ + + update ent_ins_record set del_state = 2 where ins_record_id = #{deviceEntInsRecordId} + + diff --git a/inventory-dao/src/main/resources/mapper/EntInspectionRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntInspectionRecordMapper.xml index 1f117d7..ddff198 100644 --- a/inventory-dao/src/main/resources/mapper/EntInspectionRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntInspectionRecordMapper.xml @@ -5,7 +5,6 @@ - @@ -15,26 +14,37 @@ + - inspection_id, inspection_device_id, inspection_organization, inspection_user_id, inspection_time, inspection_state, inspection_text, create_by, create_time, modify_by, modify_time + inspection_id, inspection_organization, inspection_user_id, inspection_time, inspection_state, inspection_text, create_by, create_time, modify_by, modify_time - update ent_inspection_record set inspection_device_id = #{data.inspectionDeviceId}, inspection_organization = #{data.inspectionOrganization},inspection_user_id = #{data.inspectionUserId}, + update ent_inspection_record set device_id = #{data.deviceId}, inspection_organization = #{data.inspectionOrganization},inspection_user_id = #{data.inspectionUserId}, inspection_time = #{data.inspectionTime},inspection_state = #{data.inspectionState},inspection_text = #{data.inspectionText},modify_by = #{data.modifyBy},modify_time = #{data.modifyTime} + where inspection_id = #{data.inspectionId} + + update ent_inspection_record set del_state = 2 where inspection_id = #{data.inspectionId} + + + + diff --git a/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml b/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml index f543417..87025cd 100644 --- a/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntOperatingInstructionMapper.xml @@ -17,9 +17,13 @@ op_instruction_id, op_instruction_name, op_instruction_description, create_by, create_time, modify_by, modify_time + + update ent_operating_instruction set del_state = 2 where op_instruction_id = #{opInstructionId} + + select * from ent_post_list_detail where SysUserId = #{userId} + + and ListFactorId = #{postListId} + + + + diff --git a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml index d3a5518..783108b 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml @@ -32,6 +32,10 @@ post_list_id, post_id, ent_user_id, enterprise_id, ent_list_id, list_id, item_title, item_content, sort_id, year_num, standard, frequency, finish_state, red_alert, yellow_alert, del_state, create_time, create_by, modify_time, modify_by + + delete from ent_post_list where ent_user_id = #{entUserId} + + select * from ent_post_task where enterprise_id = #{enterpriseId} diff --git a/inventory-dao/src/main/resources/mapper/EntRepairPlanMapper.xml b/inventory-dao/src/main/resources/mapper/EntRepairPlanMapper.xml index 517c3c5..3e42f97 100644 --- a/inventory-dao/src/main/resources/mapper/EntRepairPlanMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntRepairPlanMapper.xml @@ -23,7 +23,7 @@ @@ -32,4 +32,8 @@ + + update ent_repair_plan set del_state = 2 where repair_plan_id = #{repairPlanId} + + diff --git a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml index 9791be0..e3b09a8 100644 --- a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml @@ -32,7 +32,7 @@ @@ -40,4 +40,8 @@ where repair_record_id = #{repairRecordId} + + update ent_repair_record set del_state = 2 where repair_record_id = #{repairRecordId} + + diff --git a/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml b/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml index 451d52f..3c0aa15 100644 --- a/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntReportRepairMapper.xml @@ -14,6 +14,7 @@ + @@ -22,7 +23,8 @@ @@ -33,4 +35,8 @@ where report_repair_id = #{data.reportRepairId} + + update ent_report_repair set del_state = 2 where report_repair_id = #{reportRepairId} + + diff --git a/inventory-dao/src/main/resources/mapper/EntUserCredentialMapper.xml b/inventory-dao/src/main/resources/mapper/EntUserCredentialMapper.xml index 75ce61b..6f1aff2 100644 --- a/inventory-dao/src/main/resources/mapper/EntUserCredentialMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntUserCredentialMapper.xml @@ -51,4 +51,8 @@ delete from ent_user_credential where credential_id = #{credentialId} + + delete from ent_user_credential where ent_user_id = #{userId} + + diff --git a/inventory-dao/src/main/resources/mapper/NoticeMapper.xml b/inventory-dao/src/main/resources/mapper/NoticeMapper.xml index ac920ac..3835dd4 100644 --- a/inventory-dao/src/main/resources/mapper/NoticeMapper.xml +++ b/inventory-dao/src/main/resources/mapper/NoticeMapper.xml @@ -289,7 +289,11 @@ update notice set read_state = 1 where checkUserId = #{checkUserId} - + + update notice set read_state = 1 where checkUserId = #{userId} + + + insert into notice (id, title, checkUserId, companyId, content, read_state, @@ -327,4 +331,29 @@ AND nt.`type` = 7 ORDER BY nt.`create_time` DESC + + + + + + + + + + + diff --git a/inventory-ent/src/main/java/com/rzyc/advice/Swagger2Config.java b/inventory-ent/src/main/java/com/rzyc/advice/Swagger2Config.java index 92c4c1d..c5009b3 100644 --- a/inventory-ent/src/main/java/com/rzyc/advice/Swagger2Config.java +++ b/inventory-ent/src/main/java/com/rzyc/advice/Swagger2Config.java @@ -51,7 +51,6 @@ public class Swagger2Config { //标题 .title("PROJECT API") .description("通过访问swagger-ui.html,实现接口测试、文档生成") - .termsOfServiceUrl("http://121.40.106.103:8030/pzh") //设置联系方式 .version("1.0") .build(); diff --git a/inventory-ent/src/main/java/com/rzyc/config/RedisUtil.java b/inventory-ent/src/main/java/com/rzyc/config/RedisUtil.java index 91bfdad..1858b1a 100644 --- a/inventory-ent/src/main/java/com/rzyc/config/RedisUtil.java +++ b/inventory-ent/src/main/java/com/rzyc/config/RedisUtil.java @@ -138,7 +138,7 @@ public class RedisUtil { * 普通缓存放入并设置时间 * @param key 键 * @param value 值 - * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置默认8小时 * @return true成功 false 失败 */ diff --git a/inventory-ent/src/main/java/com/rzyc/config/Test.java b/inventory-ent/src/main/java/com/rzyc/config/TestEncryptor.java similarity index 98% rename from inventory-ent/src/main/java/com/rzyc/config/Test.java rename to inventory-ent/src/main/java/com/rzyc/config/TestEncryptor.java index 1720896..42d4f5e 100644 --- a/inventory-ent/src/main/java/com/rzyc/config/Test.java +++ b/inventory-ent/src/main/java/com/rzyc/config/TestEncryptor.java @@ -5,7 +5,7 @@ import org.jasypt.encryption.pbe.config.EnvironmentPBEConfig; import javax.validation.constraints.NotNull; -public class Test { +public class TestEncryptor { @NotNull private String a; diff --git a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java index d32fac3..63d14cf 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java @@ -547,6 +547,9 @@ public class BaseController { @Autowired protected EntEmRehearsalMapper entEmRehearsalMapper; + @Autowired + protected EntPostListDetailMapper entPostListDetailMapper; + /** * 新都文件地址处理 diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EmergencyEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EmergencyEquipmentController.java index f212435..8febfb3 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EmergencyEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EmergencyEquipmentController.java @@ -96,6 +96,7 @@ public class EmergencyEquipmentController { @ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"), @ApiImplicitParam(name = "page", value = "page",required = true, dataType = "string"), @ApiImplicitParam(name = "pageSize", value = "page",required = true, dataType = "string"), + @ApiImplicitParam(name = "name", value = "专家名",required = false, dataType = "string"), @ApiImplicitParam(name = "entEmExpertClass", value = "entEmExpertClass",required = false, dataType = "string"), @ApiImplicitParam(name = "entEmExpertCategory", value = "entEmExpertCategory",required = false, dataType = "string"), }) @@ -104,8 +105,9 @@ public class EmergencyEquipmentController { @RequestParam(required = true)Integer page, @RequestParam(required = true)Integer pageSize, String entEmExpertClass, - String entEmExpertCategory)throws Exception{ - return pcBusinessService.entEmExpertList(enterpriseId,page,pageSize,entEmExpertClass,entEmExpertCategory); + String entEmExpertCategory, + String name)throws Exception{ + return pcBusinessService.entEmExpertList(enterpriseId,page,pageSize,entEmExpertClass,entEmExpertCategory,name); } diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java index e151688..9629a2e 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java @@ -5,6 +5,7 @@ import com.common.utils.model.SingleResult; import com.rzyc.config.MethodAnnotation; import com.rzyc.model.*; import com.rzyc.model.dto.*; +import com.rzyc.service.MobileBusinessService; import com.rzyc.service.PcBusinessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -31,9 +32,12 @@ public class EnterpriseEquipmentController extends BaseController { PcBusinessService pcBusinessService; + MobileBusinessService mobileBusinessService; - public EnterpriseEquipmentController(PcBusinessService pcBusinessService) { + + public EnterpriseEquipmentController(PcBusinessService pcBusinessService,MobileBusinessService mobileBusinessService) { + this.mobileBusinessService = mobileBusinessService; this.pcBusinessService = pcBusinessService; } @@ -68,14 +72,15 @@ public class EnterpriseEquipmentController extends BaseController { @ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"), @ApiImplicitParam(name = "typeId", value = "设备类型id", required = false, dataType = "string"), @ApiImplicitParam(name = "page", value = "page", required = true, dataType = "string"), - @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "string") + @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "string"), + @ApiImplicitParam(name = "keyWord", value = "关键字", required = false, dataType = "string") }) @GetMapping(value = "/entEquipmentList") @PreAuthorize("hasAnyAuthority('entEquipmentList','entEquipmentList:update')") @MethodAnnotation(authorizations = {"entEquipmentList","entEquipmentList:update"},name = "企业设备列表") @ResponseBody - public SingleResult> entEquipmentList(@RequestParam(required = true) String enterpriseId, String typeId,Integer page,Integer pageSize)throws Exception{ - return pcBusinessService.entEquipmentList(enterpriseId,typeId,page,pageSize); + public SingleResult> entEquipmentList(@RequestParam(required = true) String enterpriseId, String typeId,Integer page,Integer pageSize,String keyWord)throws Exception{ + return pcBusinessService.entEquipmentList(enterpriseId,typeId,page,pageSize,keyWord); } @@ -313,7 +318,7 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')") @MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录") @ResponseBody - public SingleResult> inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,Integer page,Integer pageSize,String deviceId)throws Exception { + public SingleResult> inspectionRecord(String startTime, String endTime,Integer page,Integer pageSize,String deviceId)throws Exception { return pcBusinessService.inspectionRecord(startTime, endTime, page, pageSize,deviceId); } @@ -439,8 +444,8 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('operatingInstructions','operatingInstructions:update')") @MethodAnnotation(authorizations = {"operatingInstructions","operatingInstructions:update"},name = "操作规程") @ResponseBody - public SingleResult operatingInstructions(@RequestBody OperatingInstructionDto operatingInstructionDto)throws Exception{ - return pcBusinessService.operatingInstructions(operatingInstructionDto); + public SingleResult operatingInstructions(String name,String deviceId,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.operatingInstructions(name,deviceId,page,pageSize); } /** @@ -457,6 +462,20 @@ public class EnterpriseEquipmentController extends BaseController { } + + /** + *删除操作规程 + * @throws Exception + * */ + @ApiOperation(value = "删除操作规程", notes = "删除操作规程") + @PostMapping(value = "/delStateOperatingInstruction") + @PreAuthorize("hasAnyAuthority('operatingInstructions:delete')") + @MethodAnnotation(authorizations = {"operatingInstructions:delete"},name = "删除操作规程") + @ResponseBody + public SingleResult delStateOperatingInstruction(String opInstructionId)throws Exception{ + return pcBusinessService.delStateOperatingInstruction(opInstructionId); + } + /** * 企业设备过期列表 * @return Data @@ -475,6 +494,155 @@ public class EnterpriseEquipmentController extends BaseController { } + /** + * 企业设备删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备删除", notes = "企业设备删除") + @PostMapping(value = "/entDeviceDelete") + @PreAuthorize("hasAnyAuthority('entDevice:delete')") + @MethodAnnotation(authorizations = {"entDevice:delete"},name = "企业设备删除") + @ResponseBody + public SingleResult entDeviceDelete(@RequestParam(required = true) String deviceId)throws Exception{ + return pcBusinessService.entDeviceDelete(deviceId); + } + + /** + * 企业设备周期巡检删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备周期巡检删除", notes = "企业设备周期巡检删除") + @PostMapping(value = "/deviceInspectionCycleDelete") + @PreAuthorize("hasAnyAuthority('deviceInspectionCycle:delete')") + @MethodAnnotation(authorizations = {"deviceInspectionCycle:delete"},name = "企业设备周期巡检删除") + @ResponseBody + public SingleResult deviceInspectionCycleDelete(@RequestParam(required = true) String deviceInspectionCycleId)throws Exception{ + return pcBusinessService.deviceInspectionCycleDelete(deviceInspectionCycleId); + } + + + /** + * 企业设备巡检记录删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备巡检记录删除", notes = "企业设备巡检记录删除") + @PostMapping(value = "/deviceEntInsRecordDelete") + @PreAuthorize("hasAnyAuthority('deviceEntInsRecord:delete')") + @MethodAnnotation(authorizations = {"deviceEntInsRecord:delete"},name = "企业设备巡检记录删除") + @ResponseBody + public SingleResult deviceEntInsRecordDelete(@RequestParam(required = true) String deviceEntInsRecordId)throws Exception{ + return pcBusinessService.deviceEntInsRecordDelete(deviceEntInsRecordId); + } + + /** + * 企业设备保养计划删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备保养计划删除", notes = "企业设备保养计划删除") + @PostMapping(value = "/entDeviceMaintenancePlanDelete") + @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan:delete')") + @MethodAnnotation(authorizations = {"entDeviceMaintenancePlan:delete"},name = "企业设备保养计划删除") + @ResponseBody + public SingleResult entDeviceMaintenancePlanDelete(@RequestParam(required = true) String deviceEntInsPlanId)throws Exception{ + return pcBusinessService.entDeviceMaintenancePlanDelete(deviceEntInsPlanId); + } + + + + /** + * 企业设备保养记录删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备保养记录删除", notes = "企业设备保养记录删除") + @PostMapping(value = "/entDeviceMaintenanceRecordDelete") + @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord:delete')") + @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord:delete"},name = "企业设备保养记录删除") + @ResponseBody + public SingleResult entDeviceMaintenanceRecordDelete(@RequestParam(required = true) String deviceEntInsRecordId)throws Exception{ + return pcBusinessService.entDeviceMaintenanceRecordDelete(deviceEntInsRecordId); + } + + /** + * 企业设备送检记录删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备送检记录删除", notes = "企业设备送检记录删除") + @PostMapping(value = "/entDeviceEntInspectionRecordDelete") + @PreAuthorize("hasAnyAuthority('entDeviceEntInspectionRecord:delete')") + @MethodAnnotation(authorizations = {"entDeviceEntInspectionRecord:delete"},name = "企业设备送检记录删除") + @ResponseBody + public SingleResult entDeviceEntInspectionRecordDelete(@RequestParam(required = true) String deviceEntInspectionRecordId)throws Exception{ + return pcBusinessService.entDeviceEntInspectionRecordDelete(deviceEntInspectionRecordId); + } + + /** + * 企业设备维修计划删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备维修计划删除", notes = "企业设备维修计划删除") + @PostMapping(value = "/entDeviceRepairPlanDelete") + @PreAuthorize("hasAnyAuthority('entDeviceEntRepairPlan:delete')") + @MethodAnnotation(authorizations = {"entDeviceEntRepairPlan:delete"},name = "企业设备维修计划删除") + @ResponseBody + public SingleResult entDeviceRepairPlanDelete(@RequestParam(required = true) String repairPlanId)throws Exception{ + return pcBusinessService.entDeviceRepairPlanDelete(repairPlanId); + } + + + /** + * 企业设备维修记录删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备维修记录删除", notes = "企业设备维修记录删除") + @PostMapping(value = "/entDeviceRepairRecordDelete") + @PreAuthorize("hasAnyAuthority('entDeviceEntRepairRecord:delete')") + @MethodAnnotation(authorizations = {"entDeviceEntRepairRecord:delete"},name = "企业设备维修记录删除") + @ResponseBody + public SingleResult entDeviceRepairRecordDelete(@RequestParam(required = true) String repairRecordId)throws Exception{ + return pcBusinessService.entDeviceRepairRecordDelete(repairRecordId); + } + + /** + * 企业设备故障报修删除 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "企业设备故障报修删除", notes = "企业设备故障报修删除") + @PostMapping(value = "/entDeviceReportRepairDelete") + @PreAuthorize("hasAnyAuthority('entDeviceReportRepair:delete')") + @MethodAnnotation(authorizations = {"entDeviceReportRepair:delete"},name = "企业设备故障报修删除") + @ResponseBody + public SingleResult entDeviceReportRepairDelete(@RequestParam(required = true) String reportRepair)throws Exception{ + return pcBusinessService.entDeviceReportRepairDelete(reportRepair); + } + + + + /** + * 小程序-企业设备 + * @return Data + * @throws Exception + */ + @ApiOperation(value = "小程序-企业设备", notes = "小程序-企业设备") + @GetMapping(value = "/mobileEntDevice") + @PreAuthorize("hasAnyAuthority('mobileEntDevice')") + @MethodAnnotation(authorizations = {"mobileEntDevice"},name = "小程序-企业设备") + @ResponseBody + public SingleResult mobileEntDevice(String modelState,@RequestParam(required = true)Integer page,@RequestParam(required = true)Integer pageSize)throws Exception{ + return mobileBusinessService.mobileEntDevice(modelState,page,pageSize); + } + + + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java index c7323fd..c5e8505 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java @@ -277,7 +277,7 @@ public class PersonalController extends BaseController{ @PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')") @MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表") @ResponseBody - public SingleResult> entUserCredential(@RequestParam(required = true) String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize,Integer credentialState,String enterpriseId)throws Exception{ + public SingleResult> entUserCredential(String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize,Integer credentialState,String enterpriseId)throws Exception{ return pcBusinessService.entUserCredential(enterpriseId,entUserId,page,pageSize,credentialState); } @@ -369,8 +369,6 @@ public class PersonalController extends BaseController{ - - /** * 新增和修改公司岗位人员 * @param addOrUpdateEntUserDto @@ -389,8 +387,6 @@ public class PersonalController extends BaseController{ - - /** * 手动企业分配任务 * @param listDto @@ -407,8 +403,34 @@ public class PersonalController extends BaseController{ return pcBusinessService.manualAssignmentTask(listDto); } + /** + * 手动企业添加履职记录 + * @param entPostListDetailDto 履职记录dto + * @return list + * @throws Exception + */ + @ApiOperation(value = "手动企业添加履职记录", notes = "手动企业添加履职记录") + @PostMapping(value = "/manualAddListDetail") + @PreAuthorize("hasAnyAuthority('entPostListDetail:update')") + @MethodAnnotation(authorizations = {"entPostListDetail:update"},name = "手动企业添加履职记录") + @ResponseBody + public SingleResult manualAddListDetail(@RequestBody EntPostListDetailDto entPostListDetailDto)throws Exception{ + return pcBusinessService.manualAddListDetail(entPostListDetailDto); + } + /** + * 查询履职记录列表 + * */ + @ApiOperation(value = "查询履职记录列表", notes = "查询履职记录列表") + @GetMapping(value = "/selectPostListDetail") + @PreAuthorize("hasAnyAuthority('entPostListDetail:update')") + @MethodAnnotation(authorizations = {"entPostListDetail:update"},name = "查询履职记录列表") + @ResponseBody + public SingleResult selectPostListDetail(String postListId,String userId)throws Exception{ + return pcBusinessService.selectPostListDetail(postListId,userId); + } + /** * 新增和修改公司岗位 @@ -466,7 +488,52 @@ public class PersonalController extends BaseController{ } + /** + * 消息通知接口 + * @return list + * @throws Exception + */ + @ApiOperation(value = "消息通知接口", notes = "消息通知接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "1.修改隐患 2.履职 3:系统通知 4:检查签名 5:履职提醒 7:文件下达",required = false, dataType = "string") + }) + @GetMapping(value = "/entNotice") + @PreAuthorize("hasAnyAuthority('entNotice')") + @MethodAnnotation(authorizations = {"entNotice"},name = "消息通知接口") + @ResponseBody + public SingleResult> notice(String type,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.notices(type,page,pageSize); + } + /** + * 消息一键已读 + * @return list + * @throws Exception + */ + @ApiOperation(value = "消息一键已读", notes = "消息一键已读") + @GetMapping(value = "/oneButtonRead") + @PreAuthorize("hasAnyAuthority('entNotice')") + @MethodAnnotation(authorizations = {"entNotice"},name = "消息一键已读") + @ResponseBody + public SingleResult oneButtonRead()throws Exception{ + return pcBusinessService.oneButtonRead(); + } + + + + /** + * 消息通知数量 + * @return list + * @throws Exception + */ + @ApiOperation(value = "消息通知数量", notes = "消息通知数量") + @GetMapping(value = "/entNoticeNumber") + @PreAuthorize("hasAnyAuthority('entNotice')") + @MethodAnnotation(authorizations = {"entNotice"},name = "消息通知数量") + @ResponseBody + public SingleResult entNoticeNumber()throws Exception{ + return pcBusinessService.entNoticeNumber(); + } diff --git a/inventory-ent/src/main/java/com/rzyc/service/AssignmentTaskThread.java b/inventory-ent/src/main/java/com/rzyc/service/AssignmentTaskThread.java new file mode 100644 index 0000000..d0a74c8 --- /dev/null +++ b/inventory-ent/src/main/java/com/rzyc/service/AssignmentTaskThread.java @@ -0,0 +1,372 @@ +package com.rzyc.service; + + +import com.common.utils.Constants; +import com.common.utils.DateUtils; +import com.common.utils.RandomNumber; +import com.common.utils.model.Code; +import com.common.utils.model.Message; +import com.common.utils.model.SingleResult; +import com.rzyc.bean.OaTaskTime; +import com.rzyc.controller.BaseController; +import com.rzyc.enums.DelState; +import com.rzyc.mapper.EntPostListMapper; +import com.rzyc.mapper.EntPostTaskMapper; +import com.rzyc.mapper.ent.EntUserMapper; +import com.rzyc.mapper.ent.InEntListMapper; +import com.rzyc.model.EntPostList; +import com.rzyc.model.EntPostTask; +import com.rzyc.model.dto.AddOrUpdateEntUserPostListDto; +import com.rzyc.model.ent.EntUser; +import com.rzyc.model.ent.InEntList; +import com.rzyc.model.user.SysUser; +import org.springframework.beans.BeanUtils; + +import java.util.*; + +/** + * 企业移动端业务 Service + * @author Xuwanxin + * @date 2022/12/8 + * */ +public class AssignmentTaskThread implements Runnable{ + + + private String entUser; + + private String enterpriseId; + + private String postId; + + private String createByUserId; + + private EntPostListMapper entPostListMapper; + + private EntPostTaskMapper entPostTaskMapper; + + private InEntListMapper inEntListMapper; + + private EntUserMapper entUserMapper; + + public AssignmentTaskThread(String entUser, String enterpriseId, String postId, EntPostListMapper entPostListMapper, EntPostTaskMapper entPostTaskMapper,InEntListMapper inEntListMapper,String createByUserId,EntUserMapper entUserMapper) { + this.entUser = entUser; + this.enterpriseId = enterpriseId; + this.postId = postId; + this.entPostListMapper = entPostListMapper; + this.entPostTaskMapper = entPostTaskMapper; + this.inEntListMapper = inEntListMapper; + this.createByUserId = createByUserId; + this.entUserMapper = entUserMapper; + } + + @Override + public void run() { + //插入清单和任务 + try { + autoAssignmentTask(entUser,enterpriseId,postId,createByUserId); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public void autoAssignmentTask(String userId,String enterpriseId,String postId,String createByUserId) throws Exception { + entPostListMapper.deleteEntPostList(userId); + entPostTaskMapper.deleteEntPostTaskList(userId); + List inEntLists = inEntListMapper.selectByEnterpriseId(enterpriseId); + for (InEntList ie:inEntLists) { + AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto = new AddOrUpdateEntUserPostListDto(); + addOrUpdateEntUserPostTaskDto.setEntUserId(userId); + addOrUpdateEntUserPostTaskDto.setEnterpriseId(enterpriseId); + addOrUpdateEntUserPostTaskDto.setPostId(postId); + addOrUpdateEntUserPostTaskDto.setEntListId(ie.getEntListId()); + addOrUpdateEntUserPostTaskDto.setFrequency(ie.getFrequency()); + addOrUpdateEntUserPostTaskDto.setItemContent(ie.getItemContent()); + addOrUpdateEntUserPostTaskDto.setItemTitle(ie.getItemTitle()); + addOrUpdateEntUserPostTaskDto.setListId(ie.getListId()); + addOrUpdateEntUserPostTaskDto.setStandard(ie.getStandard()); + insertListAndTask(addOrUpdateEntUserPostTaskDto,createByUserId); + } + } + + private SingleResult insertListAndTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto,String createByUserId) throws Exception { + EntPostList entPostList = new EntPostList(); + SingleResult singleResult = new SingleResult(); + BeanUtils.copyProperties(addOrUpdateEntUserPostTaskDto,entPostList); + entPostList.setCreateBy(createByUserId); + entPostList.setCreateTime(new Date()); + entPostList.setDelState(DelState.NOT_DEL.getState()); + entPostList.setPostListId(RandomNumber.getUUid()); + int result = entPostListMapper.insert(entPostList); + if (result != 1 ){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + //插入任务 + addFactorTask(entPostList,createByUserId); + return singleResult; + } + + /** + * 创建岗位任务 + * @param entPostList + * @throws Exception + */ + public void addFactorTask(EntPostList entPostList,String entUserId)throws Exception{ + //任务列表 + List entTasks = new ArrayList<>(); + if(1 == entPostList.getStandard()){ + entTasks = this.getYearTask(entPostList,entUserId); + }else if(2 == entPostList.getStandard()){ + entTasks = this.getHalfYearTask(entPostList,entUserId); + }else if(4 == entPostList.getStandard()){ + entTasks = this.getQuarterTask(entPostList,entUserId); + }else if(12 == entPostList.getStandard()){ + entTasks = this.getMonthTask(entPostList,entUserId); + } + if(null != entTasks && entTasks.size() > 0){ + entPostTaskMapper.insertList(entTasks); + } + } + + /** + * 获取年任务信息 + * @return + * @throws Exception + */ + private List getYearTask(EntPostList entPostList, String entUserId)throws Exception{ + List entPostTasks = new ArrayList<>(); + EntPostTask ept = new EntPostTask(); + EntUser entUser = entUserMapper.selectById(entUserId); + Integer year = Calendar.getInstance().get(Calendar.YEAR); + String startTime = year + "-01-01 00:00:01"; + String endTime = year + "-12-31 23:59:59"; + String subject = year+"年工作任务:"+entPostList.getItemTitle(); + ept.setItemTitle(subject); + ept.setFrequency(entPostList.getFrequency()); + ept.setTaskState(1); + ept.setEnterpriseId(entPostList.getEnterpriseId()); + ept.setItemContent(entPostList.getItemContent()); + ept.setPostId(entPostList.getPostId()); + ept.setEntUserId(entPostList.getEntUserId()); + ept.setListId(entPostList.getListId()); + ept.setPostListId(entPostList.getPostListId()); + ept.setEntListId(entPostList.getPostListId()); + ept.setTaskId(RandomNumber.getUUid()); + Date start = DateUtils.parseString2Date(startTime, Constants.DATA); + Date end = DateUtils.parseString2Date(endTime,Constants.DATA); + ept.setStartTime(start); + ept.setEntTime(end); + ept.setDelState(DelState.NOT_DEL.getState()); + ept.setCreateBy(entUser.getName()); + ept.setCreateTime(new Date()); + ept.setModifyBy(entUser.getName()); + ept.setModifyTime(new Date()); + entPostTasks.add(ept); + return entPostTasks; + } + + /** + * 获取半年任务信息 + * @return + * @throws Exception + */ + private List getHalfYearTask(EntPostList entPostList,String entUserId)throws Exception{ + List entPostTasks = new ArrayList<>(); + List taskTimes = this.getTaskTime(entPostList.getStandard()); + Integer year = Calendar.getInstance().get(Calendar.YEAR); + EntUser entUser = entUserMapper.selectById(entUserId); + for (OaTaskTime taskTime : taskTimes){ + EntPostTask ept = new EntPostTask(); + String subject = year+"年工作任务:"+entPostList.getItemTitle(); + ept.setItemTitle(subject); + ept.setFrequency(entPostList.getFrequency()); + ept.setTaskState(1); + ept.setEnterpriseId(entPostList.getEnterpriseId()); + ept.setItemContent(entPostList.getItemContent()); + ept.setPostId(entPostList.getPostId()); + ept.setEntUserId(entPostList.getEntUserId()); + ept.setListId(entPostList.getListId()); + ept.setPostListId(entPostList.getPostListId()); + ept.setEntListId(entPostList.getPostListId()); + ept.setTaskId(RandomNumber.getUUid()); + Date start = DateUtils.parseString2Date(taskTime.getStartTime(),Constants.DATA); + Date end = DateUtils.parseString2Date(taskTime.getEndTime(),Constants.DATA); + ept.setStartTime(start); + ept.setEntTime(end); + ept.setDelState(DelState.NOT_DEL.getState()); + ept.setCreateBy(entUser.getName()); + ept.setCreateTime(new Date()); + ept.setModifyBy(entUser.getName()); + ept.setModifyTime(new Date()); + entPostTasks.add(ept); + } + return entPostTasks; + } + + + /** + * 获取季度任务信息 + * @return + * @throws Exception + */ + private List getQuarterTask(EntPostList entPostList,String entUserId)throws Exception{ + List entPostTasks = new ArrayList<>(); + List taskTimes = this.getTaskTime(entPostList.getStandard()); + Integer year = Calendar.getInstance().get(Calendar.YEAR); + Integer index = 1; + for (OaTaskTime taskTime : taskTimes){ + EntPostTask ept = new EntPostTask(); + EntUser entUser = entUserMapper.selectById(entUserId); + String subject = year+"年第"+index+"季度工作任务::"+entPostList.getItemTitle(); + ept.setItemTitle(subject); + ept.setFrequency(entPostList.getFrequency()); + ept.setTaskState(1); + ept.setEnterpriseId(entPostList.getEnterpriseId()); + ept.setItemContent(entPostList.getItemContent()); + ept.setPostId(entPostList.getPostId()); + ept.setEntUserId(entPostList.getEntUserId()); + ept.setListId(entPostList.getListId()); + ept.setPostListId(entPostList.getPostListId()); + ept.setEntListId(entPostList.getPostListId()); + ept.setTaskId(RandomNumber.getUUid()); + Date start = DateUtils.parseString2Date(taskTime.getStartTime(),Constants.DATA); + Date end = DateUtils.parseString2Date(taskTime.getEndTime(),Constants.DATA); + ept.setStartTime(start); + ept.setEntTime(end); + ept.setDelState(DelState.NOT_DEL.getState()); + ept.setCreateBy(entUser.getName()); + ept.setCreateTime(new Date()); + ept.setModifyBy(entUser.getName()); + ept.setModifyTime(new Date()); + entPostTasks.add(ept); + index++; + } + return entPostTasks; + } + + + + /** + * 获取月任务信息 + * @return + * @throws Exception + */ + private List getMonthTask(EntPostList entPostList,String entUserId)throws Exception{ + List entPostTasks = new ArrayList<>(); + List taskTimes = this.getTaskTime(entPostList.getStandard()); + Integer year = Calendar.getInstance().get(Calendar.YEAR); + Integer index = 1; + for (OaTaskTime taskTime : taskTimes){ + EntPostTask ept = new EntPostTask(); + EntUser entUser = entUserMapper.selectById(entUserId); + String subject = year+"年第"+index+"月工作任务:"+entPostList.getFrequency(); + ept.setItemTitle(subject); + ept.setItemContent(entPostList.getItemContent()); + ept.setFrequency(entPostList.getFrequency()); + ept.setTaskState(1); + ept.setEnterpriseId(entPostList.getEnterpriseId()); + ept.setPostId(entPostList.getPostId()); + ept.setEntUserId(entPostList.getEntUserId()); + ept.setListId(entPostList.getListId()); + ept.setPostListId(entPostList.getPostListId()); + ept.setEntListId(entPostList.getPostListId()); + ept.setTaskId(RandomNumber.getUUid()); + Date start = DateUtils.parseString2Date(taskTime.getStartTime(),Constants.DATA); + Date end = DateUtils.parseString2Date(taskTime.getEndTime(),Constants.DATA); + ept.setStartTime(start); + ept.setEntTime(end); + ept.setDelState(DelState.NOT_DEL.getState()); + ept.setCreateBy(entUser.getName()); + ept.setCreateTime(new Date()); + ept.setModifyBy(entUser.getName()); + ept.setModifyTime(new Date()); + entPostTasks.add(ept); + index++; + } + return entPostTasks; + } + + /** + * 获取任务时间段 + * @param checkstandard + * @return + * @throws Exception + */ + private List getTaskTime(Integer checkstandard)throws Exception{ + List oaTaskTimes = new LinkedList<>(); + List months = new ArrayList<>(); + Integer year = Calendar.getInstance().get(Calendar.YEAR); + if(2 == checkstandard){ + months.add(1); + months.add(7); + for (Integer month : months){ + + Integer endMonth = month + 5; + Integer day = DateUtils.getMonthLastDay(year,endMonth); + OaTaskTime oaTaskTime = new OaTaskTime(); + oaTaskTime.setStartTime(year+"-0"+month+"-01 00:00:01"); + if(endMonth < 10){ + oaTaskTime.setEndTime(year+"-0"+endMonth+"-"+day+" 23:59:59"); + }else{ + oaTaskTime.setEndTime(year+"-"+endMonth+"-"+day+" 23:59:59"); + } + oaTaskTimes.add(oaTaskTime); + } + }else if(4 == checkstandard){ + months.add(1); + months.add(4); + months.add(7); + months.add(10); + for (Integer month : months){ + + Integer entMonth = month + 2; + Integer day = DateUtils.getMonthLastDay(year,entMonth); + OaTaskTime oaTaskTime = new OaTaskTime(); + + String startMonthStr = ""; + String endMonthStr = ""; + if(month < 10){ + startMonthStr = "0"+month; + }else{ + startMonthStr = ""+month; + } + if(entMonth < 10){ + endMonthStr = "0"+entMonth; + }else{ + endMonthStr = entMonth+""; + } + oaTaskTime.setStartTime(year+"-"+startMonthStr+"-01 00:00:01"); + oaTaskTime.setEndTime(year+"-"+endMonthStr+"-"+day+" 23:59:59"); + oaTaskTimes.add(oaTaskTime); + } + }else if(12 == checkstandard){ + months.add(1); + months.add(2); + months.add(3); + months.add(4); + months.add(5); + months.add(6); + months.add(7); + months.add(8); + months.add(9); + months.add(10); + months.add(11); + months.add(12); + for (Integer month : months){ + Integer day = DateUtils.getMonthLastDay(year,month); + OaTaskTime oaTaskTime = new OaTaskTime(); + String startMonthStr = ""; + if(month < 10){ + startMonthStr = "0"+month; + }else{ + startMonthStr = ""+month; + } + oaTaskTime.setStartTime(year+"-"+startMonthStr+"-01 00:00:01"); + oaTaskTime.setEndTime(year+"-"+startMonthStr+"-"+day+" 23:59:59"); + oaTaskTimes.add(oaTaskTime); + } + } + return oaTaskTimes; + } +} diff --git a/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java new file mode 100644 index 0000000..34ff9ea --- /dev/null +++ b/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java @@ -0,0 +1,29 @@ +package com.rzyc.service; + + +import com.common.utils.model.SingleResult; +import com.common.utils.pager.PageOperation; +import com.rzyc.controller.BaseController; +import com.rzyc.model.EntDevice; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 企业移动端业务 Service + * @author Xuwanxin + * @date 2022/12/8 + * */ +@Service +public class MobileBusinessService extends BaseController { + + @PageOperation + public SingleResult mobileEntDevice(String modelState,Integer page,Integer pageSize){ + SingleResult singleResult = new SingleResult(); + Listdevices = entDeviceMapper.mobileEntDevice(modelState); + singleResult.setData(devices); + return singleResult; + } + + +} diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index f49942c..e0e54da 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -22,6 +22,7 @@ import com.rzyc.model.dto.SparePartDto; import com.rzyc.model.ent.InEntList; import com.rzyc.model.ent.SysEnterprise; +import org.apache.commons.math3.analysis.function.Sin; import org.junit.Test; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -134,7 +135,7 @@ public class PcBusinessService extends BaseController { public List entUserPostTask(EntUserPostTaskDto entUserPostTaskDto) throws Exception { entUserPostTaskDto.setPostId(getUserPostId()); //当listId为null时,默认第一个日常清单,查询所有正在进行中的任务 - if (null == entUserPostTaskDto.getListId()){ + if (null == entUserPostTaskDto.getListId() && (null != entUserPostTaskDto.getTaskState()&& 3 != entUserPostTaskDto.getTaskState())){ //2为正在进行中 entUserPostTaskDto.setTaskState(1); } @@ -263,9 +264,13 @@ public class PcBusinessService extends BaseController { d.setEntUserId(entUser.getEntUserId()); } singleResult = this.entUserCredentialUpdate(addOrUpdateEntUserDto.getEntUserCredentialUpdateDtos()); + }else { + entUserCredentialMapper.delEntUserCredential(entUser.getEntUserId()); } //插入清单和任务 - autoAssignmentTask(entUser.getEntUserId(),addOrUpdateEntUserDto.getEnterpriseId(),addOrUpdateEntUserDto.getPostId()); + AssignmentTaskThread textThread = new AssignmentTaskThread(entUser.getEntUserId(),addOrUpdateEntUserDto.getEnterpriseId(),addOrUpdateEntUserDto.getPostId(),entPostListMapper,entPostTaskMapper,inEntListMapper,getUserId(),entUserMapper); + Thread thread=new Thread(textThread); + thread.start(); return singleResult; } @@ -338,9 +343,9 @@ public class PcBusinessService extends BaseController { } @PageOperation - public SingleResult entEquipmentList(String enterpriseId, String typeId,Integer page,Integer pageSize){ + public SingleResult entEquipmentList(String enterpriseId, String typeId,Integer page,Integer pageSize,String keyWord){ SingleResult singleResult = new SingleResult(); - Page devices = (Page) entDeviceMapper.selectEntEquipmentList(enterpriseId,typeId); + Page devices = (Page) entDeviceMapper.selectEntEquipmentList(enterpriseId,typeId,keyWord); singleResult.setDataPager(devices); return singleResult; } @@ -474,8 +479,13 @@ public class PcBusinessService extends BaseController { Date nextTime = calculationDays(addOrUpdateDeviceInspectionCycleDto.getInspectionCycle()); entDeviceInsCycle.setNextTimeInspection(nextTime); if (null != addOrUpdateDeviceInspectionCycleDto && null != addOrUpdateDeviceInspectionCycleDto.getInspectionId()){ + entDeviceInsCycle.setModifyBy(getUserId()); + entDeviceInsCycle.setModifyTime(new Date()); result = entDeviceInsCycleMapper.updateDeviceInspectionCycle(entDeviceInsCycle); }else { + entDeviceInsCycle.setInspectionId(RandomNumber.getUUid()); + entDeviceInsCycle.setCreateBy(getUserId()); + entDeviceInsCycle.setCreateTime(new Date()); result = entDeviceInsCycleMapper.insert(entDeviceInsCycle); } if (result != 1 ){ @@ -485,7 +495,7 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult addOrUpdateInspectionRecord(AddOrUpdateInspectionRecordDto addOrUpdateInspectionRecordDto){ + public SingleResult addOrUpdateInspectionRecord(AddOrUpdateInspectionRecordDto addOrUpdateInspectionRecordDto) throws Exception { SingleResult singleResult = new SingleResult(); EntInsRecord entInsRecord = new EntInsRecord(); BeanUtils.copyProperties(addOrUpdateInspectionRecordDto,entInsRecord); @@ -496,11 +506,16 @@ public class PcBusinessService extends BaseController { if (cycle != null) { entInsRecord.setCycleId(cycle.getInspectionId()); } + entInsRecord.setModifyBy(getUserId()); + entInsRecord.setModifyTime(new Date()); result = entInsRecordMapper.updateInspectionRecord(entInsRecord); }else { if (cycle != null) { entInsRecord.setCycleId(cycle.getInspectionId()); } + entInsRecord.setInsRecordId(RandomNumber.getUUid()); + entInsRecord.setCreateBy(getUserId()); + entInsRecord.setCreateTime(new Date()); result = entInsRecordMapper.insert(entInsRecord); } if (result != 1 ){ @@ -647,6 +662,8 @@ public class PcBusinessService extends BaseController { entInspectionRecord.setInspectionId(RandomNumber.getUUid()); entInspectionRecord.setCreateBy(getUserId()); entInspectionRecord.setCreateTime(new Date()); + //state 1 是待检测 + entInspectionRecord.setInspectionState(1); result = entInspectionRecordMapper.insert(entInspectionRecord); } if (result != 1 ){ @@ -678,9 +695,9 @@ public class PcBusinessService extends BaseController { BeanUtils.copyProperties(reportRecordDto,entReportRepair); int result = 0; if (null != reportRecordDto && null != entReportRepair.getReportRepairId()){ - entReportRepairMapper.updateReportRecord(entReportRepair); + result = entReportRepairMapper.updateReportRecord(entReportRepair); }else { - entReportRepairMapper.insert(entReportRepair); + result = entReportRepairMapper.insert(entReportRepair); } if (result != 1 ){ singleResult.setCode(Code.ERROR.getCode()); @@ -690,10 +707,10 @@ public class PcBusinessService extends BaseController { } @PageOperation - public SingleResult operatingInstructions(OperatingInstructionDto operatingInstructionDto){ + public SingleResult operatingInstructions(String name,String deviceId,Integer page,Integer pageSize){ SingleResult SingleResult = new SingleResult(); - Page page = (Page) entOperatingInstructionMapper.selectOperatingInstructions(operatingInstructionDto.getName(),operatingInstructionDto.getDeviceId()); - SingleResult.setDataPager(page); + Page p = (Page) entOperatingInstructionMapper.selectOperatingInstructions(name,deviceId); + SingleResult.setDataPager(p); return SingleResult; } @@ -721,22 +738,9 @@ public class PcBusinessService extends BaseController { return insertListAndTask(addOrUpdateEntUserPostTaskDto); } - public void autoAssignmentTask(String userId,String enterpriseId,String postId) throws Exception { - ListinEntLists = inEntListMapper.selectByEnterpriseId(enterpriseId); - for (InEntList ie:inEntLists) { - AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto = new AddOrUpdateEntUserPostListDto(); - addOrUpdateEntUserPostTaskDto.setEntUserId(userId); - addOrUpdateEntUserPostTaskDto.setEnterpriseId(enterpriseId); - addOrUpdateEntUserPostTaskDto.setPostId(postId); - addOrUpdateEntUserPostTaskDto.setEntListId(ie.getEntListId()); - addOrUpdateEntUserPostTaskDto.setFrequency(ie.getFrequency()); - addOrUpdateEntUserPostTaskDto.setItemContent(ie.getItemContent()); - addOrUpdateEntUserPostTaskDto.setItemTitle(ie.getItemTitle()); - addOrUpdateEntUserPostTaskDto.setListId(ie.getListId()); - addOrUpdateEntUserPostTaskDto.setStandard(ie.getStandard()); - insertListAndTask(addOrUpdateEntUserPostTaskDto); - } - } + + + private SingleResult insertListAndTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto) throws Exception { EntPostList entPostList = new EntPostList(); @@ -757,6 +761,7 @@ public class PcBusinessService extends BaseController { } + public SingleResult inListStatistic(String enterpriseId,String listId,String keyWord,Integer page,Integer pageSize){ SingleResult singleResult = new SingleResult(); HashMap map = new HashMap(); @@ -806,6 +811,10 @@ public class PcBusinessService extends BaseController { map.put("unfinished",unfinishedPercent); double haveInHand = Arith.div(entPostTaskStatistic.getHaveInHand(),total) * 100; map.put("haveInHand",haveInHand); + //数量 + map.put("finishNumber",entPostTaskStatistic.getFinished()); + map.put("unFinishNumber",entPostTaskStatistic.getOvertime()); + map.put("haveInHandNumber",entPostTaskStatistic.getHaveInHand()); singleResult.setData(map); }else { map.put("finished",0); @@ -824,10 +833,10 @@ public class PcBusinessService extends BaseController { private String getUserPostId() throws Exception { String userId = getUserId(); if (StringUtils.isNotBlank(userId)){ - Object object = redisUtil.get("postId:userId"+userId); + Object object = redisUtil.get(redisUtil.appendSymbol(RedisKeys.POSTID.getKey(),RedisKeys.USERID.getKey())+userId); if (null == object){ EntUser entUser = entUserMapper.selectById(userId); - redisUtil.set("postId:userId"+userId,entUser.getPostId()); + redisUtil.set(redisUtil.appendSymbol(RedisKeys.POSTID.getKey(),RedisKeys.USERID.getKey())+userId,entUser.getPostId()); return entUser.getPostId(); }else { return (String)object; @@ -876,9 +885,9 @@ public class PcBusinessService extends BaseController { } @PageOperation - public SingleResult entEmExpertList(String enterpriseId,Integer page,Integer pageSize,String entEmExpertClass,String entEmExpertCategory){ + public SingleResult entEmExpertList(String enterpriseId,Integer page,Integer pageSize,String entEmExpertClass,String entEmExpertCategory,String name){ SingleResult singleResult = new SingleResult(); - Pagelist = (Page)entEmExpertMapper.selectEntEmExpertList(enterpriseId,entEmExpertClass,entEmExpertCategory); + Pagelist = (Page)entEmExpertMapper.selectEntEmExpertList(enterpriseId,entEmExpertClass,entEmExpertCategory,name); singleResult.setDataPager(list); return singleResult; } @@ -912,14 +921,14 @@ public class PcBusinessService extends BaseController { SingleResult singleResult = new SingleResult(); EntEmReservePlan entEmReservePlan = new EntEmReservePlan(); BeanUtils.copyProperties(entEmReservePlanDto,entEmReservePlan); - if(null != entEmReservePlan.getEntEmReservePlanId()){ + EntEmReservePlan reservePlan = entEmReservePlanMapper.selectById(entEmReservePlan.getEntEmReservePlanId()); + if(null != reservePlan && null != reservePlan.getEntEmReservePlanId()){ entEmReservePlan.setModifyBy(getUserId()); entEmReservePlan.setModifyTime(new Date()); entEmReservePlanMapper.updateEntEmReservePlan(entEmReservePlan); }else { entEmReservePlan.setCreateBy(getUserId()); entEmReservePlan.setCreateTime(new Date()); - entEmReservePlan.setEntEmReservePlanId(RandomNumber.getUUid()); entEmReservePlanMapper.insert(entEmReservePlan); } return singleResult; @@ -938,14 +947,14 @@ public class PcBusinessService extends BaseController { SingleResult singleResult = new SingleResult(); EntEmRehearsal entEmRehearsal = new EntEmRehearsal(); BeanUtils.copyProperties(entEmRehearsalDto,entEmRehearsal); - if(null != entEmRehearsal.getEntEmRehearsalId()){ + EntEmRehearsal emRehearsal = entEmRehearsalMapper.selectById(entEmRehearsal.getEntEmRehearsalId()); + if(null != emRehearsal && null != emRehearsal.getEntEmRehearsalId()){ entEmRehearsal.setModifyBy(getUserId()); entEmRehearsal.setModifyTime(new Date()); entEmRehearsalMapper.updateEntEmRehearsal(entEmRehearsal); }else { entEmRehearsal.setCreateBy(getUserId()); entEmRehearsal.setCreateTime(new Date()); - entEmRehearsal.setEntEmRehearsalId(RandomNumber.getUUid()); entEmRehearsalMapper.insert(entEmRehearsal); } return singleResult; @@ -1009,14 +1018,18 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult repairRecordUpdate(EntRepairRecordDto entRepairRecordDto){ + public SingleResult repairRecordUpdate(EntRepairRecordDto entRepairRecordDto) throws Exception { SingleResult singleResult = new SingleResult(); EntRepairRecord entRepairRecord = new EntRepairRecord(); BeanUtils.copyProperties(entRepairRecordDto,entRepairRecord); int result = 0; if (null != entRepairRecordDto && null != entRepairRecordDto.getRepairRecordId()){ + entRepairRecord.setModifyBy(getUserId()); + entRepairRecord.setModifyTime(new Date()); result =entRepairRecordMapper.repairRecordUpdate(entRepairRecord); }else { + entRepairRecord.setCreateBy(getUserId()); + entRepairRecord.setCreateTime(new Date()); result = entRepairRecordMapper.insert(entRepairRecord); } if (result <= 0){ @@ -1026,6 +1039,151 @@ public class PcBusinessService extends BaseController { return singleResult; } + public SingleResult entDeviceDelete(String deviceId){ + SingleResult singleResult = new SingleResult(); + int result = entDeviceMapper.updateDelState(deviceId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult deviceInspectionCycleDelete(String deviceInspectionCycleId){ + SingleResult singleResult = new SingleResult(); + int result = entDeviceInsCycleMapper.updateDelState(deviceInspectionCycleId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult deviceEntInsRecordDelete(String deviceEntInsRecordId){ + SingleResult singleResult = new SingleResult(); + int result = entInsRecordMapper.updateDelState(deviceEntInsRecordId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult entDeviceMaintenancePlanDelete(String deviceEntInsPlanId){ + SingleResult singleResult = new SingleResult(); + int result = entDeviceMaintenancePlanMapper.updateDelState(deviceEntInsPlanId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + public SingleResult entDeviceMaintenanceRecordDelete(String deviceEntInsRecordId){ + SingleResult singleResult = new SingleResult(); + int result = entDeviceMaintenanceRecordMapper.updateDelState(deviceEntInsRecordId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult entDeviceEntInspectionRecordDelete(String deviceEntInspectionRecordId){ + SingleResult singleResult = new SingleResult(); + int result = entInspectionRecordMapper.updateDelState(deviceEntInspectionRecordId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult entDeviceRepairPlanDelete(String repairPlanId){ + SingleResult singleResult = new SingleResult(); + int result = entRepairPlanMapper.updateDelState(repairPlanId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult entDeviceRepairRecordDelete(String repairRecordId){ + SingleResult singleResult = new SingleResult(); + int result = entRepairRecordMapper.updateDelState(repairRecordId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult entDeviceReportRepairDelete(String reportRepair){ + SingleResult singleResult = new SingleResult(); + int result = entReportRepairMapper.updateDelState(reportRepair); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + @PageOperation + public SingleResult notices(String type,Integer page,Integer pageSize) throws Exception { + SingleResult singleResult = new SingleResult(); + String userId = getUserId(); + Listnotices = noticeMapper.selectNotices(type,userId); + singleResult.setData(notices); + return singleResult; + } + + public SingleResult entNoticeNumber() throws Exception { + SingleResult singleResult = new SingleResult(); + String userId = getUserId(); + Notice notice = noticeMapper.selectEntNoticeNumber(userId); + singleResult.setData(notice); + return singleResult; + } + + public SingleResult delStateOperatingInstruction(String opInstructionId){ + SingleResult singleResult = new SingleResult(); + int result = entOperatingInstructionMapper.updateStateOperatingInstruction(opInstructionId); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + + public SingleResult oneButtonRead() throws Exception { + SingleResult singleResult = new SingleResult(); + int result = noticeMapper.oneButtonRead(getUserId()); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult manualAddListDetail(EntPostListDetailDto entPostListDetailDto){ + SingleResult singleResult = new SingleResult(); + EntPostListDetail entPostListDetail = new EntPostListDetail(); + BeanUtils.copyProperties(entPostListDetailDto,entPostListDetail); + int result = entPostListDetailMapper.insert(entPostListDetail); + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + + public SingleResult selectPostListDetail(String postListId,String userId){ + SingleResult singleResult = new SingleResult(); + List list = entPostListDetailMapper.selectListDetail(postListId,userId); + singleResult.setData(list); + return singleResult; + } } diff --git a/inventory-ent/src/main/resources/application-dev.yml b/inventory-ent/src/main/resources/application-dev.yml index c5f61d7..756aaa4 100644 --- a/inventory-ent/src/main/resources/application-dev.yml +++ b/inventory-ent/src/main/resources/application-dev.yml @@ -38,7 +38,7 @@ spring: #数据库 datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://121.40.106.103:3306/inventory_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false + url: jdbc:mysql://121.40.106.103:3306/inventory_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false& username: rzyc password: ENC(FDlRK2MAcJBMF7UBHBJPLGzRkpWQ4T6dgYP2bDnTodQ=) tomcat: diff --git a/inventory-gov/src/main/resources/application-dev.yml b/inventory-gov/src/main/resources/application-dev.yml index 2dcb6f4..870ead2 100644 --- a/inventory-gov/src/main/resources/application-dev.yml +++ b/inventory-gov/src/main/resources/application-dev.yml @@ -37,9 +37,6 @@ spring: application: name: log - - - #数据库 datasource: driver-class-name: com.mysql.cj.jdbc.Driver