| | |
| | | import org.springblade.modules.coinspect.entity.Coinspect; |
| | | import org.springblade.modules.coinspect.service.ICoinspectService; |
| | | import org.springblade.modules.coinspect.vo.CoinspectVO; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | public class CoinspectController extends BladeController { |
| | | |
| | | private final ICoinspectService coinspectService; |
| | | |
| | | private final MyAsyncService myAsyncService; |
| | | /** |
| | | * 详情 |
| | | */ |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入coinspect") |
| | | public R save(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | coinspect.setReviewtime(new Date()); |
| | | coinspectService.save(coinspect); |
| | | String url = ""; |
| | | if (coinspect.getUrl()!=null && !"".equals(coinspect.getUrl())){ |
| | |
| | | } |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_coinspect(id,name,sName,deptName,reviewTime,insid,results,url) " + |
| | | "insert into sys_coinspect(id,examiner_id,reviewed_dept_id,examiner_dept_id,reviewTime,insid,results,url) " + |
| | | "values(" + "'" + coinspect.getId() + "'" + "," + |
| | | "'" + coinspect.getName() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getDeptname() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(coinspect.getReviewtime()) + "'" + "," + |
| | | "'" + coinspect.getExaminerId() + "'" + "," + |
| | | "'" + coinspect.getReviewedDeptId() + "'" + "," + |
| | | "'" + coinspect.getExaminerDeptId() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + coinspect.getInsid() + "'" + "," + |
| | | "'" + coinspect.getResults() + "'" + "," + |
| | | "'" + coinspect.getUrl() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | return R.success("新增成功"); |
| | | } |
| | | |