功能码9A、21、22、23、26、86、87、93、A2、A3远程命令接口定义与后端编码实现
| | |
| | | return sb.toString() ; |
| | | } |
| | | |
| | | public String toStr(boolean showBase){ |
| | | StringBuffer sb = new StringBuffer() ; |
| | | if(showBase){ |
| | | sb.append(comName + " : \n") ; |
| | | sb.append("控制器类型 : ") ; |
| | | sb.append(CommonV202404.ctrlDevType(controllerType)) ; |
| | | sb.append("\n") ; |
| | | sb.append("项目编号 : ") ; |
| | | sb.append(projectNo == null?"未知":projectNo) ; |
| | | sb.append("\n") ; |
| | | } |
| | | sb.append("IP通道号 : ") ; |
| | | sb.append(channel == null?"未知":channel) ; |
| | | sb.append("\n") ; |
| | | sb.append("ip : ") ; |
| | | sb.append(ip == null?"未知":ip) ; |
| | | sb.append("\n") ; |
| | | sb.append("端口号 : ") ; |
| | | sb.append(port == null?"未知":port) ; |
| | | sb.append("\n") ; |
| | | |
| | | return sb.toString() ; |
| | | } |
| | | |
| | | } |
| | |
| | | return sb.toString() ; |
| | | } |
| | | |
| | | public String toStr(boolean showBase){ |
| | | StringBuffer sb = new StringBuffer() ; |
| | | if(showBase){ |
| | | sb.append(comName + " : \n") ; |
| | | sb.append("控制器类型 : ") ; |
| | | sb.append(CommonV202404.ctrlDevType(controllerType)) ; |
| | | sb.append("\n") ; |
| | | sb.append("项目编号 : ") ; |
| | | sb.append(projectNo == null?"未知":projectNo) ; |
| | | sb.append("\n") ; |
| | | } |
| | | sb.append("IP通道号 : ") ; |
| | | sb.append(channel == null?"未知":channel) ; |
| | | sb.append("\n") ; |
| | | sb.append("域名 : ") ; |
| | | sb.append(domain == null?"未知":domain) ; |
| | | sb.append("\n") ; |
| | | sb.append("端口号 : ") ; |
| | | sb.append(port == null?"未知":port) ; |
| | | sb.append("\n") ; |
| | | |
| | | return sb.toString() ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd21; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCdXyVo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.util.IPUtils; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:42 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "设置设备终端IP地址端口") |
| | | @RestController("cd21Ctrl") |
| | | @RequestMapping(path = "p202404V201/cd21") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "21" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .channel(dto.channel)//IP通道号(取值范围 1、2) |
| | | .ip(dto.ip)//IP(例如 125.235.35.89) |
| | | .port(dto.port)//端口号(0~65536) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | if(dto != null){ |
| | | CdDto myo = (CdDto) dto ; |
| | | if(myo.channel == null){ |
| | | return "IP通道号不能为空"; |
| | | } |
| | | if(myo.ip == null){ |
| | | return "IP不能为空"; |
| | | } |
| | | if(myo.port == null){ |
| | | return "端口号不能为空"; |
| | | } |
| | | if(myo.channel != 1 && myo.channel != 2){ |
| | | return "请正确填写IP通道号(1、2)"; |
| | | } |
| | | if(!IPUtils.ipValid(myo.ip)){ |
| | | return "请正确填写IP"; |
| | | } |
| | | if(myo.port > 65535 || myo.port < 0){ |
| | | return "请正确填写端口号(0~65536)"; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCdXyVo cvo = JSON.parseObject(json, DataCdXyVo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd21; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:42 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505151042001L; |
| | | @NotNull(message = "IP通道号不能为空") |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | @NotNull(message = "IP不能为空") |
| | | public String ip ;//IP(例如 125.235.35.89) |
| | | @NotNull(message = "端口号不能为空") |
| | | public Integer port ;//端口号(0~65536) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd21; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:42 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | public String ip ;//IP(例如 125.235.35.89) |
| | | public Integer port ;//端口号(0~65536) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd21; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:42 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd21Sv") |
| | | public class CdSv extends ComSv { |
| | | } |
| | |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "设置机井年最大开采量和水位下限"; |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "22" ; |
| | | |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd23; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCdXyVo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.util.IPUtils; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:45 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "设置设备终端域名端口") |
| | | @RestController("cd23Ctrl") |
| | | @RequestMapping(path = "p202404V201/cd23") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "23" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .channel(dto.channel)//IP通道号(取值范围 1、2) |
| | | .domain(dto.domain.trim())//域名(例如 www.baidu.com) |
| | | .port(dto.port)//端口号(0~65536) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | if(dto != null){ |
| | | CdDto myo = (CdDto) dto ; |
| | | if(myo.channel == null){ |
| | | return "IP通道号不能为空"; |
| | | } |
| | | if(myo.domain == null){ |
| | | return "域名不能为空"; |
| | | } |
| | | if(myo.port == null){ |
| | | return "端口号不能为空"; |
| | | } |
| | | if(myo.channel != 1 && myo.channel != 2){ |
| | | return "请正确填写IP通道号(1、2)"; |
| | | } |
| | | if(myo.domain.trim().equals("")){ |
| | | return "请正确填写域名"; |
| | | } |
| | | if(myo.port > 65535 || myo.port < 0){ |
| | | return "请正确填写端口号(0~65536)"; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCdXyVo cvo = JSON.parseObject(json, DataCdXyVo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd23; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:45 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505151045001L; |
| | | @NotNull(message = "IP通道号不能为空") |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | @NotNull(message = "域名不能为空") |
| | | public String domain;//域名(例如 www.baidu.com) |
| | | @NotNull(message = "端口号不能为空") |
| | | public Integer port ;//端口号(0~65536) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd23; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:45 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | public String domain;//域名(例如 www.baidu.com) |
| | | public Integer port ;//端口号(0~65536) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd23; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:45 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd23Sv") |
| | | public class CdSv extends ComSv { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd26; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCdXyVo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:33 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "设置设备终端年用水量") |
| | | @RestController("cd26Ctrl") |
| | | @RequestMapping(path = "p202404V201/cd26") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "26" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .maxAmountYear(dto.amountYear)//设备终端年用水量单位:m3 整数,取值范围0~99999999 |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | if(dto != null){ |
| | | CdDto myo = (CdDto) dto ; |
| | | if(myo.amountYear == null){ |
| | | return "设备终端年用水量不能为空"; |
| | | } |
| | | if(myo.amountYear > 99999999 || myo.amountYear <= 0){ |
| | | return "请正确填写设备终端年用水量(m3)(0~99999999)"; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCdXyVo cvo = JSON.parseObject(json, DataCdXyVo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd26; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:33 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505121133001L; |
| | | @NotNull(message = "设备终端年用水量不能为空") |
| | | public Integer amountYear;//设备终端年用水量单位:m3 整数,取值范围0~99999999 |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd26; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:33 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public Integer maxAmountYear ;//设备终端年用水量单位:m3 整数,取值范围0~99999999 |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd26; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:33 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd26Sv") |
| | | public class CdSv extends ComSv { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd86; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd86Vo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.util.IPUtils; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import com.dy.pipIrrRemote.monitor.p202404V201.cd21.CdParam; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "查询设备终端IP地址端口") |
| | | @RestController("cd86Ctrl") |
| | | @RequestMapping(path = "p202404V201/cd86") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "86" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .channel(dto.channel)//IP通道号(取值范围 1、2) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | if(dto != null){ |
| | | CdDto myo = (CdDto) dto ; |
| | | if(myo.channel == null){ |
| | | return "IP通道号不能为空"; |
| | | } |
| | | if(myo.channel != 1 && myo.channel != 2){ |
| | | return "请正确填写IP通道号(1、2)"; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCd86Vo cvo = JSON.parseObject(json, DataCd86Vo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd86; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505151135001L; |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd86; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd86; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd86Sv") |
| | | public class CdSv extends ComSv { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd87; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd87Vo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import com.dy.pipIrrRemote.monitor.p202404V201.cd21.CdParam; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "查询设备终端域名端口") |
| | | @RestController("cd87Ctrl") |
| | | @RequestMapping(path = "p202404V201/cd87") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "87" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .channel(dto.channel)//IP通道号(取值范围 1、2) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | if(dto != null){ |
| | | CdDto myo = (CdDto) dto ; |
| | | if(myo.channel == null){ |
| | | return "IP通道号不能为空"; |
| | | } |
| | | if(myo.channel != 1 && myo.channel != 2){ |
| | | return "请正确填写IP通道号(1、2)"; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCd87Vo cvo = JSON.parseObject(json, DataCd87Vo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd87; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505151135001L; |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd87; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public Integer channel ;//IP通道号(取值范围 1、2). |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd87; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 11:32 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd87Sv") |
| | | public class CdSv extends ComSv { |
| | | } |
| | |
| | | @Autowired |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | |
| | | public VoVirtualCard selectClientVtCardById(Long id){ |
| | | return seVirtualCardDao.getVcById(id) ; |
| | | } |
| | | public Double selectWaterPrice(){ |
| | | return prWaterPriceDao.getPrice() ; |
| | | } |
| | | |
| | | /** |
| | | * 解除虚拟卡被占用 |
| | | */ |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd9A; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd9AVo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/12 11:40 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "查询设备年用水量") |
| | | @RestController("cd9ACtrl") |
| | | @RequestMapping(path = "p202404V201/cd9A") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "9A" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType).build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam ; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, null); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCd9AVo cvo = JSON.parseObject(json, DataCd9AVo.class) ; |
| | | if(cvo != null){ |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd9A; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:19 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505121140001L; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd9A; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:19 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd9A; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 10:19 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cd9ASv") |
| | | public class CdSv extends ComSv { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA2; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd92_A2Vo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.RandomStringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:21 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "App远程开阀") |
| | | @RestController("cdA2Ctrl") |
| | | @RequestMapping(path = "p202404V201/cdA2") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "A2" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | if(dto.vtCardId == null || "".equals(dto.vtCardId.trim())){ |
| | | Long vtId = sv.selectVcIdByIntakeId(dto.getIntakeId()) ; |
| | | if(vtId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("请选择一张虚拟卡"); |
| | | }else{ |
| | | dto.vtCardId = vtId.toString() ; |
| | | } |
| | | } |
| | | VoVirtualCard vcPo = sv.selectClientVtCardById(Long.parseLong(dto.vtCardId.trim())) ; |
| | | if(vcPo == null){ |
| | | return BaseResponseUtils.buildErrorMsg("服务端出错,未得到农户虚拟卡") ; |
| | | } |
| | | if(vcPo.getInUse().booleanValue()){ |
| | | return BaseResponseUtils.buildErrorMsg("农户该虚拟卡已经被占用,不能再应用其开阀") ; |
| | | } |
| | | if(vcPo.getMoney() <= 0.0){ |
| | | return BaseResponseUtils.buildErrorMsg("农户该虚拟卡中剩余金额为0,不能再应用其开阀") ; |
| | | } |
| | | Double waterPrice = sv.selectWaterPrice() ; |
| | | if(waterPrice == null){ |
| | | return BaseResponseUtils.buildErrorMsg("服务端出错,未得到水价") ; |
| | | } |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo("" + vcPo.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .waterRemain(0.0)//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .moneyRemain(vcPo.getMoney())//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .waterPrice(waterPrice)//水量单价 单位:元, 2个小数点 |
| | | .elePrice(0.0)//电量单价 单位:元, 2个小数点 |
| | | .orderNo(RandomStringUtils.randomNumeric(16))//订单号(16位数字) |
| | | .build(); |
| | | //发送命令前-3:保存命令日志 |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, new Callback() { |
| | | @Override |
| | | public void call(Object obj) { |
| | | Boolean success = (Boolean) obj; |
| | | if(success){ |
| | | // 添加常用取水口或更新使用信息 |
| | | sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ; |
| | | //开阀成功,虚拟卡记录上标记已被占用 |
| | | sv.setVcUsed(vcPo.getId(), dto.getIntakeId()); |
| | | } |
| | | } |
| | | @Override |
| | | public void call(Object... objs) { |
| | | } |
| | | @Override |
| | | public void exception(Exception e) { |
| | | } |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ; |
| | | if(cvo != null){ |
| | | if(callback != null){ |
| | | if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)0){ |
| | | callback.call(true);//开阀成功 |
| | | }else{ |
| | | callback.call(false);//开阀失败 |
| | | } |
| | | } |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA2; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:21 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505150921001L; |
| | | public String vtCardId ;//用户卡(虚拟卡)序列号(17位数字)(6字节BCD,2字节HEX) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA2; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:21 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public String icCardNo ;//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | public Double waterRemain ;//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | public Double moneyRemain ;//用户剩余金额, 两个小数点, 单位元, 0~999999.99 |
| | | public Double waterPrice ;//水量单价 单位:元, 2个小数点 |
| | | public Double elePrice ;//电量单价 单位:元, 2个小数点 |
| | | public String orderNo ;//订单号(16位数字) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA2; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:21 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cdA2Sv") |
| | | public class CdSv extends ComSv { |
| | | @Autowired |
| | | protected SeVirtualCardMapper seVirtualCardDao ; |
| | | @Autowired |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | @Autowired |
| | | protected PrIntakeVcMapper prIntakeVcDao ; |
| | | |
| | | public VoVirtualCard selectClientVtCardById(Long id){ |
| | | return seVirtualCardDao.getVcById(id) ; |
| | | } |
| | | public Double selectWaterPrice(){ |
| | | return prWaterPriceDao.getPrice() ; |
| | | } |
| | | /** |
| | | * 根据取水口ID获取与之绑定虚拟卡ID |
| | | * @param intakeId |
| | | * @return |
| | | */ |
| | | public Long selectVcIdByIntakeId(Long intakeId) { |
| | | return prIntakeVcDao.getVcIdByIntakeId(intakeId); |
| | | } |
| | | /** |
| | | * 设置虚拟卡被占用 |
| | | */ |
| | | public void setVcUsed(Long id, Long intakeId){ |
| | | SeVirtualCard po = new SeVirtualCard() ; |
| | | po.setId(id); |
| | | po.setIntakeId(intakeId); |
| | | po.setInUse((byte)1); |
| | | po.setOpenTime(new Date()); |
| | | seVirtualCardDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA3; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_A3Vo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:23 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "远程命令", description = "App远程关阀") |
| | | @RestController("cdA3Ctrl") |
| | | @RequestMapping(path = "p202404V201/cdA3") |
| | | @RequiredArgsConstructor |
| | | @Scope("prototype") //因为有对象类属性,所以采用原型模式,每次请求新建一个实例对象 |
| | | public class CdCtrl extends ComCtrl { |
| | | |
| | | private static final String RtuSuccessMsg = "控制器接收并执行命令成功,无返回数据"; |
| | | |
| | | private static final String ComCode = "A3" ; |
| | | |
| | | @Autowired |
| | | private CdSv sv ; |
| | | /** |
| | | * 向设备(控制器)发送命令 |
| | | * @param dto 前端发来的值对象 |
| | | * @param bindingResult 对dto验证的结果 |
| | | * @return 返回前端 |
| | | */ |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) { |
| | | BaseResponse<Object> res ; |
| | | //发送命令前-1:验证 |
| | | res = super.pre1(sv, ComCode, dto, bindingResult); |
| | | if(res == null) { |
| | | //发送命令前-2:获得数据 |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //获取开阀命令参数 |
| | | VoUnclosedParam opPa = sv.selectUncloseParam(dto.getIntakeId(), ctrlPo.getRtuAddr()); |
| | | if(opPa == null) { |
| | | return BaseResponseUtils.buildFail("该取水口上无您最近的开阀操作"); |
| | | } |
| | | Long vcId = sv.getVcIdByNum(opPa.getVcNum()) ; |
| | | if(vcId == null) { |
| | | return BaseResponseUtils.buildFail("服务端出错,未得到虚拟卡ID"); |
| | | } |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo(opPa.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .orderNo(opPa.getOrderNo())//订单号(16位数字) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | | super.pre4(); |
| | | try { |
| | | //创建外部命令(发给控制器) |
| | | Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode); |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl; |
| | | com.param = comParam; |
| | | //发送命令 |
| | | res = super.doSend(sv, com); |
| | | if (res == null) { |
| | | //发送命令后 |
| | | res = super.after(ComCode, new Callback() { |
| | | @Override |
| | | public void call(Object obj) { |
| | | Boolean success = (Boolean) obj; |
| | | if(success){ |
| | | //关阀成功,解除虚拟卡被占用 |
| | | sv.setVcNoUsed(vcId); |
| | | } |
| | | } |
| | | @Override |
| | | public void call(Object... objs) { |
| | | } |
| | | @Override |
| | | public void exception(Exception e) { |
| | | } |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | res = BaseResponseUtils.buildFail("服务端构造并向通信中间件发送请求时异常" + (e.getMessage() == null ? "" : e.getMessage())); |
| | | } finally { |
| | | //最终 |
| | | super.end(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res ; |
| | | } |
| | | |
| | | @Override |
| | | protected String checkDto(DtoBase dto) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | if(codeData == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | DataCd93_A3Vo cvo = JSON.parseObject(json, DataCd93_A3Vo.class) ; |
| | | if(cvo != null){ |
| | | if(callback != null){ |
| | | if(cvo.clResult != null && cvo.clResult == 0){ |
| | | callback.call(true);//关阀成功 |
| | | }else{ |
| | | callback.call(false);//关阀失败 |
| | | } |
| | | } |
| | | msg = cvo.toStr(false) ; |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | | } |
| | | return msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA3; |
| | | |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:23 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=true) |
| | | public class CdDto extends DtoBase { |
| | | public static final long serialVersionUID = 202505150923001L; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA3; |
| | | |
| | | import com.dy.pipIrrRemote.monitor.common.CdParameter; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import lombok.experimental.SuperBuilder; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:23 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @SuperBuilder |
| | | public class CdParam extends CdParameter { |
| | | public String icCardNo ;//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | public String orderNo ;//订单号(16位数字) |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA3; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/15 09:23 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service("cdA3Sv") |
| | | public class CdSv extends ComSv { |
| | | |
| | | @Autowired |
| | | protected SeVirtualCardMapper seVirtualCardDao ; |
| | | |
| | | @Autowired |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | |
| | | /** |
| | | * 解除虚拟卡被占用 |
| | | */ |
| | | public void setVcNoUsed(Long id){ |
| | | SeVirtualCard po = new SeVirtualCard() ; |
| | | po.setId(id); |
| | | po.setIntakeId(null); |
| | | po.setInUse((byte)0); |
| | | po.setOpenTime(null); |
| | | seVirtualCardDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 通过虚拟卡编号得到记录实体ID |
| | | * @param vcNum |
| | | * @return |
| | | */ |
| | | public Long getVcIdByNum(String vcNum){ |
| | | return seVirtualCardDao.getVcIdByNum(vcNum) ; |
| | | } |
| | | } |