| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.commons.service.EmailService; |
| | | import org.springblade.mdm.gkw.programnode.entity.MachineFile; |
| | | import org.springblade.mdm.flow.service.WIthdrawService; |
| | | import org.springblade.mdm.machinefile.entity.MachineFile; |
| | | import org.springblade.mdm.machinefile.service.MachineFileScanService; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.service.NcNodeService; |
| | | import org.springblade.mdm.program.service.ProgramAnnotationService; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | |
| | | private IDictBizClient bizDictClient; |
| | | @Autowired |
| | | private EmailService mailService; |
| | | @Autowired |
| | | private MachineFileScanService machineFileScanService; |
| | | @Autowired |
| | | private WIthdrawService withdrawService; |
| | | /** |
| | | * 新增 |
| | | */ |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/scan") |
| | | @GetMapping("/scandir") |
| | | @Operation(summary = "test扫描", description = "test扫描") |
| | | public R<Void> scan() throws IOException { |
| | | Machine machine = new Machine(); |
| | | machine.setCode("M_01_FN"); |
| | | machine.setProgReceiveDir("d:/data/machine1/rec"); |
| | | machineFileScanTask.scanDir(machine, MachineFile.DIR_TYPE_REC); |
| | | machineFileScanService.scanDir(machine, MachineFile.DIR_TYPE_REC); |
| | | return R.success(); |
| | | } |
| | | |
| | |
| | | @GetMapping("/sendmail") |
| | | @Operation(summary = "sendmail", description = "sendmail") |
| | | public R<Void> sendmail(String code) throws IOException, MessagingException { |
| | | mailService.sendHtmlEmail("zhangxiaoxu@qianwen.ltd","testtitle"+code,"abc烦烦烦"); |
| | | mailService.sendHtmlEmail("y_ys79@sina.com","testtitle"+code,"abc烦烦烦"); |
| | | |
| | | return R.success(); |
| | | } |
| | | |
| | | @GetMapping("/withdraw") |
| | | public R<Void> withdraw(String id) throws IOException, MessagingException { |
| | | withdrawService.withdraw(id); |
| | | return R.success(); |
| | | } |
| | | |
| | | @GetMapping("/scanfile") |
| | | public void scanFile(){ |
| | | machineFileScanService.scanMachineFile(); |
| | | } |
| | | |
| | | } |