| | |
| | | @Override |
| | | @Transactional |
| | | public boolean saveUp(DangerReport dangerReport) { |
| | | this.save(dangerReport); |
| | | // 填充加密内容 |
| | | DangerReportSUPO dangerReportSUPO = BeanUtil.copy(dangerReport, DangerReportSUPO.class); |
| | | String message = JSONObject.toJSONString(dangerReportSUPO); |
| | | R<CBCResultDTO> cbcResultDTOR = pwdClient.getCBCMacEncipher(message); |
| | |
| | | String maced = cbcResultDTOR.getData().getMaced(); |
| | | String keyIndex = cbcResultDTOR.getData().getKeyIndex(); |
| | | String sm4iv = cbcResultDTOR.getData().getSm4IV(); |
| | | DangerReport ympo = new DangerReport(); |
| | | ympo.setId(dangerReport.getId()); |
| | | ympo.setMaced(maced); |
| | | ympo.setKeyindexs(keyIndex); |
| | | ympo.setSm4iv(sm4iv); |
| | | dangerReport.setMaced(maced); |
| | | dangerReport.setKeyindexs(keyIndex); |
| | | dangerReport.setSm4iv(sm4iv); |
| | | R<ResultDTO> resultDTOR = pwdClient.getEncrypt(sm4iv, keyIndex, message); |
| | | if (resultDTOR.getCode() != 200) { |
| | | return false; |
| | | } |
| | | ympo.setEncdata(resultDTOR.getData().getData()); |
| | | dangerReport.setEncdata(resultDTOR.getData().getData()); |
| | | |
| | | return this.updateById(ympo); |
| | | return this.save(dangerReport); |
| | | } |
| | | |
| | | } |