| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Base64; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @GetMapping(path = "/issuedTask") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> issuedTask(String id){ |
| | | if(id == null || !id.trim().equals("")){ |
| | | if(id == null || id.trim().equals("")){ |
| | | return BaseResponseUtils.buildError("任务id不能为空") ; |
| | | } |
| | | UgRtuTask tpo = this.sv.selectTaskById(id) ; |
| | |
| | | return BaseResponseUtils.buildError("任务所涉及的控制器还未设置") ; |
| | | } |
| | | |
| | | String ugCallbackUrl_rm = env.getProperty("mw." + DataSourceContext.get() + ".ugCallbackUrl_rm" ); |
| | | String ugCallbackUrl_rm = env.getProperty("mw.ugCallbackUrl_rm" ); |
| | | if(ugCallbackUrl_rm == null || ugCallbackUrl_rm.trim().equals("")){ |
| | | return BaseResponseUtils.buildError("未配置升级任务回调网址") ; |
| | | } |
| | |
| | | vo.softFileName = ppo.hexFileName ; |
| | | vo.softStoreAddr = ppo.storeRamAddr ; |
| | | vo.softStartAddr = ppo.startRamAddr ; |
| | | vo.softFileData = ppo.programBytes ; |
| | | vo.softFileData64 = Base64.getEncoder().encodeToString(ppo.programBytes) ; |
| | | //vo.softFileData = ppo.programBytes ; |
| | | vo.softBytesCalculate = ppo.programCalculateBytes ; |
| | | vo.softByteSrc16 = ppo.programCrc16 ; |
| | | } |
| | |
| | | @GetMapping(path = "/demoReset") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> demoReset(){ |
| | | if(RtuUpgradeStateReceiverCtrl.cache == null){ |
| | | if(RtuUpgradeStateReceiverCtrl.cache != null){ |
| | | //return BaseResponseUtils.buildError("当前没有升级任务") ; |
| | | //正式运行时,下面两行去掉,上面一行打开 |
| | | RtuUpgradeStateReceiverCtrl ctrl = SpringContextUtil.getBean(RtuUpgradeStateReceiverCtrl.class); |