Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -195,6 +195,7 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
columns.put("transferType", "调拨类型");
|
||||
columns.put("team", "班组");
|
||||
columns.put("theoreticalThickness", "理论厚度");
|
||||
columns.put("scheduleThickness", "排产厚度");
|
||||
columns.put("theoreticalLength", "理论长度");
|
||||
columns.put("chromePlateCoilNo", "镀铬卷号");
|
||||
return R.ok(columns);
|
||||
|
||||
@@ -219,6 +219,11 @@ public class WmsMaterialCoil extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal theoreticalThickness;
|
||||
|
||||
/**
|
||||
* 排产厚度(单位:毫米)
|
||||
*/
|
||||
private BigDecimal scheduleThickness;
|
||||
|
||||
/**
|
||||
* 理论长度(单位:米)
|
||||
*/
|
||||
|
||||
@@ -392,6 +392,11 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal theoreticalThickness;
|
||||
|
||||
/**
|
||||
* 排产厚度(单位:毫米)
|
||||
*/
|
||||
private BigDecimal scheduleThickness;
|
||||
|
||||
/**
|
||||
* 理论长度(单位:米)
|
||||
*/
|
||||
|
||||
@@ -215,6 +215,12 @@ public class WmsMaterialCoilExportVo {
|
||||
@ExcelProperty(value = "理论厚度")
|
||||
private BigDecimal theoreticalThickness;
|
||||
|
||||
/**
|
||||
* 排产厚度(单位:毫米)
|
||||
*/
|
||||
@ExcelProperty(value = "排产厚度")
|
||||
private BigDecimal scheduleThickness;
|
||||
|
||||
/**
|
||||
* 理论长度(单位:米)
|
||||
*/
|
||||
|
||||
@@ -345,6 +345,11 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal theoreticalThickness;
|
||||
|
||||
/**
|
||||
* 排产厚度(单位:毫米)
|
||||
*/
|
||||
private BigDecimal scheduleThickness;
|
||||
|
||||
/**
|
||||
* 理论长度(单位:米)
|
||||
*/
|
||||
|
||||
@@ -731,6 +731,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getActualThickness()), "mc.actual_thickness", bo.getActualThickness());
|
||||
// 理论厚度
|
||||
qw.eq(bo.getTheoreticalThickness() != null, "mc.theoretical_thickness", bo.getTheoreticalThickness());
|
||||
// 排产厚度
|
||||
qw.eq(bo.getScheduleThickness() != null, "mc.schedule_thickness", bo.getScheduleThickness());
|
||||
// 理论长度
|
||||
qw.eq(bo.getTheoreticalLength() != null, "mc.theoretical_length", bo.getTheoreticalLength());
|
||||
// 镀铬卷号
|
||||
@@ -1490,6 +1492,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public WmsMaterialCoilVo insertByBo(WmsMaterialCoilBo bo) {
|
||||
// 检查当前钢卷号是否重复(新增)
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(null, null, bo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("新增失败:当前钢卷号[" + bo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
|
||||
// 1. 生成二维码
|
||||
Long qrcodeRecordId = generateQrcodeForInsert(bo);
|
||||
bo.setQrcodeRecordId(qrcodeRecordId);
|
||||
@@ -1669,6 +1677,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("钢卷ID不能为空");
|
||||
}
|
||||
|
||||
// 检查当前钢卷号是否重复(简单更新,传入coilId排除自身)
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(bo.getCoilId(), null, bo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("更新失败:当前钢卷号[" + bo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
|
||||
// 检查独占状态
|
||||
validateCoilOperationPermission(bo.getCoilId(), "简单更新");
|
||||
|
||||
@@ -1801,6 +1815,13 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("原钢卷已被更新");
|
||||
}
|
||||
|
||||
// 检查当前钢卷号是否重复(单个更新,传入coilId排除老卷) 首先退火走的这个接口但是退火的当前钢卷号是不会变的
|
||||
// 当前钢卷号不变加工必然报错老卷还没变成历史所以要排除和老卷相同的情况 由于老卷马上就要变成历史了也不用担心和老卷的当前钢卷号重复问题了
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(bo.getCoilId(), null, bo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("更新失败:当前钢卷号[" + bo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
|
||||
// 若修改实际库位,先进行校验
|
||||
if (bo.getActualWarehouseId() != null) {
|
||||
Long ignoreOccupiedId = Objects.equals(bo.getActualWarehouseId(), oldCoil.getActualWarehouseId())
|
||||
@@ -2046,6 +2067,14 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("分卷操作需要原钢卷信息");
|
||||
}
|
||||
|
||||
// 检查每个子钢卷的当前钢卷号是否重复
|
||||
for (WmsMaterialCoilBo newCoilBo : bo.getNewCoils()) {
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(null, null, newCoilBo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("分卷失败:子钢卷号[" + newCoilBo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 1. 将原始钢卷的二维码标记为失效(status=0)
|
||||
if (oldCoil.getQrcodeRecordId() != null) {
|
||||
WmsGenerateRecordBo oldQrBo = new WmsGenerateRecordBo();
|
||||
@@ -2166,6 +2195,14 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 1. 将参与合卷的原始钢卷的二维码标记为失效,并将钢卷标记为历史数据
|
||||
//在合卷之前需要判断前端传来的bo.getNewCoils()中的所有原始钢卷的coilId是否已经是历史卷
|
||||
validateOriginalCoilsForMerge(bo.getNewCoils());
|
||||
|
||||
// 检查合卷后新钢卷的当前钢卷号是否重复
|
||||
if (StringUtils.isNotBlank(bo.getCurrentCoilNo())) {
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(null, null, bo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("合卷失败:当前钢卷号[" + bo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
}
|
||||
for (WmsMaterialCoilBo originalCoilBo : bo.getNewCoils()) {
|
||||
if (originalCoilBo.getCoilId() != null) {
|
||||
WmsMaterialCoil originalCoil = baseMapper.selectById(originalCoilBo.getCoilId());
|
||||
@@ -3872,8 +3909,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 1. 如果coilId不为空(修改操作),先查询该钢卷的dataType
|
||||
if (coilId != null) {
|
||||
WmsMaterialCoil coil = baseMapper.selectById(coilId);
|
||||
// 2. 如果查询到钢卷且dataType!=1(说明是历史记录),直接返回无重复
|
||||
if (coil != null && coil.getDataType() != 1) {
|
||||
// 2. 如果查询到钢卷且dataType==0(说明是历史记录),直接返回无重复
|
||||
// 为了防止历史的入场钢卷号问题因为排除自身也没用, 回滚本身操作的就是历史钢卷,但是它不应该跳过因为它要变成现存卷了
|
||||
// 回滚卷要校验钢卷号 所以回滚是不需要传递coilId 加上本身是历史卷 所以也不会被查出来 .eq(WmsMaterialCoil::getDataType, 1);已经过滤掉自身了 所以也能修改
|
||||
if (coil != null && coil.getDataType() == 0) {
|
||||
result.put("duplicateType", "none");
|
||||
result.put("enterCoilNoDuplicate", false);
|
||||
result.put("currentCoilNoDuplicate", false);
|
||||
@@ -4290,7 +4329,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
// // 检查恢复的钢卷的当前钢卷号是否重复
|
||||
// for (WmsMaterialCoil originalCoil : originalCoils) {
|
||||
// Map<String, Object> duplicateCheck = checkCoilNoDuplicate(originalCoil.getCoilId(), originalCoil.getEnterCoilNo(), originalCoil.getCurrentCoilNo());
|
||||
// Map<String, Object> duplicateCheck = checkCoilNoDuplicate(originalCoil.getCoilId(), null, originalCoil.getCurrentCoilNo(), null);
|
||||
// boolean currentCoilNoDuplicate = (boolean) duplicateCheck.get("currentCoilNoDuplicate");
|
||||
// if (currentCoilNoDuplicate) {
|
||||
// String errorMsg = "无法恢复原始钢卷,存在重复的钢卷号:原始钢卷的当前钢卷号[" + originalCoil.getCurrentCoilNo() + "]重复。";
|
||||
@@ -5036,11 +5075,11 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("待操作记录不存在或不匹配");
|
||||
}
|
||||
|
||||
// // 4. 检查子钢卷号是否重复
|
||||
// Map<String, Object> duplicateCheck = checkCoilNoDuplicate(null, parentCoil.getEnterCoilNo(), childCoilBo.getCurrentCoilNo());
|
||||
// if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
// throw new RuntimeException("子钢卷号[" + childCoilBo.getCurrentCoilNo() + "]已存在");
|
||||
// }
|
||||
// 4. 检查子钢卷号是否重复
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(null, null, childCoilBo.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("子钢卷号[" + childCoilBo.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
|
||||
// 校验每个子卷的实际库位
|
||||
if (childCoilBo.getActualWarehouseId() != null) {
|
||||
@@ -5351,6 +5390,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
throw new RuntimeException("该钢卷是历史钢卷");
|
||||
}
|
||||
|
||||
// 检查当前钢卷号是否重复(退货时用原钢卷号创建新钢卷,传入coilId排除自身)
|
||||
Map<String, Object> duplicateCheck = checkCoilNoDuplicate(coilId, null, oldCoil.getCurrentCoilNo(), null);
|
||||
if ("current".equals(duplicateCheck.get("duplicateType")) || "both".equals(duplicateCheck.get("duplicateType"))) {
|
||||
throw new RuntimeException("退货失败:当前钢卷号[" + oldCoil.getCurrentCoilNo() + "]已存在");
|
||||
}
|
||||
|
||||
WmsWarehouseBo warehouseBo = new WmsWarehouseBo();
|
||||
warehouseBo.setWarehouseName("退货仓");
|
||||
warehouseBo.setWarehouseCode("return");
|
||||
|
||||
@@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="specId" column="spec_id"/>
|
||||
<result property="versionId" column="version_id"/>
|
||||
<result property="theoreticalThickness" column="theoretical_thickness"/>
|
||||
<result property="scheduleThickness" column="schedule_thickness"/>
|
||||
<result property="theoreticalLength" column="theoretical_length"/>
|
||||
<result property="chromePlateCoilNo" column="chrome_plate_coil_no"/>
|
||||
|
||||
@@ -132,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mc.exclusive_status,
|
||||
mc.transfer_type,
|
||||
mc.theoretical_thickness,
|
||||
mc.schedule_thickness,
|
||||
mc.theoretical_length,
|
||||
mc.chrome_plate_coil_no,
|
||||
mc.sale_name AS saleName,
|
||||
@@ -488,6 +490,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mc.transfer_type AS transferType,
|
||||
-- 理论厚度
|
||||
mc.theoretical_thickness AS theoreticalThickness,
|
||||
-- 排产厚度
|
||||
mc.schedule_thickness AS scheduleThickness,
|
||||
-- 理论长度
|
||||
mc.theoretical_length AS theoreticalLength,
|
||||
-- 镀铬卷号
|
||||
@@ -580,6 +584,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mc.sale_name AS saleName,
|
||||
mc.transfer_type AS transferType,
|
||||
mc.theoretical_thickness AS theoreticalThickness,
|
||||
mc.schedule_thickness AS scheduleThickness,
|
||||
mc.theoretical_length AS theoreticalLength,
|
||||
mc.chrome_plate_coil_no AS chromePlateCoilNo,
|
||||
CASE
|
||||
@@ -701,6 +706,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mc.sale_name AS saleName,
|
||||
mc.transfer_type AS transferType,
|
||||
mc.theoretical_thickness AS theoreticalThickness,
|
||||
mc.schedule_thickness AS scheduleThickness,
|
||||
mc.theoretical_length AS theoreticalLength,
|
||||
mc.chrome_plate_coil_no AS chromePlateCoilNo,
|
||||
CASE
|
||||
|
||||
Reference in New Issue
Block a user