opt:优化
This commit is contained in:
@@ -56,7 +56,7 @@ public enum PackageInfoIvtEnum {
|
|||||||
|
|
||||||
public String check(String code) {
|
public String check(String code) {
|
||||||
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
|
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
|
||||||
if (entry.getValue().equals("code")) {
|
if (entry.getValue().equals(code)) {
|
||||||
return entry.getValue();
|
return entry.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,18 +106,9 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PdaIosInService pdaIosInService;
|
private PdaIosInService pdaIosInService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISectattrService iSectattrService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 基础物料服务
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典服务
|
* 字典服务
|
||||||
*/
|
*/
|
||||||
@@ -453,7 +444,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Transactional
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public MesResponse backMaterial(MesBackMaterialRequestDto dto) {
|
public MesResponse backMaterial(MesBackMaterialRequestDto dto) {
|
||||||
MDC.put(TagNameEnum.TAG_NAME.getTag(), TagNameEnum.MES_BACK_MATERIAL.getTag());
|
MDC.put(TagNameEnum.TAG_NAME.getTag(), TagNameEnum.MES_BACK_MATERIAL.getTag());
|
||||||
log.info("MES下发设备退料信息输入参数:-------------------: {}", dto);
|
log.info("MES下发设备退料信息输入参数:-------------------: {}", dto);
|
||||||
@@ -609,7 +600,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
|||||||
.reduce(Double::sum).orElse(0.0);
|
.reduce(Double::sum).orElse(0.0);
|
||||||
|
|
||||||
// 查询库区
|
// 查询库区
|
||||||
Sectattr sectDao = iSectattrService.getById(whereJson.getString("sect_id"));
|
Sectattr sectDao = sectattrService.getById(whereJson.getString("sect_id"));
|
||||||
// 组织主表数据
|
// 组织主表数据
|
||||||
Map<String, Object> jsonMst = new HashMap<>();
|
Map<String, Object> jsonMst = new HashMap<>();
|
||||||
jsonMst.put("stor_id", sectDao.getStor_id());
|
jsonMst.put("stor_id", sectDao.getStor_id());
|
||||||
@@ -624,7 +615,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
|||||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||||
HashMap<String, String> dtl = new HashMap<>();
|
HashMap<String, String> dtl = new HashMap<>();
|
||||||
GroupPlate plateDao = plateDaoList.get(0);
|
GroupPlate plateDao = plateDaoList.get(0);
|
||||||
MdMeMaterialbase materDao = materialbaseService.getByCode(plateDao.getMaterial_id(), true);
|
MdMeMaterialbase materDao = materialbaseService.getByCode(plateDao.getMaterial_code(), true);
|
||||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||||
dtl.put("material_id", materDao.getMaterial_id());
|
dtl.put("material_id", materDao.getMaterial_id());
|
||||||
dtl.put("material_code", materDao.getMaterial_code());
|
dtl.put("material_code", materDao.getMaterial_code());
|
||||||
|
|||||||
@@ -842,8 +842,12 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PdaResponse zwConfirmIn(ZwConfirmInDto dtoList) {
|
public PdaResponse zwConfirmIn(ZwConfirmInDto dtoList) {
|
||||||
|
// 空值检查
|
||||||
|
if (dtoList == null || CollectionUtils.isEmpty(dtoList.getParam_list())) {
|
||||||
|
throw new BadRequestException("参数列表不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, List<ZwConfirmInParamDto>> paramMap = dtoList.getParam_list().stream()
|
Map<String, List<ZwConfirmInParamDto>> paramMap = dtoList.getParam_list().stream()
|
||||||
.collect(Collectors.groupingBy(ZwConfirmInParamDto::getForm_data_code));
|
.collect(Collectors.groupingBy(ZwConfirmInParamDto::getForm_data_code));
|
||||||
@@ -1021,7 +1025,6 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
whereJson.put("priority","1");
|
whereJson.put("priority","1");
|
||||||
|
|
||||||
whereJson.put("form_data_code", entry.getValue().get(0).getForm_data_code());
|
whereJson.put("form_data_code", entry.getValue().get(0).getForm_data_code());
|
||||||
|
|
||||||
jsonObjectList.add(whereJson);
|
jsonObjectList.add(whereJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -137,6 +138,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
|||||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", dict.getCode()));
|
throw new BadRequestException(LangProcess.msg("error_ParamExist", dict.getCode()));
|
||||||
// 判断是否有空的值
|
// 判断是否有空的值
|
||||||
List<Dict> selectOne = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dict.getCode()));
|
List<Dict> selectOne = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dict.getCode()));
|
||||||
|
if (CollectionUtils.isEmpty(selectOne)) {
|
||||||
|
throw new BadRequestException("字典配置不存在,请先创建字典主项");
|
||||||
|
}
|
||||||
Dict dic = selectOne.get(0);
|
Dict dic = selectOne.get(0);
|
||||||
if (ObjectUtil.isEmpty(dic.getLabel())) {
|
if (ObjectUtil.isEmpty(dic.getLabel())) {
|
||||||
// 空就赋值
|
// 空就赋值
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public enum IOSEnum {
|
|||||||
|
|
||||||
public String check(String code) {
|
public String check(String code) {
|
||||||
for (Map.Entry<String, String> entry : this.getCode().entrySet())
|
for (Map.Entry<String, String> entry : this.getCode().entrySet())
|
||||||
if (entry.getValue().equals("code")) {
|
if (entry.getValue().equals(code)) {
|
||||||
return entry.getValue();
|
return entry.getValue();
|
||||||
}
|
}
|
||||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||||
|
|||||||
Reference in New Issue
Block a user