Commit cea890c8 authored by wanghao's avatar wanghao

1 燃气用户下 增加 安全装置加装信息 开发,并自测。

parent e56ada59
...@@ -8,7 +8,9 @@ import com.zehong.common.utils.SecurityUtils; ...@@ -8,7 +8,9 @@ import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.ServletUtils; import com.zehong.common.utils.ServletUtils;
import com.zehong.framework.web.service.TokenService; import com.zehong.framework.web.service.TokenService;
import com.zehong.system.domain.TDetectorUserCount; import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.GasUserAndSafetyDeviceVo;
import com.zehong.system.domain.vo.TDetectorUserInspectVo; import com.zehong.system.domain.vo.TDetectorUserInspectVo;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -177,6 +179,21 @@ public class TDetectorUserController extends BaseController ...@@ -177,6 +179,21 @@ public class TDetectorUserController extends BaseController
return toAjax(tDetectorUserService.insertTDetectorUser(tDetectorUser)); return toAjax(tDetectorUserService.insertTDetectorUser(tDetectorUser));
} }
/**
* 新增燃气用户和安全装置
*/
@PostMapping("/addUserAndSafetyDevice")
public AjaxResult addUserAndSafetyDevice(@RequestBody GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo) {
return toAjax(tDetectorUserService.addUserAndSafetyDevice(gasUserAndSafetyDeviceVo));
}
/**
* 修改燃气用户和安全装置
*/
@PostMapping("/updateUserAndSafetyDevice")
public AjaxResult updateUserAndSafetyDevice(@RequestBody GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo) {
return toAjax(tDetectorUserService.updateUserAndSafetyDevice(gasUserAndSafetyDeviceVo));
}
/** /**
* 修改燃气用户 * 修改燃气用户
*/ */
......
...@@ -2,6 +2,7 @@ package com.zehong.web.controller.supervise; ...@@ -2,6 +2,7 @@ package com.zehong.web.controller.supervise;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDetailInfoList;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.system.domain.TDeviceInfoS;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -124,4 +125,15 @@ public class TGasuserSafetyDeviceInfoController extends BaseController ...@@ -124,4 +125,15 @@ public class TGasuserSafetyDeviceInfoController extends BaseController
public void deleteSafetyDeviceInfo(@RequestBody Long safetyDetailId){ public void deleteSafetyDeviceInfo(@RequestBody Long safetyDetailId){
tGasuserSafetyDeviceInfoService.deleteSafetyDeviceInfo(safetyDetailId); tGasuserSafetyDeviceInfoService.deleteSafetyDeviceInfo(safetyDetailId);
} }
/**
* 根据 燃气用户id 查询集合数据
* @param userId i
*/
@GetMapping("/selectSafetyDeviceDetailInfoList/{userId}")
public AjaxResult selectSafetyDeviceDetailInfoList(@PathVariable("userId") Long userId){
return AjaxResult.success(tGasuserSafetyDeviceInfoService.selectSafetyDeviceDetailInfoList(userId));
}
} }
...@@ -51,8 +51,8 @@ public class TGasuserSafetyDeviceInfo extends BaseEntity ...@@ -51,8 +51,8 @@ public class TGasuserSafetyDeviceInfo extends BaseEntity
/** 安装位置 */ /** 安装位置 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装位置", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "安装位置")
private Date deviceInstallPosition; private String deviceInstallPosition;
/** 负责人 */ /** 负责人 */
@Excel(name = "负责人") @Excel(name = "负责人")
...@@ -138,12 +138,12 @@ public class TGasuserSafetyDeviceInfo extends BaseEntity ...@@ -138,12 +138,12 @@ public class TGasuserSafetyDeviceInfo extends BaseEntity
{ {
return deviceInstallTime; return deviceInstallTime;
} }
public void setDeviceInstallPosition(Date deviceInstallPosition) public void setDeviceInstallPosition(String deviceInstallPosition)
{ {
this.deviceInstallPosition = deviceInstallPosition; this.deviceInstallPosition = deviceInstallPosition;
} }
public Date getDeviceInstallPosition() public String getDeviceInstallPosition()
{ {
return deviceInstallPosition; return deviceInstallPosition;
} }
......
package com.zehong.system.domain.vo;
import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.TGasuserSafetyDeviceInfo;
import java.util.List;
public class GasUserAndSafetyDeviceVo {
private TDetectorUser detectorUser;
private List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList;
public TDetectorUser getDetectorUser() {
return detectorUser;
}
public void setDetectorUser(TDetectorUser detectorUser) {
this.detectorUser = detectorUser;
}
public List<TGasuserSafetyDeviceInfo> getGasuserSafetyDeviceInfoList() {
return gasuserSafetyDeviceInfoList;
}
public void setGasuserSafetyDeviceInfoList(List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList) {
this.gasuserSafetyDeviceInfoList = gasuserSafetyDeviceInfoList;
}
}
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TGasuserSafetyDeviceInfo; import com.zehong.system.domain.TGasuserSafetyDeviceInfo;
import org.apache.ibatis.annotations.Param;
/** /**
* 用户管理-燃气用户-安全装置加装维护Mapper接口 * 用户管理-燃气用户-安全装置加装维护Mapper接口
...@@ -74,4 +76,13 @@ public interface TGasuserSafetyDeviceInfoMapper ...@@ -74,4 +76,13 @@ public interface TGasuserSafetyDeviceInfoMapper
public int deleteSafetyDeviceListInfo(Long[] gasUserSafetyDeviceIds); public int deleteSafetyDeviceListInfo(Long[] gasUserSafetyDeviceIds);
public int deleteSafetyDeviceInfo(Long deviceId); public int deleteSafetyDeviceInfo(Long deviceId);
List<TGasuserSafetyDeviceInfo> selectSafetyDeviceDetailInfoList(Long userId);
/**
* 将关联设备信息与设备进行绑定
* @param gettDeviceInfoS
*/
void updatetRelationSafetyDeviceInfo(@Param("gettDeviceInfoS")List<TGasuserSafetyDeviceInfo> gettDeviceInfoS,
@Param("id") Long id);
} }
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import com.zehong.system.domain.TDetectorUser; import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.TDetectorUserCount; import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.GasUserAndSafetyDeviceVo;
import com.zehong.system.domain.vo.TDetectorUserInspectVo; import com.zehong.system.domain.vo.TDetectorUserInspectVo;
import com.zehong.system.domain.vo.TDetectorUserVO; import com.zehong.system.domain.vo.TDetectorUserVO;
import com.zehong.system.domain.vo.TMassMarksDetectorUserVO; import com.zehong.system.domain.vo.TMassMarksDetectorUserVO;
...@@ -103,6 +104,20 @@ public interface ITDetectorUserService ...@@ -103,6 +104,20 @@ public interface ITDetectorUserService
*/ */
public int insertTDetectorUser(TDetectorUser tDetectorUser); public int insertTDetectorUser(TDetectorUser tDetectorUser);
/**
* 新增燃气用户和安全装置
* @param gasUserAndSafetyDeviceVo gas
* @return r
*/
public int addUserAndSafetyDevice(GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo);
/**
* 修改燃气用户和安全装置
* @param gasUserAndSafetyDeviceVo gas
* @return r
*/
public int updateUserAndSafetyDevice(GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo);
/** /**
* 修改燃气用户 * 修改燃气用户
* *
......
...@@ -68,10 +68,16 @@ public interface ITGasuserSafetyDeviceInfoService ...@@ -68,10 +68,16 @@ public interface ITGasuserSafetyDeviceInfoService
/** /**
* 关联设备数据删除接口 * 关联设备数据删除接口
* @param deviceIds * @param deviceId
*/ */
void deleteSafetyDeviceInfo(Long deviceId); void deleteSafetyDeviceInfo(Long deviceId);
/**
* 根据 燃气用户id 查询数据
* @param userId
* @return
*/
List<TGasuserSafetyDeviceInfo> selectSafetyDeviceDetailInfoList(Long userId);
/** /**
* 删除用户管理-燃气用户-安全装置加装维护信息 * 删除用户管理-燃气用户-安全装置加装维护信息
* *
......
...@@ -8,9 +8,12 @@ import java.util.stream.Collectors; ...@@ -8,9 +8,12 @@ import java.util.stream.Collectors;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorUserCount; import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.TGasuserSafetyDeviceInfo;
import com.zehong.system.domain.vo.GasUserAndSafetyDeviceVo;
import com.zehong.system.domain.vo.TDetectorUserInspectVo; import com.zehong.system.domain.vo.TDetectorUserInspectVo;
import com.zehong.system.domain.vo.TDetectorUserVO; import com.zehong.system.domain.vo.TDetectorUserVO;
import com.zehong.system.mapper.TDeviceInfoMapper; import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.mapper.TGasuserSafetyDeviceInfoMapper;
import com.zehong.system.mapper.TSiteStationInfoMapper; import com.zehong.system.mapper.TSiteStationInfoMapper;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -19,6 +22,8 @@ import com.zehong.system.mapper.TDetectorUserMapper; ...@@ -19,6 +22,8 @@ import com.zehong.system.mapper.TDetectorUserMapper;
import com.zehong.system.domain.TDetectorUser; import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.service.ITDetectorUserService; import com.zehong.system.service.ITDetectorUserService;
import javax.annotation.Resource;
/** /**
* 燃气用户Service业务层处理 * 燃气用户Service业务层处理
* *
...@@ -35,6 +40,8 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -35,6 +40,8 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
@Autowired @Autowired
private TSiteStationInfoMapper tSiteStationInfoMapper; private TSiteStationInfoMapper tSiteStationInfoMapper;
@Resource
private TGasuserSafetyDeviceInfoMapper gasuserSafetyDeviceInfoMapper;
/** /**
* 查询探测器用户列表 * 查询探测器用户列表
...@@ -290,6 +297,45 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -290,6 +297,45 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
return tDetectorUserMapper.insertTDetectorUser(tDetectorUser); return tDetectorUserMapper.insertTDetectorUser(tDetectorUser);
} }
/**
* 新增燃气用户 和 安全装置
* @param gasUserAndSafetyDeviceVo gas
* @return r
*/
@Override
public int addUserAndSafetyDevice(GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo) {
TDetectorUser detectorUser = gasUserAndSafetyDeviceVo.getDetectorUser();
tDetectorUserMapper.insertTDetectorUser(detectorUser);
List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList = gasUserAndSafetyDeviceVo.getGasuserSafetyDeviceInfoList();
if (gasuserSafetyDeviceInfoList != null && gasuserSafetyDeviceInfoList.size() > 0) {
for (TGasuserSafetyDeviceInfo tGasuserSafetyDeviceInfo : gasuserSafetyDeviceInfoList) {
tGasuserSafetyDeviceInfo.setRelationGasuserId(detectorUser.getUserId());
}
gasuserSafetyDeviceInfoMapper.updatetRelationSafetyDeviceInfo(gasuserSafetyDeviceInfoList, detectorUser.getUserId());
}
return 1;
}
/**
* 修改燃气用户 和 安全装置
* @param gasUserAndSafetyDeviceVo gas
* @return r
*/
@Override
public int updateUserAndSafetyDevice(GasUserAndSafetyDeviceVo gasUserAndSafetyDeviceVo) {
TDetectorUser detectorUser = gasUserAndSafetyDeviceVo.getDetectorUser();
List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList = gasUserAndSafetyDeviceVo.getGasuserSafetyDeviceInfoList();
if (gasuserSafetyDeviceInfoList != null && gasuserSafetyDeviceInfoList.size() > 0) {
for (TGasuserSafetyDeviceInfo tGasuserSafetyDeviceInfo : gasuserSafetyDeviceInfoList) {
tGasuserSafetyDeviceInfo.setRelationGasuserId(detectorUser.getUserId());
}
gasuserSafetyDeviceInfoMapper.updatetRelationSafetyDeviceInfo(gasuserSafetyDeviceInfoList, detectorUser.getUserId());
}
return 1;
}
/** /**
* 修改燃气用户 * 修改燃气用户
* *
......
...@@ -109,6 +109,16 @@ public class TGasuserSafetyDeviceInfoServiceImpl implements ITGasuserSafetyDevic ...@@ -109,6 +109,16 @@ public class TGasuserSafetyDeviceInfoServiceImpl implements ITGasuserSafetyDevic
tGasuserSafetyDeviceInfoMapper.deleteSafetyDeviceInfo(deviceId); tGasuserSafetyDeviceInfoMapper.deleteSafetyDeviceInfo(deviceId);
} }
/**
* 根据燃气用户id查询数据
* @param userId u
* @return r
*/
@Override
public List<TGasuserSafetyDeviceInfo> selectSafetyDeviceDetailInfoList(Long userId) {
return tGasuserSafetyDeviceInfoMapper.selectSafetyDeviceDetailInfoList(userId);
}
/** /**
* 删除用户管理-燃气用户-安全装置加装维护信息 * 删除用户管理-燃气用户-安全装置加装维护信息
* *
......
...@@ -130,4 +130,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -130,4 +130,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="deleteSafetyDeviceInfo"> <update id="deleteSafetyDeviceInfo">
update t_gasuser_safety_device_info set is_del='1' where f_gasUser_safety_device_id = #{deviceId} update t_gasuser_safety_device_info set is_del='1' where f_gasUser_safety_device_id = #{deviceId}
</update> </update>
<select id="selectSafetyDeviceDetailInfoList" resultMap="TGasuserSafetyDeviceInfoResult" parameterType="Long">
<include refid="selectTGasuserSafetyDeviceInfoVo"/>
where f_relation_gasUser_id = #{userId} and is_del='0'
</select>
<!--将关联设备信息与设备进行绑定-->
<update id="updatetRelationSafetyDeviceInfo" parameterType="java.util.List">
update t_gasuser_safety_device_info set f_relation_gasUser_id = #{id}
where
f_gasUser_safety_device_id in
<foreach collection="gettDeviceInfoS" item="items" index="key" open="(" separator="," close=")">
#{items.gasUserSafetyDeviceId}
</foreach>
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -87,7 +87,7 @@ export function addSafetyDetailInfo(data) { ...@@ -87,7 +87,7 @@ export function addSafetyDetailInfo(data) {
// 关联安装加装装置 批量删除 // 关联安装加装装置 批量删除
export function deleteSafetyDeviceListInfo(data) { export function deleteSafetyDeviceListInfo(data) {
return request({ return request({
url: '/gasUserSafetyDevice/deleteSafetyDeviceListInfo', url: '/gasUserSafetyDevice/info/deleteSafetyDeviceListInfo',
method: 'post', method: 'post',
data: data data: data
}) })
...@@ -96,8 +96,36 @@ export function deleteSafetyDeviceListInfo(data) { ...@@ -96,8 +96,36 @@ export function deleteSafetyDeviceListInfo(data) {
// 删除关联设备信息 // 删除关联设备信息
export function deleteSafetyDeviceInfo(deviceId) { export function deleteSafetyDeviceInfo(deviceId) {
return request({ return request({
url: '/gasUserSafetyDevice/deleteSafetyDeviceInfo', url: '/gasUserSafetyDevice/info/deleteSafetyDeviceInfo',
method: 'delete', method: 'delete',
data:deviceId data:deviceId
}) })
}
// 根据燃气用户id 查询 关联 安全装置加装
export function selectSafetyDeviceDetailInfo(userId) {
return request({
url: '/gasUserSafetyDevice/info/selectSafetyDeviceDetailInfoList/'+ userId,
method: 'get'
})
}
// 新增燃气用户-包含安全装置
export function addUserAndSafetyDevice(data) {
return request({
url: '/supervise/user/addUserAndSafetyDevice',
method: 'post',
data: data
})
}
// 修改燃气用户-包含安全装置
export function updateUserAndSafetyDevice(data) {
return request({
url: '/supervise/user/updateUserAndSafetyDevice',
method: 'post',
data: data
})
} }
\ No newline at end of file
...@@ -1029,6 +1029,8 @@ export default { ...@@ -1029,6 +1029,8 @@ export default {
const deviceIds = this.ids; const deviceIds = this.ids;
const li=this.datalist; const li=this.datalist;
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
console.log("this.DetailInfoList = " + this.DetailInfoList);
console.log("this.datalist = " + this.datalist);
//修改 //修改
this.DetailInfoList=this.DetailInfoList.concat(this.datalist) this.DetailInfoList=this.DetailInfoList.concat(this.datalist)
//添加到数组中 以便下次使用 //添加到数组中 以便下次使用
......
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