| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.FtpConstant; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.coinspect.entity.Coinspect; |
| | | import org.springblade.modules.coinspect.service.ICoinspectService; |
| | | import org.springblade.modules.coinspect.vo.CoinspectVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入coinspect") |
| | | public R save(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | //arg.test01(arg.url+"/coinspect/save",coinspect); |
| | | return R.status(coinspectService.save(coinspect)); |
| | | coinspectService.save(coinspect); |
| | | String url = ""; |
| | | 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 += FtpConstant.ip + s + ","; |
| | | } |
| | | 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,handler_result) " + |
| | | "values(" + "'" + coinspect.getId() + "'" + "," + |
| | | "'" + coinspect.getName() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getDeptname() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(coinspect.getReviewtime()) + "'" + "," + |
| | | "'" + coinspect.getInsid() + "'" + "," + |
| | | "'" + coinspect.getResults() + "'" + "," + |
| | | "'" + coinspect.getUrl() + "'" + "," + |
| | | "'" + coinspect.getHandlerResult() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入coinspect") |
| | | public R update(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | //arg.test01(arg.url+"/coinspect/update",coinspect); |
| | | return R.status(coinspectService.updateById(coinspect)); |
| | | } |
| | | |