| | |
| | | import org.springblade.modules.seinspect.entity.Seinspect; |
| | | import org.springblade.modules.seinspect.service.ISeinspectService; |
| | | import org.springblade.modules.seinspect.vo.SeinspectVO; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | public class SeinspectController extends BladeController { |
| | | |
| | | private final ISeinspectService seinspectService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | @ApiOperation(value = "新增", notes = "传入seinspect") |
| | | public R save(@Valid @RequestBody Seinspect seinspect) throws Exception { |
| | | seinspect.setReviewtime(new Date()); |
| | | seinspectService.save(seinspect); |
| | | String url = ""; |
| | | if (seinspect.getUrl()!=null&& !"".equals(seinspect.getUrl())){ |
| | | String[] split = seinspect.getUrl().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | url += FtpConfig.ip + s + ","; |
| | | boolean save = seinspectService.save(seinspect); |
| | | if (save) { |
| | | String url = ""; |
| | | if (seinspect.getUrl() != null && !"".equals(seinspect.getUrl())) { |
| | | String[] split = seinspect.getUrl().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | url += FtpConfig.ip + s + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | seinspect.setUrl(substring); |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | seinspect.setUrl(substring); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_seinspect(id,reviewTime,content,result,url,examiner_dept_id,examiner_id,jurisdiction,security_id) " + |
| | | "values(" + "'" + seinspect.getId() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + seinspect.getContent() + "'" + "," + |
| | | "'" + seinspect.getResult() + "'" + "," + |
| | | "'" + seinspect.getUrl() + "'" + "," + |
| | | "'" + seinspect.getExaminerDeptId() + "'" + "," + |
| | | "'" + seinspect.getExaminerId() + "'" + "," + |
| | | "'" + seinspect.getJurisdiction() + "'" + "," + |
| | | "'" + seinspect.getSecurityId() + "'" + ")"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_seinspect(id,reviewTime,content,result,url,examiner_dept_id,examiner_id,jurisdiction,security_id) " + |
| | | "values(" + "'" + seinspect.getId() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + seinspect.getContent() + "'" + "," + |
| | | "'" + seinspect.getResult() + "'" + "," + |
| | | "'" + seinspect.getUrl() + "'" + "," + |
| | | "'" + seinspect.getExaminerDeptId() + "'" + "," + |
| | | "'" + seinspect.getExaminerId() + "'" + "," + |
| | | "'" + seinspect.getJurisdiction() + "'" + "," + |
| | | "'" + seinspect.getSecurityId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("成功"); |
| | | } |
| | | |