Browse Source

- 将平台代码从"GDC"更正为"J4K"

master
qiankanghui 3 weeks ago
parent
commit
aac56042cb
  1. 148
      src/main/java/com/ccl/tt/controller/PrePressController.java
  2. 76
      src/main/java/com/ccl/tt/service/impl/PrepressServiceImpl.java

148
src/main/java/com/ccl/tt/controller/PrePressController.java

@ -47,37 +47,37 @@ public class PrePressController {
@Autowired @Autowired
private FinalRollDao finalRollDao; private FinalRollDao finalRollDao;
@Autowired @Autowired
private ShipmentRepository shipRepo; private ShipmentRepository shipRepo;
@Autowired @Autowired
private ProjectCodeRepository pjcRepo; private ProjectCodeRepository pjcRepo;
@Autowired @Autowired
private MailSendService mailSendService; 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 @Autowired
private PrepressService prepressService; private PrepressService prepressService;
@Value("${item.zipPath}") @Value("${item.zipPath}")
private String zipPath; private String zipPath;
@Autowired @Autowired
private BasicDao basicDao; private BasicDao basicDao;
@InitBinder @InitBinder
public void initBinder(WebDataBinder binder) { public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -97,7 +97,7 @@ public class PrePressController {
public String prepressReworkHome(){ public String prepressReworkHome(){
return "sntracking/prepress_rework"; return "sntracking/prepress_rework";
} }
@GetMapping("/query") @GetMapping("/query")
public String prepressQuery(){ public String prepressQuery(){
return "sntracking/prepress_query"; return "sntracking/prepress_query";
@ -110,15 +110,15 @@ public class PrePressController {
public String receiveQty(){ public String receiveQty(){
return "sntracking/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 * @throws
*/ */
@GetMapping("/serialInfo") @GetMapping("/serialInfo")
@ -134,14 +134,14 @@ public class PrePressController {
return "/sntracking/so_order_info"; 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 @param serialNo
* @param @return 参数
* @return Object 返回类型
* @param @return 参数
* @return Object 返回类型
* @throws * @throws
*/ */
@PostMapping("/serialInfo") @PostMapping("/serialInfo")
@ -153,7 +153,7 @@ public class PrePressController {
map.put("rows", rows); map.put("rows", rows);
return map; return map;
} }
@PostMapping("/missingReportData") @PostMapping("/missingReportData")
@ResponseBody @ResponseBody
public Object missingReportData(String serialNo){ public Object missingReportData(String serialNo){
@ -163,7 +163,7 @@ public class PrePressController {
map.put("rows", rows); map.put("rows", rows);
return map; return map;
} }
@GetMapping("/downSerialInfo") @GetMapping("/downSerialInfo")
@ResponseBody @ResponseBody
public Object downSerialInfo(@RequestParam("serilaNo") String serilaNo, public Object downSerialInfo(@RequestParam("serilaNo") String serilaNo,
@ -316,7 +316,7 @@ public class PrePressController {
map.put("rows", page.getContent()); map.put("rows", page.getContent());
return map; return map;
} }
@GetMapping("/reworkAll") @GetMapping("/reworkAll")
@ResponseBody @ResponseBody
public Map soInfoReworkJson( public Map soInfoReworkJson(
@ -449,14 +449,14 @@ public class PrePressController {
} }
return ret; return ret;
} }
/** /**
*
* @Title: addSoInfo
* @Description: 工单新增信息
*
* @Title: addSoInfo
* @Description: 工单新增信息
* @author: LR * @author: LR
* @date 2024年6月19日 下午2:24:09
* @return: Object
* @date 2024年6月19日 下午2:24:09
* @return: Object
* @throws * @throws
*/ */
@PostMapping("/soinfo/addSoInfo") @PostMapping("/soinfo/addSoInfo")
@ -476,7 +476,7 @@ public class PrePressController {
} }
return resultMap; return resultMap;
} }
/** /**
* 新增返工订单 * 新增返工订单
* @param soInfo * @param soInfo
@ -495,7 +495,7 @@ public class PrePressController {
soInfo.setFirstRollTime(new Date()); soInfo.setFirstRollTime(new Date());
soInfo.validate(); soInfo.validate();
//查询是否经过热覆合 //查询是否经过热覆合
//设置参数 //设置参数
soInfo.setLaminationFlag("Y"); soInfo.setLaminationFlag("Y");
//添加全的客户料号 //添加全的客户料号
@ -513,7 +513,7 @@ public class PrePressController {
} }
return ret; return ret;
} }
@PostMapping("/soinfo/{id}/update") @PostMapping("/soinfo/{id}/update")
@ResponseBody @ResponseBody
public Map add(@PathVariable("id") Integer id, SoInfo soInfo){ public Map add(@PathVariable("id") Integer id, SoInfo soInfo){
@ -603,8 +603,8 @@ public class PrePressController {
} }
return ret; return ret;
} }
@PostMapping("/soinfo/{id}/refreshSerials") @PostMapping("/soinfo/{id}/refreshSerials")
@ResponseBody @ResponseBody
public Map refreshSerials(@PathVariable Integer id,Authentication authentication){ public Map refreshSerials(@PathVariable Integer id,Authentication authentication){
@ -640,14 +640,14 @@ public class PrePressController {
File file = new File("snfiles"+File.separator + filename + ".csv"); File file = new File("snfiles"+File.separator + filename + ".csv");
return new FileSystemResource(file); return new FileSystemResource(file);
} }
/** /**
*
* @Title: downloadFileZip
* @Description: 下载已经生成好的文件
*
* @Title: downloadFileZip
* @Description: 下载已经生成好的文件
* @author: LR * @author: LR
* @date 2024年7月29日 下午5:46:22
* @return: FileSystemResource
* @date 2024年7月29日 下午5:46:22
* @return: FileSystemResource
* @throws * @throws
*/ */
@GetMapping("/downloadFileZip/{fileName}") @GetMapping("/downloadFileZip/{fileName}")
@ -786,7 +786,7 @@ public class PrePressController {
} }
return ret; return ret;
} }
@Autowired @Autowired
private SequenceRepository seqRepo; private SequenceRepository seqRepo;
@ -855,14 +855,14 @@ public class PrePressController {
} }
return ret; return ret;
} }
/** /**
*
* @Title: genSerials
* @Description: 产生工单得码包新的方法
*
* @Title: genSerials
* @Description: 产生工单得码包新的方法
* @author: LR * @author: LR
* @date 2024年6月19日 下午2:46:03
* @return: Object
* @date 2024年6月19日 下午2:46:03
* @return: Object
* @throws * @throws
*/ */
@PostMapping("/soinfo/{id}/genSerials") @PostMapping("/soinfo/{id}/genSerials")
@ -893,10 +893,10 @@ public class PrePressController {
//查询物料的信息 //查询物料的信息
PartData partData = basicDao.getPartDataByPartNo(partNo); PartData partData = basicDao.getPartDataByPartNo(partNo);
String codeType = partData.getCodeType(); String codeType = partData.getCodeType();
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(soInfo.getSerialsDate()); cal.setTime(soInfo.getSerialsDate());
String platCode3 = "GDC";
String platCode3 = "J4K";
String year1 = String.valueOf(cal.get(Calendar.YEAR) % 10); 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 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)); String day1 = String.valueOf(cal.get(Calendar.DAY_OF_WEEK));
@ -936,7 +936,7 @@ public class PrePressController {
ZipEntry entry = new ZipEntry(fileName + ".csv"); ZipEntry entry = new ZipEntry(fileName + ".csv");
zos.putNextEntry(entry); zos.putNextEntry(entry);
//查询当前物料的数据 获取编码的类型 //查询当前物料的数据 获取编码的类型
String partNo = soInfo.getPartNo(); String partNo = soInfo.getPartNo();
PartData part = basicDao.getPartDataByPartNo(partNo); PartData part = basicDao.getPartDataByPartNo(partNo);
@ -1097,16 +1097,16 @@ public class PrePressController {
return ret; return ret;
} }
/** /**
*
* @Title: downloadSingleTrace
* @Description: 按照单排下载
*
* @Title: downloadSingleTrace
* @Description: 按照单排下载
* @param orderNo * @param orderNo
* @return
* @return: Map
* @return
* @return: Map
* @author LR * @author LR
* @date: 2021-7-28 10:09:34
* @date: 2021-7-28 10:09:34
* @throws * @throws
*/ */
@PostMapping("/downloadSingleTrace") @PostMapping("/downloadSingleTrace")
@ -1172,7 +1172,7 @@ public class PrePressController {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
@PostMapping("/ifsOrder") @PostMapping("/ifsOrder")
@ResponseBody @ResponseBody
@ -1190,7 +1190,7 @@ public class PrePressController {
} }
return resultMap; return resultMap;
} }
@GetMapping("/getReceiveQty") @GetMapping("/getReceiveQty")
@ResponseBody @ResponseBody
public Object getReceiveQty(@RequestParam(value = "orderNo", required = false) String orderNo, public Object getReceiveQty(@RequestParam(value = "orderNo", required = false) String orderNo,

76
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; import com.ccl.tt.utils.SerialUtil;
/** /**
*
* @ClassName: PrepressServiceImpl
* @Description: 印前的方法实现
*
* @ClassName: PrepressServiceImpl
* @Description: 印前的方法实现
* @author: LR * @author: LR
* @date: 2024年6月18日 下午5:59:42
* @date: 2024年6月18日 下午5:59:42
* @Copyright: * @Copyright:
*/ */
@Service @Service
public class PrepressServiceImpl implements PrepressService { public class PrepressServiceImpl implements PrepressService {
private static final Logger logger = LoggerFactory.getLogger(PrepressServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(PrepressServiceImpl.class);
@Value("${ifs.datasource.sql.order}") @Value("${ifs.datasource.sql.order}")
String ifsOrderSql; String ifsOrderSql;
@Value("${item.filePath}") @Value("${item.filePath}")
private String filePath; private String filePath;
@Autowired @Autowired
private PrepressDao prepressDao; private PrepressDao prepressDao;
@Autowired @Autowired
@ -62,14 +62,14 @@ public class PrepressServiceImpl implements PrepressService {
private SequenceRepository seqRepo; private SequenceRepository seqRepo;
@Autowired @Autowired
private FinalRollDao finalRollDao; private FinalRollDao finalRollDao;
@Override @Override
public Map<String, Object> getIfsOrder(String orderNo) { public Map<String, Object> getIfsOrder(String orderNo) {
Map<String, Object> resultMap = prepressDao.getResultMapBySql(ifsOrderSql, orderNo); Map<String, Object> resultMap = prepressDao.getResultMapBySql(ifsOrderSql, orderNo);
//判断是否非空 //判断是否非空
if (resultMap == null || resultMap.isEmpty()) { if (resultMap == null || resultMap.isEmpty()) {
throw new RuntimeException("Order information not found for " + orderNo + ":"); throw new RuntimeException("Order information not found for " + orderNo + ":");
}
}
//校验工单是否存在当前的物料编码 //校验工单是否存在当前的物料编码
String partNo = String.valueOf(resultMap.get("part_no")); String partNo = String.valueOf(resultMap.get("part_no"));
//判断物料是否存在 //判断物料是否存在
@ -93,7 +93,7 @@ public class PrepressServiceImpl implements PrepressService {
resultMap.put("projectCode", part.getProjectCode()); resultMap.put("projectCode", part.getProjectCode());
return resultMap; return resultMap;
} }
@Override @Override
@Transactional @Transactional
public void addSoInfo(SoInfo soInfo) throws Exception { public void addSoInfo(SoInfo soInfo) throws Exception {
@ -136,7 +136,7 @@ public class PrepressServiceImpl implements PrepressService {
if(null == part) { if(null == part) {
throw new RuntimeException("Please maintain material code first:"+partNo+"!"); throw new RuntimeException("Please maintain material code first:"+partNo+"!");
} }
//设置参数 //设置参数
soInfo.setLaminationFlag("Y"); soInfo.setLaminationFlag("Y");
//查询长度是否符合要求 //查询长度是否符合要求
@ -150,7 +150,7 @@ public class PrepressServiceImpl implements PrepressService {
} }
//设置参数 //设置参数
soInfo.setCustomerPartNoAll(part.getCustomerPartNo()); soInfo.setCustomerPartNoAll(part.getCustomerPartNo());
soInfoRepo.save(soInfo); soInfoRepo.save(soInfo);
} }
@ -185,7 +185,7 @@ public class PrepressServiceImpl implements PrepressService {
soInfo.setSerialEnd(soInfo.getSerialStart() + soInfo.getInputLotSize() - 1); soInfo.setSerialEnd(soInfo.getSerialStart() + soInfo.getInputLotSize() - 1);
//调用方法产生当前码包文件 //调用方法产生当前码包文件
List<String> serialList = this.genSoOrderSerialList(soInfo); List<String> serialList = this.genSoOrderSerialList(soInfo);
//公共参数 //公共参数
String orderNo = soInfo.getOrderNo(); String orderNo = soInfo.getOrderNo();
String partNo = soInfo.getPartNo(); String partNo = soInfo.getPartNo();
@ -209,14 +209,14 @@ public class PrepressServiceImpl implements PrepressService {
seq.setSeq(soInfo.getSerialEnd()); seq.setSeq(soInfo.getSerialEnd());
seqRepo.save(seq); seqRepo.save(seq);
} }
/** /**
*
* @Title: genMultiRowZipSerialFile
* @Description: 创建多排的文件
*
* @Title: genMultiRowZipSerialFile
* @Description: 创建多排的文件
* @author: LR * @author: LR
* @date 2024年5月22日 下午2:48:25
* @return: void
* @date 2024年5月22日 下午2:48:25
* @return: void
* @throws * @throws
*/ */
public void genMultiRowZipSerialFile(String orderNo, String partNo, List<String> serialList) { public void genMultiRowZipSerialFile(String orderNo, String partNo, List<String> serialList) {
@ -256,7 +256,7 @@ public class PrepressServiceImpl implements PrepressService {
} }
//换行写数据 //换行写数据
zos.write(("\r\n").getBytes("UTF-8")); zos.write(("\r\n").getBytes("UTF-8"));
//双重for循环开始写入数据
//双重for循环开始写入数据
//外层for循环写行 //外层for循环写行
for(int i = 0; i < rows; i++) { for(int i = 0; i < rows; i++) {
//写入行数 //写入行数
@ -294,14 +294,14 @@ public class PrepressServiceImpl implements PrepressService {
//保存当前的文件记录 //保存当前的文件记录
prepressDao.insertSoOrderFileHist(fileHist); prepressDao.insertSoOrderFileHist(fileHist);
} }
/** /**
*
* @Title: genSingleRowZipSerialFile
* @Description:
*
* @Title: genSingleRowZipSerialFile
* @Description:
* @author: LR * @author: LR
* @date 2024年5月22日 下午2:00:30
* @return: void
* @date 2024年5月22日 下午2:00:30
* @return: void
* @throws * @throws
*/ */
public void genSingleRowZipSerialFile(String orderNo, String partNo, List<String> serialList) { public void genSingleRowZipSerialFile(String orderNo, String partNo, List<String> serialList) {
@ -342,7 +342,7 @@ public class PrepressServiceImpl implements PrepressService {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
long duration = System.currentTimeMillis() - start; long duration = System.currentTimeMillis() - start;
logger.info("Generated SN for order [{}], size={}, duration={}.", logger.info("Generated SN for order [{}], size={}, duration={}.",
orderNo, serialList.size(), duration); orderNo, serialList.size(), duration);
@ -358,12 +358,12 @@ public class PrepressServiceImpl implements PrepressService {
} }
/** /**
*
* @Title: genSoOrderSerialList
* @Description: 产生按照要求符合条件的码包数据
*
* @Title: genSoOrderSerialList
* @Description: 产生按照要求符合条件的码包数据
* @author: LR * @author: LR
* @date 2024年6月19日 下午3:01:40
* @return: List<String>
* @date 2024年6月19日 下午3:01:40
* @return: List<String>
* @throws * @throws
*/ */
public List<String> genSoOrderSerialList(SoInfo soInfo) { public List<String> genSoOrderSerialList(SoInfo soInfo) {
@ -380,12 +380,12 @@ public class PrepressServiceImpl implements PrepressService {
} }
/** /**
*
* @Title: genSerialTemplate
*
* @Title: genSerialTemplate
* @Description: 产生码包的模板的方法 * @Description: 产生码包的模板的方法
* @author: LR * @author: LR
* @date 2024年6月19日 下午2:50:09
* @return: String
* @date 2024年6月19日 下午2:50:09
* @return: String
* @throws * @throws
*/ */
public String genSerialTemplate(SoInfo soInfo) { public String genSerialTemplate(SoInfo soInfo) {
@ -395,10 +395,10 @@ public class PrepressServiceImpl implements PrepressService {
PartData part = basicDao.getPartDataByPartNo(partNo); PartData part = basicDao.getPartDataByPartNo(partNo);
//查询相关的参数 //查询相关的参数
String codeType = part.getCodeType(); String codeType = part.getCodeType();
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(soInfo.getSerialsDate()); cal.setTime(soInfo.getSerialsDate());
String platCode3 = "GDC";
String platCode3 = "J4K";
String year1 = String.valueOf(cal.get(Calendar.YEAR) % 10); 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 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)); String day1 = String.valueOf(cal.get(Calendar.DAY_OF_WEEK));

Loading…
Cancel
Save