Commit 414d3f77 authored by 王晓倩's avatar 王晓倩

企业基础信息页面显示经纬度数值,增加值班电话字段;

增加特种设备台账菜单,设备编号、设备类型、危险等级改为非必填;
设备增加报废字段,报废的设备不能在维修工单和保养计划中列入选项;
特种设备记录表增加device_id字段,设备表和特种设备记录的关联字段改为device_id。
parent c8a7eef9
......@@ -60,6 +60,7 @@ public class TDeviceInfoController extends BaseController
public AjaxResult listSpecial(TDeviceInfo tDeviceInfo)
{
tDeviceInfo.setIsSpecial("1");
tDeviceInfo.setIsCancel("0");
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return AjaxResult.success(list);
}
......
......@@ -61,6 +61,10 @@ public class TDeviceInfo extends BaseEntity
@Excel(name = "备注信息")
private String remarks;
/** 是否作废(0正常,1作废) */
@Excel(name = "是否作废(0正常,1作废)")
private String isCancel;
/** 是否删除(0正常,1删除) */
private String isDel;
......@@ -173,4 +177,19 @@ public class TDeviceInfo extends BaseEntity
return isDel;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getIsCancel() {
return isCancel;
}
public void setIsCancel(String isCancel) {
this.isCancel = isCancel;
}
}
......@@ -50,6 +50,10 @@ public class TEnterpriseInfo extends BaseEntity
@Excel(name = "营业期限")
private String businessTerm;
/** 值班电话 */
@Excel(name = "值班电话")
private String dutyPhone;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
......@@ -292,6 +296,14 @@ public class TEnterpriseInfo extends BaseEntity
return remarks;
}
public String getDutyPhone() {
return dutyPhone;
}
public void setDutyPhone(String dutyPhone) {
this.dutyPhone = dutyPhone;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -31,6 +31,9 @@ public class TSpecialDeviceRecord extends BaseEntity
@Excel(name = "设备编号")
private String deviceCode;
/** 设备id */
private Long deviceId;
/** 登记有效日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "登记有效日期", width = 30, dateFormat = "yyyy-MM-dd")
......@@ -71,6 +74,14 @@ public class TSpecialDeviceRecord extends BaseEntity
return deviceCode;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getOperateType() {
return operateType;
}
......
......@@ -69,6 +69,7 @@ public class TMaintainPlanServiceImpl implements ITMaintainPlanService
TSpecialDeviceRecord tSpecialDeviceRecord = new TSpecialDeviceRecord();
tSpecialDeviceRecord.setDeviceCode(tDeviceInfo.getDeviceCode());
tSpecialDeviceRecord.setDeviceId(tDeviceInfo.getId());
tSpecialDeviceRecord.setOperateCode(planCode);
tSpecialDeviceRecord.setOperateType("1");
tSpecialDeviceRecord.setEffectiveDate(tMaintainPlan.getPlanEndTime());
......
......@@ -67,6 +67,7 @@ public class TRepairOrderServiceImpl implements ITRepairOrderService
TSpecialDeviceRecord tSpecialDeviceRecord = new TSpecialDeviceRecord();
tSpecialDeviceRecord.setDeviceCode(tDeviceInfo.getDeviceCode());
tSpecialDeviceRecord.setDeviceId(tDeviceInfo.getId());
tSpecialDeviceRecord.setOperateCode(repairCode);
tSpecialDeviceRecord.setOperateType("2");
tSpecialDeviceRecord.setRecordStatus(tRepairOrder.getOrderStatus());
......
......@@ -19,11 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="isCancel" column="is_cancel" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTDeviceInfoVo">
select id, device_name, device_code, device_status, device_type, tag_number, device_grade, install_location, is_special, responsible_person, responsible_phone, create_time, update_time, is_del, remarks from t_device_info
select id, device_name, device_code, device_status, device_type, tag_number, device_grade, install_location, is_special, responsible_person, responsible_phone, create_time, update_time, is_cancel, is_del, remarks from t_device_info
</sql>
<select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
......@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tagNumber != null and tagNumber != ''"> and tag_number = #{tagNumber}</if>
<if test="deviceGrade != null and deviceGrade != ''"> and device_grade = #{deviceGrade}</if>
<if test="isSpecial != null and isSpecial != ''"> and is_special = #{isSpecial}</if>
<if test="isCancel != null and isCancel != ''"> and is_cancel = #{isCancel}</if>
<if test="responsiblePhone != null and responsiblePhone != ''"> and responsible_phone = #{responsiblePhone}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
......@@ -103,9 +105,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">is_del = #{remarks},</if>
<if test="isCancel != null">is_cancel = #{isCancel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where device_code = #{deviceCode} and is_del = '0'
where id = #{id} and is_del = '0'
</update>
<delete id="deleteTDeviceInfoById" parameterType="Long">
......
......@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="regulationType" column="regulation_type" />
<result property="regDate" column="reg_date" />
<result property="businessTerm" column="business_term" />
<result property="dutyPhone" column="duty_phone" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="businessScope" column="business_scope" />
......@@ -31,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTEnterpriseInfoVo">
select id, unit_name, org_code, run_address, reg_address, regulation_type, reg_date, business_term, longitude, latitude, business_scope, employee_num, legal_person, legal_person_phone, key_person, key_person_phone, safety_person, safety_person_phone, create_user_id, update_user_id, update_time, create_time, remarks from t_enterprise_info
select id, unit_name, org_code, run_address, reg_address, regulation_type, reg_date, business_term, duty_phone, longitude, latitude, business_scope, employee_num, legal_person, legal_person_phone, key_person, key_person_phone, safety_person, safety_person_phone, create_user_id, update_user_id, update_time, create_time, remarks from t_enterprise_info
</sql>
<select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult">
......@@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="regulationType != null">regulation_type,</if>
<if test="regDate != null">reg_date,</if>
<if test="businessTerm != null">business_term,</if>
<if test="dutyPhone != null">duty_phone,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="businessScope != null">business_scope,</if>
......@@ -100,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="regulationType != null">#{regulationType},</if>
<if test="regDate != null">#{regDate},</if>
<if test="businessTerm != null">#{businessTerm},</if>
<if test="dutyPhone != null">#{dutyPhone},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="businessScope != null">#{businessScope},</if>
......@@ -128,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="regulationType != null">regulation_type = #{regulationType},</if>
<if test="regDate != null">reg_date = #{regDate},</if>
<if test="businessTerm != null">business_term = #{businessTerm},</if>
duty_phone = #{dutyPhone},
longitude = #{longitude},
latitude = #{latitude},
business_scope = #{businessScope},
......
......@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t.id, t.operate_code, t.operate_type, t.device_code, t.effective_date, t.record_status, t.create_time, t.update_time, t.is_del,
d.device_name, d.device_type
from t_special_device_record t
left join t_device_info d on t.device_code = d.device_code
left join t_device_info d on t.device_id = d.id
</sql>
<select id="selectTSpecialDeviceRecordList" parameterType="TSpecialDeviceRecord" resultMap="TSpecialDeviceRecordResult">
......@@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operateCode != null">operate_code,</if>
<if test="operateType != null">operate_type,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceId != null">device_id,</if>
<if test="effectiveDate != null">effective_date,</if>
<if test="recordStatus != null">record_status,</if>
<if test="createTime != null">create_time,</if>
......@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operateCode != null">#{operateCode},</if>
<if test="operateType != null">#{operateType},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="effectiveDate != null">#{effectiveDate},</if>
<if test="recordStatus != null">#{recordStatus},</if>
<if test="createTime != null">#{createTime},</if>
......@@ -78,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="operateType != null">operate_type = #{operateType},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
<if test="recordStatus != null">record_status = #{recordStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
......
......@@ -29,8 +29,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="是否特种设备" prop="isSpecial">
<el-select v-model="queryParams.isSpecial" placeholder="请选择是否特种设备" clearable size="small">
<el-form-item label="是否报废" prop="isCancel">
<el-select v-model="queryParams.isCancel" placeholder="请选择是否报废" clearable size="small">
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
......@@ -74,25 +74,52 @@
</el-row>
<el-table v-loading="loading" :data="deviceInfoList" >
<el-table-column label="设备编码" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备类型" align="center" prop="deviceType" :formatter="typeFormat" />
<el-table-column label="设备编码" align="center" prop="deviceCode" >
<template slot-scope="scope">
<span v-if="scope.row.deviceCode == '' || scope.row.deviceCode == null">-</span>
<span v-else>{{scope.row.deviceCode}}</span>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType">
<template slot-scope="scope">
<span v-if="scope.row.deviceType == '' || scope.row.deviceType == null">-</span>
<span v-if="scope.row.deviceType == '1'">液位探测器</span>
<span v-if="scope.row.deviceType == '2'">气体探测器</span>
<span v-if="scope.row.deviceType == '3'">液压力探测器</span>
</template>
</el-table-column>
<el-table-column label="设备等级" align="center" prop="deviceGrade">
<template slot-scope="scope">
<span v-if="scope.row.deviceGrade == '' || scope.row.deviceGrade == null">-</span>
<span v-if="scope.row.deviceGrade == '1'">一级危险源</span>
<span v-if="scope.row.deviceGrade == '2'">二级危险源</span>
<span v-if="scope.row.deviceGrade == '3'">三级危险源</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" prop="deviceStatus" :formatter="statusFormat" />
<el-table-column label="设备等级" align="center" prop="deviceGrade" :formatter="gradeFormat" />
<el-table-column label="是否特种设备" align="center" prop="isSpecial" >
<el-table-column label="是否报废" align="center" prop="isCancel" >
<template slot-scope="scope">
<span v-if="scope.row.isSpecial == '0'"></span>
<span v-if="scope.row.isSpecial == '1'"></span>
<span v-if="scope.row.isCancel == '0'"></span>
<span v-if="scope.row.isCancel == '1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.isCancel=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
v-if="scope.row.isCancel=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCancel(scope.row)"
>报废</el-button>
<el-button
size="mini"
type="text"
......@@ -153,22 +180,22 @@
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<!--<el-col :span="11">
<el-form-item label="是否特种设备" prop="isSpecial">
<el-select v-model="form.isSpecial" placeholder="请选择是否特种设备" clearable size="small" style="width: 100%">
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
</el-col>-->
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="位号" prop="tagNumber">
<el-input v-model="form.tagNumber" placeholder="请输入位号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-col :span="12">
<el-form-item label="安装位置" prop="installLocation">
<el-input v-model="form.installLocation" placeholder="请输入安装位置" />
</el-form-item>
......@@ -272,7 +299,8 @@ export default {
deviceType: null,
tagNumber: null,
deviceGrade: null,
isSpecial: null,
isSpecial: "0",
isCancel: null,
responsiblePhone: null,
},
// 设备导入参数
......@@ -297,7 +325,7 @@ export default {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" }
],
deviceCode: [
/*deviceCode: [
{ required: true, message: "请输入设备编号", trigger: "blur" }
],
deviceType: [
......@@ -305,10 +333,10 @@ export default {
],
deviceGrade: [
{ required: true, message: "请选择设备等级", trigger: "blur" }
],
isSpecial: [
],*/
/*isSpecial: [
{ required: true, message: "请选择是否特种装备", trigger: "blur" }
],
],*/
}
};
},
......@@ -362,7 +390,7 @@ export default {
tagNumber: null,
deviceGrade: null,
installLocation: null,
isSpecial: null,
isSpecial: "0",
responsiblePerson: null,
responsiblePhone: null,
createTime: null,
......@@ -408,6 +436,7 @@ export default {
this.getList();
});
} else {
this.form.isSpecial="0";
addDeviceInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
......@@ -417,6 +446,21 @@ export default {
}
});
},
/** 报废报废按钮操作 */
handleCancel(row) {
// const ids = row.id || this.ids;
this.$confirm('是否确认将"' + row.deviceName + '"报废?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
row.isCancel = '1';
return updateDeviceInfo(row);
}).then(() => {
this.getList();
this.msgSuccess("报废成功");
}).catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
// const ids = row.id || this.ids;
......
......@@ -41,7 +41,12 @@
</template>
</el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备编号" align="center" prop="deviceCode" >
<template slot-scope="scope">
<span v-if="scope.row.deviceCode == '' || scope.row.deviceCode == null">-</span>
<span v-else>{{scope.row.deviceCode}}</span>
</template>
</el-table-column>
<el-table-column label="登记有效日期" align="center" prop="effectiveDate" width="180">
<template slot-scope="scope">
<span v-if="scope.row.effectiveDate != null && scope.row.effectiveDate != '' && getDays(scope.row.effectiveDate, new Date())<30 && getDays(scope.row.effectiveDate, new Date())>0" style="color: red;">
......
......@@ -43,15 +43,23 @@
<th>
经营范围
</th>
<td>
<td colspan="3">
{{form.businessScope}}
</td>
</tr>
<tr>
<th>
营业期限
</th>
<td>
{{form.businessTerm}}
</td>
<th>
值班电话
</th>
<td>
{{form.dutyPhone}}
</td>
</tr>
<tr>
<th>
......@@ -101,6 +109,20 @@
<span v-else>-</span>
</td>
</tr>
<tr>
<th>
经度
</th>
<td>
{{form.longitude}}
</td>
<th>
纬度
</th>
<td>
{{form.latitude}}
</td>
</tr>
<tr>
<th>
生产经营地址
......@@ -188,16 +210,23 @@
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-col :span="23">
<el-form-item label="经营范围" prop="businessScope">
<el-input v-model="form.businessScope" placeholder="请输入经营范围" />
</el-form-item>
</el-col>
<el-col :span="12">
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="营业期限" prop="businessTerm">
<el-input v-model="form.businessTerm" placeholder="请输入营业期限" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="值班电话" prop="dutyPhone">
<el-input v-model="form.dutyPhone" placeholder="请输入值班电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
......@@ -365,6 +394,9 @@ export default {
businessTerm: [
{ required: true, message: "请输入营业期限", trigger: "blur" }
],
dutyPhone: [
{ required: true, message: "请输入值班电话", trigger: "blur" }
],
runAddress: [
{ required: true, message: "请输入生产经营地址", trigger: "blur" }
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment