add:手持点位操作
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
package org.nl.wms.pda.sch_manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.pda.sch_manage.service.PdaSchPointService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 手持点位操作 控制层
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-06-06
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/api/pda/schPoint")
|
||||||
|
@Slf4j
|
||||||
|
public class PdaSchPointController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PdaSchPointService pdaSchPointService;
|
||||||
|
|
||||||
|
@PostMapping("/getPoint")
|
||||||
|
@Log("查询点位信息")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> getPoint(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pdaSchPointService.getPoint(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/binding")
|
||||||
|
@Log("解绑")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> binding(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pdaSchPointService.binding(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/dissect")
|
||||||
|
@Log("绑定")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> dissect(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pdaSchPointService.dissect(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.nl.wms.pda.sch_manage.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.pda.util.PdaResponse;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 手持点位操作 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-06-06
|
||||||
|
*/
|
||||||
|
public interface PdaSchPointService extends IService<SchBasePoint> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询点位信息
|
||||||
|
* @param whereJson {
|
||||||
|
* point_code: 点位编码
|
||||||
|
* }
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse getPoint(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解绑
|
||||||
|
* @param whereJson {
|
||||||
|
* point_code: 点位编码
|
||||||
|
* point_name: 点位名称
|
||||||
|
* storagevehicle_code: 载具编码
|
||||||
|
* }
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse binding(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定
|
||||||
|
* @param whereJson {
|
||||||
|
* point_code: 点位编码
|
||||||
|
* point_name: 点位名称
|
||||||
|
* storagevehicle_code: 载具编码
|
||||||
|
* }
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse dissect(JSONObject whereJson);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.nl.wms.pda.sch_manage.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||||
|
import org.nl.wms.pda.sch_manage.service.PdaSchPointService;
|
||||||
|
import org.nl.wms.pda.util.PdaResponse;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 手持点位操作 实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-06-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PdaSchPointkServiceImpl extends ServiceImpl<SchBasePointMapper, SchBasePoint> implements PdaSchPointService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 载具信息服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PdaResponse getPoint(JSONObject whereJson) {
|
||||||
|
SchBasePoint pointDao = this.getById(whereJson.getString("point_code"));
|
||||||
|
pointDao.setStoragevehicle_code(pointDao.getVehicle_code());
|
||||||
|
return PdaResponse.requestParamOk(pointDao);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PdaResponse binding(JSONObject whereJson) {
|
||||||
|
this.update(
|
||||||
|
new UpdateWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
||||||
|
.set(SchBasePoint::getVehicle_code, null)
|
||||||
|
.set(SchBasePoint::getIos_id, null)
|
||||||
|
);
|
||||||
|
return PdaResponse.requestOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PdaResponse dissect(JSONObject whereJson) {
|
||||||
|
// 判断载具是否存在
|
||||||
|
iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("storagevehicle_code"));
|
||||||
|
this.update(
|
||||||
|
new UpdateWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
||||||
|
.set(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
return PdaResponse.requestOk();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -157,4 +157,6 @@ public class SchBasePoint implements Serializable {
|
|||||||
private String raw_material_code;
|
private String raw_material_code;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String task_warn;
|
private String task_warn;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String storagevehicle_code;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user