diff --git a/src/main/java/com/ccl/tt/controller/PrePressController.java b/src/main/java/com/ccl/tt/controller/PrePressController.java index 70d1985..3825865 100644 --- a/src/main/java/com/ccl/tt/controller/PrePressController.java +++ b/src/main/java/com/ccl/tt/controller/PrePressController.java @@ -47,37 +47,37 @@ public class PrePressController { @Autowired private FinalRollDao finalRollDao; - + @Autowired private ShipmentRepository shipRepo; - + @Autowired private ProjectCodeRepository pjcRepo; @Autowired private MailSendService mailSendService; - @Value("${com.ftp.ftpHost}") - private String ftpHost; - - @Value("${com.ftp.ftpPort}") - private Integer ftpPort; - - @Value("${com.ftp.ftpUser}") - private String ftpUser; - - @Value("${com.ftp.ftpPassword}") - private String ftpPassword; - - @Value("${com.ftp.ftpDir}") - private String ftpDir; - + @Value("${com.ftp.ftpHost}") + private String ftpHost; + + @Value("${com.ftp.ftpPort}") + private Integer ftpPort; + + @Value("${com.ftp.ftpUser}") + private String ftpUser; + + @Value("${com.ftp.ftpPassword}") + private String ftpPassword; + + @Value("${com.ftp.ftpDir}") + private String ftpDir; + @Autowired private PrepressService prepressService; @Value("${item.zipPath}") private String zipPath; - + @Autowired private BasicDao basicDao; - + @InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); @@ -97,7 +97,7 @@ public class PrePressController { public String prepressReworkHome(){ return "sntracking/prepress_rework"; } - + @GetMapping("/query") public String prepressQuery(){ return "sntracking/prepress_query"; @@ -110,15 +110,15 @@ public class PrePressController { public String receiveQty(){ return "sntracking/receiveQty"; } - + /** - * - * @Title: serialInfo - * @Description: 查询信息页面 - * @author lirui - * @date 2018年4月20日 - * @param @return 参数 - * @return String 返回类型 + * + * @Title: serialInfo + * @Description: 查询信息页面 + * @author lirui + * @date 2018年4月20日 + * @param @return 参数 + * @return String 返回类型 * @throws */ @GetMapping("/serialInfo") @@ -134,14 +134,14 @@ public class PrePressController { return "/sntracking/so_order_info"; } /** - * - * @Title: getSerialInfo - * @Description: TODO(这里用一句话描述这个方法的作用) - * @author lirui - * @date 2018年4月20日 + * + * @Title: getSerialInfo + * @Description: TODO(这里用一句话描述这个方法的作用) + * @author lirui + * @date 2018年4月20日 * @param @param serialNo - * @param @return 参数 - * @return Object 返回类型 + * @param @return 参数 + * @return Object 返回类型 * @throws */ @PostMapping("/serialInfo") @@ -153,7 +153,7 @@ public class PrePressController { map.put("rows", rows); return map; } - + @PostMapping("/missingReportData") @ResponseBody public Object missingReportData(String serialNo){ @@ -163,7 +163,7 @@ public class PrePressController { map.put("rows", rows); return map; } - + @GetMapping("/downSerialInfo") @ResponseBody public Object downSerialInfo(@RequestParam("serilaNo") String serilaNo, @@ -316,7 +316,7 @@ public class PrePressController { map.put("rows", page.getContent()); return map; } - + @GetMapping("/reworkAll") @ResponseBody public Map soInfoReworkJson( @@ -449,14 +449,14 @@ public class PrePressController { } return ret; } - + /** - * - * @Title: addSoInfo - * @Description: 工单新增信息 + * + * @Title: addSoInfo + * @Description: 工单新增信息 * @author: LR - * @date 2024年6月19日 下午2:24:09 - * @return: Object + * @date 2024年6月19日 下午2:24:09 + * @return: Object * @throws */ @PostMapping("/soinfo/addSoInfo") @@ -476,7 +476,7 @@ public class PrePressController { } return resultMap; } - + /** * 新增返工订单 * @param soInfo @@ -495,7 +495,7 @@ public class PrePressController { soInfo.setFirstRollTime(new Date()); soInfo.validate(); //查询是否经过热覆合 - + //设置参数 soInfo.setLaminationFlag("Y"); //添加全的客户料号 @@ -513,7 +513,7 @@ public class PrePressController { } return ret; } - + @PostMapping("/soinfo/{id}/update") @ResponseBody public Map add(@PathVariable("id") Integer id, SoInfo soInfo){ @@ -603,8 +603,8 @@ public class PrePressController { } return ret; } - - + + @PostMapping("/soinfo/{id}/refreshSerials") @ResponseBody public Map refreshSerials(@PathVariable Integer id,Authentication authentication){ @@ -640,14 +640,14 @@ public class PrePressController { File file = new File("snfiles"+File.separator + filename + ".csv"); return new FileSystemResource(file); } - + /** - * - * @Title: downloadFileZip - * @Description: 下载已经生成好的文件 + * + * @Title: downloadFileZip + * @Description: 下载已经生成好的文件 * @author: LR - * @date 2024年7月29日 下午5:46:22 - * @return: FileSystemResource + * @date 2024年7月29日 下午5:46:22 + * @return: FileSystemResource * @throws */ @GetMapping("/downloadFileZip/{fileName}") @@ -786,7 +786,7 @@ public class PrePressController { } return ret; } - + @Autowired private SequenceRepository seqRepo; @@ -855,14 +855,14 @@ public class PrePressController { } return ret; } - + /** - * - * @Title: genSerials - * @Description: 产生工单得码包新的方法 + * + * @Title: genSerials + * @Description: 产生工单得码包新的方法 * @author: LR - * @date 2024年6月19日 下午2:46:03 - * @return: Object + * @date 2024年6月19日 下午2:46:03 + * @return: Object * @throws */ @PostMapping("/soinfo/{id}/genSerials") @@ -893,10 +893,10 @@ public class PrePressController { //查询物料的信息 PartData partData = basicDao.getPartDataByPartNo(partNo); String codeType = partData.getCodeType(); - + Calendar cal = Calendar.getInstance(); cal.setTime(soInfo.getSerialsDate()); - String platCode3 = "GDC"; + String platCode3 = "J4K"; String year1 = String.valueOf(cal.get(Calendar.YEAR) % 10); String week2 = org.apache.commons.lang3.StringUtils.leftPad(String.valueOf(cal.get(Calendar.WEEK_OF_YEAR)), 2, '0'); String day1 = String.valueOf(cal.get(Calendar.DAY_OF_WEEK)); @@ -936,7 +936,7 @@ public class PrePressController { ZipEntry entry = new ZipEntry(fileName + ".csv"); zos.putNextEntry(entry); - + //查询当前物料的数据 获取编码的类型 String partNo = soInfo.getPartNo(); PartData part = basicDao.getPartDataByPartNo(partNo); @@ -1097,16 +1097,16 @@ public class PrePressController { return ret; } - + /** - * - * @Title: downloadSingleTrace - * @Description: 按照单排下载 + * + * @Title: downloadSingleTrace + * @Description: 按照单排下载 * @param orderNo - * @return - * @return: Map + * @return + * @return: Map * @author LR - * @date: 2021-7-28 10:09:34 + * @date: 2021-7-28 10:09:34 * @throws */ @PostMapping("/downloadSingleTrace") @@ -1172,7 +1172,7 @@ public class PrePressController { @Autowired JdbcTemplate jdbcTemplate; - + @PostMapping("/ifsOrder") @ResponseBody @@ -1190,7 +1190,7 @@ public class PrePressController { } return resultMap; } - + @GetMapping("/getReceiveQty") @ResponseBody public Object getReceiveQty(@RequestParam(value = "orderNo", required = false) String orderNo, diff --git a/src/main/java/com/ccl/tt/service/impl/PrepressServiceImpl.java b/src/main/java/com/ccl/tt/service/impl/PrepressServiceImpl.java index 5972804..7df1661 100644 --- a/src/main/java/com/ccl/tt/service/impl/PrepressServiceImpl.java +++ b/src/main/java/com/ccl/tt/service/impl/PrepressServiceImpl.java @@ -35,23 +35,23 @@ import com.ccl.tt.utils.DateUtils; import com.ccl.tt.utils.SerialUtil; /** - * - * @ClassName: PrepressServiceImpl - * @Description: 印前的方法实现 + * + * @ClassName: PrepressServiceImpl + * @Description: 印前的方法实现 * @author: LR - * @date: 2024年6月18日 下午5:59:42 + * @date: 2024年6月18日 下午5:59:42 * @Copyright: */ @Service public class PrepressServiceImpl implements PrepressService { - + private static final Logger logger = LoggerFactory.getLogger(PrepressServiceImpl.class); - + @Value("${ifs.datasource.sql.order}") String ifsOrderSql; @Value("${item.filePath}") private String filePath; - + @Autowired private PrepressDao prepressDao; @Autowired @@ -62,14 +62,14 @@ public class PrepressServiceImpl implements PrepressService { private SequenceRepository seqRepo; @Autowired private FinalRollDao finalRollDao; - + @Override public Map getIfsOrder(String orderNo) { Map resultMap = prepressDao.getResultMapBySql(ifsOrderSql, orderNo); //判断是否非空 if (resultMap == null || resultMap.isEmpty()) { throw new RuntimeException("Order information not found for " + orderNo + ":"); - } + } //校验工单是否存在当前的物料编码 String partNo = String.valueOf(resultMap.get("part_no")); //判断物料是否存在 @@ -93,7 +93,7 @@ public class PrepressServiceImpl implements PrepressService { resultMap.put("projectCode", part.getProjectCode()); return resultMap; } - + @Override @Transactional public void addSoInfo(SoInfo soInfo) throws Exception { @@ -136,7 +136,7 @@ public class PrepressServiceImpl implements PrepressService { if(null == part) { throw new RuntimeException("Please maintain material code first:"+partNo+"!"); } - + //设置参数 soInfo.setLaminationFlag("Y"); //查询长度是否符合要求 @@ -150,7 +150,7 @@ public class PrepressServiceImpl implements PrepressService { } //设置参数 soInfo.setCustomerPartNoAll(part.getCustomerPartNo()); - + soInfoRepo.save(soInfo); } @@ -185,7 +185,7 @@ public class PrepressServiceImpl implements PrepressService { soInfo.setSerialEnd(soInfo.getSerialStart() + soInfo.getInputLotSize() - 1); //调用方法产生当前码包文件 List serialList = this.genSoOrderSerialList(soInfo); - + //公共参数 String orderNo = soInfo.getOrderNo(); String partNo = soInfo.getPartNo(); @@ -209,14 +209,14 @@ public class PrepressServiceImpl implements PrepressService { seq.setSeq(soInfo.getSerialEnd()); seqRepo.save(seq); } - + /** - * - * @Title: genMultiRowZipSerialFile - * @Description: 创建多排的文件 + * + * @Title: genMultiRowZipSerialFile + * @Description: 创建多排的文件 * @author: LR - * @date 2024年5月22日 下午2:48:25 - * @return: void + * @date 2024年5月22日 下午2:48:25 + * @return: void * @throws */ public void genMultiRowZipSerialFile(String orderNo, String partNo, List serialList) { @@ -256,7 +256,7 @@ public class PrepressServiceImpl implements PrepressService { } //换行写数据 zos.write(("\r\n").getBytes("UTF-8")); - //双重for循环开始写入数据 + //双重for循环开始写入数据 //外层for循环写行 for(int i = 0; i < rows; i++) { //写入行数 @@ -294,14 +294,14 @@ public class PrepressServiceImpl implements PrepressService { //保存当前的文件记录 prepressDao.insertSoOrderFileHist(fileHist); } - + /** - * - * @Title: genSingleRowZipSerialFile - * @Description: + * + * @Title: genSingleRowZipSerialFile + * @Description: * @author: LR - * @date 2024年5月22日 下午2:00:30 - * @return: void + * @date 2024年5月22日 下午2:00:30 + * @return: void * @throws */ public void genSingleRowZipSerialFile(String orderNo, String partNo, List serialList) { @@ -342,7 +342,7 @@ public class PrepressServiceImpl implements PrepressService { } catch (Exception e) { e.printStackTrace(); } - + long duration = System.currentTimeMillis() - start; logger.info("Generated SN for order [{}], size={}, duration={}.", orderNo, serialList.size(), duration); @@ -358,12 +358,12 @@ public class PrepressServiceImpl implements PrepressService { } /** - * - * @Title: genSoOrderSerialList - * @Description: 产生按照要求符合条件的码包数据 + * + * @Title: genSoOrderSerialList + * @Description: 产生按照要求符合条件的码包数据 * @author: LR - * @date 2024年6月19日 下午3:01:40 - * @return: List + * @date 2024年6月19日 下午3:01:40 + * @return: List * @throws */ public List genSoOrderSerialList(SoInfo soInfo) { @@ -380,12 +380,12 @@ public class PrepressServiceImpl implements PrepressService { } /** - * - * @Title: genSerialTemplate + * + * @Title: genSerialTemplate * @Description: 产生码包的模板的方法 * @author: LR - * @date 2024年6月19日 下午2:50:09 - * @return: String + * @date 2024年6月19日 下午2:50:09 + * @return: String * @throws */ public String genSerialTemplate(SoInfo soInfo) { @@ -395,10 +395,10 @@ public class PrepressServiceImpl implements PrepressService { PartData part = basicDao.getPartDataByPartNo(partNo); //查询相关的参数 String codeType = part.getCodeType(); - + Calendar cal = Calendar.getInstance(); cal.setTime(soInfo.getSerialsDate()); - String platCode3 = "GDC"; + String platCode3 = "J4K"; String year1 = String.valueOf(cal.get(Calendar.YEAR) % 10); String week2 = org.apache.commons.lang3.StringUtils.leftPad(String.valueOf(cal.get(Calendar.WEEK_OF_YEAR)), 2, '0'); String day1 = String.valueOf(cal.get(Calendar.DAY_OF_WEEK));