春风项目四线(合箱线、总装线)
懒羊羊
2024-01-16 64e1759592f3618855ef015b6340cdea54647c35
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -1,5 +1,8 @@
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;
@@ -97,6 +100,12 @@
    @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();
@@ -108,7 +117,7 @@
            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 ++;
        }