|
@ -4,8 +4,10 @@ import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.wms.ext.service.AcsToWmsService; |
|
|
import org.nl.wms.ext.service.AcsToWmsService; |
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
import org.nl.wms.pda.service.PdaService; |
|
|
import org.nl.wms.pda.service.PdaService; |
|
@ -13,6 +15,7 @@ import org.nl.wms.pda.service.dao.mapper.PdaMapper; |
|
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo; |
|
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo; |
|
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
|
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
|
|
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; |
|
|
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; |
|
|
|
|
|
import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper; |
|
|
import org.nl.wms.sch.material.service.dao.Material; |
|
|
import org.nl.wms.sch.material.service.dao.Material; |
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
@ -22,6 +25,7 @@ import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.context.annotation.Lazy; |
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -46,6 +50,8 @@ public class PdaServiceImpl implements PdaService { |
|
|
private PointMapper pointMapper; |
|
|
private PointMapper pointMapper; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private MaterialMapper materialMapper; |
|
|
private MaterialMapper materialMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SchBaseVehiclematerialgroupMapper vehiclematerialgroupMapper; |
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo dwzt(JSONObject param) { |
|
|
public PdaResponseVo dwzt(JSONObject param) { |
|
|
return PdaResponseVo.pdaResultOk("回温状态查询成功"); |
|
|
return PdaResponseVo.pdaResultOk("回温状态查询成功"); |
|
@ -53,34 +59,73 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo yclrk(JSONObject param) { |
|
|
public PdaResponseVo yclrk(JSONObject param) { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
param.put("request_medthod_code", "YCLRKTask"); |
|
|
param.put("request_medthod_code", "YCLRKTask"); |
|
|
param.put("request_medthod_name", "原材料入库"); |
|
|
param.put("request_medthod_name", "原材料入库"); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
return PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
Integer code = baseResponse.getCode(); |
|
|
|
|
|
if(code == HttpStatus.OK.value()){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
|
|
|
}else { |
|
|
|
|
|
result = PdaResponseVo.pdaResultError(baseResponse.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo yclck(JSONObject param) { |
|
|
public PdaResponseVo yclck(JSONObject param) { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
|
|
|
String workorder_code = param.getString("workorder_code"); |
|
|
|
|
|
workorder_code = workorder_code.trim(); |
|
|
|
|
|
if(ObjectUtil.isEmpty(workorder_code)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("工单号不能为空!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
param.put("request_medthod_code", "YCLCKTask"); |
|
|
param.put("request_medthod_code", "YCLCKTask"); |
|
|
param.put("request_medthod_name", "原材料出库"); |
|
|
param.put("request_medthod_name", "原材料出库"); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
return PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
Integer code = baseResponse.getCode(); |
|
|
|
|
|
if(code == HttpStatus.OK.value()){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
|
|
|
}else { |
|
|
|
|
|
result = PdaResponseVo.pdaResultError(baseResponse.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo task(JSONObject param) { |
|
|
public PdaResponseVo task(JSONObject param) { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
param.put("request_medthod_code", "POINTTask"); |
|
|
param.put("request_medthod_code", "POINTTask"); |
|
|
param.put("request_medthod_name", "点对点任务"); |
|
|
param.put("request_medthod_name", "点对点任务"); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
return PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
Integer code = baseResponse.getCode(); |
|
|
|
|
|
if(code == HttpStatus.OK.value()){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
|
|
|
}else { |
|
|
|
|
|
result = PdaResponseVo.pdaResultError(baseResponse.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo zpjb(JSONObject param) { |
|
|
public PdaResponseVo zpjb(JSONObject param) { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
String subTray = param.getString("sub_tray"); |
|
|
String subTray = param.getString("sub_tray"); |
|
|
|
|
|
subTray = subTray.trim(); |
|
|
|
|
|
if(ObjectUtil.isEmpty(subTray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("子托盘号不能为空!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
String motherTray = param.getString("mother_tray"); |
|
|
|
|
|
motherTray = motherTray.trim(); |
|
|
|
|
|
if(ObjectUtil.isEmpty(motherTray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("母托盘号不能为空!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
//子拖盘解绑
|
|
|
//子拖盘解绑
|
|
|
if(ObjectUtil.isNotEmpty(subTray)){ |
|
|
if(ObjectUtil.isNotEmpty(subTray)){ |
|
|
//查询母托盘
|
|
|
//查询母托盘
|
|
@ -102,7 +147,6 @@ public class PdaServiceImpl implements PdaService { |
|
|
pointService.update(schBasePoint); |
|
|
pointService.update(schBasePoint); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
String motherTray = param.getString("mother_tray"); |
|
|
|
|
|
//母盘解绑
|
|
|
//母盘解绑
|
|
|
if(ObjectUtil.isNotEmpty(motherTray)){ |
|
|
if(ObjectUtil.isNotEmpty(motherTray)){ |
|
|
//查询母托盘
|
|
|
//查询母托盘
|
|
@ -130,8 +174,65 @@ public class PdaServiceImpl implements PdaService { |
|
|
return PdaResponseVo.pdaResultOk("组盘解绑成功"); |
|
|
return PdaResponseVo.pdaResultOk("组盘解绑成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PdaResponseVo zpchange(JSONObject param) { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
|
|
|
String currentUserId = SecurityUtils.getCurrentUserId(); |
|
|
|
|
|
String nickName = SecurityUtils.getCurrentNickName(); |
|
|
|
|
|
String now = DateUtil.now(); |
|
|
|
|
|
//原托盘号
|
|
|
|
|
|
String sub_tray = param.getString("sub_tray"); |
|
|
|
|
|
sub_tray = sub_tray.trim(); |
|
|
|
|
|
//新托盘号
|
|
|
|
|
|
String new_sub_tray = param.getString("new_sub_tray"); |
|
|
|
|
|
new_sub_tray = new_sub_tray.trim(); |
|
|
|
|
|
if(ObjectUtil.isEmpty(new_sub_tray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("新子托盘号不能为空!"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
List<Material> materialList = materialMapper.selectList(new LambdaQueryWrapper<Material>() |
|
|
|
|
|
.eq(Material::getPalletSN,new_sub_tray) |
|
|
|
|
|
.le(Material::getReturn_status, "1") |
|
|
|
|
|
.eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); |
|
|
|
|
|
if (ObjectUtil.isEmpty(materialList)) { |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("新子托盘号无组盘入库单据信息!"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
if(ObjectUtil.isEmpty(sub_tray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("原子托盘号不能为空!"); |
|
|
|
|
|
}else if (!sub_tray.startsWith("YBHC")){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("原子托盘号非缓存临时码!"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
//更新点位载具
|
|
|
|
|
|
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
updateWrapper.eq(SchBasePoint::getVehicle_code2,sub_tray); |
|
|
|
|
|
|
|
|
|
|
|
updateWrapper.set(SchBasePoint::getVehicle_code2,new_sub_tray); |
|
|
|
|
|
updateWrapper.set(SchBasePoint::getUpdate_id,currentUserId); |
|
|
|
|
|
updateWrapper.set(SchBasePoint::getUpdate_name,nickName); |
|
|
|
|
|
updateWrapper.set(SchBasePoint::getUpdate_time,now); |
|
|
|
|
|
pointMapper.update(null,updateWrapper); |
|
|
|
|
|
|
|
|
|
|
|
//更新组盘载具
|
|
|
|
|
|
LambdaUpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper_group = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
updateWrapper_group.eq(SchBaseVehiclematerialgroup::getVehicle_code,sub_tray); |
|
|
|
|
|
updateWrapper_group.le(SchBaseVehiclematerialgroup::getGroup_bind_material_status,"2"); |
|
|
|
|
|
|
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getVehicle_code,new_sub_tray); |
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getSource_vehicle_code,sub_tray); |
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_id,currentUserId); |
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_name,nickName); |
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_time,now); |
|
|
|
|
|
vehiclematerialgroupMapper.update(null,updateWrapper_group); |
|
|
|
|
|
result = PdaResponseVo.pdaResultOk("缓存码变更成功!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PdaResponseVo ycck() { |
|
|
public PdaResponseVo ycck() { |
|
|
|
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
JSONObject param=new JSONObject(); |
|
|
JSONObject param=new JSONObject(); |
|
|
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getPoint_code, "FBC01")); |
|
|
.eq(SchBasePoint::getPoint_code, "FBC01")); |
|
@ -144,6 +245,12 @@ public class PdaServiceImpl implements PdaService { |
|
|
param.put("start_point","FBC01"); |
|
|
param.put("start_point","FBC01"); |
|
|
param.put("next_point","DKT01"); |
|
|
param.put("next_point","DKT01"); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
BaseResponse baseResponse=acsToWmsService.pdaApply(param); |
|
|
return PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
Integer code = baseResponse.getCode(); |
|
|
|
|
|
if(code == HttpStatus.OK.value()){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultOk(baseResponse.getMessage()); |
|
|
|
|
|
}else { |
|
|
|
|
|
result = PdaResponseVo.pdaResultError(baseResponse.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|