| | |
| | | package com.jcdm.main.om.productionOrde.controller; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @PostMapping("/orderSchedulingForBoxCode") |
| | | public AjaxResult addOrderSchedulingForBoxCode(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo) |
| | | { |
| | | //获取当前时间 |
| | | LocalDateTime date= LocalDateTime.now(); |
| | | //创建日期时间对象格式化器,日期格式类似: 2023-05-23 22:18:38 |
| | | DateTimeFormatter formatter= DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | //将时间转化为对应格式的字符串 |
| | | String fomateDate=date.format(formatter).toString(); |
| | | Integer startCode = Integer.parseInt(omProductionOrdeInfo.getStartCode());//开始编号 |
| | | Integer planQty = Math.toIntExact(omProductionOrdeInfo.getPlanQty());//计划数量 |
| | | String dateTimeRule = omProductionOrdeInfo.getDateTimeRule(); |
| | |
| | | bsOrderScheduling.setEngineNo(omProductionOrdeInfo.getTypeZ() + " "+dateTimeRule+ StringUtils.leftPad(String.valueOf(startCode),3, "0")); |
| | | bsOrderScheduling.setProductionStatus("1"); |
| | | bsOrderScheduling.setOperator(getUserName()); |
| | | // bsOrderScheduling.setOperateTime(String.valueOf(new Date())); |
| | | bsOrderScheduling.setOperateTime(fomateDate); |
| | | bsOrderSchedulingService.insertBsOrderScheduling(bsOrderScheduling); |
| | | startCode ++; |
| | | } |