Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-09-15 13:21:45 +08:00
13 changed files with 99 additions and 66 deletions

View File

@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.base.TableDataInfo;
import org.nl.common.exception.BadRequestException;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
@@ -21,7 +22,9 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static org.nl.common.utils.ValidationUtil.assertNotBlankJson;
@@ -154,13 +157,23 @@ public class PdaIosInController {
public ResponseEntity<Object> zwConfirmIn(@RequestBody ZwConfirmInDto dto) {
if(CollectionUtils.isEmpty(dto.getParam_list())){
throw new IllegalArgumentException("请传入参数!");
throw new BadRequestException("请传入参数!");
}
for(ZwConfirmInParamDto paramDto : dto.getParam_list()){
if(StringUtils.isBlank(paramDto.getVehicle_code()) || StringUtils.isBlank(paramDto.getSite_code())
|| StringUtils.isBlank(paramDto.getForm_data_code()))
throw new IllegalArgumentException("载具、卸货区点位、单据不能为空!");
throw new BadRequestException("载具、卸货区点位、单据不能为空!");
}
// 校验是否存在重复的载具
List<String> vehicleCodeList = dto.getParam_list().stream().map(ZwConfirmInParamDto::getVehicle_code).collect(Collectors.toList());
if(vehicleCodeList.size() != vehicleCodeList.stream().distinct().count()){
throw new BadRequestException("存在重复的载具!");
}
// 校验是否存在重复的卸货区点位
List<String> siteCodeList = dto.getParam_list().stream().map(ZwConfirmInParamDto::getSite_code).collect(Collectors.toList());
if(siteCodeList.size() != siteCodeList.stream().distinct().count()){
throw new BadRequestException("存在重复的卸货区点位!");
}
return new ResponseEntity<>(pdaIosInService.zwConfirmIn(dto), HttpStatus.OK);

View File

@@ -147,7 +147,9 @@ public class PdaIosOutController {
@Log("根据库区、物料信息获取库存信息")
public ResponseEntity<Object> getStructivtByMaterialAndSectCode(@RequestBody JSONObject whereJson) {
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code");
return new ResponseEntity<>(pdaIosOutService.getStructivtByMaterialAndSectCode(whereJson), HttpStatus.OK);
JSONObject selectJson = new JSONObject();
selectJson.put("sect_id" ,whereJson.getString("sect_code"));
return new ResponseEntity<>(pdaIosOutService.getStructivtByMaterialAndSectCode(selectJson), HttpStatus.OK);
}

View File

@@ -437,6 +437,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
PmFormMaterialDto pmFormMaterialDto = new PmFormMaterialDto();
BeanUtils.copyProperties(mdMeMaterialbase,pmFormMaterialDto);
pmFormMaterialDto.setMaterial_code(pmFormDataList.get(0).getMaterial_code());
pmFormMaterialDto.setExt_code(ext_code);
return PdaResponse.requestParamOk(pmFormMaterialDto);
}
@@ -773,7 +774,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
Map<String, List<ZwConfirmInParamDto>> paramMap = dtoList.getParam_list().stream()
.collect(Collectors.groupingBy(ZwConfirmInParamDto::getForm_data_code));
Integer i = 0;
for (Map.Entry<String, List<ZwConfirmInParamDto>> entry : paramMap.entrySet()) {
//校验是否重复
if (entry.getValue().stream()
@@ -803,9 +804,6 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
//循环判断每个 如果有问题,则抛出异常
String lastSchBasePoint = null;
Integer taskGroupSeq = 0 ;
String taskGroupId = IdUtil.getStringId();
List<JSONObject> jsonObjectList = new ArrayList<>();
for (ZwConfirmInParamDto paramDto : entry.getValue()) {
@@ -827,9 +825,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
throw new BadRequestException("存在正在执行任务的点位"+paramDto.getSite_code());
}
taskGroupSeq++;
//当前点位
String schBasePointString = lastSchBasePoint;
String schBasePointString ;
JSONObject whereJson = new JSONObject();
whereJson.put("vehicle_code", paramDto.getVehicle_code());
whereJson.put("search", paramDto.getVehicle_code());
@@ -838,7 +835,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
whereJson.put("site_code", paramDto.getSite_code());
whereJson.put("noEmptyVehicle", "1");
String material_model = getVehicleMaterial(whereJson).getString("material_model");
if (StringUtils.isEmpty(material_model)) {
if (StringUtils.isBlank(material_model)) {
throw new BadRequestException("组盘的物料未配置【物料型号】!");
}
@@ -874,8 +871,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
throw new BadRequestException("载具" + paramDto.getVehicle_code() + "不在" + paramDto.getSite_code() + "");
}
//如果是第一个,则不知道搬出来的托盘应该放哪里,因此需要计算得出,其他的则是【上一个点位】
if (StringUtils.isBlank(lastSchBasePoint)) {
//每次都需要计算得出
LambdaQueryWrapper<SchBasePoint> queryWrapper = new LambdaQueryWrapper<>(SchBasePoint.class)
.select(SchBasePoint::getPoint_code)
.eq(SchBasePoint::getRegion_code, "YLXCQ")
@@ -891,11 +887,10 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
//剔除任务执行中的点位
final List<String> emptyPointStringList = schBasePointList.stream().map(SchBasePoint::getPoint_code)
.collect(Collectors.toList());
//找到空点位正在执行的任务(正常来说不应该存在)
//找到空点位正在执行的任务
List<SchBaseTask> taskingSchBaseTaskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getIs_delete, IOSConstant.IS_DELETE_NO)
.and(wp -> wp
@@ -911,7 +906,10 @@ public class PdaIosInServiceImpl implements PdaIosInService {
//如果不存在,则正常执行
if(CollectionUtils.isEmpty(taskingSchBaseTaskList)){
schBasePointString = schBasePointList.get(0).getPoint_code();
if (CollectionUtils.isEmpty(emptyPointStringList) || emptyPointStringList.size() < dtoList.getParam_list().size()) {
throw new BadRequestException("空点位太少,请多设置空点位");
}
schBasePointString = emptyPointStringList.get(i++);
} else {
List<String> pointList1 = taskingSchBaseTaskList.stream().map(SchBaseTask::getPoint_code1)
.collect(Collectors.toList());
@@ -929,9 +927,13 @@ public class PdaIosInServiceImpl implements PdaIosInService {
&& !pointList4.contains(a))
.collect(Collectors.toList());
schBasePointString = pointStringList.get(0);
if (CollectionUtils.isEmpty(pointStringList) || pointStringList.size() < dtoList.getParam_list().size()) {
throw new BadRequestException("空点位太少,请多设置空点位");
}
schBasePointString = pointStringList.get(i++);
}
}
//point1为库存空托盘点
//point2为卸货区空托盘应该放置的点
@@ -944,14 +946,10 @@ public class PdaIosInServiceImpl implements PdaIosInService {
whereJson.put("sch_base_point", schBasePointString);
whereJson.put("bill_type",StatusEnum.IOBILL_TYPE_IN.code("来料入库"));
whereJson.put("priority","1");
whereJson.put("task_group_seq",taskGroupSeq);
whereJson.put("task_group_id",taskGroupId);
whereJson.put("form_data_code", entry.getValue().get(0).getForm_data_code());
jsonObjectList.add(whereJson);
//下一个的托盘放置点为本次的起点
lastSchBasePoint = whereJson.getString("site_code");
}
//校验没有问题,则进行入库世纪操作
@@ -977,7 +975,6 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
}
return PdaResponse.requestOk();
}
@@ -1391,7 +1388,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
whereJson.put("site_code", site_code);
whereJson.put("noEmptyVehicle", "1");
String material_model = getVehicleMaterial(whereJson).getString("material_model");
if (StringUtils.isEmpty(material_model)) {
if (StringUtils.isBlank(material_model)) {
throw new BadRequestException("组盘的物料未配置【物料型号】!");
}
@@ -1425,13 +1422,16 @@ public class PdaIosInServiceImpl implements PdaIosInService {
throw new BadRequestException("载具" + vehicle_code + "未组盘,请先组盘!");
}
MdMeMaterialbase mdMeMaterialbase = iMdMeMaterialbaseService.getByCode( groupPlates.get(0).getMaterial_id(),true);
ZwConfirmCheckParamRespondDto respDto = new ZwConfirmCheckParamRespondDto();
respDto.setQty(String.valueOf(groupPlates.get(0).getQty()));
respDto.setMaterial_code(groupPlates.get(0).getMaterial_code());
respDto.setMaterial_code(mdMeMaterialbase.getMaterial_code());
respDto.setForm_data_code(groupPlates.get(0).getExt_code());
respDto.setVehicle_code(vehicle_code);
respDto.setSite_code(site_code);
return PdaResponse.requestParamOk(respDto);
return PdaResponse.requestParamOk(Collections.singletonList(respDto));
}
@@ -1445,15 +1445,14 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
JSONObject outJson = new JSONObject();
outJson.put("point_code",schBasePointList.get(0).getPoint_code());
//查询托盘的
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
if(mdPbStoragevehicleinfo != null ){
outJson.put("recommended_sect_code",mdPbStoragevehicleinfo.getRecommended_sect_code());
}
outJson.put("point_code",schBasePointList.get(0).getPoint_code());
outJson.put("recommended_sect_code",mdPbStoragevehicleinfo.getRecommended_sect_code());
return PdaResponse.requestParamOk(outJson);
}

View File

@@ -156,6 +156,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
@Autowired
private PdaPointTask pdaPointTask;
@Autowired
private IMdPbGroupplateService iMdPbGroupplateService;
/**
* 入库服务服务
@@ -381,6 +384,21 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_code, null)
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_qty, 0)
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
//查询点位上的载具
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
);
if (CollectionUtils.isNotEmpty(schBasePointList)) {
//删除
Set<String> groupSet = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, schBasePointList.get(0).getVehicle_code()))
.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(groupSet)) {
iMdPbGroupplateService.delete(groupSet);
}
}
return PdaResponse.requestOk();
}
@@ -406,17 +424,6 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
@Override
public PdaResponse getMaterialSuppByVehicleCode(JSONObject whereJson) {
//从库存判断
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
.eq(Structattr::getOccupancy_state, 3)
.eq(Structattr::getLock_type, "0")
.eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code")));
if (structattrList.isEmpty()) {
throw new BadRequestException("载具不在库位中或库位已锁定,请核对!");
}
//查找状态为入库状态的组盘表
List<GroupPlate> groupPlateList = iMdPbGroupPlateService.list(new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
@@ -445,6 +452,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
outJson.put("material_model", materialbase.getMaterial_model());
}
outJson.put("supp_code", groupPlateList.get(0).getSupp_code());
outJson.put("qty", groupPlateList.get(0).getQty());
outJson.put("supp_name", groupPlateList.get(0).getSupp_name());
return PdaResponse.requestParamOk(outJson);

View File

@@ -17,6 +17,8 @@ public class PmFormMaterialDto extends Model<PmFormMaterialDto> {
private String material_model;
private String material_code;
private String material_name;
private String material_spec;

View File

@@ -14,7 +14,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Liuxy
@@ -51,7 +53,9 @@ public class SchBasePointController {
@PostMapping("/updatePointType")
@Log("修改点位类型")
public ResponseEntity<Object> updatePointType(@Validated @RequestBody SchBasePoint entity) {
public ResponseEntity<Object> updatePointType(@RequestBody JSONObject whereJson) {
List<JSONObject> rows = whereJson.getJSONArray("rows").toJavaList(JSONObject.class);
List<SchBasePoint> entity = rows.stream().map(row -> row.toJavaObject(SchBasePoint.class)).collect(Collectors.toList());
return new ResponseEntity<>(schBasePointService.updatePointType(entity),HttpStatus.OK);
}

View File

@@ -46,7 +46,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
*
* @param entity /
*/
PdaResponse updatePointType(SchBasePoint entity);
PdaResponse updatePointType( List<SchBasePoint> entity);
/**
* 编辑点位类型

View File

@@ -143,24 +143,25 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
}
@Override
public PdaResponse updatePointType(SchBasePoint entity) {
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
if (point == null) {
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
}
public PdaResponse updatePointType(List<SchBasePoint> entityList) {
for(SchBasePoint entity : entityList) {
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
if (point == null) {
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
}
if(!"YLXCQ".equals(point.getRegion_code())){
throw new BadRequestException("只允许更改原料卸车区的点位");
if (!"YLXCQ".equals(point.getRegion_code())) {
throw new BadRequestException("只允许更改原料卸车区的点位");
}
point.setPoint_type(entity.getPoint_type());
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
point.setUpdate_id(currentUserId);
point.setUpdate_name(nickName);
point.setUpdate_time(now);
pointMapper.updateById(point);
}
point.setPoint_type(entity.getPoint_type());
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
point.setUpdate_id(currentUserId);
point.setUpdate_name(nickName);
point.setUpdate_time(now);
pointMapper.updateById(point);
return PdaResponse.requestOk();
}

View File

@@ -284,7 +284,7 @@ public class InBillTask extends AbstractTask {
//更新组盘表 status 20->10
iMdPbGroupplateService.update(new LambdaUpdateWrapper<>(GroupPlate.class)
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code()));
.eq(GroupPlate::getStoragevehicle_code,taskObj.getVehicle_code2()));
}
//分配表清除任务

View File

@@ -1007,7 +1007,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
);
if(CollectionUtils.isNotEmpty(mdPbStoragevehicleinfoList)){
mdPbStoragevehicleinfoList.get(0).setRecommended_sect_code(ioStorInvDis.getSect_code());
mdPbStoragevehicleinfoList.get(0).setRecommended_sect_code(ioStorInvDis.getSect_id());
mdPbStoragevehicleinfoList.get(0).setUpdate_time(DateUtil.now());
mdPbStoragevehicleinfoMapper.updateById(mdPbStoragevehicleinfoList.get(0));
}