企业端设备模块->企业端PC,小程序接口调试

This commit is contained in:
79493 2022-11-17 18:06:12 +08:00
parent 72d3215c49
commit a50f62cba8
28 changed files with 180 additions and 59 deletions

View File

@ -47,4 +47,12 @@ public interface EntDeviceInsCycleMapper extends BaseMapper<EntDeviceInsCycle> {
* @return int * @return int
* */ * */
List<EntDeviceInsCycle> checkDeviceInspectionRecord(String date); List<EntDeviceInsCycle> checkDeviceInspectionRecord(String date);
/**
* 查询周期巡检通过设备id
* @param deviceId 设备id
* @return 周期巡检
* */
EntDeviceInsCycle selectByDeviceId(String deviceId);
} }

View File

@ -28,8 +28,9 @@ public interface EntDeviceMaintenancePlanMapper extends BaseMapper<EntDeviceMain
/** /**
* 查询企业设备保养计划 * 查询企业设备保养计划
* @param deviceId 设备id
* @return list * @return list
* */ * */
List<EntDeviceMaintenancePlan>selectEntDeviceMaintenancePlanList(); List<EntDeviceMaintenancePlan>selectEntDeviceMaintenancePlanList(String deviceId);
} }

View File

@ -28,8 +28,9 @@ public interface EntDeviceMaintenanceRecordMapper extends BaseMapper<EntDeviceMa
/** /**
* 查询企业保养记录 * 查询企业保养记录
* @param deviceId 设备id
* @return list * @return list
* */ * */
List<EntDeviceMaintenanceRecord>selectEntDeviceMaintenanceRecord(); List<EntDeviceMaintenanceRecord>selectEntDeviceMaintenanceRecord(String deviceId);
} }

View File

@ -24,8 +24,9 @@ public interface EntInspectionRecordMapper extends BaseMapper<EntInspectionRecor
* @return list * @return list
* @param startTime * @param startTime
* @param endTime * @param endTime
* @param deviceId
* */ * */
List<EntInspectionRecord>selectInspectionRecord(@Param("startTime") String startTime,@Param("endTime") String endTime); List<EntInspectionRecord>selectInspectionRecord(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("deviceId") String deviceId);
/** /**

View File

@ -22,9 +22,11 @@ public interface EntOperatingInstructionMapper extends BaseMapper<EntOperatingIn
/** /**
* 查询操作规程 * 查询操作规程
* @param name 规程名 * @param name 规程名
* @param deviceId 设备id
* @return list * @return list
* */ * */
List<EntOperatingInstruction>selectOperatingInstructions(String name); List<EntOperatingInstruction>selectOperatingInstructions(@Param("name") String name,@Param("deviceId") String deviceId);
/** /**

View File

@ -20,9 +20,10 @@ public interface EntRepairPlanMapper extends BaseMapper<EntRepairPlan> {
/** /**
* 企业维修计划查询 * 企业维修计划查询
* @param deviceId
* @return list * @return list
* */ * */
List<EntRepairPlan>selectRepairPlan(); List<EntRepairPlan>selectRepairPlan(String deviceId);
/** /**

View File

@ -19,8 +19,9 @@ public interface EntRepairRecordMapper extends BaseMapper<EntRepairRecord> {
/** /**
* 查询维修记录 * 查询维修记录
* @param deviceId
* @return List<EntRepairRecord> * @return List<EntRepairRecord>
* */ * */
List<EntRepairRecord>repairRecord(); List<EntRepairRecord>repairRecord(String deviceId);
} }

View File

@ -20,9 +20,10 @@ public interface EntReportRepairMapper extends BaseMapper<EntReportRepair> {
/** /**
* 查询报修列表 * 查询报修列表
* @param deviceId
* @return list * @return list
* */ * */
List<EntReportRepair>reportRecord(); List<EntReportRepair>reportRecord(String deviceId);
/** /**
* 修改报修列表 * 修改报修列表

View File

@ -21,12 +21,13 @@ public interface EntUserCredentialMapper extends BaseMapper<EntUserCredential> {
/** /**
* 企业用户岗位职责 * 企业用户证照表
* @param enterpriseId 企业id * @param enterpriseId 企业id
* @param entUserId 企业用户id * @param entUserId 企业用户id
* @param credentialState 证件
* @return EntUserCredential 企业用户证照 * @return EntUserCredential 企业用户证照
* */ * */
List<EntUserCredential>selectEntUserCredential(@Param("enterpriseId") String enterpriseId, @Param("entUserId")String entUserId); List<EntUserCredential>selectEntUserCredential(@Param("enterpriseId") String enterpriseId, @Param("entUserId")String entUserId,@Param("credentialState") Integer credentialState);
/** /**

View File

@ -56,6 +56,7 @@ public class EntDeviceInsCycle implements Serializable {
@TableField("inspection_charge_person") @TableField("inspection_charge_person")
private String inspectionChargePerson; private String inspectionChargePerson;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "最后巡检日期") @ApiModelProperty(value = "最后巡检日期")
@TableField("last_inspection_date") @TableField("last_inspection_date")
private Date lastInspectionDate; private Date lastInspectionDate;
@ -96,6 +97,10 @@ public class EntDeviceInsCycle implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private Date insRecordDate; private Date insRecordDate;
public Date getInsRecordDate() { public Date getInsRecordDate() {
return insRecordDate; return insRecordDate;
} }

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date; import java.util.Date;
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;
@ -21,10 +23,11 @@ public class EntInsRecord implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "巡检记录") @ApiModelProperty(value = "巡检记录id")
@TableField("ins_record_id") @TableField("ins_record_id")
private String insRecordId; private String insRecordId;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "巡检日期") @ApiModelProperty(value = "巡检日期")
@TableField("ins_record_date") @TableField("ins_record_date")
private Date insRecordDate; private Date insRecordDate;
@ -69,7 +72,16 @@ public class EntInsRecord implements Serializable {
@TableField("create_by") @TableField("create_by")
private String createBy; private String createBy;
@TableField(exist = false)
private String inspectionName;
public String getInspectionName() {
return inspectionName;
}
public void setInspectionName(String inspectionName) {
this.inspectionName = inspectionName;
}
public String getCycleId() { public String getCycleId() {
return cycleId; return cycleId;

View File

@ -30,6 +30,9 @@ public class AddOrUpdateDeviceInspectionCycleDto {
@ApiModelProperty("巡检周期") @ApiModelProperty("巡检周期")
private Integer inspectionCycle; private Integer inspectionCycle;
@ApiModelProperty(value = "巡检级别 1.一般 2.重大 3.紧急巡检")
private Integer inspectionState;
@ApiModelProperty("巡检负责人") @ApiModelProperty("巡检负责人")
private String inspectionChargePerson; private String inspectionChargePerson;
@ -52,6 +55,14 @@ public class AddOrUpdateDeviceInspectionCycleDto {
@TableField("next_time_inspection") @TableField("next_time_inspection")
private Date nextTimeInspection; private Date nextTimeInspection;
public Integer getInspectionState() {
return inspectionState;
}
public void setInspectionState(Integer inspectionState) {
this.inspectionState = inspectionState;
}
public Date getNextTimeInspection() { public Date getNextTimeInspection() {
return nextTimeInspection; return nextTimeInspection;
} }

View File

@ -3,6 +3,8 @@ package com.rzyc.model.dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/** /**
* 企业设备巡检记录 * 企业设备巡检记录
* @author Xuwanxin * @author Xuwanxin
@ -14,7 +16,7 @@ public class AddOrUpdateInspectionRecordDto {
private String insRecordId; private String insRecordId;
@ApiModelProperty(value = "巡检日期") @ApiModelProperty(value = "巡检日期")
private String insRecordDate; private Date insRecordDate;
@ApiModelProperty(value = "巡检记录工时") @ApiModelProperty(value = "巡检记录工时")
private Integer insRecordWorkingHour; private Integer insRecordWorkingHour;
@ -53,11 +55,11 @@ public class AddOrUpdateInspectionRecordDto {
this.insRecordId = insRecordId; this.insRecordId = insRecordId;
} }
public String getInsRecordDate() { public Date getInsRecordDate() {
return insRecordDate; return insRecordDate;
} }
public void setInsRecordDate(String insRecordDate) { public void setInsRecordDate(Date insRecordDate) {
this.insRecordDate = insRecordDate; this.insRecordDate = insRecordDate;
} }

View File

@ -1,12 +1,29 @@
package com.rzyc.model.dto; package com.rzyc.model.dto;
/**
* 送检记录dto
* @author Xuwanxin
* @date 2022/10/27
* */
public class OperatingInstructionDto { public class OperatingInstructionDto {
private String name; private String name;
private String deviceId;
private Integer page; private Integer page;
private Integer pageSize; private Integer pageSize;
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getName() { public String getName() {
return name; return name;
} }

View File

@ -46,9 +46,14 @@
select edic.*,eir.ins_record_date from ent_device_ins_cycle edic select edic.*,eir.ins_record_date from ent_device_ins_cycle edic
left join left join
(select * from ent_ins_record order by create_time desc limit 1)as eir on edic.inspection_id = eir.cycle_id (select * from ent_ins_record order by create_time desc limit 1)as eir on edic.inspection_id = eir.cycle_id
left join ent_device ed on edic.device_id = ed.device_id and overdue_inspection = 1
where edic.next_time_inspection = #{date} where edic.next_time_inspection = #{date}
</select> </select>
<select id="selectByDeviceId" resultMap="BaseResultMap">
select * from ent_device_ins_cycle where device_id = #{deviceId}
</select>
</mapper> </mapper>

View File

@ -32,6 +32,6 @@
</update> </update>
<select id="selectEntDeviceMaintenancePlanList"> <select id="selectEntDeviceMaintenancePlanList">
select * from ent_device_maintenance_plan select * from ent_device_maintenance_plan where device_id = #{deviceId}
</select> </select>
</mapper> </mapper>

View File

@ -36,6 +36,6 @@
<select id="selectEntDeviceMaintenanceRecord" resultMap="BaseResultMap"> <select id="selectEntDeviceMaintenanceRecord" resultMap="BaseResultMap">
select * from ent_device_maintenance_record select * from ent_device_maintenance_record where device_id = #{deviceId}
</select> </select>
</mapper> </mapper>

View File

@ -16,6 +16,7 @@
<result column="modify_by" property="modifyBy" /> <result column="modify_by" property="modifyBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="create_by" property="createBy" /> <result column="create_by" property="createBy" />
<result column="inspectionName" property="inspectionName"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
@ -30,9 +31,10 @@
</update> </update>
<select id="selectInspectionRecord" resultMap="BaseResultMap"> <select id="selectInspectionRecord" resultMap="BaseResultMap">
select * from ent_ins_record where device_id = #{deviceId} select eir.*,edic.inspection_name as inspectionName from ent_ins_record eir left join ent_device_ins_cycle edic on eir.cycle_id = edic.inspection_id
where eir.device_id = #{deviceId}
<if test="null != inspectionRecordName and '' != inspectionRecordName"> <if test="null != inspectionRecordName and '' != inspectionRecordName">
and ins_record_situation like concat('%',#{inspectionRecordName},'%') and eir.ins_record_situation like concat('%',#{inspectionRecordName},'%')
</if> </if>
</select> </select>

View File

@ -23,7 +23,7 @@
</sql> </sql>
<select id="selectInspectionRecord" resultMap="BaseResultMap"> <select id="selectInspectionRecord" resultMap="BaseResultMap">
select * from ent_inspection_record where 1=1 select * from ent_inspection_record where device_id = #{deviceId}
<if test="startTime != null and '' != startTime"> <if test="startTime != null and '' != startTime">
and start_time = #{startTime} and start_time = #{startTime}
</if> </if>

View File

@ -19,9 +19,9 @@
</sql> </sql>
<select id="selectOperatingInstructions" resultMap="BaseResultMap"> <select id="selectOperatingInstructions" resultMap="BaseResultMap">
select * from ent_operating_instruction select * from ent_operating_instruction where device_id = #{deviceId}
<if test="null != name and '' != name"> <if test="null != name and '' != name">
where op_instruction_name like concat('%',#{name},'%') and op_instruction_name like concat('%',#{name},'%')
</if> </if>
</select> </select>

View File

@ -23,7 +23,7 @@
</sql> </sql>
<select id="selectRepairPlan"> <select id="selectRepairPlan">
select * from ent_repair_plan select * from ent_repair_plan where device_id = #{deviceId}
</select> </select>
<update id="updateRepairPlan"> <update id="updateRepairPlan">

View File

@ -32,7 +32,7 @@
</sql> </sql>
<select id="repairRecord"> <select id="repairRecord">
select * from ent_report_repair select * from ent_report_repair where device_id = #{deviceId}
</select> </select>
</mapper> </mapper>

View File

@ -22,7 +22,7 @@
</sql> </sql>
<select id="reportRecord" resultMap="BaseResultMap"> <select id="reportRecord" resultMap="BaseResultMap">
select * from ent_report_repair select * from ent_report_repair where device_id = #{deviceId}
</select> </select>

View File

@ -23,7 +23,17 @@
</sql> </sql>
<select id="selectEntUserCredential" resultMap="BaseResultMap"> <select id="selectEntUserCredential" resultMap="BaseResultMap">
select * from ent_user_credential where ent_user_id = #{entUserId} select euc.* from ent_user_credential euc
<if test="null != enterpriseId and '' != enterpriseId">
left join ent_user eu on euc.ent_user_id = eu.ent_user_id and eu.enterprise_id = #{enterpriseId}
</if>
where 1=1
<if test="null != entUserId and '' != entUserId">
and euc.ent_user_id = #{entUserId}
</if>
<if test="null != credentialState and '' != credentialState">
and euc.credential_state = #{credentialState}
</if>
</select> </select>
<update id="updateEntUserCredential" parameterType="com.rzyc.model.EntUserCredential"> <update id="updateEntUserCredential" parameterType="com.rzyc.model.EntUserCredential">

View File

@ -249,7 +249,7 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan:update')") @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan:update"},name = "保养计划-新增和修改") @MethodAnnotation(authorizations = {"entDeviceMaintenancePlan:update"},name = "保养计划-新增和修改")
@ResponseBody @ResponseBody
public SingleResult entDeviceMaintenancePlanUpdate(EntDeviceMaintenancePlanDto deviceMaintenancePlanDto)throws Exception{ public SingleResult entDeviceMaintenancePlanUpdate(@RequestBody EntDeviceMaintenancePlanDto deviceMaintenancePlanDto)throws Exception{
return pcBusinessService.entDeviceMaintenancePlanUpdate(deviceMaintenancePlanDto); return pcBusinessService.entDeviceMaintenancePlanUpdate(deviceMaintenancePlanDto);
} }
@ -264,8 +264,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan','entDeviceMaintenancePlan:update')") @PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan','entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan","entDeviceMaintenancePlan:update"},name = "保养计划列表") @MethodAnnotation(authorizations = {"entDeviceMaintenancePlan","entDeviceMaintenancePlan:update"},name = "保养计划列表")
@ResponseBody @ResponseBody
public SingleResult<List<EntDeviceMaintenancePlan>> entDeviceMaintenancePlan(Integer page, Integer pageSize)throws Exception{ public SingleResult<List<EntDeviceMaintenancePlan>> entDeviceMaintenancePlan(String deviceId,Integer page, Integer pageSize)throws Exception{
return pcBusinessService.entDeviceMaintenancePlan(page,pageSize) ; return pcBusinessService.entDeviceMaintenancePlan(deviceId,page,pageSize) ;
} }
@ -280,7 +280,7 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord:update')") @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord:update"},name = "保养记录-新增和修改") @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord:update"},name = "保养记录-新增和修改")
@ResponseBody @ResponseBody
public SingleResult entDeviceMaintenanceRecordUpdate(EntDeviceMaintenanceRecordDto entDeviceMaintenanceRecordDto)throws Exception{ public SingleResult entDeviceMaintenanceRecordUpdate(@RequestBody EntDeviceMaintenanceRecordDto entDeviceMaintenanceRecordDto)throws Exception{
return pcBusinessService.entDeviceMaintenanceRecordUpdate(entDeviceMaintenanceRecordDto); return pcBusinessService.entDeviceMaintenanceRecordUpdate(entDeviceMaintenanceRecordDto);
} }
@ -297,8 +297,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')") @PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录") @MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录")
@ResponseBody @ResponseBody
public SingleResult<List<EntDeviceMaintenanceRecord>> entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{ public SingleResult<List<EntDeviceMaintenanceRecord>> entDeviceMaintenanceRecord(String deviceId,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize); return pcBusinessService.entDeviceMaintenanceRecord(deviceId,page,pageSize);
} }
@ -313,8 +313,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')") @PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')")
@MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录") @MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录")
@ResponseBody @ResponseBody
public SingleResult<List<EntInspectionRecord>> inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,Integer page,Integer pageSize)throws Exception { public SingleResult<List<EntInspectionRecord>> inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,Integer page,Integer pageSize,String deviceId)throws Exception {
return pcBusinessService.inspectionRecord(startTime, endTime, page, pageSize); return pcBusinessService.inspectionRecord(startTime, endTime, page, pageSize,deviceId);
} }
@ -344,8 +344,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('repairPlan','repairPlan:update')") @PreAuthorize("hasAnyAuthority('repairPlan','repairPlan:update')")
@MethodAnnotation(authorizations = {"repairPlan","repairPlan:update"},name = "维修计划") @MethodAnnotation(authorizations = {"repairPlan","repairPlan:update"},name = "维修计划")
@ResponseBody @ResponseBody
public SingleResult<EntRepairPlan> repairPlan(Integer page,Integer pageSize)throws Exception{ public SingleResult<EntRepairPlan> repairPlan(String deviceId,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.repairPlan(page,pageSize); return pcBusinessService.repairPlan(page,pageSize,deviceId);
} }
/** /**
@ -375,8 +375,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('repairRecord','repairRecord:update')") @PreAuthorize("hasAnyAuthority('repairRecord','repairRecord:update')")
@MethodAnnotation(authorizations = {"repairRecord","repairRecord:update"},name = "维修记录") @MethodAnnotation(authorizations = {"repairRecord","repairRecord:update"},name = "维修记录")
@ResponseBody @ResponseBody
public SingleResult<EntRepairRecord> repairRecord(Integer page,Integer pageSize)throws Exception{ public SingleResult<EntRepairRecord> repairRecord(Integer page,Integer pageSize,String deviceId)throws Exception{
return pcBusinessService.repairRecord(page,pageSize); return pcBusinessService.repairRecord(page,pageSize,deviceId);
} }
/** /**
@ -389,8 +389,8 @@ public class EnterpriseEquipmentController extends BaseController {
@PreAuthorize("hasAnyAuthority('reportRecord','reportRecord:update')") @PreAuthorize("hasAnyAuthority('reportRecord','reportRecord:update')")
@MethodAnnotation(authorizations = {"reportRecord","reportRecord:update"},name = "报修记录") @MethodAnnotation(authorizations = {"reportRecord","reportRecord:update"},name = "报修记录")
@ResponseBody @ResponseBody
public SingleResult<EntReportRepair> reportRecord(Integer page,Integer pageSize)throws Exception{ public SingleResult<EntReportRepair> reportRecord(Integer page,Integer pageSize,String deviceId)throws Exception{
return pcBusinessService.reportRecord(page,pageSize); return pcBusinessService.reportRecord(page,pageSize,deviceId);
} }
/** /**

View File

@ -270,13 +270,15 @@ public class PersonalController extends BaseController{
@ApiImplicitParam(name = "entUserId", value = "企业用户id",required = true, dataType = "string"), @ApiImplicitParam(name = "entUserId", value = "企业用户id",required = true, dataType = "string"),
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"), @ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"),
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"), @ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
@ApiImplicitParam(name = "credentialState", value = "证件过期 1.未过期 2.已超时",required = false, dataType = "int"),
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
}) })
@GetMapping(value = "/entUserCredential") @GetMapping(value = "/entUserCredential")
@PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')") @PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')")
@MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表") @MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表")
@ResponseBody @ResponseBody
public SingleResult<List<EntUserCredential>> entUserCredential(@RequestParam(required = true) String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize)throws Exception{ public SingleResult<List<EntUserCredential>> entUserCredential(@RequestParam(required = true) String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize,Integer credentialState,String enterpriseId)throws Exception{
return pcBusinessService.entUserCredential(null,entUserId,page,pageSize); return pcBusinessService.entUserCredential(enterpriseId,entUserId,page,pageSize,credentialState);
} }
/** /**

View File

@ -153,9 +153,9 @@ public class PcBusinessService extends BaseController {
} }
@PageOperation @PageOperation
public SingleResult entUserCredential(String enterpriseId, String entUserId,Integer page,Integer pageSize){ public SingleResult entUserCredential(String enterpriseId, String entUserId,Integer page,Integer pageSize,Integer credentialState){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntUserCredential>list = (Page<EntUserCredential>) entUserCredentialMapper.selectEntUserCredential(enterpriseId,entUserId); Page<EntUserCredential>list = (Page<EntUserCredential>) entUserCredentialMapper.selectEntUserCredential(enterpriseId,entUserId,credentialState);
singleResult.setDataPager(list); singleResult.setDataPager(list);
return singleResult; return singleResult;
} }
@ -258,7 +258,8 @@ public class PcBusinessService extends BaseController {
} }
singleResult = this.entUserCredentialUpdate(addOrUpdateEntUserDto.getEntUserCredentialUpdateDtos()); singleResult = this.entUserCredentialUpdate(addOrUpdateEntUserDto.getEntUserCredentialUpdateDtos());
} }
//插入清单和任务
autoAssignmentTask(entUser.getEntUserId(),addOrUpdateEntUserDto.getEnterpriseId(),addOrUpdateEntUserDto.getPostId());
return singleResult; return singleResult;
} }
@ -445,6 +446,12 @@ public class PcBusinessService extends BaseController {
public SingleResult addOrUpdateDeviceInspectionCycle(AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto) throws Exception { public SingleResult addOrUpdateDeviceInspectionCycle(AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto) throws Exception {
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
EntDeviceInsCycle cycle = entDeviceInsCycleMapper.selectByDeviceId(addOrUpdateDeviceInspectionCycleDto.getDeviceId());
if (null != cycle){
singleResult.setCode(Code.ERROR.getCode());
singleResult.setMessage(Message.NOT_ONLY_INSPECTION_CYCLE);
return singleResult;
}
Integer result = 0; Integer result = 0;
EntDeviceInsCycle entDeviceInsCycle = new EntDeviceInsCycle(); EntDeviceInsCycle entDeviceInsCycle = new EntDeviceInsCycle();
BeanUtils.copyProperties(addOrUpdateDeviceInspectionCycleDto,entDeviceInsCycle); BeanUtils.copyProperties(addOrUpdateDeviceInspectionCycleDto,entDeviceInsCycle);
@ -466,10 +473,18 @@ public class PcBusinessService extends BaseController {
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
EntInsRecord entInsRecord = new EntInsRecord(); EntInsRecord entInsRecord = new EntInsRecord();
BeanUtils.copyProperties(addOrUpdateInspectionRecordDto,entInsRecord); BeanUtils.copyProperties(addOrUpdateInspectionRecordDto,entInsRecord);
//存放设备的周期巡检id
EntDeviceInsCycle cycle = entDeviceInsCycleMapper.selectByDeviceId(addOrUpdateInspectionRecordDto.getDeviceId());
int result = 0; int result = 0;
if (null != addOrUpdateInspectionRecordDto && null != addOrUpdateInspectionRecordDto.getInsRecordId()){ if (null != addOrUpdateInspectionRecordDto && null != addOrUpdateInspectionRecordDto.getInsRecordId()){
if (cycle != null) {
entInsRecord.setCycleId(cycle.getInspectionId());
}
result = entInsRecordMapper.updateInspectionRecord(entInsRecord); result = entInsRecordMapper.updateInspectionRecord(entInsRecord);
}else { }else {
if (cycle != null) {
entInsRecord.setCycleId(cycle.getInspectionId());
}
result = entInsRecordMapper.insert(entInsRecord); result = entInsRecordMapper.insert(entInsRecord);
} }
if (result != 1 ){ if (result != 1 ){
@ -531,9 +546,9 @@ public class PcBusinessService extends BaseController {
} }
@PageOperation @PageOperation
public SingleResult entDeviceMaintenancePlan(Integer page,Integer pageSize){ public SingleResult entDeviceMaintenancePlan(String deviceId,Integer page,Integer pageSize){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntDeviceMaintenancePlan> list = (Page<EntDeviceMaintenancePlan>) entDeviceMaintenancePlanMapper.selectEntDeviceMaintenancePlanList(); Page<EntDeviceMaintenancePlan> list = (Page<EntDeviceMaintenancePlan>) entDeviceMaintenancePlanMapper.selectEntDeviceMaintenancePlanList(deviceId);
singleResult.setDataPager(list); singleResult.setDataPager(list);
return singleResult; return singleResult;
} }
@ -556,25 +571,25 @@ public class PcBusinessService extends BaseController {
} }
@PageOperation @PageOperation
public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize){ public SingleResult entDeviceMaintenanceRecord(String deviceId,Integer page,Integer pageSize){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntDeviceMaintenanceRecord> list = (Page<EntDeviceMaintenanceRecord>) entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(); Page<EntDeviceMaintenanceRecord> list = (Page<EntDeviceMaintenanceRecord>) entDeviceMaintenanceRecordMapper.selectEntDeviceMaintenanceRecord(deviceId);
singleResult.setDataPager(list); singleResult.setDataPager(list);
return singleResult; return singleResult;
} }
@PageOperation @PageOperation
public SingleResult inspectionRecord(String startTime,String endTime,Integer page,Integer pageSize){ public SingleResult inspectionRecord(String startTime,String endTime,Integer page,Integer pageSize,String deviceId){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntInspectionRecord>inspectionRecords = (Page<EntInspectionRecord>) entInspectionRecordMapper.selectInspectionRecord(startTime,endTime); Page<EntInspectionRecord>inspectionRecords = (Page<EntInspectionRecord>) entInspectionRecordMapper.selectInspectionRecord(startTime,endTime,deviceId);
singleResult.setDataPager(inspectionRecords); singleResult.setDataPager(inspectionRecords);
return singleResult; return singleResult;
} }
@PageOperation @PageOperation
public SingleResult repairPlan(Integer page,Integer pageSize){ public SingleResult repairPlan(Integer page,Integer pageSize,String deviceId){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntRepairPlan>entRepairPlans = (Page<EntRepairPlan>) entRepairPlanMapper.selectRepairPlan(); Page<EntRepairPlan>entRepairPlans = (Page<EntRepairPlan>) entRepairPlanMapper.selectRepairPlan(deviceId);
singleResult.setDataPager(entRepairPlans); singleResult.setDataPager(entRepairPlans);
return singleResult; return singleResult;
} }
@ -614,17 +629,17 @@ public class PcBusinessService extends BaseController {
} }
@PageOperation @PageOperation
public SingleResult repairRecord(Integer page,Integer pageSize){ public SingleResult repairRecord(Integer page,Integer pageSize,String deviceId){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntRepairRecord> repairRecords = (Page<EntRepairRecord>) entRepairRecordMapper.repairRecord(); Page<EntRepairRecord> repairRecords = (Page<EntRepairRecord>) entRepairRecordMapper.repairRecord(deviceId);
singleResult.setDataPager(repairRecords); singleResult.setDataPager(repairRecords);
return singleResult; return singleResult;
} }
@PageOperation @PageOperation
public SingleResult reportRecord(Integer page,Integer pageSize){ public SingleResult reportRecord(Integer page,Integer pageSize,String deviceId){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Page<EntReportRepair>reportRepairs = (Page<EntReportRepair>) entReportRepairMapper.reportRecord(); Page<EntReportRepair>reportRepairs = (Page<EntReportRepair>) entReportRepairMapper.reportRecord(deviceId);
singleResult.setDataPager(reportRepairs); singleResult.setDataPager(reportRepairs);
return singleResult; return singleResult;
} }
@ -649,7 +664,7 @@ public class PcBusinessService extends BaseController {
@PageOperation @PageOperation
public SingleResult operatingInstructions(OperatingInstructionDto operatingInstructionDto){ public SingleResult operatingInstructions(OperatingInstructionDto operatingInstructionDto){
SingleResult SingleResult = new SingleResult(); SingleResult SingleResult = new SingleResult();
Page<EntOperatingInstruction> page = (Page<EntOperatingInstruction>) entOperatingInstructionMapper.selectOperatingInstructions(operatingInstructionDto.getName()); Page<EntOperatingInstruction> page = (Page<EntOperatingInstruction>) entOperatingInstructionMapper.selectOperatingInstructions(operatingInstructionDto.getName(),operatingInstructionDto.getDeviceId());
SingleResult.setDataPager(page); SingleResult.setDataPager(page);
return SingleResult; return SingleResult;
} }
@ -674,8 +689,29 @@ public class PcBusinessService extends BaseController {
public SingleResult manualAssignmentTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto) throws Exception { public SingleResult manualAssignmentTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto) throws Exception {
SingleResult singleResult = new SingleResult(); return insertListAndTask(addOrUpdateEntUserPostTaskDto);
}
public void autoAssignmentTask(String userId,String enterpriseId,String postId) throws Exception {
List<InEntList>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);
}
}
private SingleResult insertListAndTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto) throws Exception {
EntPostList entPostList = new EntPostList(); EntPostList entPostList = new EntPostList();
SingleResult singleResult = new SingleResult();
BeanUtils.copyProperties(addOrUpdateEntUserPostTaskDto,entPostList); BeanUtils.copyProperties(addOrUpdateEntUserPostTaskDto,entPostList);
entPostList.setCreateBy(getUserId()); entPostList.setCreateBy(getUserId());
entPostList.setCreateTime(new Date()); entPostList.setCreateTime(new Date());

View File

@ -172,4 +172,6 @@ public class Message {
public static final String MOBILE_IS_ILLEGAL="手机号非法"; public static final String MOBILE_IS_ILLEGAL="手机号非法";
public static final String CANT_ADD_IN_COMPANY_LEVEL = "不允许在公司下直接编辑人员"; public static final String CANT_ADD_IN_COMPANY_LEVEL = "不允许在公司下直接编辑人员";
public static final String NOT_ONLY_INSPECTION_CYCLE = "已经存在周期巡检,仅仅允许一个";
} }