| | |
| | | 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.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | | import org.springblade.modules.exam.excel.ExamScoreExcel; |
| | | import org.springblade.modules.exam.excel.ExamScoreImporter; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @PostMapping("/submit") |
| | | public R submit(@Valid @RequestBody DispatcherUnit dispatcherUnit) { |
| | | boolean status = false; |
| | | if (null == dispatcherUnit.getId()) { |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | //内网 |
| | | DispatcherUnit dispatcherUnit1 = dispatcherUnit; |
| | | DispatcherUnit dispatcherUnit1 = Objects.requireNonNull(BeanUtil.copy(dispatcherUnit, DispatcherUnit.class)); |
| | | //脱敏处理 |
| | | if (null!=dispatcherUnit.getLinkman()) { |
| | | dispatcherUnit1.setLinkman(DesensitizedUtil.desensitizedName(dispatcherUnit.getLinkman())); |
| | |
| | | } |
| | | dispatcherUnit1.setSecurityLinkman(DesensitizedUtil.desensitizedName(dispatcherUnit.getSecurityLinkman())); |
| | | dispatcherUnit1.setCell(DesensitizedUtil.desensitizedPhoneNumber(dispatcherUnit.getCell())); |
| | | if (null == dispatcherUnit.getId()) { |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | //新增 |
| | | status = dispatcherUnitService.save(dispatcherUnit); |
| | | if (status) { |
| | |
| | | list.forEach(id -> { |
| | | //内网同步 |
| | | String s1 = "delete from sys_dispatcher_unit where id = " + "'" + id + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | return R.status(dispatcherUnitService.removeByIds(Func.toLongList(ids))); |