| | |
| | | */ |
| | | package org.springblade.modules.permit.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.FTP.OutJson; |
| | | import org.springblade.modules.permit.entity.Permit; |
| | | import org.springblade.modules.permit.service.IPermitService; |
| | | import org.springblade.modules.permit.vo.PermitVO; |
| | |
| | | @RequestMapping("/permit") |
| | | @Api(value = "", tags = "接口") |
| | | public class PermitController extends BladeController { |
| | | //ftp服务器IP地址 |
| | | private static String ftpHost = "192.168.0.105"; |
| | | //ftp服务器端口 |
| | | private static int ftpPort = 21; |
| | | //ftp服务器用户名 |
| | | private static String ftpUserName = "yly"; |
| | | //ftp服务器密码 |
| | | private static String ftpPassword = "Yly@123"; |
| | | //ftp服务器路径 |
| | | private static String ftpPath = ""; |
| | | //本地路径 |
| | | private static String localPath = "D:\\anbao"; |
| | | //文件名 |
| | | private static String fileName = "sql.json"; |
| | | |
| | | private final IPermitService permitService; |
| | | |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入permit") |
| | | public R save(@Valid @RequestBody Permit permit) { |
| | | public R save(@Valid @RequestBody Permit permit) throws FileNotFoundException { |
| | | String cardid = permit.getCardid(); |
| | | Map map = permitService.selectIn(cardid); |
| | | if (map!=null){ |
| | |
| | | permit.setType("2"); |
| | | permit.setStorage("1"); |
| | | permit.setPermitime(new Date()); |
| | | return R.status(permitService.save(permit)); |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |