Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -35,6 +35,12 @@ public class WmsMaterialWarning extends BaseEntity {
|
|||||||
* 告警类型(LENGTH=长度, THICKNESS=厚度, WIDTH=宽度)
|
* 告警类型(LENGTH=长度, THICKNESS=厚度, WIDTH=宽度)
|
||||||
*/
|
*/
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线类型
|
||||||
|
*/
|
||||||
|
private Integer actionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 理论值
|
* 理论值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ public class WmsMaterialWarningBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线类型
|
||||||
|
*/
|
||||||
|
private Integer actionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 理论值
|
* 理论值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ public class WmsMaterialWarningVo {
|
|||||||
@ExcelProperty(value = "告警类型(LENGTH=长度, THICKNESS=厚度, WIDTH=宽度)")
|
@ExcelProperty(value = "告警类型(LENGTH=长度, THICKNESS=厚度, WIDTH=宽度)")
|
||||||
private String warningType;
|
private String warningType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "产线类型")
|
||||||
|
private Integer actionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 理论值
|
* 理论值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2137,6 +2137,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
baseMapper.insert(newCoil);
|
baseMapper.insert(newCoil);
|
||||||
|
|
||||||
// 检查长度/厚度偏差并插入告警
|
// 检查长度/厚度偏差并插入告警
|
||||||
|
newCoilBo.setActionId(bo.getCoilId());
|
||||||
materialWarningService.checkAndInsertWarnings(newCoil, newCoilBo);
|
materialWarningService.checkAndInsertWarnings(newCoil, newCoilBo);
|
||||||
|
|
||||||
newCoils.add(newCoil);
|
newCoils.add(newCoil);
|
||||||
@@ -2287,6 +2288,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
baseMapper.insert(newCoil);
|
baseMapper.insert(newCoil);
|
||||||
|
|
||||||
// 检查长度/厚度偏差并插入告警
|
// 检查长度/厚度偏差并插入告警
|
||||||
|
bo.setActionId(bo.getNewCoils().get(0).getActionId());
|
||||||
materialWarningService.checkAndInsertWarnings(newCoil, bo);
|
materialWarningService.checkAndInsertWarnings(newCoil, bo);
|
||||||
|
|
||||||
newCoils.add(newCoil);
|
newCoils.add(newCoil);
|
||||||
@@ -3603,6 +3605,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
for (WmsMaterialCoilBo originalCoilBo : bo.getNewCoils()) {
|
for (WmsMaterialCoilBo originalCoilBo : bo.getNewCoils()) {
|
||||||
if (originalCoilBo.getCoilId() == null) {
|
if (originalCoilBo.getCoilId() == null) {
|
||||||
continue;
|
continue;
|
||||||
|
}else {
|
||||||
|
bo.setActionId(coilToActionIdMap.get(originalCoilBo.getCoilId()));
|
||||||
}
|
}
|
||||||
if (!coilIdSet.add(originalCoilBo.getCoilId())) {
|
if (!coilIdSet.add(originalCoilBo.getCoilId())) {
|
||||||
throw new RuntimeException("参与合卷的钢卷中存在重复,相同的钢卷不能进行合卷操作");
|
throw new RuntimeException("参与合卷的钢卷中存在重复,相同的钢卷不能进行合卷操作");
|
||||||
@@ -5143,6 +5147,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
baseMapper.insert(childCoil);
|
baseMapper.insert(childCoil);
|
||||||
|
|
||||||
// 检查长度/厚度偏差并插入告警
|
// 检查长度/厚度偏差并插入告警
|
||||||
|
childCoilBo.setActionId(pendingActionId);
|
||||||
materialWarningService.checkAndInsertWarnings(childCoil, childCoilBo);
|
materialWarningService.checkAndInsertWarnings(childCoil, childCoilBo);
|
||||||
|
|
||||||
// 插入子钢卷的异常信息
|
// 插入子钢卷的异常信息
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.klp.common.core.service.ConfigService;
|
import com.klp.common.core.service.ConfigService;
|
||||||
import com.klp.common.utils.StringUtils;
|
import com.klp.common.utils.StringUtils;
|
||||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||||
|
import com.klp.mapper.WmsCoilPendingActionMapper;
|
||||||
import com.klp.mapper.WmsMaterialCoilMapper;
|
import com.klp.mapper.WmsMaterialCoilMapper;
|
||||||
import com.klp.service.IWmsMaterialCoilService;
|
import com.klp.service.IWmsMaterialCoilService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -18,6 +19,7 @@ import com.klp.domain.bo.WmsMaterialWarningBo;
|
|||||||
import com.klp.domain.vo.WmsMaterialWarningVo;
|
import com.klp.domain.vo.WmsMaterialWarningVo;
|
||||||
import com.klp.domain.WmsMaterialCoil;
|
import com.klp.domain.WmsMaterialCoil;
|
||||||
import com.klp.domain.WmsMaterialWarning;
|
import com.klp.domain.WmsMaterialWarning;
|
||||||
|
import com.klp.domain.WmsCoilPendingAction;
|
||||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||||
import com.klp.mapper.WmsMaterialWarningMapper;
|
import com.klp.mapper.WmsMaterialWarningMapper;
|
||||||
import com.klp.service.IWmsMaterialWarningService;
|
import com.klp.service.IWmsMaterialWarningService;
|
||||||
@@ -43,6 +45,7 @@ public class WmsMaterialWarningServiceImpl implements IWmsMaterialWarningService
|
|||||||
|
|
||||||
private final WmsMaterialWarningMapper baseMapper;
|
private final WmsMaterialWarningMapper baseMapper;
|
||||||
private final ConfigService configService;
|
private final ConfigService configService;
|
||||||
|
private final WmsCoilPendingActionMapper wmsCoilPendingActionMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,6 +94,7 @@ public class WmsMaterialWarningServiceImpl implements IWmsMaterialWarningService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getWarningType()), WmsMaterialWarning::getWarningType, bo.getWarningType());
|
lqw.eq(StringUtils.isNotBlank(bo.getWarningType()), WmsMaterialWarning::getWarningType, bo.getWarningType());
|
||||||
|
lqw.eq(bo.getActionType() !=null, WmsMaterialWarning::getActionType, bo.getActionType());
|
||||||
lqw.eq(bo.getTheoreticalVal() != null, WmsMaterialWarning::getTheoreticalVal, bo.getTheoreticalVal());
|
lqw.eq(bo.getTheoreticalVal() != null, WmsMaterialWarning::getTheoreticalVal, bo.getTheoreticalVal());
|
||||||
lqw.eq(bo.getActualVal() != null, WmsMaterialWarning::getActualVal, bo.getActualVal());
|
lqw.eq(bo.getActualVal() != null, WmsMaterialWarning::getActualVal, bo.getActualVal());
|
||||||
lqw.eq(bo.getAllowDeviation() != null, WmsMaterialWarning::getAllowDeviation, bo.getAllowDeviation());
|
lqw.eq(bo.getAllowDeviation() != null, WmsMaterialWarning::getAllowDeviation, bo.getAllowDeviation());
|
||||||
@@ -179,8 +183,24 @@ public class WmsMaterialWarningServiceImpl implements IWmsMaterialWarningService
|
|||||||
// ========== 厚度检查 ==========
|
// ========== 厚度检查 ==========
|
||||||
checkThickness(coil, bo, warnings);
|
checkThickness(coil, bo, warnings);
|
||||||
|
|
||||||
// 批量插入
|
// 批量插入(查询产线类型并设置)
|
||||||
if (!warnings.isEmpty()) {
|
if (!warnings.isEmpty()) {
|
||||||
|
Integer actionType = null;
|
||||||
|
if (bo != null && bo.getActionId() != null) {
|
||||||
|
try {
|
||||||
|
WmsCoilPendingAction action = wmsCoilPendingActionMapper.selectById(bo.getActionId());
|
||||||
|
if (action != null) {
|
||||||
|
actionType = action.getActionType();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("查询产线类型失败, actionId={}", bo.getActionId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (actionType != null) {
|
||||||
|
for (WmsMaterialWarning w : warnings) {
|
||||||
|
w.setActionType(actionType);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
baseMapper.insertBatch(warnings);
|
baseMapper.insertBatch(warnings);
|
||||||
log.info("批量插入钢卷告警记录成功, coilId={}, 告警数={}", coil.getCoilId(), warnings.size());
|
log.info("批量插入钢卷告警记录成功, coilId={}, 告警数={}", coil.getCoilId(), warnings.size());
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<result property="warningId" column="warning_id"/>
|
<result property="warningId" column="warning_id"/>
|
||||||
<result property="coilId" column="coil_id"/>
|
<result property="coilId" column="coil_id"/>
|
||||||
<result property="warningType" column="warning_type"/>
|
<result property="warningType" column="warning_type"/>
|
||||||
|
<result property="actionType" column="action_type"/>
|
||||||
<result property="theoreticalVal" column="theoretical_val"/>
|
<result property="theoreticalVal" column="theoretical_val"/>
|
||||||
<result property="actualVal" column="actual_val"/>
|
<result property="actualVal" column="actual_val"/>
|
||||||
<result property="allowDeviation" column="allow_deviation"/>
|
<result property="allowDeviation" column="allow_deviation"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user