Merge branch 'b_lms' of http://121.40.234.130:8899/root/lanzhouhailiang_one into b_lms
This commit is contained in:
@@ -46,6 +46,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -256,16 +258,20 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
cutPoint = emptyNotTaskPoint.get(0);
|
||||
}
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
// 枷锁
|
||||
RLock lockPoint = redissonClient.getLock(cutPoint.getPoint_code());
|
||||
boolean tryLockPoint = lockPoint.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLockPoint) {
|
||||
// 分切计划设置套轴完成
|
||||
String qzzNo = IdUtil.getSnowflake(1, 1).nextIdStr();
|
||||
String qzzNo = resourceName.substring(0, 2)
|
||||
+ resourceName.substring(resourceName.length() - 2)
|
||||
+ demoPlan.getSplit_group()
|
||||
+ TaskUtils.getDateTime("MMddHHmm") + "-";
|
||||
plans.forEach(plan -> {
|
||||
plan.setIs_child_tz_ok(SlitterConstant.SLITTER_YES);
|
||||
plan.setQzzno(qzzNo);
|
||||
plan.setQzzno(qzzNo + plan.getUp_or_down());
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
});
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
|
||||
@@ -9,6 +9,9 @@ import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: 工具类
|
||||
@@ -113,4 +116,18 @@ public class TaskUtils {
|
||||
point.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
point.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定格式的日期时间
|
||||
* @param format 格式
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String getDateTime(String format) {
|
||||
// 获取当前日期和时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 定义日期时间格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
// 格式化日期时间
|
||||
return now.format(formatter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user