add:平板点位更新
This commit is contained in:
@@ -35,8 +35,29 @@ public class PdaUpdatePointController {
|
||||
@PostMapping("/queryPointInfo")
|
||||
@Log("查询点位物料信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
|
||||
public ResponseEntity<Object> queryPointInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.queryPointInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/bindVehicle")
|
||||
@Log("绑定")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> bindVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.bindVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearVehicle")
|
||||
@Log("清载具")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.clearVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearMaterial")
|
||||
@Log("清物料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.clearMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,4 +22,34 @@ public interface PdaUpdatePointService {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryPointInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse bindVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 清载具
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 清物料
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearMaterial(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package org.nl.wms.pda.general_management.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pda.general_management.service.PdaUpdatePointService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -26,12 +33,6 @@ public class PdaUpdatePointServiceImpl implements PdaUpdatePointService {
|
||||
@Autowired
|
||||
private MdPbGroupplateMapper mdPbGroupplateMapper;
|
||||
|
||||
/**
|
||||
* 任务服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
/**
|
||||
* 点位mapper
|
||||
*/
|
||||
@@ -42,4 +43,79 @@ public class PdaUpdatePointServiceImpl implements PdaUpdatePointService {
|
||||
public PdaResponse queryPointInfo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdPbGroupplateMapper.pdaGetPointDtl(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse bindVehicle(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
throw new BadRequestException("载具不能为空!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
pointDao.setVehicle_code(whereJson.getString("storagevehicle_code"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearVehicle(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code")) && ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code")) ) {
|
||||
throw new BadRequestException("请先扫码!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao ;
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
pointDao = schBasePointMapper.selectOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
);
|
||||
} else if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
} else {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
}
|
||||
|
||||
pointDao.setVehicle_code("");
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("空位"));
|
||||
pointDao.setIng_task_code("");
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearMaterial(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code")) && ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code")) ) {
|
||||
throw new BadRequestException("请先扫码!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao ;
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
pointDao = schBasePointMapper.selectOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
);
|
||||
} else if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
} else {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
}
|
||||
|
||||
// 更新点位状态为空位
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("空载具"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
|
||||
mdPbGroupplateMapper.delete(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, pointDao.getVehicle_code())
|
||||
.in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"),
|
||||
IOSEnum.GROUP_PLATE_STATUS.code("出库")
|
||||
)
|
||||
);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public enum PDAEnum {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
for (String key : code.keySet()) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("label", key);
|
||||
json.put("text", key);
|
||||
json.put("value", code.get(key));
|
||||
list.add(json);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public enum IOSEnum {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
for (String key : code.keySet()) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("label", key);
|
||||
json.put("text", key);
|
||||
json.put("value", code.get(key));
|
||||
list.add(json);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user