Compare commits

...

3 Commits

2 changed files with 8 additions and 4 deletions

View File

@ -253,6 +253,13 @@ public class WoPackagingBoxSubstrateController {
@LogOperation("合箱") @LogOperation("合箱")
public Result insertSubstrate(@RequestBody ChangePackingBoxDTO dto){ public Result insertSubstrate(@RequestBody ChangePackingBoxDTO dto){
//验证包装箱是否为存在
String packagingBoxId = dto.getPackagingBoxId();
QueryWrapper<WoPackagingBox> boxQueryWrapper = new QueryWrapper<>();
boxQueryWrapper.eq(StringUtils.isNotBlank(packagingBoxId), WoPackagingBox.BOX_NO, packagingBoxId);
if(woPackagingBoxMapper.selectCount(boxQueryWrapper)== 0){
return new Result().error(1,"该包装箱不存在,请重新输入");
}
//验证模组是否存在 //验证模组是否存在
QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper1 = new QueryWrapper<>(); QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper1 = new QueryWrapper<>();
substrateQueryWrapper1.eq(WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId()); substrateQueryWrapper1.eq(WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId());
@ -274,9 +281,6 @@ public class WoPackagingBoxSubstrateController {
} }
//验证该模组的线体功率等级是否BoxID的线体功率等级一致一致保存成功数据发生更新不一致则显示保存失败数据不发生更新 //验证该模组的线体功率等级是否BoxID的线体功率等级一致一致保存成功数据发生更新不一致则显示保存失败数据不发生更新
String packagingBoxId = dto.getPackagingBoxId();
QueryWrapper<WoPackagingBox> boxQueryWrapper = new QueryWrapper<>();
boxQueryWrapper.eq(StringUtils.isNotBlank(packagingBoxId), WoPackagingBox.BOX_NO, packagingBoxId);
WoPackagingBox box = woPackagingBoxMapper.selectList(boxQueryWrapper).get(0); WoPackagingBox box = woPackagingBoxMapper.selectList(boxQueryWrapper).get(0);
if((substrate.getLineBody()==box.getLineBody()) && (substrate.getPowerLevel().equals(box.getPowerLevel())) ) if((substrate.getLineBody()==box.getLineBody()) && (substrate.getPowerLevel().equals(box.getPowerLevel())) )

View File

@ -142,7 +142,7 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
WoPackagingBoxDTO dto = ConvertUtils.sourceToTarget(entity, WoPackagingBoxDTO.class); WoPackagingBoxDTO dto = ConvertUtils.sourceToTarget(entity, WoPackagingBoxDTO.class);
QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>(); QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(entity.getBoxNo()), WoPackagingBoxSubstrate.PACKAGING_BOX_ID, entity.getBoxNo()); wrapper.eq(StringUtils.isNotBlank(entity.getBoxNo()), WoPackagingBoxSubstrate.PACKAGING_BOX_ID, entity.getBoxNo());
wrapper.orderByDesc(WoPackagingBoxSubstrate.CREATE_TIME); wrapper.orderByAsc(WoPackagingBoxSubstrate.SLOT);
List<WoPackagingBoxSubstrate> woPackagingBoxSubstrateList = substrateMapper.selectList(wrapper); List<WoPackagingBoxSubstrate> woPackagingBoxSubstrateList = substrateMapper.selectList(wrapper);
dto.setSubstrateList(woPackagingBoxSubstrateList); dto.setSubstrateList(woPackagingBoxSubstrateList);
return dto; return dto;