| | |
| | | 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.seinspect.entity.Seinspect; |
| | | import org.springblade.modules.seinspect.service.ISeinspectService; |
| | | import org.springblade.modules.seinspect.vo.SeinspectVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入seinspect") |
| | | public R save(@Valid @RequestBody Seinspect seinspect) throws Exception { |
| | | arg.test01(arg.url+"/seinspect/save",seinspect); |
| | | return R.status(seinspectService.save(seinspect)); |
| | | 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 += FtpConstant.ip + s + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | seinspect.setUrl(substring); |
| | | } |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_seinspect(id,realName,carid,sName,inspectman,deptName,reviewTime,insid,examination_type,url,jid,deptid,jurisdiction,handler_result) " + |
| | | "values(" + "'" + seinspect.getId() + "'" + "," + |
| | | "'" + seinspect.getRealname() + "'" + "," + |
| | | "'" + seinspect.getCarid() + "'" + "," + |
| | | "'" + seinspect.getSname() + "'" + "," + |
| | | "'" + seinspect.getInspectman() + "'" + "," + |
| | | "'" + seinspect.getDeptname() + "'" + "," + |
| | | "'" + seinspect.getReviewtime() + "'" + "," + |
| | | "'" + seinspect.getInsid() + "'" + "," + |
| | | "'" + seinspect.getExaminationType() + "'" + "," + |
| | | "'" + seinspect.getUrl() + "'" + "," + |
| | | "'" + seinspect.getJid() + "'" + "," + |
| | | "'" + seinspect.getDeptid() + "'" + "," + |
| | | "'" + seinspect.getJurisdiction() + "'" + "," + |
| | | "'" +seinspect.getHandlerResult() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入seinspect") |
| | | public R update(@Valid @RequestBody Seinspect seinspect) throws Exception { |
| | | arg.test01(arg.url+"/seinspect/update",seinspect); |
| | | //arg.test01(arg.url+"/seinspect/update",seinspect); |
| | | return R.status(seinspectService.updateById(seinspect)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | arg.sendPostRemoveByIds(arg.url+"/seinspect/remove",ids); |
| | | //arg.sendPostRemoveByIds(arg.url+"/seinspect/remove",ids); |
| | | return R.status(seinspectService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |