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 08cc61f..bcfc162 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ShopUserDutyMapper.java @@ -25,7 +25,7 @@ public interface ShopUserDutyMapper { ShopUserDuty selectByTokenId(@Param("tokenId") Integer tokenId); - void updateStatusByTokenId(@Param("tokenId") Integer tokenId); + void updateStatusByTokenId(@Param("day") String day,@Param("shopId") Integer shopId); List selectByShopId(@Param("shopId") String shopId); 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 35d3cf3..07db6b6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java @@ -51,6 +51,7 @@ public class DutyService { String type = jsonObject.getString("type"); TbToken tbToken = tbTokenMapper.selectByToken(token); String day = DateUtils.getDay(); + Integer shop = 0; if (type.equals("return") || type.equals("create")) { if (Objects.isNull(tbToken)) { throw new MsgException("当前用户不存在"); @@ -59,6 +60,7 @@ public class DutyService { Integer orderId = jsonObject.getInteger("orderId"); JSONObject tokenJson = TokenUtil.parseParamFromToken(tbToken.getToken()); Integer shopId = tokenJson.getInteger("shopId"); + shop = shopId; Integer userId = tokenJson.getInteger("staffId"); String loginName = tokenJson.getString("loginName"); TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId); @@ -262,7 +264,7 @@ public class DutyService { } }else{ if (type.equals("close")){ - shopUserDutyMapper.updateStatusByTokenId(tbToken.getId()); + shopUserDutyMapper.updateStatusByTokenId(day,shop); } } } catch (Exception e) { diff --git a/src/main/resources/mapper/ShopUserDutyMapper.xml b/src/main/resources/mapper/ShopUserDutyMapper.xml index 6167996..64062d8 100644 --- a/src/main/resources/mapper/ShopUserDutyMapper.xml +++ b/src/main/resources/mapper/ShopUserDutyMapper.xml @@ -46,7 +46,7 @@ delete from tb_shop_user_duty @@ -222,6 +222,6 @@ where id = #{id,jdbcType=INTEGER} - update tb_shop_user_duty set status = '1' and login_out_time = now() where token_id = #{tokenId} + update tb_shop_user_duty set status = '1' , login_out_time = now() where shop_id = #{shopId} and trade_day = #{day} \ No newline at end of file