From 606e903e80fa9a7e77c72879494b47fbd195b93a Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期五, 22 八月 2025 13:42:17 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/properties/SystemProperties.java | 2
src/main/java/com/zy/asrs/entity/AgvSite.java | 9 ++++
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 56 +++++++++++++++++++++++++++
src/main/java/com/zy/asrs/controller/MobileController.java | 12 ++++++
src/main/java/com/zy/asrs/service/MobileService.java | 2 +
5 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 40a5eaa..11ed8c0 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -70,6 +70,18 @@
//
//
// }
+@RequestMapping("/agv/staBind")
+@ManagerAuth(memo = "AGV绔欑偣缁戝畾鐗╂枡")
+public R pdaAgvStaBind(@RequestBody CombParam combParam){
+ if (Cools.isEmpty(combParam.getBarcode(), combParam.getCombMats())) {
+ throw new CoolException(BaseRes.PARAM);
+ }
+
+ mobileService.AgvStaBind(combParam,getUserId());
+
+ return R.ok();
+
+}
@PostMapping("/agv/lineCall")
@ManagerAuth
public R pdaAgvLineCall(@RequestBody Map<String,Object> map){
diff --git a/src/main/java/com/zy/asrs/entity/AgvSite.java b/src/main/java/com/zy/asrs/entity/AgvSite.java
index 70291a1..f6572d0 100644
--- a/src/main/java/com/zy/asrs/entity/AgvSite.java
+++ b/src/main/java/com/zy/asrs/entity/AgvSite.java
@@ -1,5 +1,6 @@
package com.zy.asrs.entity;
+import com.baomidou.mybatisplus.enums.FieldStrategy;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
@@ -29,9 +30,15 @@
private String area;
@ApiModelProperty(value= "")
- @TableField("work_no")
+ @TableField(strategy = FieldStrategy.IGNORED, value = "work_no")
private Integer workNo;
+ /**
+ * 1.鍗犵敤
+ * 0.绌洪棽
+ * 2.棰勭害
+ */
+
@ApiModelProperty(value= "")
private Integer status;
diff --git a/src/main/java/com/zy/asrs/service/MobileService.java b/src/main/java/com/zy/asrs/service/MobileService.java
index db9f27c..1ef3c3a 100644
--- a/src/main/java/com/zy/asrs/service/MobileService.java
+++ b/src/main/java/com/zy/asrs/service/MobileService.java
@@ -66,4 +66,6 @@
R siteList();
R lineCall(Map<String, Object> map);
+
+ void AgvStaBind(CombParam combParam,Long userID);
}
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index caac500..37ca2d9 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -87,6 +87,59 @@
@Autowired
private AgvSiteService agvSiteService;
+
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void AgvStaBind(CombParam param,Long userId) {
+ AgvSite agvSite = agvSiteService.selectOne(new EntityWrapper<AgvSite>().eq("name", param.getBarcode()));
+ if (Cools.isEmpty(agvSite)){
+ throw new CoolException("鏈壘鍒癆GV鏆傚瓨浣嶄俊鎭�");
+ }
+ if (agvSite.getStatus() != 0){
+ throw new CoolException("AGV鏆傚瓨浣嶇姸鎬佷笉涓虹┖闂�");
+ }
+
+ int workNo = commonService.getWorkNo(1);
+ Date now = new Date();
+ WrkMast wrkMast1 = new WrkMast();
+ wrkMast1.setWrkNo(workNo);
+ wrkMast1.setWrkSts(2L);
+ wrkMast1.setIoType(300);
+ wrkMast1.setIoTime(now);
+ wrkMast1.setIoPri(13D); // 浼樺厛绾э細13
+ wrkMast1.setFullPlt("Y"); // 婊℃澘锛歒
+ wrkMast1.setPicking("N"); // 鎷f枡
+ wrkMast1.setExitMk("N"); // 閫�鍑�
+ wrkMast1.setEmptyMk("N"); // 绌烘澘
+ wrkMast1.setLinkMis("N");
+ wrkMast1.setAppeUser(userId); // 鎿嶄綔浜哄憳鏁版嵁
+ wrkMast1.setAppeTime(now);
+ wrkMast1.setModiUser(userId);
+ wrkMast1.setModiTime(now);
+ wrkMast1.setBarcode(param.getBarcode());
+ if (!wrkMastService.insert(wrkMast1)) {
+ throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
+ }
+ // 鐢熸垚宸ヤ綔妗f槑缁�
+ param.getCombMats().forEach(waitPakin -> {
+ WrkDetl wrkDetl = new WrkDetl();
+ wrkDetl.sync(waitPakin);
+ wrkDetl.setWrkNo(workNo);
+ wrkDetl.setIoTime(now);
+ wrkDetl.setAppeTime(now);
+ wrkDetl.setModiTime(now);
+ if (!wrkDetlService.insert(wrkDetl)) {
+ throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
+ }
+ });
+
+ agvSite.setWorkNo(workNo);
+ agvSite.setStatus(1);
+ agvSiteService.updateById(agvSite);
+
+ }
+
@Override
public R inLocCallAgv(String sta, String inSta) {
@@ -1280,7 +1333,7 @@
@Override
public R siteList() {
- List<AgvSite> agvSites = agvSiteService.selectList(new EntityWrapper<AgvSite>().eq("status", 1));
+ List<AgvSite> agvSites = agvSiteService.selectList(new EntityWrapper<AgvSite>());
ArrayList<AgvSiteListVo> agvSiteListVos = new ArrayList<>();
for (AgvSite agvSite : agvSites) {
AgvSiteListVo agvSiteListVo = new AgvSiteListVo();
@@ -1335,6 +1388,7 @@
return R.ok();
}
+
public void uploadErp(InventoryErpParam param){
String response = "";
boolean success = false;
diff --git a/src/main/java/com/zy/common/properties/SystemProperties.java b/src/main/java/com/zy/common/properties/SystemProperties.java
index b693d42..f32bf91 100644
--- a/src/main/java/com/zy/common/properties/SystemProperties.java
+++ b/src/main/java/com/zy/common/properties/SystemProperties.java
@@ -64,7 +64,7 @@
// 鐢熸垚婵�娲荤爜
public static void main(String[] args) {
- String timeStr = "2021-08-01 17:48:35";
+ String timeStr = "2026-08-08 08:00:00";
Date exprTime = DateUtils.convert(timeStr);
String code = AesUtils.encrypt(DateUtils.convert(exprTime, DateUtils.yyyyMMddHHmmss), SystemProperties.SALT);
System.out.println("婵�娲荤爜锛�"+code);
--
Gitblit v1.9.1