From 5c20c2d51db107bc7c67f42050568535c2ab588b Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Wed, 14 Sep 2022 15:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LogisticsTurnoverController.java | 26 ++++----- .../service/LogisticsTurnoverService.java | 5 ++ .../impl/LogisticsTurnoverServiceImpl.java | 23 ++++++++ .../mapper/LogisticsTurnoverMapper.xml | 53 +++++++++++++++++++ 4 files changed, 94 insertions(+), 13 deletions(-) diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/LogisticsTurnoverController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/LogisticsTurnoverController.java index 075a418d..00c3ec15 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/LogisticsTurnoverController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/LogisticsTurnoverController.java @@ -303,18 +303,18 @@ public class LogisticsTurnoverController { } -// @PostMapping("/selectSFC") -// @ResponseBody -// public String selectSFC(String sfc){ -// StoreSfcInfo storeSfcInfo= logisticsTurnoverService.storeSelectSfc(sfc); -// return Optional.ofNullable(storeSfcInfo).map(t->JSONObject.toJSONString(t)).orElse("null"); -// } -// @PostMapping("/submentInStore") -// @ResponseBody -// public String selectSFC(String sfc,double qty,int inStoreType,String user, -// @RequestParam(value = "storeLocation",defaultValue = "") String storeLocation){ -// -// return logisticsTurnoverService.submentInStore(sfc,qty, inStoreType, user,storeLocation); -// } + @PostMapping("/selectSFC") + @ResponseBody + public String selectSFC(String sfc){ + StoreSfcInfo storeSfcInfo= logisticsTurnoverService.storeSelectSfc(sfc); + return Optional.ofNullable(storeSfcInfo).map(t->JSONObject.toJSONString(t)).orElse("null"); + } + @PostMapping("/submentInStore") + @ResponseBody + public String selectSFC(String sfc,double qty,int inStoreType,String user, + @RequestParam(value = "storeLocation",defaultValue = "") String storeLocation){ + + return logisticsTurnoverService.submentInStore(sfc,qty, inStoreType, user,storeLocation); + } } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/LogisticsTurnoverService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/LogisticsTurnoverService.java index c3bce2d2..3a4638a7 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/LogisticsTurnoverService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/LogisticsTurnoverService.java @@ -5,6 +5,7 @@ import com.foreverwin.mesnac.meapi.dto.LogisticsDto; import com.foreverwin.mesnac.meapi.model.Location; import com.foreverwin.mesnac.meapi.model.LogisticsTurnover; import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.mesnac.meapi.model.StoreSfcInfo; import com.foreverwin.modular.core.util.FrontPage; import java.util.List; @@ -40,4 +41,8 @@ public interface LogisticsTurnoverService extends IService { Boolean Receivelogistics(StringBuffer message, List logisticsDtoList); boolean updateLogistics(List logisticsDtoList, Location lt,StringBuffer message, String transportno, String user, String username); + StoreSfcInfo storeSelectSfc(String sfc); + + String submentInStore(String sfc, double qty, int inStoreType, String user,String storeLocation); + } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/LogisticsTurnoverServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/LogisticsTurnoverServiceImpl.java index 3eb1d8fc..45f07d4a 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/LogisticsTurnoverServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/LogisticsTurnoverServiceImpl.java @@ -4,6 +4,7 @@ import com.foreverwin.mesnac.meapi.dto.LogisticsDto; import com.foreverwin.mesnac.meapi.mapper.LogisticsBillMapper; import com.foreverwin.mesnac.meapi.model.Location; import com.foreverwin.mesnac.meapi.model.LogisticsBill; +import com.foreverwin.mesnac.meapi.model.StoreSfcInfo; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -127,5 +128,27 @@ public class LogisticsTurnoverServiceImpl extends ServiceImpl0){ + if (inStoreType==0){ + int tag=logisticsTurnoverMapper.countLedgerBySfc(sfc); + if (tag==0){ + logisticsTurnoverMapper.insertRecordLedger(sfc,qty,storeLocation); + }else { + logisticsTurnoverMapper.updateRecordLedger(sfc,qty); + } + } + return "suess"; + }else { + return "error"; + } + + } } \ No newline at end of file diff --git a/meapi/src/main/resources/mapper/LogisticsTurnoverMapper.xml b/meapi/src/main/resources/mapper/LogisticsTurnoverMapper.xml index ddcd295a..fdc4005a 100644 --- a/meapi/src/main/resources/mapper/LogisticsTurnoverMapper.xml +++ b/meapi/src/main/resources/mapper/LogisticsTurnoverMapper.xml @@ -757,4 +757,57 @@ + + + + + + + + + + + + + + + INSERT INTO WIP.STORE_RECORD_IN (SFC, IN_QTY, STORE_LOCATION, WORK_USER, IN_TYPE) + VALUES (#{sfc}, #{qty}, #{storeLocation}, #{user}, #{inStoreType}) + + + + + INSERT INTO WIP.STORE_RECORD_LEDGER (SFC, IN_QTY, STORE_LOCATION) VALUES (#{sfc}, #{qty}, #{storeLocation}) + + + update WIP.STORE_RECORD_LEDGER set IN_QTY=IN_QTY+#{qty} where SFC=#{sfc} +