| | |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.mail.MessagingException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.IOUtils; |
| | | 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.program.entity.NcNode; |
| | | import org.springblade.mdm.program.service.NcNodeService; |
| | | import org.springblade.mdm.program.service.ProgramAnnotationService; |
| | | import org.springblade.mdm.task.MachineFileScanTask; |
| | | import org.springblade.mdm.utils.FileContentUtil; |
| | | import org.springblade.system.feign.IDictBizClient; |
| | | import org.springblade.system.pojo.entity.DictBiz; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Autowired |
| | | private MachineFileScanTask machineFileScanTask; |
| | | |
| | | @Autowired |
| | | private ProgramAnnotationService programAnnotationService; |
| | | @Autowired |
| | | private IDictBizClient bizDictClient; |
| | | @Autowired |
| | | private EmailService mailService; |
| | | /** |
| | | * 新增 |
| | | */ |
| | |
| | | return R.success(); |
| | | } |
| | | |
| | | @GetMapping("/repalce-anno") |
| | | @Operation(summary = "替换注释", description = "test扫描") |
| | | public R<List<String>> repalceAnno() throws IOException { |
| | | InputStream res; |
| | | try(FileInputStream fis = new FileInputStream("d:/b.txt");) { |
| | | res = programAnnotationService.setSendDirAndStatusAnnotation("D:/mysend", "PL", fis,"FANUC"); |
| | | } |
| | | List<String> lines = null; |
| | | if(res!=null) { |
| | | try(res) { |
| | | lines = IOUtils.readLines(res, "utf-8"); |
| | | } |
| | | } |
| | | return R.data(lines); |
| | | } |
| | | |
| | | @GetMapping("/dict-biz") |
| | | @Operation(summary = "biz", description = "test扫描") |
| | | public R<List<DictBiz>> giz(String code) throws IOException { |
| | | log.info("mytset中的日志"); |
| | | return this.bizDictClient.getList (code); |
| | | } |
| | | |
| | | @GetMapping("/sendmail") |
| | | @Operation(summary = "sendmail", description = "sendmail") |
| | | public R<Void> sendmail(String code) throws IOException, MessagingException { |
| | | |
| | | return R.success(); |
| | | } |
| | | |
| | | } |