修改区域功能
This commit is contained in:
parent
0df0c40570
commit
fa417ea81d
|
|
@ -297,8 +297,8 @@ public class ElderInfoMQDto implements Serializable {
|
|||
/**
|
||||
* 长者入住时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkinTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@ public class ElderInfoEntity implements Serializable {
|
|||
/**
|
||||
* 长者入住时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkinTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -517,4 +517,16 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.motionCtrl(cameraInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="护理单元-物联管理-摄像头信息-分页列表查询", notes="护理单元-物联管理-摄像头信息-分页列表查询")
|
||||
@GetMapping(value = "/previewList")
|
||||
public Result<IPage<CameraInfo>> previewList(CameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<CameraInfo> page = new Page<CameraInfo>(pageNo, pageSize);
|
||||
IPage<CameraInfo> pageList = service.previewList(page, CameraInfo);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class CameraInfo implements Serializable {
|
|||
/**设备类型*/
|
||||
@Excel(name = "设备类型", width = 15)
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
@Dict(dicCode = "tplink_device_type")
|
||||
private String deviceType;
|
||||
/**设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中*/
|
||||
@Excel(name = "设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中", width = 15, dicCode = "tplink_status")
|
||||
|
|
@ -139,9 +140,14 @@ public class CameraInfo implements Serializable {
|
|||
@ApiModelProperty(value = "护理单元编码")
|
||||
@Dict(dictTable ="nu_base_info",dicText = "nu_name",dicCode = "nu_id")
|
||||
private String nuId;
|
||||
|
||||
/**设备维度*/
|
||||
@Excel(name = "设备维度", width = 15)
|
||||
@ApiModelProperty(value = "设备维度")
|
||||
@Dict(dicCode = "dimension")
|
||||
private String dimension;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
@TableField(exist = false)
|
||||
private String nuName;
|
||||
@ApiModelProperty(value = "码流类型 0 代表主码流,1 代码子码流")
|
||||
@TableField(exist = false)
|
||||
|
|
|
|||
|
|
@ -28,4 +28,6 @@ public interface CameraInfoMapper extends BaseMapper<CameraInfo> {
|
|||
void updateCapabilityById(CameraInfo cameraInfo);
|
||||
void updateDeviceStatusByDevId(CameraInfo cameraInfo);
|
||||
void updatePlanByDevId(CameraInfo cameraInfo);
|
||||
|
||||
IPage<CameraInfo> previewList(Page<CameraInfo> page, @Param("params") CameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,4 +272,28 @@
|
|||
where device_index = #{deviceIndex}
|
||||
</update>
|
||||
|
||||
<select id="previewList" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select a.*,b.nu_name from (
|
||||
select id,nu_id,device_index,device_model,device_type,device_status from nu_iot_tplink_camera
|
||||
union all
|
||||
select id,nu_id,cid as device_index,'' as device_model,'sb' as device_type,relay_state as device_status from nu_iot_tq_water_meter
|
||||
union all
|
||||
select id,nu_id,cid as device_index,'' as device_model,'db' as device_type,relay_state as device_status from nu_iot_tq_electricity_meter
|
||||
union all
|
||||
select id,nu_id,sn as device_index,'' as device_model,'wsdj' as device_type,status as device_status from nu_iot_yiweilian_humid_device
|
||||
) a
|
||||
left join nu_base_info b on a.nu_id = b.nu_id
|
||||
<where>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
and b.nu_name like concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
<if test="params.deviceStatus != null and params.deviceStatus != ''">
|
||||
and a.device_status = #{params.deviceStatus}
|
||||
</if>
|
||||
<if test="params.deviceType != null and params.deviceType != ''">
|
||||
and a.device_type = #{params.deviceType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -86,4 +86,6 @@ public interface ICameraInfoService extends IService<CameraInfo> {
|
|||
* @return
|
||||
*/
|
||||
String zdyTplinkVideo(String nuId, String startTime, String endTime);
|
||||
|
||||
IPage<CameraInfo> previewList(Page<CameraInfo> page, CameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2942,6 +2942,11 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<CameraInfo> previewList(Page<CameraInfo> page, CameraInfo cameraInfo) {
|
||||
return baseMapper.previewList(page, cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回放视频转mp4上传
|
||||
*
|
||||
|
|
|
|||
|
|
@ -237,4 +237,30 @@ public class NuBaseInfoController extends JeecgController<NuBaseInfo, INuBaseInf
|
|||
return super.importExcel(request, response, NuBaseInfo.class);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "获取nuid编码")
|
||||
@GetMapping(value = "/getNuId")
|
||||
public Result<Map<String,String>> getNuId() {
|
||||
String nuId = service.getNuId();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("nuId",nuId);
|
||||
return Result.OK(map);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "护理单元-启用停用")
|
||||
@RequiresPermissions("nuBaseInfo:nu_base_info:edit")
|
||||
@RequestMapping(value = "/hldyQyty", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> hldyQyty(@RequestBody NuBaseInfo nuBaseInfo) {
|
||||
nuBaseInfoService.updateById(nuBaseInfo);
|
||||
NuBaseInfoMQDto nuBaseInfoMQDto = new NuBaseInfoMQDto();
|
||||
BeanUtils.copyProperties(nuBaseInfo, nuBaseInfoMQDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.hldy", "hldy.async.updateBase", nuBaseInfoMQDto);
|
||||
if(StringUtils.equals("5",nuBaseInfo.getStatus())){
|
||||
nuBaseInfoService.updateSbsf(nuBaseInfo);
|
||||
}
|
||||
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ public class NuBaseInfo implements Serializable {
|
|||
private java.lang.String izSync;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
@Dict(dictTable = "nu_biz_employees_info",dicCode = "id",dicText = "name")
|
||||
private java.lang.String fzr;
|
||||
|
||||
@ApiModelProperty(value = "负责人电话")
|
||||
|
|
|
|||
|
|
@ -34,4 +34,12 @@ public interface NuBaseInfoMapper extends BaseMapper<NuBaseInfo> {
|
|||
List<NuBaseInfo> getPermissionList(@Param("employeesId") String employeesId);
|
||||
|
||||
List<NuBaseInfo> queryReadList(@Param("employeesId") String employeesId,@Param("username") String username);
|
||||
|
||||
void updateSbsfTplink(@Param("nuId") String nuId);
|
||||
|
||||
void updateSbsfElectricity(@Param("nuId") String nuId);
|
||||
|
||||
void updateSbsfWater(@Param("nuId") String nuId);
|
||||
|
||||
void updateSbsfHumid(@Param("nuId") String nuId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,29 @@
|
|||
<!-- union ALL-->
|
||||
<!-- select fq_by as empId,nu_id,'thd' as type,'退货单' as typeName from nu_invoicing_thd_main where status = '1' and fq_by = #{employeesId} GROUP BY fq_by,nu_id-->
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="updateSbsfTplink">
|
||||
update nu_iot_tplink_camera
|
||||
set nu_id = null
|
||||
where nu_id = #{nuId}
|
||||
</update>
|
||||
<update id="updateSbsfElectricity">
|
||||
update nu_iot_tq_electricity_meter
|
||||
set nu_id = null
|
||||
where nu_id = #{nuId}
|
||||
</update>
|
||||
<update id="updateSbsfWater">
|
||||
update nu_iot_tq_water_meter
|
||||
set nu_id = null
|
||||
where nu_id = #{nuId}
|
||||
</update>
|
||||
<update id="updateSbsfHumid">
|
||||
update nu_iot_yiweilian_humid_device
|
||||
set nu_id = null
|
||||
where nu_id = #{nuId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -25,4 +25,8 @@ public interface INuBaseInfoService extends IService<NuBaseInfo> {
|
|||
IPage<NuBaseInfo> qyList(Page<NuBaseInfo> page, QueryWrapper<NuBaseInfo> queryWrapper);
|
||||
|
||||
IPage<NuBaseInfo> qyPemissionList(Page<NuBaseInfo> page, QueryWrapper<NuBaseInfo> queryWrapper,String employeesId);
|
||||
|
||||
String getNuId();
|
||||
|
||||
void updateSbsf(NuBaseInfo nuBaseInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.dto.IotNuBaseInfoMQDto;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.appConfig.entity.NuAppPermission;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
|
|
@ -20,6 +21,7 @@ import com.nu.modules.nubaseinfo.service.INuBaseInfoService;
|
|||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nuidPermission.entity.NuAppNuidPermission;
|
||||
import com.nu.modules.nuidPermission.service.INuAppNuidPermissionService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
|
|
@ -61,6 +63,9 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
@Autowired
|
||||
private INuAppNuidPermissionService nuAppNuidPermissionService;
|
||||
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
|
||||
@Override
|
||||
public void setNuId(NuBaseInfo nuBaseInfo) {
|
||||
|
|
@ -130,6 +135,51 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
return listPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNuId() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
String nuIdRet = "";
|
||||
if (StringUtils.isBlank(orgCode)) {
|
||||
throw new RuntimeException("请先在部门管理中设置机构编码!");
|
||||
}
|
||||
try {
|
||||
String nuId = baseMapper.getNuId();
|
||||
if (nuId == null) {
|
||||
// 年月 + 机构编码 + 001
|
||||
nuIdRet = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMM")) + orgCode + "001";
|
||||
} else {
|
||||
// 取最后3位
|
||||
String last3Digits = nuId.substring(nuId.length() - 3);
|
||||
// 转为整数并加1
|
||||
int nextNum = Integer.parseInt(last3Digits) + 1;
|
||||
// 格式化为3位数字,不足补零
|
||||
String formattedNum = String.format("%03d", nextNum);
|
||||
// 设置新的nuId
|
||||
nuIdRet = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMM")) + orgCode + formattedNum;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("护理单元添加失败,请联系管理员进行处理!");
|
||||
}
|
||||
return nuIdRet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSbsf(NuBaseInfo nuBaseInfo) {
|
||||
baseMapper.updateSbsfTplink(nuBaseInfo.getNuId());// 更新tplink
|
||||
baseMapper.updateSbsfElectricity(nuBaseInfo.getNuId());// 更新电表
|
||||
baseMapper.updateSbsfWater(nuBaseInfo.getNuId());// 更新水表
|
||||
baseMapper.updateSbsfHumid(nuBaseInfo.getNuId());// 更新湿度计
|
||||
// 通知运维平台设防对应设备释放
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
IotNuBaseInfoMQDto dto = new IotNuBaseInfoMQDto();
|
||||
dto.setNuId(nuBaseInfo.getNuId());
|
||||
dto.setOrgCode(orgCode);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotDeviceRelease", "hldy.iotDeviceRelease.result.async", dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(NuBaseInfoEntity dto) {
|
||||
NuBaseInfo nuBaseInfo = new NuBaseInfo();
|
||||
|
|
|
|||
Loading…
Reference in New Issue