Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_java_monomer
This commit is contained in:
commit
2f7361a0cc
|
@ -0,0 +1,15 @@
|
||||||
|
package com.nu.modules.EmployessInfo.api;
|
||||||
|
|
||||||
|
import com.nu.modules.EmployessInfo.entity.EmployeesAdvisoryInfoEntity;
|
||||||
|
import com.nu.modules.orgapplyinfo.entity.OrgApplyInfoApiEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IEmployessAdvisioryInfoApi {
|
||||||
|
|
||||||
|
EmployeesAdvisoryInfoEntity insert(EmployeesAdvisoryInfoEntity eployeesAdvisoryInfoEntity);
|
||||||
|
|
||||||
|
int updateById(EmployeesAdvisoryInfoEntity eployeesAdvisoryInfoEntity);
|
||||||
|
|
||||||
|
List<EmployeesAdvisoryInfoEntity> queryAuditInfo(String tel);
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.nu.modules.EmployessInfo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 员工咨询信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-06-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EmployeesAdvisoryInfoEntity implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
private String id;
|
||||||
|
/**微信id*/
|
||||||
|
private String openId;
|
||||||
|
/**微信名称*/
|
||||||
|
private String wechatName;
|
||||||
|
/**联系电话*/
|
||||||
|
private String tel;
|
||||||
|
/**状态 1审核中 2审核完成 3驳回 */
|
||||||
|
private String status;
|
||||||
|
/**审核备注*/
|
||||||
|
private String content;
|
||||||
|
/**创建人*/
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
private String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
/**机构是否入驻0否 1是(是否入驻过)*/
|
||||||
|
private String izEntry;
|
||||||
|
/**咨询人姓名*/
|
||||||
|
private String name;
|
||||||
|
/**性别*/
|
||||||
|
private String sex;
|
||||||
|
/**民族*/
|
||||||
|
private String national;
|
||||||
|
/**出生日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
private Date birthDate;
|
||||||
|
/**住址(身份证上)*/
|
||||||
|
private String idCardAddress;
|
||||||
|
/**身份证号*/
|
||||||
|
private String idCard;
|
||||||
|
/**签发机关*/
|
||||||
|
private String issuingAuthority;
|
||||||
|
/**有效开始日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
private Date startTime;
|
||||||
|
/**有效结束日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
private Date endTime;
|
||||||
|
/**身份证正面*/
|
||||||
|
private String cardZmPath;
|
||||||
|
/**身份证反面*/
|
||||||
|
private String cardFmPath;
|
||||||
|
/**婚否(0未婚 1已婚)*/
|
||||||
|
private String maritalStatus;
|
||||||
|
/**身高*/
|
||||||
|
private String height;
|
||||||
|
/**体重*/
|
||||||
|
private String weight;
|
||||||
|
/**健康状况(0健康 1患病)*/
|
||||||
|
private String healthStatus;
|
||||||
|
/**政治面貌(0共产党员 1民主党 2国民党 3无党派)*/
|
||||||
|
private String politicalAppearance;
|
||||||
|
/**紧急联系人姓名*/
|
||||||
|
private String contactName;
|
||||||
|
/**紧急联系人电话*/
|
||||||
|
private String contactTel;
|
||||||
|
/**紧急联系人与本人关系*/
|
||||||
|
private String contactRelationship;
|
||||||
|
/**户口性质(0农业 1非农业)*/
|
||||||
|
private String hukouType;
|
||||||
|
/**银行卡正面*/
|
||||||
|
private String bankZmPath;
|
||||||
|
/**银行卡反面*/
|
||||||
|
private String bankFmPath;
|
||||||
|
/**开户行*/
|
||||||
|
private String openingBank;
|
||||||
|
/**银行卡号*/
|
||||||
|
private String bankCard;
|
||||||
|
/**健康证正面*/
|
||||||
|
private String healthZmPath;
|
||||||
|
/**健康证反面*/
|
||||||
|
private String healthFmPath;
|
||||||
|
/**资质证(可多张)*/
|
||||||
|
private String qualificationPath;
|
||||||
|
/**无犯罪正面*/
|
||||||
|
private String noCrimeCertificate;
|
||||||
|
}
|
|
@ -1,12 +1,20 @@
|
||||||
package com.nu.modules.nuEmployeesAdvisoryInfo.service.impl;
|
package com.nu.modules.nuEmployeesAdvisoryInfo.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.nu.modules.EmployessInfo.api.IEmployessAdvisioryInfoApi;
|
||||||
|
import com.nu.modules.EmployessInfo.entity.EmployeesAdvisoryInfoEntity;
|
||||||
import com.nu.modules.nuEmployeesAdvisoryInfo.entity.NuEmployeesAdvisoryInfo;
|
import com.nu.modules.nuEmployeesAdvisoryInfo.entity.NuEmployeesAdvisoryInfo;
|
||||||
import com.nu.modules.nuEmployeesAdvisoryInfo.mapper.NuEmployeesAdvisoryInfoMapper;
|
import com.nu.modules.nuEmployeesAdvisoryInfo.mapper.NuEmployeesAdvisoryInfoMapper;
|
||||||
import com.nu.modules.nuEmployeesAdvisoryInfo.service.INuEmployeesAdvisoryInfoService;
|
import com.nu.modules.nuEmployeesAdvisoryInfo.service.INuEmployeesAdvisoryInfoService;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 员工咨询信息
|
* @Description: 员工咨询信息
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
|
@ -14,6 +22,39 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl<NuEmployeesAdvisoryInfoMapper, NuEmployeesAdvisoryInfo> implements INuEmployeesAdvisoryInfoService {
|
public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl<NuEmployeesAdvisoryInfoMapper, NuEmployeesAdvisoryInfo> implements INuEmployeesAdvisoryInfoService, IEmployessAdvisioryInfoApi {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmployeesAdvisoryInfoEntity insert(EmployeesAdvisoryInfoEntity EmployeesAdvisoryInfoEntity) {
|
||||||
|
NuEmployeesAdvisoryInfo NuEmployeesAdvisoryInfo = new NuEmployeesAdvisoryInfo();
|
||||||
|
BeanUtils.copyProperties(EmployeesAdvisoryInfoEntity,NuEmployeesAdvisoryInfo);
|
||||||
|
baseMapper.insert(NuEmployeesAdvisoryInfo);
|
||||||
|
EmployeesAdvisoryInfoEntity.setId(NuEmployeesAdvisoryInfo.getId());
|
||||||
|
return EmployeesAdvisoryInfoEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateById(EmployeesAdvisoryInfoEntity EmployeesAdvisoryInfoEntity) {
|
||||||
|
NuEmployeesAdvisoryInfo NuEmployeesAdvisoryInfo = new NuEmployeesAdvisoryInfo();
|
||||||
|
BeanUtils.copyProperties(EmployeesAdvisoryInfoEntity,NuEmployeesAdvisoryInfo);
|
||||||
|
return baseMapper.updateById(NuEmployeesAdvisoryInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmployeesAdvisoryInfoEntity> queryAuditInfo(String tel) {
|
||||||
|
QueryWrapper<NuEmployeesAdvisoryInfo> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("tel",tel);
|
||||||
|
// qw.in("status",new String[]{"1","3"});//审核状态为审核中、驳回的
|
||||||
|
qw.orderByDesc("create_time");
|
||||||
|
List<NuEmployeesAdvisoryInfo> list = baseMapper.selectList(qw);
|
||||||
|
List<EmployeesAdvisoryInfoEntity> result = Lists.newArrayList();
|
||||||
|
result = list.stream()
|
||||||
|
.map(item -> {
|
||||||
|
EmployeesAdvisoryInfoEntity entity = new EmployeesAdvisoryInfoEntity();
|
||||||
|
BeanUtils.copyProperties(item, entity);
|
||||||
|
return entity;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.nu.modules.wechat.employess.api;
|
||||||
|
|
||||||
|
import com.nu.modules.EmployessInfo.api.IEmployessAdvisioryInfoApi;
|
||||||
|
import com.nu.modules.EmployessInfo.entity.EmployeesAdvisoryInfoEntity;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/employessAdvisiory")
|
||||||
|
public class EmployessInfoApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEmployessAdvisioryInfoApi employessAdvisioryInfoApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增/编辑员工入驻申请信息
|
||||||
|
* @param EmployeesAdvisoryInfoEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "员工咨询信息-新增或修改")
|
||||||
|
@PostMapping("/saveApiEmployess")
|
||||||
|
public Result<Object> saveApiEmployess(@RequestBody EmployeesAdvisoryInfoEntity EmployeesAdvisoryInfoEntity) {
|
||||||
|
if (StringUtils.isNotBlank(EmployeesAdvisoryInfoEntity.getId())) {
|
||||||
|
employessAdvisioryInfoApi.updateById(EmployeesAdvisoryInfoEntity);
|
||||||
|
return Result.ok("保存成功!");
|
||||||
|
} else {
|
||||||
|
return Result.ok(employessAdvisioryInfoApi.insert(EmployeesAdvisoryInfoEntity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号获取工入驻申请信息
|
||||||
|
*
|
||||||
|
* @param tel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/queryApiEmployessInfo")
|
||||||
|
public Result<List<EmployeesAdvisoryInfoEntity>> queryApiEmployessInfo(@RequestParam("tel") String tel){
|
||||||
|
if(StringUtils.isBlank(tel)){
|
||||||
|
return Result.error("手机号码错误");
|
||||||
|
}
|
||||||
|
return Result.ok(employessAdvisioryInfoApi.queryAuditInfo(tel));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,180 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,105 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
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> {
|
||||||
|
|
||||||
|
}
|
|
@ -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.nuIotTqElectricitySyncLog.mapper.NuIotTqElectricitySyncLogMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,14 @@
|
||||||
|
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> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
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 {
|
||||||
|
|
||||||
|
}
|
|
@ -74,10 +74,18 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
||||||
|
|
||||||
|
|
||||||
@AutoLog(value = "修改机构及护理单元信息")
|
@AutoLog(value = "修改机构及护理单元信息")
|
||||||
@ApiOperation(value="修改机构及护理单元信息-编辑", notes="修改机构及护理单元信息-编辑")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody ElectricityMeter electricityMeter) {
|
public Result<String> edit(@RequestBody ElectricityMeter electricityMeter) {
|
||||||
service.updateById(electricityMeter);
|
service.updateById(electricityMeter);
|
||||||
return Result.OK("编辑成功!");
|
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("同步成功!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,9 @@ public class ElectricityMeter implements Serializable {
|
||||||
private String departId;//机构ID
|
private String departId;//机构ID
|
||||||
private String departName;//机构名称
|
private String departName;//机构名称
|
||||||
private String departServerUrl;//机构服务地址
|
private String departServerUrl;//机构服务地址
|
||||||
|
private String oldServerUrl;//原机构服务地址
|
||||||
|
private String syncType;//是否同步 0 未同步 1已同步
|
||||||
|
private String oldDepartId;//原机构id
|
||||||
|
private String oldDepartName;//原机构名称
|
||||||
|
|
||||||
}
|
}
|
|
@ -19,7 +19,9 @@
|
||||||
a.nu_name as nuName,
|
a.nu_name as nuName,
|
||||||
a.depart_id as departId,
|
a.depart_id as departId,
|
||||||
a.depart_name as departName,
|
a.depart_name as departName,
|
||||||
a.depart_server_url as departServerUrl
|
a.depart_server_url as departServerUrl,
|
||||||
|
a.old_server_url ,
|
||||||
|
a.sync_type
|
||||||
from nu_iot_tq_electricity_meter a
|
from nu_iot_tq_electricity_meter a
|
||||||
left join nu_iot_tq_collector b on a.cid = b.cid
|
left join nu_iot_tq_collector b on a.cid = b.cid
|
||||||
<where>
|
<where>
|
||||||
|
@ -64,22 +66,6 @@
|
||||||
and address = #{address}
|
and address = #{address}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
|
||||||
insert into nu_iot_tq_electricity_meter(
|
|
||||||
cid,
|
|
||||||
address,
|
|
||||||
relay_state,
|
|
||||||
remark,
|
|
||||||
create_time
|
|
||||||
)
|
|
||||||
values(
|
|
||||||
#{cid},
|
|
||||||
#{address},
|
|
||||||
#{relayState},
|
|
||||||
#{remark},
|
|
||||||
now()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<update id="update" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||||
update nu_iot_tq_electricity_meter
|
update nu_iot_tq_electricity_meter
|
||||||
|
|
|
@ -15,4 +15,6 @@ public interface IElectricityMeterService extends IService<ElectricityMeter> {
|
||||||
String eleResetNotify(String response_content, String timestamp, String sign);
|
String eleResetNotify(String response_content, String timestamp, String sign);
|
||||||
String eleControlNotify(String response_content, String timestamp, String sign);
|
String eleControlNotify(String response_content, String timestamp, String sign);
|
||||||
String eleReadNotify(String response_content, String timestamp, String sign);
|
String eleReadNotify(String response_content, String timestamp, String sign);
|
||||||
|
|
||||||
|
void syncElectricity(String dataSourceCode, ElectricityMeter electricityMeter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,13 @@ package com.nu.modules.tq.electricity.service.impl;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
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.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.entity.TqApiLog;
|
||||||
import com.nu.modules.tq.common.service.ITqApiLogService;
|
import com.nu.modules.tq.common.service.ITqApiLogService;
|
||||||
import com.nu.modules.tq.utils.HttpTool;
|
import com.nu.modules.tq.utils.HttpTool;
|
||||||
|
@ -15,8 +19,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||||
import com.nu.modules.tq.electricity.mapper.ElectricityMeterMapper;
|
import com.nu.modules.tq.electricity.mapper.ElectricityMeterMapper;
|
||||||
import com.nu.modules.tq.electricity.service.IElectricityMeterService;
|
import com.nu.modules.tq.electricity.service.IElectricityMeterService;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -31,6 +37,13 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
||||||
@Autowired
|
@Autowired
|
||||||
ITqApiLogService logService;
|
ITqApiLogService logService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public INuIotTqElectricitySyncLogService nuIotTqElectricitySyncLogService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private ElectricityMeterServiceImpl syncImpl;
|
||||||
|
|
||||||
public IPage<ElectricityMeter> findPage(Page<ElectricityMeter> page, ElectricityMeter electricityMeter){
|
public IPage<ElectricityMeter> findPage(Page<ElectricityMeter> page, ElectricityMeter electricityMeter){
|
||||||
return baseMapper.findPage(page,electricityMeter);
|
return baseMapper.findPage(page,electricityMeter);
|
||||||
}
|
}
|
||||||
|
@ -422,4 +435,105 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
||||||
}
|
}
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncElectricity(String dataSourceCode, 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());
|
||||||
|
baseMapper.updateById(electricityMeter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务系统删除命令
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public boolean syncElectricityDel(String dataSourceCode,ElectricityMeter electricityMeter) {
|
||||||
|
try {
|
||||||
|
baseMapper.deleteById(electricityMeter.getId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务系统保存或者修改命令
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public boolean syncElectricitySaveOrUpdate(String dataSourceCode,ElectricityMeter electricityMeter) {
|
||||||
|
try {
|
||||||
|
QueryWrapper<ElectricityMeter> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("cid",electricityMeter.getCid());
|
||||||
|
ElectricityMeter oldParam = baseMapper.selectOne(queryWrapper);//查询数据库中该表号数据原始数据
|
||||||
|
if(oldParam == null){
|
||||||
|
baseMapper.insert(electricityMeter);
|
||||||
|
}else{
|
||||||
|
baseMapper.updateById(electricityMeter);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ import java.io.Serializable;
|
||||||
* <p>功能描述:功能描述
|
* <p>功能描述:功能描述
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("nu_iot_tq_electricity_meter")
|
@TableName("nu_iot_tq_water_meter")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value="nu_iot_tq_electricity_meter对象", description="物联电表")
|
@ApiModel(value="nu_iot_tq_water_meter对象", description="物联水表")
|
||||||
public class WaterMeter implements Serializable {
|
public class WaterMeter implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
@ -65,24 +65,7 @@
|
||||||
and address = #{address}
|
and address = #{address}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
|
||||||
insert into nu_iot_tq_water_meter(
|
|
||||||
cid,
|
|
||||||
address,
|
|
||||||
relay_state,
|
|
||||||
battery_state,
|
|
||||||
remark,
|
|
||||||
create_time
|
|
||||||
)
|
|
||||||
values(
|
|
||||||
#{cid},
|
|
||||||
#{address},
|
|
||||||
#{relayState},
|
|
||||||
#{batteryState},
|
|
||||||
#{remark},
|
|
||||||
now()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
<update id="update" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||||
update nu_iot_tq_water_meter
|
update nu_iot_tq_water_meter
|
||||||
|
|
Loading…
Reference in New Issue