From 4665167843394f4586db8198d5d1c5852ede3bf7 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 19 七月 2023 10:27:44 +0800
Subject: [PATCH] agv 入库接口调整
---
src/main/java/com/zy/asrs/controller/AgvBasDevpController.java | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 107 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/AgvBasDevpController.java b/src/main/java/com/zy/asrs/controller/AgvBasDevpController.java
index e0ccebf..c2f2115 100644
--- a/src/main/java/com/zy/asrs/controller/AgvBasDevpController.java
+++ b/src/main/java/com/zy/asrs/controller/AgvBasDevpController.java
@@ -1,29 +1,33 @@
package com.zy.asrs.controller;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.AgvBasDevp;
+import com.zy.asrs.entity.BasDevp;
+import com.zy.asrs.entity.param.LocMastInitParam;
import com.zy.asrs.service.AgvBasDevpService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
-import java.util.Date;
-import java.util.Map;
+import java.util.*;
@RestController
+@RequestMapping("/agv")
public class AgvBasDevpController extends BaseController {
@Autowired
AgvBasDevpService agvBasDevpService;
- @RequestMapping(value = "/agvBasDevp/list/auth")
+ @RequestMapping(value = "/basDevp/list/auth")
@ManagerAuth
public R list(@RequestParam(defaultValue = "1")Integer curr,
@RequestParam(defaultValue = "10")Integer limit,
@@ -37,7 +41,7 @@
return R.ok(agvBasDevpService.selectPage(new Page<>(curr, limit), wrapper));
}
- @RequestMapping(value = "/agvBasDevp/add/auth")
+ @RequestMapping(value = "/basDevp/add/auth")
@ManagerAuth(memo = "绔欑偣娣诲姞")
public R add(AgvBasDevp agvBasDevp) {
agvBasDevp.setModiUser(getUserId());
@@ -46,6 +50,101 @@
agvBasDevp.setAppeTime(new Date());
agvBasDevp.setLocSts("O");
agvBasDevpService.insert(agvBasDevp);
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/basDevp/check/column/auth")
+ @ManagerAuth
+ public R query(@RequestBody JSONObject param) {
+ Wrapper<AgvBasDevp> wrapper = new EntityWrapper<AgvBasDevp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+ if (null != agvBasDevpService.selectOne(wrapper)){
+ return R.parse(BaseRes.REPEAT).add(getComment(BasDevp.class, String.valueOf(param.get("key"))));
+ }
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/basDevp/{id}/auth")
+ @ManagerAuth
+ public R get(@PathVariable("id") Long id) {
+ return R.ok(agvBasDevpService.selectById(String.valueOf(id)));
+ }
+
+ @RequestMapping(value = "/basDevp/update/auth")
+ @ManagerAuth(memo = "绔欑偣淇敼")
+ public R update(AgvBasDevp basDevp){
+ if (Cools.isEmpty(basDevp) || null==basDevp.getDevNo()){
+ return R.error();
+ }
+ basDevp.setModiUser(getUserId());
+ basDevp.setModiTime(new Date());
+ agvBasDevpService.updateById(basDevp);
+ return R.ok("淇敼瀹屾垚");
+ }
+
+ @RequestMapping(value = "/basDevp/delete/auth")
+ @ManagerAuth(memo = "绔欑偣鍒犻櫎")
+ public R delete(@RequestParam String param){
+ List<AgvBasDevp> list = JSONArray.parseArray(param, AgvBasDevp.class);
+ if (Cools.isEmpty(list)){
+ return R.error();
+ }
+ for (AgvBasDevp entity : list){
+ agvBasDevpService.delete(new EntityWrapper<>(entity));
+ }
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/basDevp/unbind/auth")
+ @ManagerAuth(memo = "绔欑偣瑙g粦")
+ public R unbind(@RequestParam String param){
+ AgvBasDevp agvBasDevp = JSONArray.parseObject(param,AgvBasDevp.class);
+
+ //鑻ュ綋鍓嶇珯鐐硅揣浣嶇姸鎬佷笉涓篎.鍦ㄥ簱鐘舵�侊紝鍒欒繑鍥為敊璇�
+ if(!agvBasDevp.getLocSts().equals("F")){
+ return R.error("褰撳墠绔欑偣璐т綅鐘舵�佷笉涓哄湪搴擄紝鏃犳硶瑙i櫎缁戝畾");
+ }
+ agvBasDevp.setLocSts("O");
+ agvBasDevp.setBarcode("");
+ agvBasDevpService.update(agvBasDevp,new EntityWrapper<AgvBasDevp>().eq("dev_no",agvBasDevp.getDevNo()));
+
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/basDevp/export/auth")
+ @ManagerAuth(memo = "绔欑偣瀵煎嚭")
+ public R export(@RequestBody JSONObject param){
+ List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+ EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>();
+ Map<String, Object> map = excludeTrash(param.getJSONObject("basDevp"));
+ convert(map, wrapper);
+ List<AgvBasDevp> list = agvBasDevpService.selectList(wrapper);
+ return R.ok(exportSupport(list, fields));
+ }
+
+ @RequestMapping(value = "/basDevpQuery/auth")
+ @ManagerAuth
+ public R query(String condition) {
+ EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>();
+ wrapper.like("dev_no", condition);
+ Page<AgvBasDevp> page = agvBasDevpService.selectPage(new Page<>(0, 10), wrapper);
+ List<Map<String, Object>> result = new ArrayList<>();
+ for (AgvBasDevp basDevp : page.getRecords()){
+ Map<String, Object> map = new HashMap<>();
+ map.put("id", basDevp.getDevNo());
+ map.put("value", basDevp.getDevNo());
+ result.add(map);
+ }
+ return R.ok(result);
+ }
+
+ @RequestMapping(value = "/basDevp/init/auth")
+ @ManagerAuth(memo = "鍒濆鍖栫珯鐐�")
+ public R init(LocMastInitParam param) {
+ //娓呯┖鍘熸湁搴撲綅
+ agvBasDevpService.clearBasDevp();
+ //鍒濆鍖�1妤�3妤肩珯鐐�
+ agvBasDevpService.initBasDevp();
+
return R.ok();
}
@@ -61,4 +160,5 @@
}
}
}
+
}
--
Gitblit v1.9.1