Commit e932e987 authored by 耿迪迪's avatar 耿迪迪

居民安检任务问题修改

parent 16be8bf6
......@@ -95,4 +95,11 @@ public interface TTaskMapper
* @return
*/
Map<String,Object> taskInspectDangerDetailInfo(Map<String,Object> param);
/**
* 检测任务是否存在安检
* @param taskId 任务主键
* @return int
*/
int taskIsHasInspect (Long taskId);
}
package com.zehong.system.service.impl;
import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTask;
......@@ -88,6 +89,7 @@ public class TTaskServiceImpl implements ITTaskService
* @param tTask 任务信息
*/
private void addTaskRelationInfo(TTask tTask){
if(CollectionUtils.isEmpty(tTask.getRelationInfoList())) return;
for (TTaskRelationInfo relationInfo : tTask.getRelationInfoList()){
relationInfo.setTaskId(tTask.getId());
relationInfo.setCreateTime(new Date());
......@@ -120,6 +122,8 @@ public class TTaskServiceImpl implements ITTaskService
@Transactional(rollbackFor = Exception.class)
public int deleteTTaskByIds(Long[] ids) {
for(Long id : ids){
int num = tTaskMapper.taskIsHasInspect(id);
if(num >0) throw new CustomException("已有用户安检,当前任务不能被删除");
tTaskRelationInfoMapper.deleteTTaskRelationInfoByTaskId(id);
}
return tTaskMapper.deleteTTaskByIds(ids);
......
......@@ -208,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t.start_time AS startTime,
t.end_time AS endTime,
t.type,
IF(type=1,(SELECT COUNT(1) FROM t_community),0) AS coummunityNum,
IF(type=1,(SELECT COUNT(1) FROM t_community com where com.id in (select re.relation_id from t_task_relation_info re where re.task_id = t.id and re.type = '1')),0) AS coummunityNum,
(case type
when 1 then
IF(ISNULL(t.task_type),
......@@ -272,5 +272,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="taskIsHasInspect" parameterType="Long" resultType="int">
SELECT count(id) FROM t_task_inspect WHERE task_id = #{taskId}
</select>
</mapper>
\ No newline at end of file
......@@ -220,12 +220,12 @@
<div id="inspect" v-if="checkType == 1 && jsondata.obj">
<div style="text-align: center;font-size: 26px;margin-bottom: 18px;">入户安检及整改作业</div>
<div style="text-align: center;font-size: 26px;margin-bottom: 18px;">入户安检单</div>
<div class="user-info">
<div class="item">用户名:{{ detailInfo.username }}</div>
<div class="item" style="flex:1.5">联系电话:{{ detailInfo.phone }}</div>
<div class="item">村庄:{{ detailInfo.villageName }}</div>
<div class="item" style="flex:1.4">村庄:{{ detailInfo.villageName }}</div>
<div class="item" style="flex:1.5">燃气表号:{{ detailInfo.usernum }}</div>
<div class="item">表底数:{{ jsondata.userInfo.biaodishuzhi }}</div>
</div>
......@@ -385,7 +385,7 @@
<tr>
<td>正常</td>
<td><input type="checkbox" :checked="jsondata.obj.dangerNumber == 0" class="input-disabled"/></td>
<td><input type="checkbox" :checked="jsondata.dangerNumber == 0" class="input-disabled"/></td>
</tr>
</table>
<div class="sign">
......
......@@ -440,6 +440,7 @@ export default {
exportLoading: false,
// 选中数组
ids: [],
titles: [],
// 非单个禁用
single: true,
// 非多个禁用
......@@ -556,6 +557,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.titles = selection.map((item) => item.title);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
......@@ -649,8 +651,9 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const titles = row.title || this.titles;
this.$confirm(
'是否确认删除入户安检任务编号为"' + ids + '"的数据项?',
'是否确认删除入户安检任务名称为"' + titles + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
......
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