Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_java
# Conflicts: # nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/mapper/xml/CameraInfoMapper.xml
This commit is contained in:
commit
724f323055
|
@ -0,0 +1,180 @@
|
|||
package com.nu.modules.nuInvoicingQgdInfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nuInvoicingQgdInfo.entity.NuInvoicingQgdInfo;
|
||||
import com.nu.modules.nuInvoicingQgdInfo.service.INuInvoicingQgdInfoService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="请购单-请购信息")
|
||||
@RestController
|
||||
@RequestMapping("/nuInvoicingQgdInfo/nuInvoicingQgdInfo")
|
||||
@Slf4j
|
||||
public class NuInvoicingQgdInfoController extends JeecgController<NuInvoicingQgdInfo, INuInvoicingQgdInfoService> {
|
||||
@Autowired
|
||||
private INuInvoicingQgdInfoService nuInvoicingQgdInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuInvoicingQgdInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "请购单-请购信息-分页列表查询")
|
||||
@ApiOperation(value="请购单-请购信息-分页列表查询", notes="请购单-请购信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuInvoicingQgdInfo>> queryPageList(NuInvoicingQgdInfo nuInvoicingQgdInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuInvoicingQgdInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuInvoicingQgdInfo, req.getParameterMap());
|
||||
Page<NuInvoicingQgdInfo> page = new Page<NuInvoicingQgdInfo>(pageNo, pageSize);
|
||||
IPage<NuInvoicingQgdInfo> pageList = nuInvoicingQgdInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuInvoicingQgdInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-请购信息-添加")
|
||||
@ApiOperation(value="请购单-请购信息-添加", notes="请购单-请购信息-添加")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuInvoicingQgdInfo nuInvoicingQgdInfo) {
|
||||
nuInvoicingQgdInfoService.save(nuInvoicingQgdInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuInvoicingQgdInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-请购信息-编辑")
|
||||
@ApiOperation(value="请购单-请购信息-编辑", notes="请购单-请购信息-编辑")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuInvoicingQgdInfo nuInvoicingQgdInfo) {
|
||||
nuInvoicingQgdInfoService.updateById(nuInvoicingQgdInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-请购信息-通过id删除")
|
||||
@ApiOperation(value="请购单-请购信息-通过id删除", notes="请购单-请购信息-通过id删除")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuInvoicingQgdInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-请购信息-批量删除")
|
||||
@ApiOperation(value="请购单-请购信息-批量删除", notes="请购单-请购信息-批量删除")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuInvoicingQgdInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "请购单-请购信息-通过id查询")
|
||||
@ApiOperation(value="请购单-请购信息-通过id查询", notes="请购单-请购信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuInvoicingQgdInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuInvoicingQgdInfo nuInvoicingQgdInfo = nuInvoicingQgdInfoService.getById(id);
|
||||
if(nuInvoicingQgdInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuInvoicingQgdInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuInvoicingQgdInfo
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuInvoicingQgdInfo nuInvoicingQgdInfo) {
|
||||
return super.exportXls(request, nuInvoicingQgdInfo, NuInvoicingQgdInfo.class, "请购单-请购信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuInvoicingQgdInfo.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.nu.modules.nuInvoicingQgdInfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_invoicing_qgd_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_invoicing_qgd_info对象", description="请购单-请购信息")
|
||||
public class NuInvoicingQgdInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**createBy*/
|
||||
@ApiModelProperty(value = "createBy")
|
||||
private java.lang.String createBy;
|
||||
/**createTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private java.util.Date createTime;
|
||||
/**updateBy*/
|
||||
@ApiModelProperty(value = "updateBy")
|
||||
private java.lang.String updateBy;
|
||||
/**updateTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private java.util.Date updateTime;
|
||||
/**sysOrgCode*/
|
||||
@ApiModelProperty(value = "sysOrgCode")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**请购单id*/
|
||||
@Excel(name = "请购单id", width = 15)
|
||||
@ApiModelProperty(value = "请购单id")
|
||||
private java.lang.String mainId;
|
||||
/**请购单编号*/
|
||||
@Excel(name = "请购单编号", width = 15)
|
||||
@ApiModelProperty(value = "请购单编号")
|
||||
private java.lang.String mainNo;
|
||||
/**物料id*/
|
||||
@Excel(name = "物料id", width = 15)
|
||||
@ApiModelProperty(value = "物料id")
|
||||
private java.lang.String wlId;
|
||||
/**物料编码*/
|
||||
@Excel(name = "物料编码", width = 15)
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private java.lang.String wlMaterialNo;
|
||||
/**物料名称*/
|
||||
@Excel(name = "物料名称", width = 15)
|
||||
@ApiModelProperty(value = "物料名称")
|
||||
private java.lang.String wlName;
|
||||
/**采购单位*/
|
||||
@Excel(name = "采购单位", width = 15)
|
||||
@ApiModelProperty(value = "采购单位")
|
||||
private java.lang.String wlUnits;
|
||||
/**规格型号*/
|
||||
@Excel(name = "规格型号", width = 15)
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private java.lang.String wlSpecificationModel;
|
||||
/**上限*/
|
||||
@Excel(name = "上限", width = 15)
|
||||
@ApiModelProperty(value = "上限")
|
||||
private java.lang.String wlUpperLimit;
|
||||
/**下限*/
|
||||
@Excel(name = "下限", width = 15)
|
||||
@ApiModelProperty(value = "下限")
|
||||
private java.lang.String wlLowerLimit;
|
||||
/**供应商id*/
|
||||
@Excel(name = "供应商id", width = 15)
|
||||
@ApiModelProperty(value = "供应商id")
|
||||
private java.lang.String suppliersId;
|
||||
/**供应商名称*/
|
||||
@Excel(name = "供应商名称", width = 15)
|
||||
@ApiModelProperty(value = "供应商名称")
|
||||
private java.lang.String suppliersName;
|
||||
/**请购数量*/
|
||||
@Excel(name = "请购数量", width = 15)
|
||||
@ApiModelProperty(value = "请购数量")
|
||||
private java.lang.Integer purchaseQuantity;
|
||||
/**brand*/
|
||||
@Excel(name = "brand", width = 15)
|
||||
@ApiModelProperty(value = "brand")
|
||||
private java.lang.String brand;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.nuInvoicingQgdInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuInvoicingQgdInfo.entity.NuInvoicingQgdInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuInvoicingQgdInfoMapper extends BaseMapper<NuInvoicingQgdInfo> {
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.nuIotTqApiRequestLog.mapper.NuIotTqApiRequestLogMapper">
|
||||
<mapper namespace="com.nu.modules.nuInvoicingQgdInfo.mapper.NuInvoicingQgdInfoMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.nuInvoicingQgdInfo.service;
|
||||
|
||||
import com.nu.modules.nuInvoicingQgdInfo.entity.NuInvoicingQgdInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuInvoicingQgdInfoService extends IService<NuInvoicingQgdInfo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.nuInvoicingQgdInfo.service.impl;
|
||||
|
||||
import com.nu.modules.nuInvoicingQgdInfo.entity.NuInvoicingQgdInfo;
|
||||
import com.nu.modules.nuInvoicingQgdInfo.mapper.NuInvoicingQgdInfoMapper;
|
||||
import com.nu.modules.nuInvoicingQgdInfo.service.INuInvoicingQgdInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuInvoicingQgdInfoServiceImpl extends ServiceImpl<NuInvoicingQgdInfoMapper, NuInvoicingQgdInfo> implements INuInvoicingQgdInfoService {
|
||||
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
package com.nu.modules.nuInvoicingQgdMain.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nuInvoicingQgdMain.entity.NuInvoicingQgdMain;
|
||||
import com.nu.modules.nuInvoicingQgdMain.service.INuInvoicingQgdMainService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 请购单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="请购单")
|
||||
@RestController
|
||||
@RequestMapping("/nuInvoicingQgdMain/nuInvoicingQgdMain")
|
||||
@Slf4j
|
||||
public class NuInvoicingQgdMainController extends JeecgController<NuInvoicingQgdMain, INuInvoicingQgdMainService> {
|
||||
@Autowired
|
||||
private INuInvoicingQgdMainService nuInvoicingQgdMainService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuInvoicingQgdMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "请购单-分页列表查询")
|
||||
@ApiOperation(value="请购单-分页列表查询", notes="请购单-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuInvoicingQgdMain>> queryPageList(NuInvoicingQgdMain nuInvoicingQgdMain,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuInvoicingQgdMain> queryWrapper = QueryGenerator.initQueryWrapper(nuInvoicingQgdMain, req.getParameterMap());
|
||||
Page<NuInvoicingQgdMain> page = new Page<NuInvoicingQgdMain>(pageNo, pageSize);
|
||||
IPage<NuInvoicingQgdMain> pageList = nuInvoicingQgdMainService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuInvoicingQgdMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-添加")
|
||||
@ApiOperation(value="请购单-添加", notes="请购单-添加")
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuInvoicingQgdMain nuInvoicingQgdMain) {
|
||||
nuInvoicingQgdMainService.save(nuInvoicingQgdMain);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuInvoicingQgdMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-编辑")
|
||||
@ApiOperation(value="请购单-编辑", notes="请购单-编辑")
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuInvoicingQgdMain nuInvoicingQgdMain) {
|
||||
nuInvoicingQgdMainService.updateById(nuInvoicingQgdMain);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-通过id删除")
|
||||
@ApiOperation(value="请购单-通过id删除", notes="请购单-通过id删除")
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuInvoicingQgdMainService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-批量删除")
|
||||
@ApiOperation(value="请购单-批量删除", notes="请购单-批量删除")
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuInvoicingQgdMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "请购单-通过id查询")
|
||||
@ApiOperation(value="请购单-通过id查询", notes="请购单-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuInvoicingQgdMain> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuInvoicingQgdMain nuInvoicingQgdMain = nuInvoicingQgdMainService.getById(id);
|
||||
if(nuInvoicingQgdMain==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuInvoicingQgdMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuInvoicingQgdMain
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuInvoicingQgdMain nuInvoicingQgdMain) {
|
||||
return super.exportXls(request, nuInvoicingQgdMain, NuInvoicingQgdMain.class, "请购单");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdMain:nu_invoicing_qgd_main:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuInvoicingQgdMain.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.nu.modules.nuInvoicingQgdMain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 请购单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_invoicing_qgd_main")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_invoicing_qgd_main对象", description="请购单")
|
||||
public class NuInvoicingQgdMain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**createBy*/
|
||||
@ApiModelProperty(value = "createBy")
|
||||
private java.lang.String createBy;
|
||||
/**createTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private java.util.Date createTime;
|
||||
/**updateBy*/
|
||||
@ApiModelProperty(value = "updateBy")
|
||||
private java.lang.String updateBy;
|
||||
/**updateTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private java.util.Date updateTime;
|
||||
/**sysOrgCode*/
|
||||
@ApiModelProperty(value = "sysOrgCode")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**请购单号*/
|
||||
@Excel(name = "请购单号", width = 15)
|
||||
@ApiModelProperty(value = "请购单号")
|
||||
private java.lang.Integer qgdNo;
|
||||
/**请购状态 0未下单 1已下单*/
|
||||
@Excel(name = "请购状态 0未下单 1已下单", width = 15)
|
||||
@ApiModelProperty(value = "请购状态 0未下单 1已下单")
|
||||
private java.lang.Integer status;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.nuInvoicingQgdMain.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuInvoicingQgdMain.entity.NuInvoicingQgdMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 请购单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuInvoicingQgdMainMapper extends BaseMapper<NuInvoicingQgdMain> {
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.nuIotTqElectricitySyncLog.mapper.NuIotTqElectricitySyncLogMapper">
|
||||
<mapper namespace="com.nu.modules.nuInvoicingQgdMain.mapper.NuInvoicingQgdMainMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.nuInvoicingQgdMain.service;
|
||||
|
||||
import com.nu.modules.nuInvoicingQgdMain.entity.NuInvoicingQgdMain;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 请购单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuInvoicingQgdMainService extends IService<NuInvoicingQgdMain> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.nuInvoicingQgdMain.service.impl;
|
||||
|
||||
import com.nu.modules.nuInvoicingQgdMain.entity.NuInvoicingQgdMain;
|
||||
import com.nu.modules.nuInvoicingQgdMain.mapper.NuInvoicingQgdMainMapper;
|
||||
import com.nu.modules.nuInvoicingQgdMain.service.INuInvoicingQgdMainService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 请购单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuInvoicingQgdMainServiceImpl extends ServiceImpl<NuInvoicingQgdMainMapper, NuInvoicingQgdMain> implements INuInvoicingQgdMainService {
|
||||
|
||||
}
|
|
@ -19,14 +19,13 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-摄像头信息
|
||||
* @Description: API-摄像头信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-01-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="护理单元-物联管理-摄像头信息")
|
||||
@RestController
|
||||
@RequestMapping("/nuIpadApi/iot/tplink/cameraInfo")
|
||||
@RequestMapping("/api/iot/tplink/cameraInfo")
|
||||
@Slf4j
|
||||
public class AppCameraInfoController extends JeecgController<AppCameraInfo, IAppCameraInfoService> {
|
||||
@Autowired
|
||||
|
@ -41,7 +40,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="护理单元-物联管理-摄像头信息-分页列表查询", notes="护理单元-物联管理-摄像头信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AppCameraInfo>> queryPageList(AppCameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -52,7 +50,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value="护理单元分页列表查询", notes="护理单元分页列表查询")
|
||||
@GetMapping(value = "/nuList")
|
||||
public Result<IPage<AppCameraInfo>> queryNuPageList(AppCameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -63,7 +60,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value="护理单元-物联管理-摄像头信息-查询", notes="护理单元-物联管理-摄像头信息-查询")
|
||||
@GetMapping(value = "/getByNuId")
|
||||
public Result<AppCameraInfo> getByNuId(AppCameraInfo CameraInfo) {
|
||||
AppCameraInfo entity = service.getByNuId(CameraInfo);
|
||||
|
@ -71,7 +67,7 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
}
|
||||
|
||||
/**
|
||||
* 重启摄像头
|
||||
* 修改摄像头信息
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
|
@ -104,17 +100,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return service.setImageCommon(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSD能力集
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getOsdCapability")
|
||||
public Result<JSONObject> getOsdCapability(@RequestBody Map<String,Object> map) {
|
||||
return service.getOsdCapability(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSD参数
|
||||
*
|
||||
|
@ -181,50 +166,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return service.getPreviewUrl(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取镜头遮挡参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getTamperDet")
|
||||
public Result<JSONObject> getTamperDet(@RequestBody Map<String,Object> map) {
|
||||
return service.getTamperDet(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置镜头遮挡参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setTamperDet")
|
||||
public Result<String> setTamperDet(@RequestBody Map<String,Object> map) {
|
||||
return service.setTamperDet(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取镜头遮挡处理方式
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getTamperNotif")
|
||||
public Result<JSONObject> getTamperNotif(@RequestBody Map<String,Object> map) {
|
||||
return service.getTamperNotif(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置镜头遮挡处理方式
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setTamperNotif")
|
||||
public Result setTamperNotif(@RequestBody Map<String,Object> map) {
|
||||
return service.setTamperNotif(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报警声音试听
|
||||
*
|
||||
|
@ -236,50 +177,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return service.testAudio(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取白光/声音告警参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getAlarmInfo")
|
||||
public Result<JSONObject> getAlarmInfo(@RequestBody Map<String,Object> map) {
|
||||
return service.getAlarmInfo(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白光/声音告警参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setAlarmInfo")
|
||||
public Result<String> setAlarmInfo(@RequestBody Map<String,Object> map) {
|
||||
return service.setAlarmInfo(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取白光/声音告警布防时间
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getAlarmPlan")
|
||||
public Result<JSONObject> getAlarmPlan(@RequestBody Map<String,Object> map) {
|
||||
return service.getAlarmPlan(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白光/声音告警布防时间
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setAlarmPlan")
|
||||
public Result setAlarmPlan(@RequestBody Map<String,Object> map) {
|
||||
return service.setAlarmPlan(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索某天的录像数据
|
||||
*
|
||||
|
@ -360,4 +257,15 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
return service.getUploadToServerProcess(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/motionCtrl")
|
||||
public Result motionCtrl(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.motionCtrl(cameraInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -278,4 +278,13 @@ public class AppCameraInfo implements Serializable {
|
|||
@ApiModelProperty(value = "上传进度")
|
||||
@TableField(exist = false)
|
||||
private String process;
|
||||
@ApiModelProperty(value = "移动方向;枚举:[0:左上,1:上,2:右上,3:左,4:持续水平转动,5:右,6:左下,7:下,8:右下,9:缩小画面,10:放大画面,11:聚焦近处,12:聚焦远处]")
|
||||
@TableField(exist = false)
|
||||
private String direction;
|
||||
@ApiModelProperty(value = "开始或停止移动;枚举:[0:停止,1:开始]")
|
||||
@TableField(exist = false)
|
||||
private String startOrNot;
|
||||
@ApiModelProperty(value = "球机移动速度")
|
||||
@TableField(exist = false)
|
||||
private String speed;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ public enum AppApiEnum {
|
|||
IPC_GET_MULTITRANS_URL("/tums/playback/v1/getMultitransUrl","获取nvmp设备双向通信URL"),
|
||||
IPC_UPLOAD_TO_SERVER("/tums/playback/v1/uploadToServer","回放视频转mp4上传"),
|
||||
IPC_STOP_UPLOAD_TO_SERVER("/tums/preview/v1/stopUploadToServer","停止转存MP4上传任务"),
|
||||
IPC_GET_UPLOAD_TO_SERVER_PROCESS("/tums/preview/v1/getUploadToServerProcess","获取转存MP4上传任务进度");
|
||||
IPC_GET_UPLOAD_TO_SERVER_PROCESS("/tums/preview/v1/getUploadToServerProcess","获取转存MP4上传任务进度"),
|
||||
IPC_MOTION_CTRL("/tums/ptz/v1/motionCtrl","高速球机移动方向控制");
|
||||
|
||||
private final String value;//自定义属性,枚举值,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getValue();
|
||||
private final String remark;//自定义属性,枚举描述,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getRemark();
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
ifnull(c.multitrans,0) as multitrans
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
left join nu_iot_tplink_camera_capability c on a.device_index = c.device_index
|
||||
<where>
|
||||
<if test="params.deviceIndex != null and params.deviceIndex != ''">
|
||||
|
@ -46,6 +46,9 @@
|
|||
<if test="params.regionName != null and params.regionName != ''">
|
||||
AND a.region_name LIKE concat('%',#{params.regionName},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
|
@ -87,12 +90,12 @@
|
|||
|
||||
<select id="findNuPage" parameterType="com.nu.modules.iot.tplink.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.entity.AppCameraInfo">
|
||||
select
|
||||
id as nuId,
|
||||
nu_id as nuId,
|
||||
nu_name as nuName
|
||||
from nu_base_info b
|
||||
<where>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND b.id = #{params.nuId}
|
||||
AND b.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
|
@ -125,7 +128,7 @@
|
|||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
|
@ -154,7 +157,7 @@
|
|||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
where a.nu_id = #{nuId}
|
||||
</select>
|
||||
|
||||
|
|
|
@ -45,4 +45,5 @@ public interface IAppCameraInfoService extends IService<AppCameraInfo> {
|
|||
Result uploadToServer(AppCameraInfo cameraInfo);
|
||||
Result<String> stopUploadToServer(AppCameraInfo cameraInfo);
|
||||
Result getUploadToServerProcess(AppCameraInfo cameraInfo);
|
||||
Result motionCtrl(AppCameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
@ -1890,4 +1890,34 @@ public class AppCameraInfoServiceImpl extends ServiceImpl<AppCameraInfoMapper, A
|
|||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result motionCtrl(AppCameraInfo cameraInfo){
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("{");
|
||||
sb.append("\"id\"").append(":").append("\"").append(cameraInfo.getDeviceIndex()).append("\",");
|
||||
sb.append("\"direction\"").append(":").append(cameraInfo.getDirection()).append(",");
|
||||
sb.append("\"startOrNot\"").append(":").append(cameraInfo.getStartOrNot()).append(",");
|
||||
sb.append("\"speed\"").append(":").append("\"").append(cameraInfo.getSpeed()).append("\"");
|
||||
sb.append("}");
|
||||
String res = tumsApi.motionCtrl(sb.toString());
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
int errorCode = jsonObject.getInt("error_code");
|
||||
if(errorCode == 0){
|
||||
return Result.OK();
|
||||
}else{
|
||||
String errMsg = jsonObject.getStr("msg");
|
||||
if(errMsg == null || errMsg.equals("")) {
|
||||
AppErrorCode errVo = errorCodeService.getByCode(String.valueOf(errorCode));
|
||||
errMsg = errVo.getErrorMsg();
|
||||
}
|
||||
log.info("motionCtrl:{}-{}",errorCode,errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,4 +268,17 @@ public class AppTumsApi {
|
|||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String motionCtrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("motionCtrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_MOTION_CTRL.getValue());
|
||||
log.info("motionCtrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.nuIotTqApiRequestLog.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuIotTqApiRequestLog.entity.NuIotTqApiRequestLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuIotTqApiRequestLogMapper extends BaseMapper<NuIotTqApiRequestLog> {
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.nuIotTqApiRequestLog.service;
|
||||
|
||||
import com.nu.modules.nuIotTqApiRequestLog.entity.NuIotTqApiRequestLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuIotTqApiRequestLogService extends IService<NuIotTqApiRequestLog> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.nuIotTqApiRequestLog.service.impl;
|
||||
|
||||
import com.nu.modules.nuIotTqApiRequestLog.entity.NuIotTqApiRequestLog;
|
||||
import com.nu.modules.nuIotTqApiRequestLog.mapper.NuIotTqApiRequestLogMapper;
|
||||
import com.nu.modules.nuIotTqApiRequestLog.service.INuIotTqApiRequestLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuIotTqApiRequestLogServiceImpl extends ServiceImpl<NuIotTqApiRequestLogMapper, NuIotTqApiRequestLog> implements INuIotTqApiRequestLogService {
|
||||
|
||||
}
|
|
@ -1,180 +0,0 @@
|
|||
package com.nu.modules.nuIotTqElectricitySyncLog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.service.INuIotTqElectricitySyncLogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 同步日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="同步日志")
|
||||
@RestController
|
||||
@RequestMapping("/nuIotTqElectricitySyncLog/nuIotTqElectricitySyncLog")
|
||||
@Slf4j
|
||||
public class NuIotTqElectricitySyncLogController extends JeecgController<NuIotTqElectricitySyncLog, INuIotTqElectricitySyncLogService> {
|
||||
@Autowired
|
||||
private INuIotTqElectricitySyncLogService nuIotTqElectricitySyncLogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuIotTqElectricitySyncLog
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步日志-分页列表查询")
|
||||
@ApiOperation(value="同步日志-分页列表查询", notes="同步日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuIotTqElectricitySyncLog>> queryPageList(NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuIotTqElectricitySyncLog> queryWrapper = QueryGenerator.initQueryWrapper(nuIotTqElectricitySyncLog, req.getParameterMap());
|
||||
Page<NuIotTqElectricitySyncLog> page = new Page<NuIotTqElectricitySyncLog>(pageNo, pageSize);
|
||||
IPage<NuIotTqElectricitySyncLog> pageList = nuIotTqElectricitySyncLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuIotTqElectricitySyncLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步日志-添加")
|
||||
@ApiOperation(value="同步日志-添加", notes="同步日志-添加")
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog) {
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuIotTqElectricitySyncLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步日志-编辑")
|
||||
@ApiOperation(value="同步日志-编辑", notes="同步日志-编辑")
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog) {
|
||||
nuIotTqElectricitySyncLogService.updateById(nuIotTqElectricitySyncLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步日志-通过id删除")
|
||||
@ApiOperation(value="同步日志-通过id删除", notes="同步日志-通过id删除")
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuIotTqElectricitySyncLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步日志-批量删除")
|
||||
@ApiOperation(value="同步日志-批量删除", notes="同步日志-批量删除")
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuIotTqElectricitySyncLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步日志-通过id查询")
|
||||
@ApiOperation(value="同步日志-通过id查询", notes="同步日志-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuIotTqElectricitySyncLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog = nuIotTqElectricitySyncLogService.getById(id);
|
||||
if(nuIotTqElectricitySyncLog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuIotTqElectricitySyncLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuIotTqElectricitySyncLog
|
||||
*/
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog) {
|
||||
return super.exportXls(request, nuIotTqElectricitySyncLog, NuIotTqElectricitySyncLog.class, "同步日志");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nuIotTqElectricitySyncLog:nu_iot_tq_electricity_sync_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuIotTqElectricitySyncLog.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
package com.nu.modules.nuIotTqElectricitySyncLog.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 同步日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tq_electricity_sync_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tq_electricity_sync_log对象", description="同步日志")
|
||||
public class NuIotTqElectricitySyncLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**createBy*/
|
||||
@ApiModelProperty(value = "createBy")
|
||||
private String createBy;
|
||||
/**createTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private Date createTime;
|
||||
/**updateBy*/
|
||||
@ApiModelProperty(value = "updateBy")
|
||||
private String updateBy;
|
||||
/**updateTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private Date updateTime;
|
||||
/**主表id*/
|
||||
@Excel(name = "主表id", width = 15)
|
||||
@ApiModelProperty(value = "主表id")
|
||||
private String mainId;
|
||||
/**主表名称*/
|
||||
@Excel(name = "主表名称", width = 15)
|
||||
@ApiModelProperty(value = "主表名称")
|
||||
private String mainName;
|
||||
/**同步类型*/
|
||||
@Excel(name = "同步类型", width = 15)
|
||||
@ApiModelProperty(value = "同步类型")
|
||||
private String syncType;
|
||||
/**原机构id*/
|
||||
@Excel(name = "原机构id", width = 15)
|
||||
@ApiModelProperty(value = "原机构id")
|
||||
private String orgId;
|
||||
/**原机构名称*/
|
||||
@Excel(name = "原机构名称", width = 15)
|
||||
@ApiModelProperty(value = "原机构名称")
|
||||
private String orgName;
|
||||
/**原机构编码*/
|
||||
@Excel(name = "原机构编码", width = 15)
|
||||
@ApiModelProperty(value = "原机构编码")
|
||||
private String orgCode;
|
||||
/**新机构id*/
|
||||
@Excel(name = "新机构id", width = 15)
|
||||
@ApiModelProperty(value = "新机构id")
|
||||
private String newOrgId;
|
||||
/**新机构名称*/
|
||||
@Excel(name = "新机构名称", width = 15)
|
||||
@ApiModelProperty(value = "新机构名称")
|
||||
private String newOrgName;
|
||||
/**新机构编码*/
|
||||
@Excel(name = "新机构编码", width = 15)
|
||||
@ApiModelProperty(value = "新机构编码")
|
||||
private String newOrgCode;
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String content;
|
||||
/**服务类型*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
private String serverType;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.nuIotTqElectricitySyncLog.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 同步日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuIotTqElectricitySyncLogMapper extends BaseMapper<NuIotTqElectricitySyncLog> {
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.nuIotTqElectricitySyncLog.service;
|
||||
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 同步日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuIotTqElectricitySyncLogService extends IService<NuIotTqElectricitySyncLog> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.nuIotTqElectricitySyncLog.service.impl;
|
||||
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.mapper.NuIotTqElectricitySyncLogMapper;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.service.INuIotTqElectricitySyncLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 同步日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuIotTqElectricitySyncLogServiceImpl extends ServiceImpl<NuIotTqElectricitySyncLogMapper, NuIotTqElectricitySyncLog> implements INuIotTqElectricitySyncLogService {
|
||||
|
||||
}
|
|
@ -47,7 +47,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
*/
|
||||
@Api(tags="护理单元-物联管理-TPLINK告警日志信息")
|
||||
@RestController
|
||||
@RequestMapping("/iot/alarmLog")
|
||||
@RequestMapping("/iot/tplink/alarmLog")
|
||||
@Slf4j
|
||||
public class AlarmLogController extends JeecgController<AlarmLog, IAlarmLogService> {
|
||||
@Autowired
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|||
*/
|
||||
@Api(tags="护理单元-物联管理-摄像头信息")
|
||||
@RestController
|
||||
@RequestMapping("/iot/cameraInfo")
|
||||
@RequestMapping("/iot/tplink/cameraInfo")
|
||||
@Slf4j
|
||||
public class CameraInfoController extends JeecgController<CameraInfo, ICameraInfoService> {
|
||||
@Autowired
|
||||
|
@ -130,6 +130,17 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.getIpcCapability(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步此项目下的IPC设备
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/syncProjectIpcDevice")
|
||||
public Result<String> syncProjectIpcDevice(CameraInfo cameraInfo) {
|
||||
return service.syncProjectIpcDevice(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画面基本信息
|
||||
*
|
||||
|
@ -488,4 +499,15 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.getUploadToServerProcess(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/motionCtrl")
|
||||
public Result motionCtrl(CameraInfo cameraInfo) throws Exception{
|
||||
return service.motionCtrl(cameraInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ public class CameraInfo implements Serializable {
|
|||
private String topTime;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元编码")
|
||||
@Dict(dictTable ="nu_base_info",dicText = "nu_name",dicCode = "code")
|
||||
@Dict(dictTable ="nu_base_info",dicText = "nu_name",dicCode = "nu_id")
|
||||
private String nuId;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
|
@ -292,4 +292,13 @@ public class CameraInfo implements Serializable {
|
|||
@ApiModelProperty(value = "IDS")
|
||||
@TableField(exist = false)
|
||||
private String ids;
|
||||
@ApiModelProperty(value = "移动方向;枚举:[0:左上,1:上,2:右上,3:左,4:持续水平转动,5:右,6:左下,7:下,8:右下,9:缩小画面,10:放大画面,11:聚焦近处,12:聚焦远处]")
|
||||
@TableField(exist = false)
|
||||
private String direction;
|
||||
@ApiModelProperty(value = "开始或停止移动;枚举:[0:停止,1:开始]")
|
||||
@TableField(exist = false)
|
||||
private String startOrNot;
|
||||
@ApiModelProperty(value = "球机移动速度")
|
||||
@TableField(exist = false)
|
||||
private String speed;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
ifnull(c.multitrans,0) as multitrans
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
left join nu_iot_tplink_camera_capability c on a.device_index = c.device_index
|
||||
<where>
|
||||
<if test="params.deviceIndex != null and params.deviceIndex != ''">
|
||||
|
@ -47,6 +47,9 @@
|
|||
<if test="params.regionName != null and params.regionName != ''">
|
||||
AND a.region_name LIKE concat('%',#{params.regionName},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
|
@ -85,7 +88,7 @@
|
|||
record_plan_id as recordPlanId,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
AND a.project_id = #{projectId}
|
||||
|
@ -129,8 +132,8 @@
|
|||
|
||||
<select id="findNuPage" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select
|
||||
nu_id as nuId,
|
||||
nu_name as nuName
|
||||
nu_id as nuId,
|
||||
nu_name as nuName
|
||||
from nu_base_info b
|
||||
<where>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
|
@ -167,7 +170,7 @@
|
|||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.id
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ public interface ICameraInfoService extends IService<CameraInfo> {
|
|||
void rebootDevice(CameraInfo cameraInfo);
|
||||
void sync(String jsonResponse);
|
||||
void syncCapability(String deviceIndex,String jsonResponse);
|
||||
Result<String> syncProjectIpcDevice(CameraInfo cameraInfo);
|
||||
Result<JSONObject> getIpcCapability(CameraInfo cameraInfo);
|
||||
Result<JSONObject> getImageCommon(Map<String,Object> map);
|
||||
Result setImageCommon(Map<String,Object> map);
|
||||
|
@ -59,4 +60,5 @@ public interface ICameraInfoService extends IService<CameraInfo> {
|
|||
Result uploadToServer(CameraInfo cameraInfo);
|
||||
Result<String> stopUploadToServer(CameraInfo cameraInfo);
|
||||
Result getUploadToServerProcess(CameraInfo cameraInfo);
|
||||
Result motionCtrl(CameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
@ -245,6 +245,111 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
return Result.OK(capability);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步此项目下的IPC设备
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<String> syncProjectIpcDevice(CameraInfo cameraInfo){
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("{");
|
||||
sb.append("\"start\"").append(":0").append(",");
|
||||
sb.append("\"limit\"").append(":1000").append(",");
|
||||
sb.append("\"filterAnd\"").append(":").append("{");
|
||||
sb.append("\"deviceTypeList\"").append(":[").append("\"SURVEILLANCECAMERA\"").append("],");
|
||||
sb.append("\"projectId\"").append(":").append("\"").append(cameraInfo.getProjectId()).append("\"");
|
||||
sb.append("},");
|
||||
sb.append("\"sort\"").append(":").append("[{");
|
||||
sb.append("\"key\"").append(":").append("\"deviceIndex\"").append(",");
|
||||
sb.append("\"value\"").append(":").append("\"asc\"");
|
||||
sb.append("}]");
|
||||
sb.append("}");
|
||||
String jsonResponse = tumsApi.getDeviceList(sb.toString());
|
||||
JSONObject jsonObject = new JSONObject(jsonResponse);
|
||||
String errorCode = jsonObject.getStr("error_code");
|
||||
if(errorCode.equals("0")){
|
||||
syncProjectIpc(jsonResponse);
|
||||
return Result.OK("同步设备成功!");
|
||||
}else{
|
||||
ErrorCode errVo = errorCodeService.getByCode(errorCode);
|
||||
String errMsg = errVo.getErrorMsg();
|
||||
log.info("getImageCommon:{}",errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步IPC设备信息入库
|
||||
* @param jsonResponse
|
||||
* @return
|
||||
*/
|
||||
private void syncProjectIpc(String jsonResponse){
|
||||
JSONObject jsonObject = new JSONObject(jsonResponse);
|
||||
if(jsonObject.getInt("error_code").equals(0)){
|
||||
JSONObject result = (JSONObject)jsonObject.get("result");
|
||||
if(result.getInt("total")>0){
|
||||
JSONArray list = result.getJSONArray("list");
|
||||
for(int i=0;i<list.size();i++){
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String jsonString = list.get(i).toString();
|
||||
try {
|
||||
CameraInfo cameraInfo = mapper.readValue(jsonString, CameraInfo.class);
|
||||
CameraInfo entity = baseMapper.getByDeviceId(cameraInfo);
|
||||
if(entity==null){
|
||||
//新增
|
||||
baseMapper.insert(cameraInfo);
|
||||
}else{
|
||||
//修改
|
||||
cameraInfo.setId(entity.getId());
|
||||
baseMapper.updateById(cameraInfo);
|
||||
}
|
||||
//同步能力集
|
||||
syncIpcCapability(cameraInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步IPC设备能力集入库
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
private void syncIpcCapability(CameraInfo cameraInfo){
|
||||
String deviceIndex = cameraInfo.getDeviceIndex();
|
||||
StringBuffer paramsSb = new StringBuffer();
|
||||
paramsSb.append("{");
|
||||
paramsSb.append("\"devId\"").append(":").append("\"").append(deviceIndex).append("\"");
|
||||
paramsSb.append("}");
|
||||
String ipcCapabilityRes = tumsApi.getIpcCapability(paramsSb.toString());
|
||||
JSONObject jsonObject = new JSONObject(ipcCapabilityRes);
|
||||
if(jsonObject.getInt("error_code").equals(0)){
|
||||
JSONObject result = (JSONObject)jsonObject.get("result");
|
||||
String capabilityStr = result.getStr("capability");
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
CameraInfo capability = mapper.readValue(capabilityStr, CameraInfo.class);
|
||||
capability.setDeviceIndex(deviceIndex);
|
||||
CameraInfo entity = baseMapper.getCapabilityByDeviceId(capability);
|
||||
if(entity==null){
|
||||
//新增
|
||||
baseMapper.insertCapability(capability);
|
||||
}else{
|
||||
//修改
|
||||
capability.setId(entity.getId());
|
||||
baseMapper.updateCapabilityById(capability);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画面基本信息
|
||||
*
|
||||
|
@ -2360,4 +2465,42 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result motionCtrl(CameraInfo cameraInfo){
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("{");
|
||||
sb.append("\"id\"").append(":").append("\"").append(cameraInfo.getDeviceIndex()).append("\",");
|
||||
sb.append("\"direction\"").append(":").append(cameraInfo.getDirection()).append(",");
|
||||
sb.append("\"startOrNot\"").append(":").append(cameraInfo.getStartOrNot()).append(",");
|
||||
sb.append("\"speed\"").append(":").append("\"").append(cameraInfo.getSpeed()).append("\"");
|
||||
sb.append("}");
|
||||
String res = tumsApi.motionCtrl(sb.toString());
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
int errorCode = jsonObject.getInt("error_code");
|
||||
if(errorCode == 0){
|
||||
// StringBuffer sb2 = new StringBuffer();
|
||||
// sb2.append("{");
|
||||
// sb2.append("\"id\"").append(":").append("\"").append(cameraInfo.getDeviceIndex()).append("\",");
|
||||
// sb2.append("\"direction\"").append(":").append(cameraInfo.getDirection()).append(",");
|
||||
// sb2.append("\"startOrNot\"").append(":").append(0).append(",");
|
||||
// sb2.append("\"speed\"").append(":").append("\"").append(cameraInfo.getSpeed()).append("\"");
|
||||
// sb2.append("}");
|
||||
// String res2 = tumsApi.motionCtrl(sb2.toString());
|
||||
return Result.OK();
|
||||
}else{
|
||||
String errMsg = jsonObject.getStr("msg");
|
||||
if(errMsg == null || errMsg.equals("")) {
|
||||
ErrorCode errVo = errorCodeService.getByCode(String.valueOf(errorCode));
|
||||
errMsg = errVo.getErrorMsg();
|
||||
}
|
||||
log.info("motionCtrl:{}-{}",errorCode,errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ public enum ApiEnum {
|
|||
IPC_GET_BATCH_PROGRESS("/tums/record/v1/getBatchProgress","获取批量操作录像计划进度"),
|
||||
IPC_GET_STORAGE_DEVICE("/tums/record/v1/getStorageDevice","获取存储设备列表"),
|
||||
IPC_GET_ALL_RECORD_PLANS("/tums/record/v1/getAllRecordPlans","获取所有录像计划列表"),
|
||||
/** =================>暂时无用 **/
|
||||
IPC_MOTION_CTRL("/tums/ptz/v1/motionCtrl","高速球机移动方向控制"),
|
||||
/** =================>暂时无用 **/
|
||||
IPC_GET_ALL_PRESETS("/tums/ptz/v1/getAllPresets","获取高速球机的所有预置点"),
|
||||
IPC_OPERATE_PRESET("/tums/ptz/v1/operatePreset","操作高速球机的预置点"),
|
||||
IPC_GET_ALL_TOURS("/tums/ptz/v1/getAllTours","获取高速球机的所有巡航列表"),
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
*/
|
||||
@Api(tags="护理单元-物联管理-TPLINK项目信息")
|
||||
@RestController
|
||||
@RequestMapping("/iot/projectInfo")
|
||||
@RequestMapping("/iot/tplink/projectInfo")
|
||||
@Slf4j
|
||||
public class ProjectInfoController extends JeecgController<ProjectInfo, IProjectInfoService> {
|
||||
@Autowired
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||
*/
|
||||
@Api(tags="护理单元-物联管理-TPLINK分组信息")
|
||||
@RestController
|
||||
@RequestMapping("/iot/regionInfo")
|
||||
@RequestMapping("/iot/tplink/regionInfo")
|
||||
@Slf4j
|
||||
public class RegionInfoController extends JeecgController<RegionInfo, IRegionInfoService> {
|
||||
@Autowired
|
||||
|
|
|
@ -44,8 +44,7 @@ public class TumsApi {
|
|||
|
||||
private void initTumsConfig(){
|
||||
if(tumsConfig==null){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
tumsConfig = tumsConfigMapper.getByCode(sysUser.getOrgCode());
|
||||
tumsConfig = tumsConfigMapper.getByCode(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,4 +584,17 @@ public class TumsApi {
|
|||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String motionCtrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("motionCtrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, ApiEnum.IPC_MOTION_CTRL.getValue());
|
||||
log.info("motionCtrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,39 +1,27 @@
|
|||
package com.nu.modules.nuIotTqApiRequestLog.controller;
|
||||
package com.nu.modules.tq.apiRequestLog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nuIotTqApiRequestLog.entity.NuIotTqApiRequestLog;
|
||||
import com.nu.modules.nuIotTqApiRequestLog.service.INuIotTqApiRequestLogService;
|
||||
import com.nu.modules.tq.apiRequestLog.entity.ApiRequestLog;
|
||||
import com.nu.modules.tq.apiRequestLog.service.IApiRequestLogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
@ -47,11 +35,11 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
*/
|
||||
@Api(tags="api请求日志")
|
||||
@RestController
|
||||
@RequestMapping("/nuIotTqApiRequestLog/nuIotTqApiRequestLog")
|
||||
@RequestMapping("/iot/tq/ApiRequestLog")
|
||||
@Slf4j
|
||||
public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRequestLog, INuIotTqApiRequestLogService> {
|
||||
public class ApiRequestLogController extends JeecgController<ApiRequestLog, IApiRequestLogService> {
|
||||
@Autowired
|
||||
private INuIotTqApiRequestLogService nuIotTqApiRequestLogService;
|
||||
private IApiRequestLogService nuIotTqApiRequestLogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
@ -65,19 +53,62 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
//@AutoLog(value = "api请求日志-分页列表查询")
|
||||
@ApiOperation(value="api请求日志-分页列表查询", notes="api请求日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuIotTqApiRequestLog>> queryPageList(NuIotTqApiRequestLog nuIotTqApiRequestLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
public Result<IPage<ApiRequestLog>> queryPageList(ApiRequestLog nuIotTqApiRequestLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("type", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("requestStatus", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("resolveStatus", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<NuIotTqApiRequestLog> queryWrapper = QueryGenerator.initQueryWrapper(nuIotTqApiRequestLog, req.getParameterMap(),customeRuleMap);
|
||||
Page<NuIotTqApiRequestLog> page = new Page<NuIotTqApiRequestLog>(pageNo, pageSize);
|
||||
IPage<NuIotTqApiRequestLog> pageList = nuIotTqApiRequestLogService.page(page, queryWrapper);
|
||||
QueryWrapper<ApiRequestLog> queryWrapper = QueryGenerator.initQueryWrapper(nuIotTqApiRequestLog, req.getParameterMap(),customeRuleMap);
|
||||
Page<ApiRequestLog> page = new Page<ApiRequestLog>(pageNo, pageSize);
|
||||
IPage<ApiRequestLog> pageList = nuIotTqApiRequestLogService.page(page, queryWrapper);
|
||||
// 获取当前时间
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
// 减去5分钟
|
||||
calendar.add(Calendar.MINUTE, -5);
|
||||
// 转换为Date对象
|
||||
Date fiveMinutesAgo = calendar.getTime();
|
||||
for(ApiRequestLog par:pageList.getRecords()){
|
||||
String dateStr = par.getRequestTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = null;
|
||||
try {
|
||||
date = sdf.parse(dateStr);
|
||||
System.out.println("Date: " + date); // 输出:Date: Tue Aug 15 14:30:00 CST 2023
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//如果返回状态为空并且超过了5分钟则返回抄表失败
|
||||
if(StringUtils.isBlank(par.getResolveStatus()) && fiveMinutesAgo.getTime() > date.getTime()){
|
||||
//9清零 3抄表 10电表拉闸 11电表合闸 49水表清零 42水表抄表 43水表开闸 53水表关闸
|
||||
if(StringUtils.equals("9",par.getType())){
|
||||
par.setResolveStatus("清零失败");
|
||||
}else if (StringUtils.equals("3",par.getType())){
|
||||
par.setResolveStatus("抄表失败");
|
||||
}else if(StringUtils.equals("10",par.getType())){
|
||||
par.setResolveStatus("拉闸失败");
|
||||
}else if (StringUtils.equals("11",par.getType())){
|
||||
par.setResolveStatus("合闸失败");
|
||||
}else if(StringUtils.equals("49",par.getType())){
|
||||
par.setResolveStatus("清零失败");
|
||||
}else if (StringUtils.equals("42",par.getType())){
|
||||
par.setResolveStatus("抄表失败");
|
||||
}else if (StringUtils.equals("43",par.getType())){
|
||||
par.setResolveStatus("开阀失败");
|
||||
}else if (StringUtils.equals("53",par.getType())){
|
||||
par.setResolveStatus("关阀失败");
|
||||
}
|
||||
|
||||
//判断返回状态为空并且没有超过了5分钟则返回抄表中
|
||||
}else if(StringUtils.isBlank(par.getResolveStatus())){
|
||||
par.setResolveStatus(par.getRequestStatus());
|
||||
}
|
||||
//返回状态有值,则保持原样,输出返回状态值
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
@ -91,7 +122,7 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
@ApiOperation(value="api请求日志-添加", notes="api请求日志-添加")
|
||||
@RequiresPermissions("nuIotTqApiRequestLog:nu_iot_tq_api_request_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuIotTqApiRequestLog nuIotTqApiRequestLog) {
|
||||
public Result<String> add(@RequestBody ApiRequestLog nuIotTqApiRequestLog) {
|
||||
nuIotTqApiRequestLogService.save(nuIotTqApiRequestLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
@ -106,7 +137,7 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
@ApiOperation(value="api请求日志-编辑", notes="api请求日志-编辑")
|
||||
@RequiresPermissions("nuIotTqApiRequestLog:nu_iot_tq_api_request_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuIotTqApiRequestLog nuIotTqApiRequestLog) {
|
||||
public Result<String> edit(@RequestBody ApiRequestLog nuIotTqApiRequestLog) {
|
||||
nuIotTqApiRequestLogService.updateById(nuIotTqApiRequestLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
@ -150,8 +181,8 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
//@AutoLog(value = "api请求日志-通过id查询")
|
||||
@ApiOperation(value="api请求日志-通过id查询", notes="api请求日志-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuIotTqApiRequestLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuIotTqApiRequestLog nuIotTqApiRequestLog = nuIotTqApiRequestLogService.getById(id);
|
||||
public Result<ApiRequestLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ApiRequestLog nuIotTqApiRequestLog = nuIotTqApiRequestLogService.getById(id);
|
||||
if(nuIotTqApiRequestLog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
|
@ -166,8 +197,8 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
*/
|
||||
@RequiresPermissions("nuIotTqApiRequestLog:nu_iot_tq_api_request_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuIotTqApiRequestLog nuIotTqApiRequestLog) {
|
||||
return super.exportXls(request, nuIotTqApiRequestLog, NuIotTqApiRequestLog.class, "api请求日志");
|
||||
public ModelAndView exportXls(HttpServletRequest request, ApiRequestLog nuIotTqApiRequestLog) {
|
||||
return super.exportXls(request, nuIotTqApiRequestLog, ApiRequestLog.class, "api请求日志");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -180,7 +211,7 @@ public class NuIotTqApiRequestLogController extends JeecgController<NuIotTqApiRe
|
|||
@RequiresPermissions("nuIotTqApiRequestLog:nu_iot_tq_api_request_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuIotTqApiRequestLog.class);
|
||||
return super.importExcel(request, response, ApiRequestLog.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,11 @@
|
|||
package com.nu.modules.nuIotTqApiRequestLog.entity;
|
||||
package com.nu.modules.tq.apiRequestLog.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
@ -31,7 +27,7 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tq_api_request_log对象", description="api请求日志")
|
||||
public class NuIotTqApiRequestLog implements Serializable {
|
||||
public class ApiRequestLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.tq.apiRequestLog.mapper;
|
||||
|
||||
import com.nu.modules.tq.apiRequestLog.entity.ApiRequestLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ApiRequestLogMapper extends BaseMapper<ApiRequestLog> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.tq.apiRequestLog.mapper.ApiRequestLogMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.tq.apiRequestLog.service;
|
||||
|
||||
import com.nu.modules.tq.apiRequestLog.entity.ApiRequestLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IApiRequestLogService extends IService<ApiRequestLog> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.tq.apiRequestLog.service.impl;
|
||||
|
||||
import com.nu.modules.tq.apiRequestLog.entity.ApiRequestLog;
|
||||
import com.nu.modules.tq.apiRequestLog.mapper.ApiRequestLogMapper;
|
||||
import com.nu.modules.tq.apiRequestLog.service.IApiRequestLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: api请求日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ApiRequestLogServiceImpl extends ServiceImpl<ApiRequestLogMapper, ApiRequestLog> implements IApiRequestLogService {
|
||||
|
||||
}
|
|
@ -1,14 +1,17 @@
|
|||
package com.nu.modules.tq.electricity.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||
import com.nu.modules.tq.electricity.service.IElectricityMeterService;
|
||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -37,7 +40,8 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<ElectricityMeter> page = new Page<ElectricityMeter>(pageNo, pageSize);
|
||||
IPage<ElectricityMeter> pageList = service.findPage(page, electricityMeter);
|
||||
QueryWrapper<ElectricityMeter> queryWrapper = QueryGenerator.initQueryWrapper(electricityMeter, req.getParameterMap());
|
||||
IPage<ElectricityMeter> pageList = service.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
@ -80,12 +84,4 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
|||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "同步电表到业务系统")
|
||||
@RequestMapping(value = "/syncElectricity", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> syncElectricity(@RequestBody ElectricityMeter electricityMeter) {
|
||||
String dataSourceCode = electricityMeter.getDepartServerUrl();
|
||||
service.syncElectricity(dataSourceCode,electricityMeter);
|
||||
return Result.OK("同步成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -67,6 +68,7 @@ public class ElectricityMeter implements Serializable {
|
|||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
left join nu_iot_tq_collector b on a.cid = b.cid
|
||||
<where>
|
||||
<if test="params.address != null and params.address != ''">
|
||||
AND a.address = #{params.address}
|
||||
AND a.address like concat('%',#{params.address},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nuId = #{params.nuId}
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.departId != null and params.departId != ''">
|
||||
AND a.departId = #{params.departId}
|
||||
AND a.depart_id = #{params.departId}
|
||||
</if>
|
||||
<if test="params.relayState != null and params.relayState != ''">
|
||||
AND a.relay_state = #{params.relayState}
|
||||
|
|
|
@ -19,5 +19,6 @@ public interface IElectricityMeterService extends IService<ElectricityMeter> {
|
|||
String eleControlNotify(String response_content, String timestamp, String sign);
|
||||
String eleReadNotify(String response_content, String timestamp, String sign);
|
||||
|
||||
void syncElectricity(String dataSourceCode, ElectricityMeter electricityMeter);
|
||||
|
||||
void editHldy(ElectricityMeter electricityMeter);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
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.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.service.INuIotTqElectricitySyncLogService;
|
||||
import com.nu.modules.tq.common.entity.TqApiLog;
|
||||
import com.nu.modules.tq.common.service.ITqApiLogService;
|
||||
import com.nu.modules.tq.utils.HttpTool;
|
||||
|
@ -37,8 +35,6 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
@Autowired
|
||||
ITqApiLogService logService;
|
||||
|
||||
@Autowired
|
||||
public INuIotTqElectricitySyncLogService nuIotTqElectricitySyncLogService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
|
@ -104,7 +100,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(9);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("清零中");
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -115,7 +111,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(9);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("清零失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -129,7 +125,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(9);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
tqApiLog.setRequestStatus("清零失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -178,7 +174,11 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setAddress(electricityMeter.getAddress());
|
||||
tqApiLog.setType(electricityMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
if(type.equals(10)){
|
||||
tqApiLog.setRequestStatus("拉闸中");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("合闸中");
|
||||
}
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -188,7 +188,11 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setAddress(electricityMeter.getAddress());
|
||||
tqApiLog.setType(electricityMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
if(type.equals(10)){
|
||||
tqApiLog.setRequestStatus("拉闸失败");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("合闸失败");
|
||||
}
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -201,7 +205,11 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setAddress(electricityMeter.getAddress());
|
||||
tqApiLog.setType(electricityMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
if(type.equals(10)){
|
||||
tqApiLog.setRequestStatus("拉闸失败");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("合闸失败");
|
||||
}
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -250,7 +258,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(3);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("抄表中");
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -261,7 +269,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(3);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("抄表失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -275,7 +283,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(3);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
tqApiLog.setRequestStatus("抄表失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -305,7 +313,11 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveValue("0");
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus("清零成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus("清零失败");
|
||||
}
|
||||
tqApiLog.setResolveRemark(data);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null) {
|
||||
|
@ -350,9 +362,20 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null) {
|
||||
Integer type = logEntity.getType();
|
||||
String typeStr = "";
|
||||
if(type.equals(10)){
|
||||
typeStr = "拉闸";
|
||||
}else{
|
||||
typeStr = "合闸";
|
||||
}
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus(typeStr+"成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus(typeStr+"失败");
|
||||
}
|
||||
tqApiLog.setId(logEntity.getId());
|
||||
logService.update(tqApiLog);
|
||||
}
|
||||
|
@ -408,7 +431,11 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
tqApiLog.setType(type);
|
||||
tqApiLog.setResolveValue(resolveValue);
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus("抄表成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus("抄表失败");
|
||||
}
|
||||
tqApiLog.setResolveRemark(dsp);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null){
|
||||
|
@ -428,7 +455,7 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
tqApiLog.setResolveStatus("抄表失败");
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null){
|
||||
tqApiLog.setId(logEntity.getId());
|
||||
|
@ -442,74 +469,14 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void syncElectricity(String dataSourceCode, ElectricityMeter electricityMeter) {
|
||||
public void editHldy(ElectricityMeter electricityMeter) {
|
||||
|
||||
electricityMeter = baseMapper.selectById(electricityMeter.getId());
|
||||
//如果两个系统编码相同则执行新增或者修改
|
||||
if(StringUtils.equals(electricityMeter.getOldServerUrl(),electricityMeter.getDepartServerUrl()) || StringUtils.isEmpty(electricityMeter.getOldServerUrl())){
|
||||
syncImpl.syncElectricitySaveOrUpdate(electricityMeter.getOldServerUrl(),electricityMeter);
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLog.setId(null);
|
||||
nuIotTqElectricitySyncLog.setMainId(electricityMeter.getId()+"");
|
||||
nuIotTqElectricitySyncLog.setMainName(electricityMeter.getCid());
|
||||
nuIotTqElectricitySyncLog.setSyncType("更新");
|
||||
nuIotTqElectricitySyncLog.setOrgId(electricityMeter.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setOrgCode(electricityMeter.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setOrgName(electricityMeter.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setNewOrgId(electricityMeter.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setNewOrgCode(electricityMeter.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setNewOrgName(electricityMeter.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setStatus("成功");
|
||||
nuIotTqElectricitySyncLog.setContent("同步成功");
|
||||
nuIotTqElectricitySyncLog.setServerType("电表");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLog);
|
||||
|
||||
//如果两个系统编码不同则需要执行删除数据后再执行同步
|
||||
}else{
|
||||
syncImpl.syncElectricityDel(electricityMeter.getOldServerUrl(),electricityMeter);
|
||||
syncImpl.syncElectricitySaveOrUpdate(dataSourceCode,electricityMeter);
|
||||
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLog.setId(null);
|
||||
nuIotTqElectricitySyncLog.setMainId(electricityMeter.getId()+"");
|
||||
nuIotTqElectricitySyncLog.setMainName(electricityMeter.getCid());
|
||||
nuIotTqElectricitySyncLog.setSyncType("更新");
|
||||
nuIotTqElectricitySyncLog.setOrgId(electricityMeter.getOldDepartId());
|
||||
nuIotTqElectricitySyncLog.setOrgCode(electricityMeter.getOldServerUrl());
|
||||
nuIotTqElectricitySyncLog.setOrgName(electricityMeter.getOldDepartName());
|
||||
nuIotTqElectricitySyncLog.setNewOrgId(electricityMeter.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setNewOrgCode(electricityMeter.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setNewOrgName(electricityMeter.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setStatus("成功");
|
||||
nuIotTqElectricitySyncLog.setContent("同步成功");
|
||||
nuIotTqElectricitySyncLog.setServerType("电表");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLog);
|
||||
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLogDel = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLogDel.setId(null);
|
||||
nuIotTqElectricitySyncLogDel.setMainId(electricityMeter.getId()+"");
|
||||
nuIotTqElectricitySyncLogDel.setMainName(electricityMeter.getCid());
|
||||
nuIotTqElectricitySyncLogDel.setSyncType("删除");
|
||||
nuIotTqElectricitySyncLogDel.setOrgId(electricityMeter.getOldDepartId());
|
||||
nuIotTqElectricitySyncLogDel.setOrgCode(electricityMeter.getOldServerUrl());
|
||||
nuIotTqElectricitySyncLogDel.setOrgName(electricityMeter.getOldDepartName());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgId(electricityMeter.getDepartId());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgCode(electricityMeter.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgName(electricityMeter.getDepartName());
|
||||
nuIotTqElectricitySyncLogDel.setStatus("成功");
|
||||
nuIotTqElectricitySyncLogDel.setContent("删除原来业务机构电表数据");
|
||||
nuIotTqElectricitySyncLogDel.setServerType("电表");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLogDel);
|
||||
}
|
||||
//更新同步状态及旧系统编码
|
||||
electricityMeter.setSyncType("1");
|
||||
electricityMeter.setOldServerUrl(dataSourceCode);
|
||||
electricityMeter.setOldDepartName(electricityMeter.getDepartName());
|
||||
electricityMeter.setOldDepartId(electricityMeter.getDepartId());
|
||||
ElectricityMeter oldParam = baseMapper.selectById(electricityMeter.getId());
|
||||
electricityMeter.setOldDepartId(oldParam.getDepartId());
|
||||
electricityMeter.setOldDepartName(oldParam.getDepartName());
|
||||
electricityMeter.setOldServerUrl(oldParam.getDepartServerUrl());
|
||||
baseMapper.updateById(electricityMeter);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.nu.modules.tq.water.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||
import com.nu.modules.tq.water.service.IWaterMeterService;
|
||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -37,7 +40,8 @@ public class WaterMeterController extends JeecgController<WaterMeter, IWaterMete
|
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<WaterMeter> page = new Page<WaterMeter>(pageNo, pageSize);
|
||||
IPage<WaterMeter> pageList = service.findPage(page, waterMeter);
|
||||
QueryWrapper<WaterMeter> queryWrapper = QueryGenerator.initQueryWrapper(waterMeter, req.getParameterMap());
|
||||
IPage<WaterMeter> pageList = service.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -70,12 +71,9 @@ public class WaterMeter implements Serializable {
|
|||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
private String nuId;//护理单元ID
|
||||
@TableField(exist = false)
|
||||
private String nuName;//护理单元
|
||||
@TableField(exist = false)
|
||||
private String departId;//机构ID
|
||||
@TableField(exist = false)
|
||||
private String departName;//机构名称
|
||||
}
|
|
@ -24,13 +24,13 @@
|
|||
left join nu_iot_tq_collector b on a.cid = b.cid
|
||||
<where>
|
||||
<if test="params.address != null and params.address != ''">
|
||||
AND a.address = #{params.address}
|
||||
AND a.address like concat('%',#{params.address},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nuId = #{params.nuId}
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.departId != null and params.departId != ''">
|
||||
AND a.departId = #{params.departId}
|
||||
AND a.depart_id = #{params.departId}
|
||||
</if>
|
||||
<if test="params.relayState != null and params.relayState != ''">
|
||||
AND a.relay_state = #{params.relayState}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.nu.modules.tq.water.service.impl;
|
|||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -17,6 +19,7 @@ import com.nu.modules.tq.water.service.IWaterMeterService;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -31,6 +34,12 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
@Autowired
|
||||
ITqApiLogService logService;
|
||||
|
||||
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private WaterMeterServiceImpl syncImpl;
|
||||
|
||||
@Override
|
||||
public IPage<WaterMeter> findPage(Page<WaterMeter> page, WaterMeter waterMeter){
|
||||
return baseMapper.findPage(page,waterMeter);
|
||||
|
@ -91,7 +100,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(49);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("清零中");
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -102,7 +111,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(49);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("清零失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -116,7 +125,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(49);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
tqApiLog.setRequestStatus("清零失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -125,7 +134,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
}
|
||||
|
||||
/**
|
||||
* 开关闸
|
||||
* 开关阀
|
||||
*/
|
||||
@Override
|
||||
public Result<String> waterControl(WaterMeter waterMeter){
|
||||
|
@ -133,9 +142,9 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
WaterMeter entity = baseMapper.getWaterMeter(waterMeter);
|
||||
if(entity == null){
|
||||
if(type.equals(43)){
|
||||
return Result.error("请先同步水表设备信息后再进行开闸");
|
||||
return Result.error("请先同步水表设备信息后再进行开阀");
|
||||
}else{
|
||||
return Result.error("请先同步水表设备信息后再进行关闸");
|
||||
return Result.error("请先同步水表设备信息后再进行关阀");
|
||||
}
|
||||
}
|
||||
List<Map<String, Object>> req = new ArrayList<>();
|
||||
|
@ -166,6 +175,11 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(waterMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
if(type.equals(43)){
|
||||
tqApiLog.setRequestStatus("开阀中");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("关阀中");
|
||||
}
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -175,7 +189,11 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setAddress(waterMeter.getAddress());
|
||||
tqApiLog.setType(waterMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
if(type.equals(43)){
|
||||
tqApiLog.setRequestStatus("开阀失败");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("关阀失败");
|
||||
}
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -188,15 +206,19 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setAddress(waterMeter.getAddress());
|
||||
tqApiLog.setType(waterMeter.getType());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
if(type.equals(43)){
|
||||
tqApiLog.setRequestStatus("开阀失败");
|
||||
}else{
|
||||
tqApiLog.setRequestStatus("关阀失败");
|
||||
}
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
if(type.equals(43)){
|
||||
return Result.OK("开闸成功");
|
||||
return Result.OK("开阀成功");
|
||||
}else{
|
||||
return Result.OK("关闸成功");
|
||||
return Result.OK("关阀成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,7 +259,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(42);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("抄表中");
|
||||
logService.insert(tqApiLog);
|
||||
}else{
|
||||
String errorMsg = json.getStr("error_msg");
|
||||
|
@ -248,7 +270,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(42);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(status);
|
||||
tqApiLog.setRequestStatus("抄表失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -262,7 +284,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setType(42);
|
||||
tqApiLog.setRequestValue(entity.getWaterValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus(httpStatus);
|
||||
tqApiLog.setRequestStatus("抄表失败");
|
||||
tqApiLog.setRequestRemark(errorMsg);
|
||||
logService.insert(tqApiLog);
|
||||
return Result.error(errorMsg);
|
||||
|
@ -292,7 +314,11 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveValue("0");
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus("清零成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus("清零失败");
|
||||
}
|
||||
tqApiLog.setResolveRemark(data);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null) {
|
||||
|
@ -318,7 +344,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
}
|
||||
|
||||
/**
|
||||
* 开关闸回调通知
|
||||
* 开关阀回调通知
|
||||
*/
|
||||
@Override
|
||||
public String waterControlNotify(String response_content, String timestamp, String sign){
|
||||
|
@ -337,9 +363,20 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null) {
|
||||
Integer type = logEntity.getType();
|
||||
String typeStr = "";
|
||||
if(type.equals(43)){
|
||||
typeStr = "开阀";
|
||||
}else {
|
||||
typeStr = "关阀";
|
||||
}
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus(typeStr+"成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus(typeStr+"失败");
|
||||
}
|
||||
tqApiLog.setId(logEntity.getId());
|
||||
logService.update(tqApiLog);
|
||||
}
|
||||
|
@ -400,7 +437,11 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
tqApiLog.setResolveValue(resolveValue);
|
||||
}
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
if(status.equals("SUCCESS")){
|
||||
tqApiLog.setResolveStatus("抄表成功");
|
||||
}else{
|
||||
tqApiLog.setResolveStatus("抄表失败");
|
||||
}
|
||||
tqApiLog.setResolveRemark(dsp);
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null){
|
||||
|
@ -424,7 +465,7 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setOprId(oprId);
|
||||
tqApiLog.setResolveTime(resolveTime);
|
||||
tqApiLog.setResolveStatus(status);
|
||||
tqApiLog.setResolveStatus("抄表失败");
|
||||
TqApiLog logEntity = logService.getApiLog(tqApiLog);
|
||||
if(logEntity!=null){
|
||||
tqApiLog.setId(logEntity.getId());
|
||||
|
@ -438,4 +479,33 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
//业务系统删除命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricityDel(String dataSourceCode,WaterMeter waterMeter) {
|
||||
try {
|
||||
baseMapper.deleteById(waterMeter.getId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//业务系统保存或者修改命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricitySaveOrUpdate(String dataSourceCode,WaterMeter waterMeter) {
|
||||
try {
|
||||
QueryWrapper<WaterMeter> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("cid",waterMeter.getCid());
|
||||
WaterMeter oldParam = baseMapper.selectOne(queryWrapper);//查询数据库中该表号数据原始数据
|
||||
if(oldParam == null){
|
||||
baseMapper.insert(waterMeter);
|
||||
}else{
|
||||
baseMapper.updateById(waterMeter);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.yiweilian.humid.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||
|
@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -36,7 +38,8 @@ public class HumidDeviceController extends JeecgController<HumidDevice, IHumidDe
|
|||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<HumidDevice> page = new Page<HumidDevice>(pageNo, pageSize);
|
||||
IPage<HumidDevice> pageList = service.findPage(page, humidDevice);
|
||||
QueryWrapper<HumidDevice> queryWrapper = QueryGenerator.initQueryWrapper(humidDevice, req.getParameterMap());
|
||||
IPage<HumidDevice> pageList = service.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
@ -132,12 +135,4 @@ public class HumidDeviceController extends JeecgController<HumidDevice, IHumidDe
|
|||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "同步电表到业务系统")
|
||||
@RequestMapping(value = "/syncHumidDevice", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> syncHumidDevice(@RequestBody HumidDevice humidDevice) {
|
||||
String dataSourceCode = humidDevice.getDepartServerUrl();
|
||||
service.syncHumidDevice(dataSourceCode,humidDevice);
|
||||
return Result.OK("同步成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -105,6 +106,7 @@ public class HumidDevice implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private Integer alarmCn; //告警数量
|
||||
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
|
|
|
@ -16,7 +16,5 @@ public interface IHumidDeviceService extends IService<HumidDevice> {
|
|||
Result getDeviceParameters(HumidDevice humidDevice);
|
||||
IPage<HumidDevice> findLogPage(Page<HumidDevice> page, HumidDevice humidDevice);
|
||||
|
||||
void syncHumidDevice(String dataSourceCode, HumidDevice humidDevice);
|
||||
|
||||
void editHldy(HumidDevice humidDevice);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.yiweilian.humid.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
@ -7,17 +8,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
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.modules.nuIotTqElectricitySyncLog.entity.NuIotTqElectricitySyncLog;
|
||||
import com.nu.modules.nuIotTqElectricitySyncLog.service.INuIotTqElectricitySyncLogService;
|
||||
import com.nu.modules.tq.utils.HttpTool;
|
||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||
import com.nu.modules.tq.water.service.impl.WaterMeterServiceImpl;
|
||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||
import com.nu.modules.yiweilian.humid.mapper.HumidDeviceMapper;
|
||||
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
||||
import com.nu.modules.yiweilian.utils.YiweilianApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
|
@ -25,9 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
@ -37,8 +33,6 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
YiweilianApi yiweilianApi;
|
||||
|
||||
|
||||
@Autowired
|
||||
public INuIotTqElectricitySyncLogService nuIotTqElectricitySyncLogService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
|
@ -231,29 +225,53 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
Integer limit = dataObj.getInt("rows");
|
||||
Integer page = dataObj.getInt("page");
|
||||
JSONArray dataArr = dataObj.getJSONArray("dataList");
|
||||
for(int i=0;i<dataArr.size();i++){
|
||||
if(dataArr.size()>0){
|
||||
for(int i=0;i<dataArr.size();i++){
|
||||
HumidDevice dh = new HumidDevice();
|
||||
JSONObject json = (JSONObject)dataArr.get(i);
|
||||
String sn = json.getStr("sn");
|
||||
String status = json.getStr("status");
|
||||
String electricity = json.getStr("electricity");
|
||||
String temperature = json.getStr("temperature");
|
||||
String humidity = json.getStr("humidity");
|
||||
String reportingTime = json.getStr("date");
|
||||
dh.setStatus(status);
|
||||
Date reportingDate = DateUtil.parse(reportingTime,"yyyy-MM-dd HH:mm:ss");
|
||||
Calendar ca = Calendar.getInstance();
|
||||
ca.add(Calendar.MINUTE,-5);
|
||||
Date currentDate = ca.getTime();
|
||||
if(reportingDate.getTime()<=currentDate.getTime()){
|
||||
dh.setStatus("1");
|
||||
}
|
||||
dh.setSn(sn);
|
||||
dh.setElectricity(electricity);
|
||||
dh.setTemperature(temperature);
|
||||
dh.setHumidity(humidity);
|
||||
dh.setReportingTime(reportingTime);
|
||||
baseMapper.updateValue(dh);
|
||||
dh.setOptType("read");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(sysUser!=null){
|
||||
dh.setOptBy(sysUser.getUsername());
|
||||
}
|
||||
baseMapper.insertLog(dh);
|
||||
}
|
||||
}else{
|
||||
errorMsg += humidDevice.getSn()+"温湿度设备丢失,请联系管理员";
|
||||
HumidDevice dh = new HumidDevice();
|
||||
JSONObject json = (JSONObject)dataArr.get(i);
|
||||
String sn = json.getStr("sn");
|
||||
String status = json.getStr("status");
|
||||
String electricity = json.getStr("electricity");
|
||||
String temperature = json.getStr("temperature");
|
||||
String humidity = json.getStr("humidity");
|
||||
String reportingTime = json.getStr("date");
|
||||
|
||||
dh.setSn(sn);
|
||||
dh.setStatus(status);
|
||||
dh.setElectricity(electricity);
|
||||
dh.setTemperature(temperature);
|
||||
dh.setHumidity(humidity);
|
||||
dh.setReportingTime(reportingTime);
|
||||
baseMapper.updateValue(dh);
|
||||
humidDevice.setOptType("read");
|
||||
dh.setSn(humidDevice.getSn());
|
||||
dh.setStatus("1");
|
||||
dh.setElectricity("0");
|
||||
dh.setTemperature("0");
|
||||
dh.setHumidity("0");
|
||||
dh.setReportingTime(DateUtil.now());
|
||||
dh.setOptType("read");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(sysUser!=null){
|
||||
humidDevice.setOptBy(sysUser.getUsername());
|
||||
dh.setOptBy(sysUser.getUsername());
|
||||
}
|
||||
baseMapper.insertLog(humidDevice);
|
||||
baseMapper.insertLog(dh);
|
||||
baseMapper.updateValue(dh);
|
||||
}
|
||||
if((page+1)*limit<count){
|
||||
Map<String, Object> params = getParmas(page+1,limit,humidDevice);
|
||||
|
@ -344,7 +362,8 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
if(deviceParameters!=null){
|
||||
return Result.OK(deviceParameters);
|
||||
}else{
|
||||
return Result.error("获取设备配置参数错误");
|
||||
return Result.error("温湿度设备丢失获取配置错误,请联系管理员");
|
||||
// return Result.error("获取设备配置参数错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,44 +380,48 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
if(responseCode.equals(0)){
|
||||
JSONObject dataObj = jsonObject.getJSONObject("data");
|
||||
JSONArray dataArr = dataObj.getJSONArray("dataList");
|
||||
for(int i=0;i<dataArr.size();i++){
|
||||
JSONObject json = (JSONObject)dataArr.get(i);
|
||||
String sn = json.getStr("sn");
|
||||
String deviceName = json.getStr("deviceName");
|
||||
String deviceTypes = json.getStr("deviceTypes");
|
||||
String reportingInterval = json.getStr("reportingInterval");
|
||||
String recordInterval = json.getStr("recordInterval");
|
||||
String historyReportTime = json.getStr("historyReportTime");
|
||||
String historyInterval = json.getStr("historyInterval");
|
||||
String temperatureHigh = json.getStr("temperatureHigh");
|
||||
String temperatureLow = json.getStr("temperatureLow");
|
||||
String temperatureBuffer = json.getStr("temperatureBuffer");
|
||||
String humidityHigh = json.getStr("humidityHigh");
|
||||
String humidityLow = json.getStr("humidityLow");
|
||||
String humidityBuffer = json.getStr("humidityBuffer");
|
||||
String timeCode = json.getStr("timeCode");
|
||||
String isOutages = json.getStr("isOutages");
|
||||
String isLowBattery = json.getStr("isLowBattery");
|
||||
String isOnline = json.getStr("isOnline");
|
||||
if(dataArr.size()>0){
|
||||
for(int i=0;i<dataArr.size();i++){
|
||||
JSONObject json = (JSONObject)dataArr.get(i);
|
||||
String sn = json.getStr("sn");
|
||||
String deviceName = json.getStr("deviceName");
|
||||
String deviceTypes = json.getStr("deviceTypes");
|
||||
String reportingInterval = json.getStr("reportingInterval");
|
||||
String recordInterval = json.getStr("recordInterval");
|
||||
String historyReportTime = json.getStr("historyReportTime");
|
||||
String historyInterval = json.getStr("historyInterval");
|
||||
String temperatureHigh = json.getStr("temperatureHigh");
|
||||
String temperatureLow = json.getStr("temperatureLow");
|
||||
String temperatureBuffer = json.getStr("temperatureBuffer");
|
||||
String humidityHigh = json.getStr("humidityHigh");
|
||||
String humidityLow = json.getStr("humidityLow");
|
||||
String humidityBuffer = json.getStr("humidityBuffer");
|
||||
String timeCode = json.getStr("timeCode");
|
||||
String isOutages = json.getStr("isOutages");
|
||||
String isLowBattery = json.getStr("isLowBattery");
|
||||
String isOnline = json.getStr("isOnline");
|
||||
|
||||
dh.setSn(sn);
|
||||
dh.setDeviceName(deviceName);
|
||||
dh.setDeviceTypes(deviceTypes);
|
||||
dh.setReportingInterval(reportingInterval);
|
||||
dh.setRecordInterval(recordInterval);
|
||||
dh.setHistoryReportTime(historyReportTime);
|
||||
dh.setHistoryInterval(historyInterval);
|
||||
dh.setTemperatureHigh(temperatureHigh);
|
||||
dh.setTemperatureLow(temperatureLow);
|
||||
dh.setTemperatureBuffer(temperatureBuffer);
|
||||
dh.setHumidityHigh(humidityHigh);
|
||||
dh.setHumidityLow(humidityLow);
|
||||
dh.setHumidityBuffer(humidityBuffer);
|
||||
dh.setTimeCode(timeCode);
|
||||
dh.setIzOutages(isOutages);
|
||||
dh.setIzLowBattery(isLowBattery);
|
||||
dh.setIzOnline(isOnline);
|
||||
break;
|
||||
dh.setSn(sn);
|
||||
dh.setDeviceName(deviceName);
|
||||
dh.setDeviceTypes(deviceTypes);
|
||||
dh.setReportingInterval(reportingInterval);
|
||||
dh.setRecordInterval(recordInterval);
|
||||
dh.setHistoryReportTime(historyReportTime);
|
||||
dh.setHistoryInterval(historyInterval);
|
||||
dh.setTemperatureHigh(temperatureHigh);
|
||||
dh.setTemperatureLow(temperatureLow);
|
||||
dh.setTemperatureBuffer(temperatureBuffer);
|
||||
dh.setHumidityHigh(humidityHigh);
|
||||
dh.setHumidityLow(humidityLow);
|
||||
dh.setHumidityBuffer(humidityBuffer);
|
||||
dh.setTimeCode(timeCode);
|
||||
dh.setIzOutages(isOutages);
|
||||
dh.setIzLowBattery(isLowBattery);
|
||||
dh.setIzOnline(isOnline);
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else{
|
||||
return null;
|
||||
|
@ -410,76 +433,6 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
return baseMapper.findLogPage(page,humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncHumidDevice(String dataSourceCode, HumidDevice humidDevice) {
|
||||
|
||||
humidDevice = baseMapper.selectById(humidDevice.getId());
|
||||
//如果两个系统编码相同则执行新增或者修改
|
||||
if(StringUtils.equals(humidDevice.getOldServerUrl(),humidDevice.getDepartServerUrl()) || StringUtils.isEmpty(humidDevice.getOldServerUrl())){
|
||||
syncImpl.syncElectricitySaveOrUpdate(humidDevice.getOldServerUrl(),humidDevice);
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLog.setId(null);
|
||||
nuIotTqElectricitySyncLog.setMainId(humidDevice.getSn()+"");
|
||||
nuIotTqElectricitySyncLog.setMainName(humidDevice.getSn());
|
||||
nuIotTqElectricitySyncLog.setSyncType("更新");
|
||||
nuIotTqElectricitySyncLog.setOrgId(humidDevice.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setOrgCode(humidDevice.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setOrgName(humidDevice.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setNewOrgId(humidDevice.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setNewOrgCode(humidDevice.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setNewOrgName(humidDevice.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setStatus("成功");
|
||||
nuIotTqElectricitySyncLog.setContent("同步成功");
|
||||
nuIotTqElectricitySyncLog.setServerType("温湿度");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLog);
|
||||
|
||||
//如果两个系统编码不同则需要执行删除数据后再执行同步
|
||||
}else{
|
||||
syncImpl.syncElectricityDel(humidDevice.getOldServerUrl(),humidDevice);
|
||||
syncImpl.syncElectricitySaveOrUpdate(dataSourceCode,humidDevice);
|
||||
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLog = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLog.setId(null);
|
||||
nuIotTqElectricitySyncLog.setMainId(humidDevice.getSn()+"");
|
||||
nuIotTqElectricitySyncLog.setMainName(humidDevice.getSn());
|
||||
nuIotTqElectricitySyncLog.setSyncType("更新");
|
||||
nuIotTqElectricitySyncLog.setOrgId(humidDevice.getOldDepartId());
|
||||
nuIotTqElectricitySyncLog.setOrgCode(humidDevice.getOldServerUrl());
|
||||
nuIotTqElectricitySyncLog.setOrgName(humidDevice.getOldDepartName());
|
||||
nuIotTqElectricitySyncLog.setNewOrgId(humidDevice.getDepartId());
|
||||
nuIotTqElectricitySyncLog.setNewOrgCode(humidDevice.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLog.setNewOrgName(humidDevice.getDepartName());
|
||||
nuIotTqElectricitySyncLog.setStatus("成功");
|
||||
nuIotTqElectricitySyncLog.setContent("同步成功");
|
||||
nuIotTqElectricitySyncLog.setServerType("温湿度");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLog);
|
||||
|
||||
|
||||
NuIotTqElectricitySyncLog nuIotTqElectricitySyncLogDel = new NuIotTqElectricitySyncLog();
|
||||
nuIotTqElectricitySyncLogDel.setId(null);
|
||||
nuIotTqElectricitySyncLogDel.setMainId(humidDevice.getSn()+"");
|
||||
nuIotTqElectricitySyncLogDel.setMainName(humidDevice.getSn());
|
||||
nuIotTqElectricitySyncLogDel.setSyncType("删除");
|
||||
nuIotTqElectricitySyncLogDel.setOrgId(humidDevice.getOldDepartId());
|
||||
nuIotTqElectricitySyncLogDel.setOrgCode(humidDevice.getOldServerUrl());
|
||||
nuIotTqElectricitySyncLogDel.setOrgName(humidDevice.getOldDepartName());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgId(humidDevice.getDepartId());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgCode(humidDevice.getDepartServerUrl());
|
||||
nuIotTqElectricitySyncLogDel.setNewOrgName(humidDevice.getDepartName());
|
||||
nuIotTqElectricitySyncLogDel.setStatus("成功");
|
||||
nuIotTqElectricitySyncLogDel.setContent("删除原来业务机构温湿度数据");
|
||||
nuIotTqElectricitySyncLogDel.setServerType("温湿度");
|
||||
nuIotTqElectricitySyncLogService.save(nuIotTqElectricitySyncLogDel);
|
||||
}
|
||||
//更新同步状态及旧系统编码
|
||||
humidDevice.setSyncType("1");
|
||||
humidDevice.setOldServerUrl(dataSourceCode);
|
||||
humidDevice.setOldDepartName(humidDevice.getDepartName());
|
||||
humidDevice.setOldDepartId(humidDevice.getDepartId());
|
||||
baseMapper.updateById(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editHldy(HumidDevice humidDevice) {
|
||||
|
|
Loading…
Reference in New Issue