From a2432316ead48c80a4ae1e9668d32029d22afbad Mon Sep 17 00:00:00 2001 From: 19991905653 Date: Fri, 12 Apr 2024 10:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E7=8F=AD=E6=89=93=E5=8D=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/controller/CloudPrinterController.java | 5 +++-- .../system/cashierservice/dao/ShopUserDutyMapper.java | 2 ++ .../system/cashierservice/service/CloudPrinterService.java | 5 +++-- .../system/cashierservice/service/DutyService.java | 6 ++++-- .../system/cashierservice/service/ShopInfoService.java | 3 ++- src/main/resources/mapper/ShopUserDutyMapper.xml | 3 +++ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java index 43b622b..16bb2c3 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java @@ -50,8 +50,9 @@ public class CloudPrinterController { public Result handoverPrint( @RequestHeader("token") String token, @RequestHeader("loginName") String loginName, @RequestHeader("clientType") String clientType, - @RequestParam("tradeDay") String tradeDay + @RequestParam("tradeDay") String tradeDay, + Integer id ){ - return cloudPrinterService.handoverprintData(token,tradeDay,loginName); + return cloudPrinterService.handoverprintData(token,id,loginName); } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java index 55ad628..0afcd8b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java @@ -40,5 +40,7 @@ public interface ShopUserDutyMapper { ShopUserDuty selectByShopIdAndDay(@Param("shopId") Integer shopId,@Param("day") String day); + void updateStatusById(@Param("id") Integer id, @Param("staffId") Integer staffId); + // List selectByShopIdAndTradeAll(@Param("shopId") Integer shopId,@Param("day") String day,@Param("tokenId") Integer tokenId); } \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java index 52c4d4b..9694ef8 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java @@ -514,7 +514,7 @@ public class CloudPrinterService { } - public Result handoverprintData(String token,String tradeDay,String loginName){ + public Result handoverprintData(String token,Integer id,String loginName){ JSONObject info= TokenUtil.parseParamFromToken(token); @@ -558,7 +558,8 @@ public class CloudPrinterService { return; } - ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay); + ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByPrimaryKey(id); +// ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay); MsgException.checkNull(shopUserDuty,"交班信息不存在"); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java index 1196cbb..d2925f2 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java @@ -278,8 +278,10 @@ public class DutyService { JSONObject tokenJson = TokenUtil.parseParamFromToken(tbToken.getToken()); Integer shopId = tokenJson.getInteger("shopId"); Integer staffId = tokenJson.getInteger("staffId"); - cloudPrinterService.handoverprintData(token, day, ""); - shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId); + ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0"); + cloudPrinterService.handoverprintData(token, shopUserDuty.getId(), ""); +// shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId); + shopUserDutyMapper.updateStatusById(shopUserDuty.getId(),staffId); } } } catch (Exception e) { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java index a66e65b..0fb1fce 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java @@ -60,7 +60,8 @@ public class ShopInfoService { Integer shopId = jsonObject.getInteger("shopId"); String day = DateUtils.getDay(); // ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenId(tbToken.getId()); - ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day); + ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId,"0"); +// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day); // List list = shopUserDutyMapper.selectByShopIdAndTradeAll(shopId,day,tbToken.getId()); if (Objects.nonNull(shopUserDuty)){ // PageHelper.startPage(page, pageSize); diff --git a/src/main/resources/mapper/ShopUserDutyMapper.xml b/src/main/resources/mapper/ShopUserDutyMapper.xml index 8623ffe..4e9005b 100644 --- a/src/main/resources/mapper/ShopUserDutyMapper.xml +++ b/src/main/resources/mapper/ShopUserDutyMapper.xml @@ -224,6 +224,9 @@ update tb_shop_user_duty set status = '1' , login_out_time = now(),user_id = #{staffId} where shop_id = #{shopId} and trade_day = #{day} and status = '0' + + update tb_shop_user_duty set status = '1' , login_out_time = now(),user_id = #{staffId} where id = #{id} +