| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.FtpConstant; |
| | | import org.springblade.common.config.FtpConfig; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | 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 = ""; |
| | | String[] split = coinspect.getUrl().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | url += FtpConstant.ip + s + ","; |
| | | if (coinspect.getUrl()!=null && !"".equals(coinspect.getUrl())){ |
| | | String[] split = coinspect.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); |
| | | coinspect.setUrl(substring); |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | coinspect.setUrl(substring); |
| | | //数据同步 |
| | | 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.FTP(s1); |
| | | return R.success("新增成功"); |
| | | } |
| | | |