From 47aac729d27749097a391847c8db3749b1782a0f Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Tue, 30 Jul 2024 14:22:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20location=E8=A7=A3=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bgs/webapi/controller/ApiController.java | 16 +++++++-------- .../webapi/controller/BroadController.java | 20 +++++++++++++++++++ .../java/com/bgs/webapi/mapper/ApiMapper.java | 1 + .../com/bgs/webapi/service/ApiService.java | 5 +++++ .../src/main/resources/mapper/ApiMapper.xml | 6 ++++-- 5 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 bgs-webapi/src/main/java/com/bgs/webapi/controller/BroadController.java diff --git a/bgs-webapi/src/main/java/com/bgs/webapi/controller/ApiController.java b/bgs-webapi/src/main/java/com/bgs/webapi/controller/ApiController.java index 88895c9..3ad57d1 100644 --- a/bgs-webapi/src/main/java/com/bgs/webapi/controller/ApiController.java +++ b/bgs-webapi/src/main/java/com/bgs/webapi/controller/ApiController.java @@ -16,19 +16,11 @@ import java.util.List; /** * Created by wangh on 2020/7/17-15:18。 */ -@Controller +@RestController @RequestMapping("/api") public class ApiController { @Autowired ApiService service; - - @GetMapping("/test") - public String stockLedger() - { - return "base/location/stockLedger"; - } - - @PostMapping("/bindingSubmit") public AjaxResult bindingSubmit(@RequestBody BindingSubmitBeen submitBeen) { List watBills = submitBeen.getWatBills(); @@ -66,6 +58,12 @@ public class ApiController { if (i == 1) return AjaxResult.success("运单:" + code + "解绑成功"); return AjaxResult.error(); } + @PostMapping("/deleteLocationCode") + public AjaxResult deleteLocationCode(String dbCode, String hkCode) { + int i = service.delectLocationInfoRemarkByDbCode(dbCode, hkCode); + if (i == 1) return AjaxResult.success(); + return AjaxResult.error(); + } @PostMapping("/blueToothSubmit") public AjaxResult blueToothSubmit(String locationCode, String hkCode) { diff --git a/bgs-webapi/src/main/java/com/bgs/webapi/controller/BroadController.java b/bgs-webapi/src/main/java/com/bgs/webapi/controller/BroadController.java new file mode 100644 index 0000000..0bfc65c --- /dev/null +++ b/bgs-webapi/src/main/java/com/bgs/webapi/controller/BroadController.java @@ -0,0 +1,20 @@ +package com.bgs.webapi.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author wanghao + * @date 2024/7/30 14:19 + */ +@Controller +@RequestMapping("/api") +public class BroadController { + + @GetMapping("/test") + public String stockLedger() + { + return "base/location/stockLedger"; + } +} diff --git a/bgs-webapi/src/main/java/com/bgs/webapi/mapper/ApiMapper.java b/bgs-webapi/src/main/java/com/bgs/webapi/mapper/ApiMapper.java index 85b674f..1922dba 100644 --- a/bgs-webapi/src/main/java/com/bgs/webapi/mapper/ApiMapper.java +++ b/bgs-webapi/src/main/java/com/bgs/webapi/mapper/ApiMapper.java @@ -25,6 +25,7 @@ public interface ApiMapper { int deleteBindingItem(String epc, String code); + int delectLocationInfoRemarkByDbCode(String locationCode); int blueToothSubmit(String locationCode, String hkCode); List jionSelect(String user); diff --git a/bgs-webapi/src/main/java/com/bgs/webapi/service/ApiService.java b/bgs-webapi/src/main/java/com/bgs/webapi/service/ApiService.java index ab88d03..cc35ee6 100644 --- a/bgs-webapi/src/main/java/com/bgs/webapi/service/ApiService.java +++ b/bgs-webapi/src/main/java/com/bgs/webapi/service/ApiService.java @@ -42,6 +42,7 @@ public class ApiService { } public int blueToothSubmit(String locationCode, String hkCode) { + mapper.delectLocationInfoRemarkByDbCode(locationCode); return mapper.blueToothSubmit(locationCode,hkCode); } @@ -56,4 +57,8 @@ public class ApiService { public int joinSelectByUser(JoinSubmitBeen been) { return mapper.joinSelectByUser(been); } + + public int delectLocationInfoRemarkByDbCode(String dbCode, String hkCode) { + return mapper.delectLocationInfoRemarkByDbCode(dbCode); + } } diff --git a/bgs-webapi/src/main/resources/mapper/ApiMapper.xml b/bgs-webapi/src/main/resources/mapper/ApiMapper.xml index 158660b..2a9c0a5 100644 --- a/bgs-webapi/src/main/resources/mapper/ApiMapper.xml +++ b/bgs-webapi/src/main/resources/mapper/ApiMapper.xml @@ -20,9 +20,11 @@ delete from ledger_instant_binding WHERE cargo_frame_epc = #{param1} and waybill_number = #{param2} - UPDATE base_location_info SET remark = null WHERE remark = #{param2}; UPDATE base_location_info SET remark = #{param2} WHERE location_code = #{param1} + + UPDATE base_location_info SET remark = null WHERE location_code = #{locationCode}; + +