add:新增手持 缓存码变更功能;
rev:点位修改子托盘号增加同步更新组盘记录勾选框;手持所有更新接口增加code字段,1为操作成功0为操作失败
This commit is contained in:
@@ -110,6 +110,13 @@ public class PdaController {
|
||||
return new ResponseEntity<>(pdaService.zpjb(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/zpchange")
|
||||
@Log("缓存码变更")
|
||||
@ApiOperation("缓存码变更")
|
||||
public ResponseEntity<Object> zpchange(@RequestBody JSONObject param){
|
||||
return new ResponseEntity<>(pdaService.zpchange(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ycck")
|
||||
@Log("废包材异常出库")
|
||||
@ApiOperation("废包材异常出库")
|
||||
|
||||
@@ -19,6 +19,8 @@ public interface PdaService {
|
||||
|
||||
PdaResponseVo zpjb(JSONObject param);
|
||||
|
||||
PdaResponseVo zpchange(JSONObject param);
|
||||
|
||||
PdaResponseVo ycck();
|
||||
|
||||
}
|
||||
|
||||
@@ -11,10 +11,30 @@ import lombok.Data;
|
||||
public class PdaResponseVo {
|
||||
// 先提供一个message
|
||||
private String message;
|
||||
// 先提供一个message
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public static PdaResponseVo pdaResultOk(String message) {
|
||||
PdaResponseVo vo = new PdaResponseVo();
|
||||
vo.setMessage(message);
|
||||
vo.setCode("1");
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public static PdaResponseVo pdaResultError(String message) {
|
||||
PdaResponseVo vo = new PdaResponseVo();
|
||||
vo.setMessage(message);
|
||||
vo.setCode("0");
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.ext.service.AcsToWmsService;
|
||||
import org.nl.wms.ext.service.dto.to.BaseResponse;
|
||||
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.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
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.mapper.MaterialMapper;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,6 +50,8 @@ public class PdaServiceImpl implements PdaService {
|
||||
private PointMapper pointMapper;
|
||||
@Autowired
|
||||
private MaterialMapper materialMapper;
|
||||
@Autowired
|
||||
private SchBaseVehiclematerialgroupMapper vehiclematerialgroupMapper;
|
||||
@Override
|
||||
public PdaResponseVo dwzt(JSONObject param) {
|
||||
return PdaResponseVo.pdaResultOk("回温状态查询成功");
|
||||
@@ -53,34 +59,73 @@ public class PdaServiceImpl implements PdaService {
|
||||
|
||||
@Override
|
||||
public PdaResponseVo yclrk(JSONObject param) {
|
||||
PdaResponseVo result = new PdaResponseVo();
|
||||
param.put("request_medthod_code", "YCLRKTask");
|
||||
param.put("request_medthod_name", "原材料入库");
|
||||
param.put("device_code",param.getString("start_point"));
|
||||
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
|
||||
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_name", "原材料出库");
|
||||
param.put("device_code",param.getString("start_point"));
|
||||
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
|
||||
public PdaResponseVo task(JSONObject param) {
|
||||
PdaResponseVo result = new PdaResponseVo();
|
||||
param.put("request_medthod_code", "POINTTask");
|
||||
param.put("request_medthod_name", "点对点任务");
|
||||
param.put("device_code",param.getString("start_point"));
|
||||
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
|
||||
public PdaResponseVo zpjb(JSONObject param) {
|
||||
PdaResponseVo result = new PdaResponseVo();
|
||||
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)){
|
||||
//查询母托盘
|
||||
@@ -102,7 +147,6 @@ public class PdaServiceImpl implements PdaService {
|
||||
pointService.update(schBasePoint);
|
||||
}
|
||||
}
|
||||
String motherTray = param.getString("mother_tray");
|
||||
//母盘解绑
|
||||
if(ObjectUtil.isNotEmpty(motherTray)){
|
||||
//查询母托盘
|
||||
@@ -130,8 +174,65 @@ public class PdaServiceImpl implements PdaService {
|
||||
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
|
||||
public PdaResponseVo ycck() {
|
||||
PdaResponseVo result = new PdaResponseVo();
|
||||
JSONObject param=new JSONObject();
|
||||
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getPoint_code, "FBC01"));
|
||||
@@ -144,6 +245,12 @@ public class PdaServiceImpl implements PdaService {
|
||||
param.put("start_point","FBC01");
|
||||
param.put("next_point","DKT01");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SchBasePointController {
|
||||
@ApiOperation("修改点位管理")
|
||||
//@SaCheckPermission("@el.check('schBasePoint:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SchBasePoint entity){
|
||||
schBasePointService.update(entity);
|
||||
schBasePointService.updateByPc(entity);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,12 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
*/
|
||||
void update(SchBasePoint entity);
|
||||
|
||||
/**
|
||||
* pc端编辑
|
||||
* @param entity /
|
||||
*/
|
||||
void updateByPc(SchBasePoint entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
|
||||
@@ -14,12 +14,15 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.point.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||
import org.nl.wms.sch.region.service.dao.mapper.SchBaseRegionMapper;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -43,6 +46,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
@Autowired
|
||||
private SchBaseRegionMapper regionMapper;
|
||||
|
||||
@Autowired
|
||||
private SchBaseVehiclematerialgroupMapper vehiclematerialgroupMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page,List<String> roles){
|
||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||
@@ -149,17 +155,45 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||
entity.setRegion_name(baseRegion.getRegion_name());
|
||||
}
|
||||
// if (ObjectUtil.isNotEmpty(entity.getCan_vehicle_types())) {
|
||||
// String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||
// entity.setCan_vehicle_type(can_vehicle_type);
|
||||
// }
|
||||
// String pointStatus = entity.getPoint_status();
|
||||
// // 根据点位状态来判断更新内容
|
||||
// if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals(PointStatusEnum.EMPTY_POINT.getCode())) {
|
||||
// entity.setVehicle_type("");
|
||||
// entity.setVehicle_code("");
|
||||
// entity.setVehicle_qty(0);
|
||||
// }
|
||||
pointMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateByPc(SchBasePoint entity) {
|
||||
log.info("管理端手动变更点位信息:{}",entity.toString());
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
if(ObjectUtil.isEmpty(entity.getRegion_name())){
|
||||
// 获取region_name
|
||||
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||
entity.setRegion_name(baseRegion.getRegion_name());
|
||||
}
|
||||
boolean is_change = entity.getIs_has_workder();
|
||||
//同步修改组盘托盘号,且子托盘号不能为空
|
||||
if(is_change && ObjectUtil.isNotEmpty(entity.getVehicle_code2())){
|
||||
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(SchBasePoint::getPoint_code,entity.getPoint_code());
|
||||
SchBasePoint old_point = this.getOne(lam);
|
||||
String old_vehicle_code2 = old_point.getVehicle_code2();
|
||||
if(ObjectUtil.isNotEmpty(old_vehicle_code2) && old_vehicle_code2.startsWith("YBHC")){
|
||||
//更新
|
||||
UpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("vehicle_code",old_vehicle_code2);
|
||||
updateWrapper.le("group_bind_material_status","2");
|
||||
|
||||
updateWrapper.set("vehicle_code",entity.getVehicle_code2());
|
||||
updateWrapper.set("source_vehicle_code",old_vehicle_code2);
|
||||
updateWrapper.set("update_id",currentUserId);
|
||||
updateWrapper.set("update_name",nickName);
|
||||
updateWrapper.set("update_time",now);
|
||||
vehiclematerialgroupMapper.update(null,updateWrapper);
|
||||
}
|
||||
}
|
||||
entity.setIs_has_workder(false);
|
||||
pointMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@@ -190,8 +224,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||
.like(region.getPoint_code()!=null,SchBasePoint::getPoint_code, region.getPoint_code())
|
||||
.eq(SchBasePoint::getIs_used, 1)
|
||||
.eq(SchBasePoint::getIs_has_workder, 1));
|
||||
.eq(SchBasePoint::getIs_used, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -318,7 +318,7 @@ public class YCLCKTask extends AbstractTask {
|
||||
qpmes065RequestBody.setLotSN(material.getPalletSN());
|
||||
qty+=Double.parseDouble(material.getQty());
|
||||
qpmes065RequestBody.setSiteName(material.getLocationCode());
|
||||
qpmes065RequestBody.setZXXV01(extGroupData.getString("workorder_code")!=null?"1":"0");
|
||||
qpmes065RequestBody.setZXXV01(ObjectUtil.isNotEmpty(extGroupData.getString("workorder_code"))?"1":"0");
|
||||
qpmes065RequestBody.setZXXV02(taskObj.getVehicle_code());
|
||||
}
|
||||
qpmes065RequestBody.setQty(String.valueOf(qty));
|
||||
@@ -333,13 +333,8 @@ public class YCLCKTask extends AbstractTask {
|
||||
String code = result.getString("code");
|
||||
if(ObjectUtil.isNotEmpty(code) && "0".equals(code)){
|
||||
//更新接口表
|
||||
LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Material::getPalletSN,taskObj.getVehicle_code2());
|
||||
updateWrapper.eq(Material::getGroup_bind_material_status,GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
//回传状态为0的
|
||||
updateWrapper.eq(Material::getReturn_status,"1");
|
||||
updateWrapper.set(Material::getReturn_status,"2");
|
||||
materialMapper.update(null,updateWrapper);
|
||||
//pdm_bd_workorder_two任务完成时,status改为3
|
||||
workorderService.update(vehicleCode2,"4");
|
||||
}
|
||||
} else {
|
||||
log.error("当前子托盘:" + taskObj.getVehicle_code2() + "不存在未解绑的物料信息,请确认!");
|
||||
|
||||
Reference in New Issue
Block a user