企业端设备模块->企业端PC,小程序接口调试
This commit is contained in:
parent
40420d3dd5
commit
3db6f52825
|
|
@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -24,9 +25,10 @@ public interface EntDeviceInsCycleMapper extends BaseMapper<EntDeviceInsCycle> {
|
||||||
/**
|
/**
|
||||||
* 查询周期巡检
|
* 查询周期巡检
|
||||||
* @param inspectionName 巡检名
|
* @param inspectionName 巡检名
|
||||||
|
* @param deviceId 设备id
|
||||||
* @return list
|
* @return list
|
||||||
* */
|
* */
|
||||||
List<EntDeviceInsCycle>deviceInspectionCycle(String inspectionName);
|
List<EntDeviceInsCycle>deviceInspectionCycle(@Param("inspectionName") String inspectionName,@Param("deviceId")String deviceId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,4 +38,13 @@ public interface EntDeviceInsCycleMapper extends BaseMapper<EntDeviceInsCycle> {
|
||||||
* @return list
|
* @return list
|
||||||
* */
|
* */
|
||||||
int updateDeviceInspectionCycle(@Param("data") EntDeviceInsCycle entDeviceInsCycle);
|
int updateDeviceInspectionCycle(@Param("data") EntDeviceInsCycle entDeviceInsCycle);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查周期巡检是否超期
|
||||||
|
* @param date 今天的任务
|
||||||
|
* @return int
|
||||||
|
* */
|
||||||
|
List<EntDeviceInsCycle> checkDeviceInspectionRecord(String date);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,4 +44,22 @@ public interface EntDeviceMapper extends BaseMapper<EntDevice> {
|
||||||
* */
|
* */
|
||||||
int updateEntDevice(@Param("entDevice") EntDevice entDevice);
|
int updateEntDevice(@Param("entDevice") EntDevice entDevice);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业设备修改
|
||||||
|
* @param deviceId 设备id
|
||||||
|
* @param overdueState 超期状态
|
||||||
|
* @return EntDevice
|
||||||
|
* */
|
||||||
|
int updateOverdueInspection(@Param("deviceId") String deviceId,@Param("overdueState")Integer overdueState);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序企业设备过期列表
|
||||||
|
* @param enterpriseId 企业id
|
||||||
|
* @return EntDevice
|
||||||
|
* */
|
||||||
|
List<EntDevice> selectEntEquipmentOverdue(String enterpriseId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,11 @@ public interface EntInsRecordMapper extends BaseMapper<EntInsRecord> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询巡检记录
|
* 查询巡检记录
|
||||||
|
* @param deviceId 设备id
|
||||||
* @param inspectionRecordName 巡检记录对象
|
* @param inspectionRecordName 巡检记录对象
|
||||||
* @return int
|
* @return int
|
||||||
* */
|
* */
|
||||||
List<EntInsRecord> selectInspectionRecord(@Param("inspectionRecordName") String inspectionRecordName);
|
List<EntInsRecord> selectInspectionRecord(@Param("deviceId") String deviceId,@Param("inspectionRecordName") String inspectionRecordName);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
@ -44,22 +46,27 @@ public class EntDevice implements Serializable {
|
||||||
@TableField("model_state")
|
@TableField("model_state")
|
||||||
private Integer modelState;
|
private Integer modelState;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "购买时间")
|
@ApiModelProperty(value = "购买时间")
|
||||||
@TableField("buy_time")
|
@TableField("buy_time")
|
||||||
private Date buyTime;
|
private Date buyTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "出厂日期")
|
@ApiModelProperty(value = "出厂日期")
|
||||||
@TableField("date_production")
|
@TableField("date_production")
|
||||||
private Date dateProduction;
|
private Date dateProduction;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "安装时间")
|
@ApiModelProperty(value = "安装时间")
|
||||||
@TableField("installation_time")
|
@TableField("installation_time")
|
||||||
private Date installationTime;
|
private Date installationTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "启用时间")
|
@ApiModelProperty(value = "启用时间")
|
||||||
@TableField("enable_time")
|
@TableField("enable_time")
|
||||||
private Date enableTime;
|
private Date enableTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "报废时间")
|
@ApiModelProperty(value = "报废时间")
|
||||||
@TableField("scrap_time")
|
@TableField("scrap_time")
|
||||||
private Date scrapTime;
|
private Date scrapTime;
|
||||||
|
|
@ -124,6 +131,77 @@ public class EntDevice implements Serializable {
|
||||||
@TableField("specific_location")
|
@TableField("specific_location")
|
||||||
private String specificLocation;
|
private String specificLocation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "保养数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer entDeviceMaintenanceRecord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "巡检数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer entInsRecord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "维修数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer entRepairRecord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "送检数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer entInspectionRecord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "需要巡检总频次")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "巡检次数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer recordNumber;
|
||||||
|
|
||||||
|
public Integer getFrequency() {
|
||||||
|
return frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrequency(Integer frequency) {
|
||||||
|
this.frequency = frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRecordNumber() {
|
||||||
|
return recordNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordNumber(Integer recordNumber) {
|
||||||
|
this.recordNumber = recordNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEntDeviceMaintenanceRecord() {
|
||||||
|
return entDeviceMaintenanceRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntDeviceMaintenanceRecord(Integer entDeviceMaintenanceRecord) {
|
||||||
|
this.entDeviceMaintenanceRecord = entDeviceMaintenanceRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEntInsRecord() {
|
||||||
|
return entInsRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntInsRecord(Integer entInsRecord) {
|
||||||
|
this.entInsRecord = entInsRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEntRepairRecord() {
|
||||||
|
return entRepairRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntRepairRecord(Integer entRepairRecord) {
|
||||||
|
this.entRepairRecord = entRepairRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEntInspectionRecord() {
|
||||||
|
return entInspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntInspectionRecord(Integer entInspectionRecord) {
|
||||||
|
this.entInspectionRecord = entInspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
public BigDecimal getLongitude() {
|
public BigDecimal getLongitude() {
|
||||||
return longitude;
|
return longitude;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
@ -86,9 +88,22 @@ public class EntDeviceInsCycle implements Serializable {
|
||||||
@TableField("modify_time")
|
@TableField("modify_time")
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@TableField("next_time_inspection")
|
@TableField("next_time_inspection")
|
||||||
private Date nextTimeInspection;
|
private Date nextTimeInspection;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date insRecordDate;
|
||||||
|
|
||||||
|
public Date getInsRecordDate() {
|
||||||
|
return insRecordDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsRecordDate(Date insRecordDate) {
|
||||||
|
this.insRecordDate = insRecordDate;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getNextTimeInspection() {
|
public Date getNextTimeInspection() {
|
||||||
return nextTimeInspection;
|
return nextTimeInspection;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
@ -74,6 +76,18 @@ public class EntDeviceType implements Serializable {
|
||||||
@TableField("modify_by")
|
@TableField("modify_by")
|
||||||
private String modifyBy;
|
private String modifyBy;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<EntDeviceType> children;
|
||||||
|
|
||||||
|
public List<EntDeviceType> getChildren() {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildren(List<EntDeviceType> children) {
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTypeId() {
|
public String getTypeId() {
|
||||||
return typeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ public class AddOrUpdateDeviceInspectionCycleDto {
|
||||||
@ApiModelProperty("周期巡检id")
|
@ApiModelProperty("周期巡检id")
|
||||||
private String inspectionId;
|
private String inspectionId;
|
||||||
|
|
||||||
@ApiModelProperty("企业名")
|
@ApiModelProperty("企业id")
|
||||||
private String enterpriseId;
|
private String enterpriseId;
|
||||||
|
|
||||||
@ApiModelProperty("设备id")
|
@ApiModelProperty("设备id")
|
||||||
|
|
@ -48,6 +48,7 @@ public class AddOrUpdateDeviceInspectionCycleDto {
|
||||||
@ApiModelProperty("技术措施")
|
@ApiModelProperty("技术措施")
|
||||||
private String technicalMeasures;
|
private String technicalMeasures;
|
||||||
|
|
||||||
|
@ApiModelProperty("下次巡检日期")
|
||||||
@TableField("next_time_inspection")
|
@TableField("next_time_inspection")
|
||||||
private Date nextTimeInspection;
|
private Date nextTimeInspection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
<result column="create_time" property="createTime" />
|
<result column="create_time" property="createTime" />
|
||||||
<result column="modify_by" property="modifyBy" />
|
<result column="modify_by" property="modifyBy" />
|
||||||
<result column="modify_time" property="modifyTime" />
|
<result column="modify_time" property="modifyTime" />
|
||||||
|
<result column="ins_record_date" property="insRecordDate"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
|
|
@ -29,7 +30,7 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="deviceInspectionCycle" resultMap="BaseResultMap">
|
<select id="deviceInspectionCycle" resultMap="BaseResultMap">
|
||||||
select * from ent_device_ins_cycle where 1=1
|
select * from ent_device_ins_cycle where device_id = #{deviceId}
|
||||||
<if test="null != inspectionName and '' != inspectionName">
|
<if test="null != inspectionName and '' != inspectionName">
|
||||||
and inspection_name like concat('%',#{inspectionName},'%')
|
and inspection_name like concat('%',#{inspectionName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -41,4 +42,13 @@
|
||||||
technical_measures = #{data.technicalMeasures} where inspection_id = #{data.inspectionId}
|
technical_measures = #{data.technicalMeasures} where inspection_id = #{data.inspectionId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="checkDeviceInspectionRecord" resultMap="BaseResultMap">
|
||||||
|
select edic.*,eir.ins_record_date from ent_device_ins_cycle edic
|
||||||
|
left join
|
||||||
|
(select * from ent_ins_record order by create_time desc limit 1)as eir on edic.inspection_id = eir.cycle_id
|
||||||
|
where edic.next_time_inspection = #{date}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,48 @@
|
||||||
<select id="selectEntEquipmentList" resultMap="BaseResultMap">
|
<select id="selectEntEquipmentList" resultMap="BaseResultMap">
|
||||||
select * from ent_device where enterprise_id = #{enterpriseId}
|
select * from ent_device where enterprise_id = #{enterpriseId}
|
||||||
<if test="null != typeId and '' != typeId">
|
<if test="null != typeId and '' != typeId">
|
||||||
and type_id = #{typeId}
|
and type_path like concat('%',#{typeId},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="entEquipmentStatistic" resultMap="BaseResultMap">
|
<resultMap id="entEquipmentOverdueMap" type="com.rzyc.model.EntDevice">
|
||||||
|
<id column="device_id" property="deviceId" />
|
||||||
|
<result column="name" property="name" />
|
||||||
|
<result column="number" property="number" />
|
||||||
|
<result column="model_num" property="modelNum" />
|
||||||
|
<result column="model_state" property="modelState" />
|
||||||
|
<result column="buy_time" property="buyTime" />
|
||||||
|
<result column="type_id" property="typeId" />
|
||||||
|
<result column="type_path" property="typePath" />
|
||||||
|
<result column="enterprise_id" property="enterpriseId" />
|
||||||
|
<result column="qr_code" property="qrCode" />
|
||||||
|
<result column="del_state" property="delState" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="modify_time" property="modifyTime" />
|
||||||
|
<result column="modify_by" property="modifyBy" />
|
||||||
|
<result column="frequency" property="frequency" />
|
||||||
|
<result column="recordNumber" property="recordNumber" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectEntEquipmentOverdue" resultMap="entEquipmentOverdueMap">
|
||||||
|
select ed.*,cycle.frequency,cycle.recordNumber from ent_device ed
|
||||||
|
left join (select edic.frequency,count(eir.ins_record_id)as recordNumber from ent_device_ins_cycle edic ed on ed.device_id = edic.device_id
|
||||||
|
left join ent_ins_record eir on edic.inspection_id = eir.cycle_id order by create_time desc limit 1)as cycle
|
||||||
|
where ed.enterprise_id = #{enterpriseId} and overdue_inspection = 2
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap id="statistic" type="com.rzyc.model.EntDevice">
|
||||||
|
<result column="entDeviceMaintenanceRecord" property="entDeviceMaintenanceRecord" />
|
||||||
|
<result column="entInsRecord" property="entInsRecord" />
|
||||||
|
<result column="entRepairRecord" property="entRepairRecord" />
|
||||||
|
<result column="entInspectionRecord" property="entInspectionRecord" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="entEquipmentStatistic" resultMap="statistic">
|
||||||
select count(edmr.record_id) as entDeviceMaintenanceRecord ,count(eir.ins_record_id) as entInsRecord,
|
select count(edmr.record_id) as entDeviceMaintenanceRecord ,count(eir.ins_record_id) as entInsRecord,
|
||||||
count(err.repair_record_id)as entRepairRecord,count(eisr.inspection_id) as entInspectionRecord
|
count(err.repair_record_id)as entRepairRecord,count(eisr.inspection_id) as entInspectionRecord
|
||||||
from ent_device ed
|
from ent_device ed
|
||||||
|
|
@ -56,4 +91,8 @@
|
||||||
eq_charge_person = #{entDevice.eqChargePerson},manufacturer = #{entDevice.manufacturer},specific_location = #{entDevice.specificLocation},modify_by = #{entDevice.modifyBy},modify_time = #{entDevice.modifyTime}
|
eq_charge_person = #{entDevice.eqChargePerson},manufacturer = #{entDevice.manufacturer},specific_location = #{entDevice.specificLocation},modify_by = #{entDevice.modifyBy},modify_time = #{entDevice.modifyTime}
|
||||||
where device_id = #{entDevice.deviceId}
|
where device_id = #{entDevice.deviceId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateOverdueInspection">
|
||||||
|
update ent_device set overdue_inspection = #{overdueState} where device_id = #{deviceId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectInspectionRecord" resultMap="BaseResultMap">
|
<select id="selectInspectionRecord" resultMap="BaseResultMap">
|
||||||
select * from ent_ins_record where 1=1
|
select * from ent_ins_record where device_id = #{deviceId}
|
||||||
<if test="null != inspectionRecordName and '' != inspectionRecordName">
|
<if test="null != inspectionRecordName and '' != inspectionRecordName">
|
||||||
and ins_record_situation like concat('%',#{inspectionRecordName},'%')
|
and ins_record_situation like concat('%',#{inspectionRecordName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,17 @@ public class SaticScheduleTask {
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 01 02 * * ?")
|
@Scheduled(cron = "0 01 02 * * ?")
|
||||||
//或直接指定时间间隔,例如:5秒
|
|
||||||
// @Scheduled(fixedRate=600000)
|
|
||||||
private void configureTasks() {
|
private void configureTasks() {
|
||||||
taskService.task();
|
taskService.task();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 */4 * * * ?")
|
||||||
|
private void deviceInspectionCycleCheck() {
|
||||||
|
taskService.deviceInspectionCycleCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ public class EmergencyEquipmentController {
|
||||||
@PreAuthorize("hasAnyAuthority('entEmRehearsalList:delete')")
|
@PreAuthorize("hasAnyAuthority('entEmRehearsalList:delete')")
|
||||||
@MethodAnnotation(authorizations = {"entEmRehearsalList:delete"},name = "应急演练删除")
|
@MethodAnnotation(authorizations = {"entEmRehearsalList:delete"},name = "应急演练删除")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"),
|
@ApiImplicitParam(name = "id", value = "主键",required = true, dataType = "string"),
|
||||||
})
|
})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult entEmRehearsalDelete(@RequestParam("id") String id)throws Exception{
|
public SingleResult entEmRehearsalDelete(@RequestParam("id") String id)throws Exception{
|
||||||
|
|
@ -232,7 +232,7 @@ public class EmergencyEquipmentController {
|
||||||
@PreAuthorize("hasAnyAuthority('entEmReservePlanList:delete')")
|
@PreAuthorize("hasAnyAuthority('entEmReservePlanList:delete')")
|
||||||
@MethodAnnotation(authorizations = {"entEmReservePlanList:delete"},name = "应急预案删除")
|
@MethodAnnotation(authorizations = {"entEmReservePlanList:delete"},name = "应急预案删除")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"),
|
@ApiImplicitParam(name = "id", value = "主键",required = true, dataType = "string"),
|
||||||
})
|
})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult entEmReservePlanDelete(@RequestParam("id") String id)throws Exception{
|
public SingleResult entEmReservePlanDelete(@RequestParam("id") String id)throws Exception{
|
||||||
|
|
@ -249,7 +249,7 @@ public class EmergencyEquipmentController {
|
||||||
@PreAuthorize("hasAnyAuthority('entEmExpertList:delete')")
|
@PreAuthorize("hasAnyAuthority('entEmExpertList:delete')")
|
||||||
@MethodAnnotation(authorizations = {"entEmExpertList:delete"},name = "应急专家删除")
|
@MethodAnnotation(authorizations = {"entEmExpertList:delete"},name = "应急专家删除")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"),
|
@ApiImplicitParam(name = "id", value = "主键",required = true, dataType = "string"),
|
||||||
})
|
})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult entEmExpertDelete(@RequestParam("id") String id)throws Exception{
|
public SingleResult entEmExpertDelete(@RequestParam("id") String id)throws Exception{
|
||||||
|
|
@ -267,7 +267,7 @@ public class EmergencyEquipmentController {
|
||||||
@PreAuthorize("hasAnyAuthority('entEmEquipmentList:delete')")
|
@PreAuthorize("hasAnyAuthority('entEmEquipmentList:delete')")
|
||||||
@MethodAnnotation(authorizations = {"entEmEquipmentList:delete"},name = "应急资源删除")
|
@MethodAnnotation(authorizations = {"entEmEquipmentList:delete"},name = "应急资源删除")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"),
|
@ApiImplicitParam(name = "id", value = "主键",required = true, dataType = "string"),
|
||||||
})
|
})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult entEmEquipmentDelete(@RequestParam("id") String id)throws Exception{
|
public SingleResult entEmEquipmentDelete(@RequestParam("id") String id)throws Exception{
|
||||||
|
|
@ -276,4 +276,5 @@ public class EmergencyEquipmentController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,25 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业设备详细
|
||||||
|
* @param deviceId 设备id
|
||||||
|
* @return 企业设备
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "企业设备详细", notes = "企业设备详细")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataType = "string"),
|
||||||
|
})
|
||||||
|
@GetMapping(value = "/deviceDetail")
|
||||||
|
@PreAuthorize("hasAnyAuthority('entEquipmentList')")
|
||||||
|
@MethodAnnotation(authorizations = {"entEquipmentList"},name = "企业设备详细")
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult<EntDevice> deviceDetail(@RequestParam(required = true) String deviceId)throws Exception{
|
||||||
|
return pcBusinessService.deviceDetail(deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业设备保养和维修检查记录统计
|
* 企业设备保养和维修检查记录统计
|
||||||
* @param enterpriseId 企业id
|
* @param enterpriseId 企业id
|
||||||
|
|
@ -95,7 +114,7 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
@PreAuthorize("hasAnyAuthority('entEquipmentStatistic')")
|
@PreAuthorize("hasAnyAuthority('entEquipmentStatistic')")
|
||||||
@MethodAnnotation(authorizations = {"entEquipmentStatistic"},name = "企业设备保养和维修检查记录统计")
|
@MethodAnnotation(authorizations = {"entEquipmentStatistic"},name = "企业设备保养和维修检查记录统计")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult<List<EntDevice>> entEquipmentStatistic(@RequestParam(required = true) String enterpriseId, String deviceId)throws Exception{
|
public SingleResult<EntDevice> entEquipmentStatistic(@RequestParam(required = true) String enterpriseId, String deviceId)throws Exception{
|
||||||
return pcBusinessService.entEquipmentStatistic(enterpriseId,deviceId);
|
return pcBusinessService.entEquipmentStatistic(enterpriseId,deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,11 +156,12 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
@PreAuthorize("hasAnyAuthority('deviceInspectionCycle','deviceInspectionCycle:update')")
|
@PreAuthorize("hasAnyAuthority('deviceInspectionCycle','deviceInspectionCycle:update')")
|
||||||
@MethodAnnotation(authorizations = {"deviceInspectionCycle","deviceInspectionCycle:update"},name = "设备维护周期")
|
@MethodAnnotation(authorizations = {"deviceInspectionCycle","deviceInspectionCycle:update"},name = "设备维护周期")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "inspectionName", value = "巡检名", required = false, dataType = "string")
|
@ApiImplicitParam(name = "inspectionName", value = "巡检名", required = false, dataType = "string"),
|
||||||
|
@ApiImplicitParam(name = "deviceId", value = "设备id", required = false, dataType = "string")
|
||||||
})
|
})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult<List<EntDeviceInsCycle>> deviceInspectionCycle(String inspectionName,Integer page,Integer pageSize)throws Exception{
|
public SingleResult<List<EntDeviceInsCycle>> deviceInspectionCycle(String inspectionName,String deviceId,Integer page,Integer pageSize)throws Exception{
|
||||||
return pcBusinessService.deviceInspectionCycle(inspectionName,page,pageSize);
|
return pcBusinessService.deviceInspectionCycle(inspectionName,deviceId,page,pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -183,8 +203,8 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
@PreAuthorize("hasAnyAuthority('insRecord','insRecord:update')")
|
@PreAuthorize("hasAnyAuthority('insRecord','insRecord:update')")
|
||||||
@MethodAnnotation(authorizations = {"insRecord","insRecord:update"},name = "设备巡检记录")
|
@MethodAnnotation(authorizations = {"insRecord","insRecord:update"},name = "设备巡检记录")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult<List<EntInsRecord>> inspectionRecord(String inspectionRecordName,Integer page,Integer pageSize)throws Exception{
|
public SingleResult<List<EntInsRecord>> insRecord(String deviceId,String inspectionRecordName,Integer page,Integer pageSize)throws Exception{
|
||||||
return pcBusinessService.selectInsRecord(inspectionRecordName,page,pageSize);
|
return pcBusinessService.selectInsRecord(deviceId,inspectionRecordName,page,pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -388,7 +408,7 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备安标
|
* 设备安标
|
||||||
*
|
* @throws Exception
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -407,7 +427,7 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增,修改操作规程
|
* 新增,修改操作规程
|
||||||
*
|
* @throws Exception
|
||||||
* */
|
* */
|
||||||
@ApiOperation(value = "新增,修改操作规程", notes = "新增,修改操作规程")
|
@ApiOperation(value = "新增,修改操作规程", notes = "新增,修改操作规程")
|
||||||
@PostMapping(value = "/operatingInstructionsAddOrUpdate")
|
@PostMapping(value = "/operatingInstructionsAddOrUpdate")
|
||||||
|
|
@ -419,5 +439,29 @@ public class EnterpriseEquipmentController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业设备过期列表
|
||||||
|
* @return Data
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "企业设备过期列表", notes = "企业设备过期列表")
|
||||||
|
@GetMapping(value = "/entDeviceOverdue")
|
||||||
|
@PreAuthorize("hasAnyAuthority('entDeviceOverdue')")
|
||||||
|
@MethodAnnotation(authorizations = {"entDeviceOverdue"},name = "应急资源删除")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
||||||
|
})
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult selectEntEquipmentOverdue(@RequestParam("enterpriseId") String enterpriseId)throws Exception{
|
||||||
|
return pcBusinessService.selectEntEquipmentOverdue(enterpriseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.rzyc.service;
|
||||||
|
|
||||||
|
import com.rzyc.mapper.EntDeviceInsCycleMapper;
|
||||||
|
import com.rzyc.mapper.EntDeviceMapper;
|
||||||
|
import com.rzyc.model.EntDeviceInsCycle;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* @author Xuwanxin
|
||||||
|
* @date 2022/11/16
|
||||||
|
* */
|
||||||
|
public class DeviceInspectionCycle implements Runnable{
|
||||||
|
|
||||||
|
private EntDeviceInsCycleMapper entDeviceInsCycleMapper;
|
||||||
|
|
||||||
|
private EntDeviceMapper entDeviceMapper;
|
||||||
|
|
||||||
|
public DeviceInspectionCycle(EntDeviceInsCycleMapper entDeviceInsCycleMapper, EntDeviceMapper entDeviceMapper) {
|
||||||
|
this.entDeviceInsCycleMapper = entDeviceInsCycleMapper;
|
||||||
|
this.entDeviceMapper = entDeviceMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Calendar calendar=Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY,-24);
|
||||||
|
String yesterdayDate=dateFormat.format(calendar.getTime());
|
||||||
|
List<EntDeviceInsCycle> list = entDeviceInsCycleMapper.checkDeviceInspectionRecord(yesterdayDate);
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
for (EntDeviceInsCycle e:list) {
|
||||||
|
String date1 = simpleDateFormat.format(e.getNextTimeInspection());
|
||||||
|
String date2 = simpleDateFormat.format(e.getInsRecordDate());
|
||||||
|
if (!date1.equals(date2)){
|
||||||
|
//2为超期
|
||||||
|
entDeviceMapper.updateOverdueInspection(e.getDeviceId(),2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -321,6 +321,7 @@ public class PcBusinessService extends BaseController {
|
||||||
entPostMap.put("typeId",entDeviceType.getTypeId());
|
entPostMap.put("typeId",entDeviceType.getTypeId());
|
||||||
entPostMap.put("name",entDeviceType.getName());
|
entPostMap.put("name",entDeviceType.getName());
|
||||||
entPostMap.put("parentId",entDeviceType.getParentId());
|
entPostMap.put("parentId",entDeviceType.getParentId());
|
||||||
|
entPostMap.put("parentPath",entDeviceType.getParentPath());
|
||||||
entPostMap.put("logo",entDeviceType.getLogo());
|
entPostMap.put("logo",entDeviceType.getLogo());
|
||||||
data.add(entPostMap);
|
data.add(entPostMap);
|
||||||
}
|
}
|
||||||
|
|
@ -336,6 +337,13 @@ public class PcBusinessService extends BaseController {
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SingleResult deviceDetail(String deviceId){
|
||||||
|
SingleResult singleResult = new SingleResult();
|
||||||
|
EntDevice entDevice = entDeviceMapper.selectById(deviceId);
|
||||||
|
singleResult.setData(entDevice);
|
||||||
|
return singleResult;
|
||||||
|
}
|
||||||
|
|
||||||
public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){
|
public SingleResult entEquipmentStatistic(String enterpriseId, String deviceId){
|
||||||
SingleResult singleResult = new SingleResult();
|
SingleResult singleResult = new SingleResult();
|
||||||
EntDevice data = entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId);
|
EntDevice data = entDeviceMapper.entEquipmentStatistic(enterpriseId,deviceId);
|
||||||
|
|
@ -428,9 +436,9 @@ public class PcBusinessService extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PageOperation
|
@PageOperation
|
||||||
public SingleResult deviceInspectionCycle(String inspectionName,Integer page,Integer pageSize){
|
public SingleResult deviceInspectionCycle(String inspectionName,String deviceId,Integer page,Integer pageSize){
|
||||||
SingleResult singleResult = new SingleResult();
|
SingleResult singleResult = new SingleResult();
|
||||||
Page<EntDeviceInsCycle>list = (Page<EntDeviceInsCycle>) entDeviceInsCycleMapper.deviceInspectionCycle(inspectionName);
|
Page<EntDeviceInsCycle>list = (Page<EntDeviceInsCycle>) entDeviceInsCycleMapper.deviceInspectionCycle(inspectionName,deviceId);
|
||||||
singleResult.setDataPager(list);
|
singleResult.setDataPager(list);
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
@ -473,9 +481,9 @@ public class PcBusinessService extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@PageOperation
|
@PageOperation
|
||||||
public SingleResult selectInsRecord(String inspectionRecordName,Integer page,Integer pageSize){
|
public SingleResult selectInsRecord(String deviceId,String inspectionRecordName,Integer page,Integer pageSize){
|
||||||
SingleResult singleResult = new SingleResult();
|
SingleResult singleResult = new SingleResult();
|
||||||
Page<EntInsRecord> entInsRecords = (Page<EntInsRecord>) entInsRecordMapper.selectInspectionRecord(inspectionRecordName);
|
Page<EntInsRecord> entInsRecords = (Page<EntInsRecord>) entInsRecordMapper.selectInspectionRecord(deviceId,inspectionRecordName);
|
||||||
singleResult.setDataPager(entInsRecords);
|
singleResult.setDataPager(entInsRecords);
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
@ -918,7 +926,12 @@ public class PcBusinessService extends BaseController {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SingleResult selectEntEquipmentOverdue(String enterpriseId){
|
||||||
|
SingleResult singleResult = new SingleResult();
|
||||||
|
List<EntDevice>devices = entDeviceMapper.selectEntEquipmentOverdue(enterpriseId);
|
||||||
|
singleResult.setData(devices);
|
||||||
|
return singleResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.rzyc.service;
|
||||||
import com.common.utils.DateUtils;
|
import com.common.utils.DateUtils;
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.common.utils.encryption.MD5;
|
import com.common.utils.encryption.MD5;
|
||||||
|
import com.common.utils.model.SingleResult;
|
||||||
import com.rzyc.bean.check.CheckPerform;
|
import com.rzyc.bean.check.CheckPerform;
|
||||||
import com.rzyc.controller.BaseController;
|
import com.rzyc.controller.BaseController;
|
||||||
import com.rzyc.model.*;
|
import com.rzyc.model.*;
|
||||||
|
|
@ -10,8 +11,11 @@ import com.rzyc.model.check.BookEntHT;
|
||||||
import com.rzyc.model.check.BookenthtCompany;
|
import com.rzyc.model.check.BookenthtCompany;
|
||||||
import com.rzyc.model.ent.SysEnterprise;
|
import com.rzyc.model.ent.SysEnterprise;
|
||||||
import com.rzyc.model.user.SysUser;
|
import com.rzyc.model.user.SysUser;
|
||||||
|
import org.junit.Test;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -180,10 +184,18 @@ public class TaskService extends BaseController {
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void deviceInspectionCycleCheck(){
|
||||||
|
new DeviceInspectionCycle(entDeviceInsCycleMapper,entDeviceMapper).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
System.out.println(MD5.md5("170929"));
|
System.out.println(MD5.md5("170929"));
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,17 @@ package com.rzyc.utils;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.rzyc.controller.BaseController;
|
||||||
|
import com.rzyc.model.EntDeviceInsCycle;
|
||||||
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
||||||
import org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig;
|
import org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置类脱敏加密工具
|
* 配置类脱敏加密工具
|
||||||
|
|
@ -13,7 +20,9 @@ import org.junit.Test;
|
||||||
* @date 2022/10/13
|
* @date 2022/10/13
|
||||||
* */
|
* */
|
||||||
|
|
||||||
public class StringEncryptorTest {
|
public class StringEncryptorTest extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test(){
|
public void test(){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user