Browse Source

紫亚兰签到

zhijiezhao 8 months ago
parent
commit
090b583af7

+ 52 - 17
src/main/java/com/caimei365/user/controller/LoginApi.java

@@ -3,6 +3,7 @@ package com.caimei365.user.controller;
 import com.caimei365.user.idempotent.IpSave;
 import com.caimei365.user.idempotent.IpSave;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.dto.*;
+import com.caimei365.user.model.po.ShopSignPo;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.service.CmDistributionService;
 import com.caimei365.user.service.CmDistributionService;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.text.ParseException;
 import java.text.ParseException;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -85,10 +87,11 @@ public class LoginApi {
 
 
     /**
     /**
      * 登录(手机号,验证码)
      * 登录(手机号,验证码)
+     *
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                      mobile   手机号
-     *                      code     短信验证码
-     *                      unionId  微信unionId
+     *                     mobile   手机号
+     *                     code     短信验证码
+     *                     unionId  微信unionId
      *                     }
      *                     }
      * @return UserLoginVo
      * @return UserLoginVo
      * @throws ParseException
      * @throws ParseException
@@ -108,12 +111,38 @@ public class LoginApi {
         loginCodeDto.setTouristId(touristId);
         loginCodeDto.setTouristId(touristId);
         return loginService.codeLogin(loginCodeDto);
         return loginService.codeLogin(loginCodeDto);
     }
     }
+
+    @ApiOperation("紫亚兰票根绑定")
+    @PostMapping("/ticket/bind")
+    public ResponseJson ticketBind(String ticket, String idCard, Integer userId, String name, String mobile, String work) {
+        return loginService.ticketBind(ticket, idCard, userId, name, mobile, work);
+    }
+
+    @ApiOperation("紫亚兰展台供应商信息")
+    @GetMapping("/shop/detail")
+    public ResponseJson<ShopSignPo> shopDetail(Integer shopId,Integer userId) {
+        return loginService.shopDetail(shopId,userId);
+    }
+
+
+    @ApiOperation("紫亚兰展台签到")
+    @PostMapping("/ticket/sign")
+    public ResponseJson ticketSign(Integer shopId, Integer userId) {
+        return loginService.ticketSign(shopId, userId);
+    }
+
+    @ApiOperation("紫亚兰展台签到结果列表")
+    @GetMapping("/sign/list")
+    public ResponseJson<List<ShopSignPo>> signList(Integer userId) {
+        return loginService.signList(userId);
+    }
     /**
     /**
      * 登录(手机号,验证码)--组织
      * 登录(手机号,验证码)--组织
+     *
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                      mobile   手机号
-     *                      code     短信验证码
-     *                      unionId  微信unionId
+     *                     mobile   手机号
+     *                     code     短信验证码
+     *                     unionId  微信unionId
      *                     }
      *                     }
      * @return UserLoginVo
      * @return UserLoginVo
      * @throws ParseException
      * @throws ParseException
@@ -159,6 +188,7 @@ public class LoginApi {
 
 
     /**
     /**
      * 分销人员登录(手机号,密码)
      * 分销人员登录(手机号,密码)
+     *
      * @param loginPasswordDto {
      * @param loginPasswordDto {
      *                         mobileOrEmail 手机号
      *                         mobileOrEmail 手机号
      *                         password 密码
      *                         password 密码
@@ -191,8 +221,8 @@ public class LoginApi {
      */
      */
     @ApiOperation("分销机构获取验证码(手机号,验证码)")
     @ApiOperation("分销机构获取验证码(手机号,验证码)")
     @PostMapping("/organizeDistributionClub")
     @PostMapping("/organizeDistributionClub")
-    public ResponseJson organizeClubCodeLogin(LoginCodeDto loginCodeDto,String userId) {
-        return cmDistributionService.organizeClubCodeLogin(loginCodeDto,userId);
+    public ResponseJson organizeClubCodeLogin(LoginCodeDto loginCodeDto, String userId) {
+        return cmDistributionService.organizeClubCodeLogin(loginCodeDto, userId);
     }
     }
 
 
     /**
     /**
@@ -234,6 +264,7 @@ public class LoginApi {
         String iv = authAppletsDto.getIv();
         String iv = authAppletsDto.getIv();
         return loginService.appletsOrganizeAuthorization(code, encryptedData, iv, headers);
         return loginService.appletsOrganizeAuthorization(code, encryptedData, iv, headers);
     }
     }
+
     @ApiOperation("颜选美学站内消息列表")
     @ApiOperation("颜选美学站内消息列表")
     @GetMapping("/auth/heheMessageList")
     @GetMapping("/auth/heheMessageList")
     public ResponseJson<PageInfo<MessageCenter>> heheMessageList(Integer commonId,
     public ResponseJson<PageInfo<MessageCenter>> heheMessageList(Integer commonId,
@@ -242,20 +273,23 @@ public class LoginApi {
                                                                  @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
                                                                  @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
         return loginService.messageList(commonId, messageType, 4, pageNum, pageSize);
         return loginService.messageList(commonId, messageType, 4, pageNum, pageSize);
     }
     }
+
     @ApiOperation("颜选美学所有站内消息未读消息记录数")
     @ApiOperation("颜选美学所有站内消息未读消息记录数")
     @GetMapping("/auth/heheMessageCount")
     @GetMapping("/auth/heheMessageCount")
     public ResponseJson<Map<String, Object>> heheMessageCount(Integer commonId) {
     public ResponseJson<Map<String, Object>> heheMessageCount(Integer commonId) {
         return loginService.messageCount(4, commonId);
         return loginService.messageCount(4, commonId);
     }
     }
+
     @ApiOperation("颜选美学站内消息未读消息记录数")
     @ApiOperation("颜选美学站内消息未读消息记录数")
     @GetMapping("/auth/heheOneMessageCount")
     @GetMapping("/auth/heheOneMessageCount")
     public ResponseJson<Map<String, Object>> heheOneMessageCount(Integer messageType, Integer commonId) {
     public ResponseJson<Map<String, Object>> heheOneMessageCount(Integer messageType, Integer commonId) {
-        return loginService.count(4,messageType, commonId);
+        return loginService.count(4, messageType, commonId);
     }
     }
+
     @ApiOperation("颜选美学站内消息改为已读")
     @ApiOperation("颜选美学站内消息改为已读")
     @GetMapping("/auth/updateHeheMessageAsRead")
     @GetMapping("/auth/updateHeheMessageAsRead")
     public ResponseJson<Void> updateHeheMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateHeheMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateMessageAsRead(4,messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(4, messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
@@ -280,6 +314,7 @@ public class LoginApi {
     public ResponseJson<Map<String, Object>> SpCount(Integer messageType, Integer commonId) {
     public ResponseJson<Map<String, Object>> SpCount(Integer messageType, Integer commonId) {
         return loginService.SpCount(messageType, commonId);
         return loginService.SpCount(messageType, commonId);
     }
     }
+
     @ApiOperation("供应商站内消息未读消息总记录数")
     @ApiOperation("供应商站内消息未读消息总记录数")
     @GetMapping("/auth/ShopCount")
     @GetMapping("/auth/ShopCount")
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
     public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
@@ -303,7 +338,7 @@ public class LoginApi {
                                                                Integer type,
                                                                Integer type,
                                                                @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                                                @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                                                @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
                                                                @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
-        return loginService.SpMessageList(commonId, messageType, source,type, pageNum, pageSize);
+        return loginService.SpMessageList(commonId, messageType, source, type, pageNum, pageSize);
     }
     }
 
 
     @ApiOperation("机构站内消息列表")
     @ApiOperation("机构站内消息列表")
@@ -332,7 +367,7 @@ public class LoginApi {
     @ApiOperation("机构站内消息改为已读")
     @ApiOperation("机构站内消息改为已读")
     @GetMapping("/auth/updateMessageAsRead")
     @GetMapping("/auth/updateMessageAsRead")
     public ResponseJson<Void> updateMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateMessageAsRead(1,messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(1, messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
@@ -340,20 +375,20 @@ public class LoginApi {
     }
     }
 
 
 
 
-
     @ApiOperation("供应商站内消息改为已读")
     @ApiOperation("供应商站内消息改为已读")
     @GetMapping("/auth/updateShopMessageAsRead")
     @GetMapping("/auth/updateShopMessageAsRead")
     public ResponseJson<Void> updateShopMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateShopMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateMessageAsRead(2,messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(2, messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
         return ResponseJson.success("标记已读成功", null);
         return ResponseJson.success("标记已读成功", null);
     }
     }
+
     @ApiOperation("协销站内消息改为已读")
     @ApiOperation("协销站内消息改为已读")
     @GetMapping("/auth/updateSpMessageAsRead")
     @GetMapping("/auth/updateSpMessageAsRead")
     public ResponseJson<Void> updateSpMessageAsRead(Integer messageType, Integer commonId) {
     public ResponseJson<Void> updateSpMessageAsRead(Integer messageType, Integer commonId) {
-        Integer i = loginService.updateMessageAsRead(3,messageType, commonId);
+        Integer i = loginService.updateMessageAsRead(3, messageType, commonId);
         if (i <= 0) {
         if (i <= 0) {
             return ResponseJson.error("没有未读消息了!", null);
             return ResponseJson.error("没有未读消息了!", null);
         }
         }
@@ -568,8 +603,8 @@ public class LoginApi {
 
 
     /**
     /**
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                      mobile   手机号
-     *                      code     短信验证码
+     *                     mobile   手机号
+     *                     code     短信验证码
      *                     }
      *                     }
      * @param loginCodeDto
      * @param loginCodeDto
      * @return
      * @return

+ 51 - 4
src/main/java/com/caimei365/user/mapper/LoginMapper.java

@@ -1,5 +1,7 @@
 package com.caimei365.user.mapper;
 package com.caimei365.user.mapper;
 
 
+import com.caimei365.user.model.po.ShopSignPo;
+import com.caimei365.user.model.po.TicketPo;
 import com.caimei365.user.model.vo.LoginFailRecordVo;
 import com.caimei365.user.model.vo.LoginFailRecordVo;
 import com.caimei365.user.model.vo.OperationVo;
 import com.caimei365.user.model.vo.OperationVo;
 import com.caimei365.user.model.vo.ServiceProviderVo;
 import com.caimei365.user.model.vo.ServiceProviderVo;
@@ -25,6 +27,7 @@ public interface LoginMapper {
      * @return baseuser
      * @return baseuser
      */
      */
     UserLoginVo getLoginUserByUserId(@Param("userId") Integer userId);
     UserLoginVo getLoginUserByUserId(@Param("userId") Integer userId);
+
     /**
     /**
      * 根据手机号或邮箱获取用户
      * 根据手机号或邮箱获取用户
      *
      *
@@ -43,6 +46,7 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 是否绑定微信
      * 是否绑定微信
+     *
      * @param mobileOrEmail
      * @param mobileOrEmail
      * @return
      * @return
      */
      */
@@ -50,9 +54,11 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 绑定微信
      * 绑定微信
+     *
      * @param operationVo
      * @param operationVo
      */
      */
     void insertOperation(OperationVo operationVo);
     void insertOperation(OperationVo operationVo);
+
     /**
     /**
      * 根据手机号获取用户
      * 根据手机号获取用户
      *
      *
@@ -60,15 +66,18 @@ public interface LoginMapper {
      * @return BaseUser
      * @return BaseUser
      */
      */
     UserLoginVo getLoginUserByMobile(@Param("mobile") String mobile, @Param("organizeId") Integer organizeId);
     UserLoginVo getLoginUserByMobile(@Param("mobile") String mobile, @Param("organizeId") Integer organizeId);
+
     /**
     /**
      * 根据openId获取协销
      * 根据openId获取协销
+     *
      * @param openId openId
      * @param openId openId
      * @return BaseUser
      * @return BaseUser
      */
      */
-    UserLoginVo getServiceProviderUserByOpenId(@Param("openId") String openId,@Param("organizeId") Integer organizeId);
+    UserLoginVo getServiceProviderUserByOpenId(@Param("openId") String openId, @Param("organizeId") Integer organizeId);
 
 
     /**
     /**
      * 根据用户ID更新协销unionId
      * 根据用户ID更新协销unionId
+     *
      * @param userId
      * @param userId
      * @param unionId
      * @param unionId
      */
      */
@@ -76,6 +85,7 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 供应商商品上架平台属性
      * 供应商商品上架平台属性
+     *
      * @param shopId
      * @param shopId
      * @return
      * @return
      */
      */
@@ -83,13 +93,16 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 修改用户微信授权信息
      * 修改用户微信授权信息
+     *
      * @param openId
      * @param openId
      * @param unionId
      * @param unionId
      * @param userId
      * @param userId
      */
      */
     void updateUserInfo(@Param("openId") String openId, @Param("unionId") String unionId, @Param("userId") Integer userId);
     void updateUserInfo(@Param("openId") String openId, @Param("unionId") String unionId, @Param("userId") Integer userId);
+
     /**
     /**
      * 根据userId获取协销
      * 根据userId获取协销
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -97,6 +110,7 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 根据unionId获取运营人员
      * 根据unionId获取运营人员
+     *
      * @param unionId unionId
      * @param unionId unionId
      * @param source
      * @param source
      * @return BaseUser
      * @return BaseUser
@@ -105,27 +119,34 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 根据unionId获取运营人员 -- 组织
      * 根据unionId获取运营人员 -- 组织
+     *
      * @param unionId unionId
      * @param unionId unionId
      * @param source
      * @param source
      * @return BaseUser
      * @return BaseUser
      */
      */
     UserLoginVo getOrganizeLoginUserByUnionId(@Param("unionId") String unionId, @Param("source") String source);
     UserLoginVo getOrganizeLoginUserByUnionId(@Param("unionId") String unionId, @Param("source") String source);
+
     /**
     /**
      * 根据openId获取运营人员
      * 根据openId获取运营人员
+     *
      * @param openId
      * @param openId
      * @param source
      * @param source
      * @return
      * @return
      */
      */
     UserLoginVo getLoginUserByOpenId(@Param("openId") String openId, @Param("source") String source);
     UserLoginVo getLoginUserByOpenId(@Param("openId") String openId, @Param("source") String source);
+
     /**
     /**
      * 根据openId获取运营人员 -- 组织
      * 根据openId获取运营人员 -- 组织
+     *
      * @param openId
      * @param openId
      * @param source
      * @param source
      * @return
      * @return
      */
      */
     UserLoginVo getOrganizeLoginUserByOpenId(@Param("openId") String openId, @Param("source") String source);
     UserLoginVo getOrganizeLoginUserByOpenId(@Param("openId") String openId, @Param("source") String source);
+
     /**
     /**
      * 根据邀请码获取运营人员
      * 根据邀请码获取运营人员
+     *
      * @param invitationCode
      * @param invitationCode
      * @return
      * @return
      */
      */
@@ -133,32 +154,39 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 根据邀请码获取运营人员 -- 组织
      * 根据邀请码获取运营人员 -- 组织
+     *
      * @param invitationCode
      * @param invitationCode
      * @param organizeId
      * @param organizeId
      * @return
      * @return
      */
      */
     UserLoginVo getOperationOrganizeUserByInvitationCode(String invitationCode, Integer organizeId);
     UserLoginVo getOperationOrganizeUserByInvitationCode(String invitationCode, Integer organizeId);
+
     /**
     /**
      * 根据Id获取运营人员用户信息(关联user)
      * 根据Id获取运营人员用户信息(关联user)
-     * @param operationId    用户Id
+     *
+     * @param operationId 用户Id
      * @return
      * @return
      */
      */
     UserLoginVo getOperationUserByOperationId(Integer operationId);
     UserLoginVo getOperationUserByOperationId(Integer operationId);
 
 
     /**
     /**
      * 根据Id、组织Id 获取运营人员用户信息(关联user)
      * 根据Id、组织Id 获取运营人员用户信息(关联user)
+     *
      * @param operationId
      * @param operationId
      * @param organizeId
      * @param organizeId
      * @return
      * @return
      */
      */
-    UserLoginVo getOrganizeByOperationId(@Param("operationId") Integer operationId,@Param("organizeId") Integer organizeId);
+    UserLoginVo getOrganizeByOperationId(@Param("operationId") Integer operationId, @Param("organizeId") Integer organizeId);
+
     /**
     /**
      * 根据openId获取用户Id
      * 根据openId获取用户Id
+     *
      * @param openId
      * @param openId
      * @param source
      * @param source
      * @return
      * @return
      */
      */
     Integer getUserIdByOpenId(@Param("openId") String openId, @Param("source") String source);
     Integer getUserIdByOpenId(@Param("openId") String openId, @Param("source") String source);
+
     /**
     /**
      * 根据机构名称获取机构数量
      * 根据机构名称获取机构数量
      *
      *
@@ -169,18 +197,21 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 获取最大的用户Id
      * 获取最大的用户Id
+     *
      * @return
      * @return
      */
      */
     Integer getMaxClubId();
     Integer getMaxClubId();
 
 
     /**
     /**
      * 获取最大的机构Id
      * 获取最大的机构Id
+     *
      * @return
      * @return
      */
      */
     Integer getMaxUserId();
     Integer getMaxUserId();
 
 
     /**
     /**
      * 记录登录时间
      * 记录登录时间
+     *
      * @param userId
      * @param userId
      */
      */
     void updateLogin(Integer userId);
     void updateLogin(Integer userId);
@@ -198,10 +229,26 @@ public interface LoginMapper {
 
 
     /**
     /**
      * 关联用户和游客
      * 关联用户和游客
+     *
      * @param userId
      * @param userId
      * @param touristId
      * @param touristId
      */
      */
-    void updateTourist(@Param("userId") Integer userId,@Param("touristId") String touristId);
+    void updateTourist(@Param("userId") Integer userId, @Param("touristId") String touristId);
 
 
     String findTemPass(Integer userId);
     String findTemPass(Integer userId);
+
+    TicketPo findTicket(String ticket);
+
+    void updateTicket(@Param("userId") Integer userId, @Param("idCard") String idCard, @Param("ticket") String ticket,
+                      @Param("name") String name, @Param("mobile") String mobile, @Param("work") String work);
+
+    TicketPo findTicketUser(Integer userId);
+
+    String findShopSign(Integer userId);
+
+    void updateShopSign(@Param("userId") Integer userId, @Param("shopSign") String shopSign);
+
+    List<ShopSignPo> findShopSignPos(Integer userId);
+
+    ShopSignPo findShopDetail(@Param("shopId") Integer shopId, @Param("userId") Integer userId);
 }
 }

+ 13 - 0
src/main/java/com/caimei365/user/model/po/ShopSignPo.java

@@ -0,0 +1,13 @@
+package com.caimei365.user.model.po;
+
+import lombok.Data;
+
+@Data
+public class ShopSignPo {
+    private Integer id;
+    private String shopName;
+    private String shopLogo;
+    // 0未签到 1已签到
+    private Integer shopSign;
+    private String shopIds;
+}

+ 10 - 0
src/main/java/com/caimei365/user/model/po/TicketPo.java

@@ -0,0 +1,10 @@
+package com.caimei365.user.model.po;
+
+import lombok.Data;
+
+@Data
+public class TicketPo {
+    private Integer userId;
+    private String ticketId;
+    private String idCard;
+}

+ 73 - 54
src/main/java/com/caimei365/user/service/LoginService.java

@@ -5,6 +5,7 @@ import com.caimei365.user.model.dto.AuthBindDto;
 import com.caimei365.user.model.dto.LoginCodeDto;
 import com.caimei365.user.model.dto.LoginCodeDto;
 import com.caimei365.user.model.dto.LoginPasswordDto;
 import com.caimei365.user.model.dto.LoginPasswordDto;
 import com.caimei365.user.model.dto.ScanBindDto;
 import com.caimei365.user.model.dto.ScanBindDto;
+import com.caimei365.user.model.po.ShopSignPo;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
@@ -27,30 +28,30 @@ public interface LoginService {
      * 登录(用户名,密码)
      * 登录(用户名,密码)
      *
      *
      * @param loginPasswordDto {
      * @param loginPasswordDto {
-     *                           mobileOrEmail 手机号或邮箱
-     *                           password      密码
-     *                           unionId       微信unionId
+     *                         mobileOrEmail 手机号或邮箱
+     *                         password      密码
+     *                         unionId       微信unionId
      *                         }
      *                         }
      * @return BaseUser
      * @return BaseUser
      */
      */
     ResponseJson<UserLoginVo> passwordLogin(LoginPasswordDto loginPasswordDto) throws ParseException;
     ResponseJson<UserLoginVo> passwordLogin(LoginPasswordDto loginPasswordDto) throws ParseException;
+
     /**
     /**
      * 登录(用户名,密码)
      * 登录(用户名,密码)
      *
      *
      * @param loginPasswordDto {
      * @param loginPasswordDto {
-     *                           mobileOrEmail 手机号或邮箱
-     *                           password      密码
-     *                           unionId       微信unionId
+     *                         mobileOrEmail 手机号或邮箱
+     *                         password      密码
+     *                         unionId       微信unionId
      *                         }
      *                         }
      * @return BaseUser
      * @return BaseUser
      */
      */
     ResponseJson<UserLoginVo> passwordOrganizeLogin(LoginPasswordDto loginPasswordDto) throws ParseException;
     ResponseJson<UserLoginVo> passwordOrganizeLogin(LoginPasswordDto loginPasswordDto) throws ParseException;
 
 
     /**
     /**
-     *
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                          mobile   手机号
-     *                          code     短信验证码
+     *                     mobile   手机号
+     *                     code     短信验证码
      *                     }
      *                     }
      * @return
      * @return
      * @throws ParseException
      * @throws ParseException
@@ -58,15 +59,15 @@ public interface LoginService {
     ResponseJson<UserLoginVo> codeLogin(LoginCodeDto loginCodeDto) throws ParseException;
     ResponseJson<UserLoginVo> codeLogin(LoginCodeDto loginCodeDto) throws ParseException;
 
 
     /**
     /**
-     *
      * @param loginCodeDto {
      * @param loginCodeDto {
-     *                          mobile   手机号
-     *                          code     短信验证码
+     *                     mobile   手机号
+     *                     code     短信验证码
      *                     }
      *                     }
      * @return
      * @return
      * @throws ParseException
      * @throws ParseException
      */
      */
     ResponseJson<UserLoginVo> codeOrganizeLogin(LoginCodeDto loginCodeDto) throws ParseException;
     ResponseJson<UserLoginVo> codeOrganizeLogin(LoginCodeDto loginCodeDto) throws ParseException;
+
     /**
     /**
      * 微信授权登录(小程序)
      * 微信授权登录(小程序)
      *
      *
@@ -76,6 +77,7 @@ public interface LoginService {
      * @return BaseUser
      * @return BaseUser
      */
      */
     ResponseJson<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) throws ParseException;
     ResponseJson<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) throws ParseException;
+
     /**
     /**
      * 微信授权登录(小程序) 组织
      * 微信授权登录(小程序) 组织
      *
      *
@@ -86,28 +88,32 @@ public interface LoginService {
      */
      */
     ResponseJson<UserLoginVo> appletsOrganizeAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) throws ParseException;
     ResponseJson<UserLoginVo> appletsOrganizeAuthorization(String code, String encryptedData, String iv, HttpHeaders headers) throws ParseException;
 
 
-    ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId,Integer messageType,Integer source,Integer type, int pageNum, int pageSize);
-    ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
+    ResponseJson<PageInfo<MessageCenter>> SpMessageList(Integer commonId, Integer messageType, Integer source, Integer type, int pageNum, int pageSize);
+
+    ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize);
 
 
-    ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize);
+    ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize);
 
 
-    ResponseJson<PageInfo<MessageCenter>> messageList(Integer commonId,Integer messageType,Integer userType, int pageNum, int pageSize);
-    ResponseJson<Map<String, Object>> messageCount(Integer userType ,Integer commonId);
-    ResponseJson<Map<String, Object>> count(Integer userType,Integer messageType,Integer commonId);
+    ResponseJson<PageInfo<MessageCenter>> messageList(Integer commonId, Integer messageType, Integer userType, int pageNum, int pageSize);
 
 
-    ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType,Integer commonId);
+    ResponseJson<Map<String, Object>> messageCount(Integer userType, Integer commonId);
 
 
-    ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType,Integer commonId);
+    ResponseJson<Map<String, Object>> count(Integer userType, Integer messageType, Integer commonId);
 
 
-    ResponseJson<Map<String, Object>> SpCount(Integer messageType,Integer commonId);
+    ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType, Integer commonId);
 
 
-    ResponseJson<Map<String, Object>> ShopCount(Integer messageType,Integer commonId);
-    ResponseJson<Map<String, Object>> ClubCount(Integer messageType,Integer commonId);
+    ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType, Integer commonId);
 
 
-     Integer updateMessageAsRead(Integer userType,Integer messageType,Integer commonId);
+    ResponseJson<Map<String, Object>> SpCount(Integer messageType, Integer commonId);
 
 
+    ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId);
 
 
-     Integer updateRead(Integer userType,String Id);
+    ResponseJson<Map<String, Object>> ClubCount(Integer messageType, Integer commonId);
+
+    Integer updateMessageAsRead(Integer userType, Integer messageType, Integer commonId);
+
+
+    Integer updateRead(Integer userType, String Id);
 
 
     Integer deleteMessage(String id);
     Integer deleteMessage(String id);
 
 
@@ -121,7 +127,7 @@ public interface LoginService {
 
 
     /**
     /**
      * 微信公众号授权登录(www)
      * 微信公众号授权登录(www)
-     *
+     * <p>
      * spi旧接口:user/authorizationLogin
      * spi旧接口:user/authorizationLogin
      *
      *
      * @param code  微信code
      * @param code  微信code
@@ -140,15 +146,15 @@ public interface LoginService {
     /**
     /**
      * 微信用户扫码,微信服务器回调
      * 微信用户扫码,微信服务器回调
      *
      *
-     * @param code      微信code
-     * @param state     安全认证key(上一步获取参数时自定义生成的uuid)
+     * @param code  微信code
+     * @param state 安全认证key(上一步获取参数时自定义生成的uuid)
      */
      */
     void qrCodeAuthScan(String code, String state);
     void qrCodeAuthScan(String code, String state);
 
 
     /**
     /**
      * 校验扫码结果
      * 校验扫码结果
      *
      *
-     * @param state   安全认证key(第一步获取参数时自定义生成的uuid)
+     * @param state 安全认证key(第一步获取参数时自定义生成的uuid)
      * @return UserLoginVo
      * @return UserLoginVo
      */
      */
     ResponseJson<UserLoginVo> qrCodeAuthScanResult(String state) throws ParseException;
     ResponseJson<UserLoginVo> qrCodeAuthScanResult(String state) throws ParseException;
@@ -157,22 +163,22 @@ public interface LoginService {
      * 微信扫码后,绑定机构账号
      * 微信扫码后,绑定机构账号
      *
      *
      * @param scanBindDto {
      * @param scanBindDto {
-     *                           mobileOrEmail 手机号或邮箱
-     *                           password      密码
-     *                           mobile        手机号
-     *                           smsCode       手机验证码
-     *                           linkName      联系人
-     *                     }
+     *                    mobileOrEmail 手机号或邮箱
+     *                    password      密码
+     *                    mobile        手机号
+     *                    smsCode       手机验证码
+     *                    linkName      联系人
+     *                    }
      */
      */
     ResponseJson<UserLoginVo> qrCodeAuthScanBind(ScanBindDto scanBindDto);
     ResponseJson<UserLoginVo> qrCodeAuthScanBind(ScanBindDto scanBindDto);
 
 
     /**
     /**
      * 邀请码登录
      * 邀请码登录
      *
      *
-     * @param invitationCode    邀请码
-     * @param nickName          微信昵称
-     * @param avatarUrl         微信头像(headimgurl)
-     * @param unionId           微信unionId
+     * @param invitationCode 邀请码
+     * @param nickName       微信昵称
+     * @param avatarUrl      微信头像(headimgurl)
+     * @param unionId        微信unionId
      * @return UserLoginVo
      * @return UserLoginVo
      */
      */
     ResponseJson<UserLoginVo> invitationCodeLogin(String invitationCode, String nickName, String avatarUrl, String unionId);
     ResponseJson<UserLoginVo> invitationCodeLogin(String invitationCode, String nickName, String avatarUrl, String unionId);
@@ -180,50 +186,63 @@ public interface LoginService {
     /**
     /**
      * 邀请码登录
      * 邀请码登录
      *
      *
-     * @param invitationCode    邀请码
-     * @param nickName          微信昵称
-     * @param avatarUrl         微信头像(headimgurl)
-     * @param unionId           微信unionId
-     * @param organizeId        组织Id
+     * @param invitationCode 邀请码
+     * @param nickName       微信昵称
+     * @param avatarUrl      微信头像(headimgurl)
+     * @param unionId        微信unionId
+     * @param organizeId     组织Id
      * @return UserLoginVo
      * @return UserLoginVo
      */
      */
     ResponseJson<UserLoginVo> invitationCodeOrganizeLogin(String invitationCode, String nickName, String avatarUrl, String unionId, Integer organizeId);
     ResponseJson<UserLoginVo> invitationCodeOrganizeLogin(String invitationCode, String nickName, String avatarUrl, String unionId, Integer organizeId);
+
     /**
     /**
      * 运营人员绑定微信
      * 运营人员绑定微信
      *
      *
      * @param authBindDto {
      * @param authBindDto {
-     *                         userId    要绑定的用户Id(userID)
-     *                         mobile    手机号
-     *                         smsCode   手机验证码(verificationCode)
-     *                         unionId   微信unionId
-     *                         nickName       微信昵称
-     *                         avatarUrl      微信头像(headimgurl)
-     *                     }
+     *                    userId    要绑定的用户Id(userID)
+     *                    mobile    手机号
+     *                    smsCode   手机验证码(verificationCode)
+     *                    unionId   微信unionId
+     *                    nickName       微信昵称
+     *                    avatarUrl      微信头像(headimgurl)
+     *                    }
      * @return OperationPo
      * @return OperationPo
      */
      */
     ResponseJson<UserLoginVo> operationBindWeChat(AuthBindDto authBindDto);
     ResponseJson<UserLoginVo> operationBindWeChat(AuthBindDto authBindDto);
 
 
     /**
     /**
      * 绑定运营人员短信验证
      * 绑定运营人员短信验证
-     * @param loginCodeDto{
-     *                      mobile   手机号
+     *
+     * @param loginCodeDto{ mobile   手机号
      *                      code     短信验证码
      *                      code     短信验证码
-     *                     }
+     *                      }
      * @return
      * @return
      */
      */
     ResponseJson<String> operateVerification(LoginCodeDto loginCodeDto);
     ResponseJson<String> operateVerification(LoginCodeDto loginCodeDto);
+
     /**
     /**
      * 修改消息
      * 修改消息
+     *
      * @param messageCenter
      * @param messageCenter
      * @return
      * @return
      */
      */
     Integer updateMessageCenter(MessageCenter messageCenter);
     Integer updateMessageCenter(MessageCenter messageCenter);
+
     /**
     /**
      * 新增消息
      * 新增消息
+     *
      * @param messageCenter
      * @param messageCenter
      * @return
      * @return
      */
      */
     Integer insertMessageCenter(MessageCenter messageCenter);
     Integer insertMessageCenter(MessageCenter messageCenter);
 
 
     List<Integer> getMessageCenterListDay(Integer day);
     List<Integer> getMessageCenterListDay(Integer day);
+
+    ResponseJson ticketBind(String ticket, String idCard, Integer userId, String name, String mobile, String work);
+
+    ResponseJson ticketSign(Integer shopId, Integer userId);
+
+    ResponseJson<ShopSignPo> shopDetail(Integer shopId,Integer userId);
+
+    ResponseJson<List<ShopSignPo>> signList(Integer userId);
 }
 }

+ 60 - 0
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -9,7 +9,9 @@ import com.caimei365.user.mapper.*;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.po.OperationPo;
 import com.caimei365.user.model.po.OperationPo;
+import com.caimei365.user.model.po.ShopSignPo;
 import com.caimei365.user.model.po.SuperVipPo;
 import com.caimei365.user.model.po.SuperVipPo;
+import com.caimei365.user.model.po.TicketPo;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.MessageCenter;
 import com.caimei365.user.model.vo.OperationVo;
 import com.caimei365.user.model.vo.OperationVo;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.model.vo.UserLoginVo;
@@ -1640,6 +1642,64 @@ public class LoginServiceImpl implements LoginService {
         return messageCenterMapper.getMessageCenterListDay(day);
         return messageCenterMapper.getMessageCenterListDay(day);
     }
     }
 
 
+    @Override
+    public ResponseJson ticketBind(String ticket, String idCard, Integer userId, String name, String mobile, String work) {
+        TicketPo ticketPo = loginMapper.findTicket(ticket);
+        TicketPo ticketUser = loginMapper.findTicketUser(userId);
+        if (StringUtils.isBlank(ticketUser.getTicketId())) {
+            return ResponseJson.error(-3, "该用户已绑定门票!");
+        }
+        if (StringUtils.isBlank(ticketPo.getTicketId())) {
+            return ResponseJson.error(-2, "不存在该票根!");
+        }
+        if (null != ticketPo.getUserId()) {
+            return ResponseJson.error("票根已绑定!");
+        } else {
+            loginMapper.updateTicket(userId, idCard, ticket, name, mobile, work);
+            return ResponseJson.success("绑定成功!");
+        }
+    }
+
+    @Override
+    public ResponseJson ticketSign(Integer shopId, Integer userId) {
+        String shopSign = loginMapper.findShopSign(userId);
+        if (StringUtils.isBlank(shopSign)) {
+            shopSign = shopId.toString();
+        } else {
+            if (shopSign.contains(shopId.toString())) {
+                return ResponseJson.error("已签到过!");
+            }
+            shopSign = shopSign + "," + shopId;
+        }
+        // 签到
+        loginMapper.updateShopSign(userId, shopSign);
+        return ResponseJson.success("签到成功!");
+    }
+
+    @Override
+    public ResponseJson<ShopSignPo> shopDetail(Integer shopId, Integer userId) {
+        ShopSignPo shop = loginMapper.findShopDetail(shopId, userId);
+        int sign = 0;
+        if (StringUtils.isNotBlank(shop.getShopIds())) {
+            sign = shop.getShopIds().contains(shop.getId().toString()) ? 1 : 0;
+        }
+        shop.setShopSign(sign);
+        return ResponseJson.success(shop);
+    }
+
+    @Override
+    public ResponseJson<List<ShopSignPo>> signList(Integer userId) {
+        List<ShopSignPo> shopSignPos = loginMapper.findShopSignPos(userId);
+        shopSignPos.forEach(s -> {
+            int sign = 0;
+            if (StringUtils.isNotBlank(s.getShopIds())) {
+                sign = s.getShopIds().contains(s.getId().toString()) ? 1 : 0;
+            }
+            s.setShopSign(sign);
+        });
+        return ResponseJson.success(shopSignPos);
+    }
+
     /**
     /**
      * 根据userId查是否过期,返回dto对象,flag=0未买过,-1过期,1有效,endTime过期时间
      * 根据userId查是否过期,返回dto对象,flag=0未买过,-1过期,1有效,endTime过期时间
      */
      */

+ 209 - 156
src/main/resources/mapper/LoginMapper.xml

@@ -2,160 +2,165 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.LoginMapper">
 <mapper namespace="com.caimei365.user.mapper.LoginMapper">
     <select id="getLoginUserByUserId" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getLoginUserByUserId" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        select u.userID             as userId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.serviceProviderId  as serviceProviderId,
-               u.userName           as userName,
-               u.name               as name,
-               u.mobile             as mobile,
-               u.bindMobile         as bindMobile,
-               u.email              as email,
-               u.userIdentity       as userIdentity,
-               u.password           as password,
-               u.guideFlag          as guideFlag,
-               (select status from club where userId = u.userId limit 1)          as clubStatus,
-               u.manufacturerStatus as shopStatus
+        select u.userID                                                  as userId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.serviceProviderId                                       as serviceProviderId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               u.mobile                                                  as mobile,
+               u.bindMobile                                              as bindMobile,
+               u.email                                                   as email,
+               u.userIdentity                                            as userIdentity,
+               u.password                                                as password,
+               u.guideFlag                                               as guideFlag,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
+               u.manufacturerStatus                                      as shopStatus
         from user u
         from user u
         where u.userID = #{userId}
         where u.userID = #{userId}
         limit 1
         limit 1
     </select>
     </select>
     <select id="getLoginUserByMobileOrEmail" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getLoginUserByMobileOrEmail" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        select u.userID             as userId,
-               u.userOrganizeID     as organizeId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.serviceProviderId  as serviceProviderId,
-               u.userName           as userName,
-               u.name               as name,
-               u.mobile             as mobile,
-               u.bindMobile         as bindMobile,
-               u.email              as email,
-               u.userIdentity       as userIdentity,
-               u.password           as password,
-               u.guideFlag          as guideFlag,
-               (select status from club where userId = u.userId limit 1)  as clubStatus,
-               u.manufacturerStatus as shopStatus,
-               u.partnerId          as partnerId,
-               cu.id                as operationId,
-               cu.status            as operationStatus,
-               cu.mobile            as operationMobile
+        select u.userID                                                  as userId,
+               u.userOrganizeID                                          as organizeId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.serviceProviderId                                       as serviceProviderId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               u.mobile                                                  as mobile,
+               u.bindMobile                                              as bindMobile,
+               u.email                                                   as email,
+               u.userIdentity                                            as userIdentity,
+               u.password                                                as password,
+               u.guideFlag                                               as guideFlag,
+               (select status from club where userId = u.userId limit 1) as clubStatus,
+               u.manufacturerStatus                                      as shopStatus,
+               u.partnerId                                               as partnerId,
+               cu.id                                                     as operationId,
+               cu.status                                                 as operationStatus,
+               cu.mobile                                                 as operationMobile
         from user u
         from user u
-        left join cm_mall_operation_user cu on cu.userID = u.userID
+                 left join cm_mall_operation_user cu on cu.userID = u.userID
         where (u.bindMobile = #{mobileOrEmail} or u.email = #{mobileOrEmail})
         where (u.bindMobile = #{mobileOrEmail} or u.email = #{mobileOrEmail})
-            and IF (u.userIdentity = 3, u.manufacturerStatus = 90, 1=1)
-            and u.userIdentity in (1, 2, 3, 4)
-            and u.userOrganizeID = 0
+          and IF(u.userIdentity = 3, u.manufacturerStatus = 90, 1 = 1)
+          and u.userIdentity in (1, 2, 3, 4)
+          and u.userOrganizeID = 0
         union
         union
-        SELECT u.userID             AS userId,
-               u.userOrganizeID     as organizeId,
-               u.clubID             AS clubId,
-               u.shopID             AS shopId,
-               u.serviceProviderId  AS serviceProviderId,
-               u.userName           AS userName,
-               u.name               AS NAME,
-               u.mobile             AS mobile,
-               u.bindMobile         AS bindMobile,
-               u.email              AS email,
-               u.userIdentity       AS userIdentity,
-               u.password           AS PASSWORD,
-               u.guideFlag          AS guideFlag,
-               u.partnerId          as partnerId,
+        SELECT u.userID                                                  AS userId,
+               u.userOrganizeID                                          as organizeId,
+               u.clubID                                                  AS clubId,
+               u.shopID                                                  AS shopId,
+               u.serviceProviderId                                       AS serviceProviderId,
+               u.userName                                                AS userName,
+               u.name                                                    AS NAME,
+               u.mobile                                                  AS mobile,
+               u.bindMobile                                              AS bindMobile,
+               u.email                                                   AS email,
+               u.userIdentity                                            AS userIdentity,
+               u.password                                                AS PASSWORD,
+               u.guideFlag                                               AS guideFlag,
+               u.partnerId                                               as partnerId,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
-               u.manufacturerStatus AS shopStatus,
-               cu.id                AS operationId,
-               cu.status            AS operationStatus,
-               cu.mobile            AS operationMobile
+               u.manufacturerStatus                                      AS shopStatus,
+               cu.id                                                     AS operationId,
+               cu.status                                                 AS operationStatus,
+               cu.mobile                                                 AS operationMobile
         FROM USER u
         FROM USER u
-        LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
-        WHERE
-            cu.mobile = #{mobileOrEmail}
-          and IF (u.userIdentity = 3, u.manufacturerStatus = 90, 1=1)
+                 LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
+        WHERE cu.mobile = #{mobileOrEmail}
+          and IF(u.userIdentity = 3, u.manufacturerStatus = 90, 1 = 1)
           and cu.delFlag != 1
           and cu.delFlag != 1
           AND u.userIdentity IN (1, 2, 3, 4)
           AND u.userIdentity IN (1, 2, 3, 4)
           AND u.userOrganizeID = 0
           AND u.userOrganizeID = 0
         limit 1
         limit 1
     </select>
     </select>
     <select id="getLoginOrganizeUserByMobileOrEmail" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getLoginOrganizeUserByMobileOrEmail" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        select u.userID             as userId,
-               u.userOrganizeID     as organizeId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.serviceProviderId  as serviceProviderId,
-               u.userName           as userName,
-               u.name               as name,
-               (SELECT linkMan FROM club WHERE userId = u.userID) as clubLinkMan,
-               u.mobile             as mobile,
-               u.bindMobile         as bindMobile,
-               u.email              as email,
-               u.userIdentity       as userIdentity,
-               u.password           as password,
-               u.guideFlag          as guideFlag,
+        select u.userID                                                  as userId,
+               u.userOrganizeID                                          as organizeId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.serviceProviderId                                       as serviceProviderId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               (SELECT linkMan FROM club WHERE userId = u.userID)        as clubLinkMan,
+               u.mobile                                                  as mobile,
+               u.bindMobile                                              as bindMobile,
+               u.email                                                   as email,
+               u.userIdentity                                            as userIdentity,
+               u.password                                                as password,
+               u.guideFlag                                               as guideFlag,
                (select status from club where userId = u.userId limit 1) as clubStatus,
                (select status from club where userId = u.userId limit 1) as clubStatus,
-               u.manufacturerStatus as shopStatus,
-               u.serviceProviderStatus as serviceStatus,
-               cu.id                as operationId,
-               cu.status            as operationStatus,
-               cu.mobile            as operationMobile
+               u.manufacturerStatus                                      as shopStatus,
+               u.serviceProviderStatus                                   as serviceStatus,
+               cu.id                                                     as operationId,
+               cu.status                                                 as operationStatus,
+               cu.mobile                                                 as operationMobile
         from user u
         from user u
                  left join cm_mall_operation_user cu on cu.userID = u.userID
                  left join cm_mall_operation_user cu on cu.userID = u.userID
         where (u.bindMobile = #{mobileOrEmail} or u.email = #{mobileOrEmail})
         where (u.bindMobile = #{mobileOrEmail} or u.email = #{mobileOrEmail})
           and u.userIdentity in (1, 2, 3, 4)
           and u.userIdentity in (1, 2, 3, 4)
           and u.userOrganizeID = 4
           and u.userOrganizeID = 4
         union
         union
-        SELECT u.userID             AS userId,
-               u.userOrganizeID     as organizeId,
-               u.clubID             AS clubId,
-               u.shopID             AS shopId,
-               u.serviceProviderId  AS serviceProviderId,
-               u.userName           AS userName,
-               u.name               AS NAME,
-               ( SELECT linkMan FROM club WHERE userId = u.userID) as clubLinkMan,
-               u.mobile             AS mobile,
-               u.bindMobile         AS bindMobile,
-               u.email              AS email,
-               u.userIdentity       AS userIdentity,
-               u.password           AS PASSWORD,
-               u.guideFlag          AS guideFlag,
+        SELECT u.userID                                                  AS userId,
+               u.userOrganizeID                                          as organizeId,
+               u.clubID                                                  AS clubId,
+               u.shopID                                                  AS shopId,
+               u.serviceProviderId                                       AS serviceProviderId,
+               u.userName                                                AS userName,
+               u.name                                                    AS NAME,
+               (SELECT linkMan FROM club WHERE userId = u.userID)        as clubLinkMan,
+               u.mobile                                                  AS mobile,
+               u.bindMobile                                              AS bindMobile,
+               u.email                                                   AS email,
+               u.userIdentity                                            AS userIdentity,
+               u.password                                                AS PASSWORD,
+               u.guideFlag                                               AS guideFlag,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
-               u.manufacturerStatus AS shopStatus,
-               u.serviceProviderStatus as serviceStatus,
-               cu.id                AS operationId,
-               cu.status            AS operationStatus,
-               cu.mobile            AS operationMobile
+               u.manufacturerStatus                                      AS shopStatus,
+               u.serviceProviderStatus                                   as serviceStatus,
+               cu.id                                                     AS operationId,
+               cu.status                                                 AS operationStatus,
+               cu.mobile                                                 AS operationMobile
         FROM USER u
         FROM USER u
                  LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
                  LEFT JOIN cm_mall_operation_user cu ON cu.userID = u.userID
-        WHERE
-            cu.mobile = #{mobileOrEmail}
+        WHERE cu.mobile = #{mobileOrEmail}
           and cu.delFlag != 1
           and cu.delFlag != 1
           AND u.userIdentity IN (1, 2, 3, 4)
           AND u.userIdentity IN (1, 2, 3, 4)
           AND u.userOrganizeID = 4
           AND u.userOrganizeID = 4
         limit 1
         limit 1
     </select>
     </select>
     <select id="getOperationUser" resultType="java.lang.Integer">
     <select id="getOperationUser" resultType="java.lang.Integer">
-        select id from cm_mall_operation_user where mobile = #{mobileOrEmail} and delFlag = 0 and userOrganizeID = 4 limit 1
+        select id
+        from cm_mall_operation_user
+        where mobile = #{mobileOrEmail}
+          and delFlag = 0
+          and userOrganizeID = 4
+        limit 1
     </select>
     </select>
     <insert id="insertOperation">
     <insert id="insertOperation">
-        INSERT INTO cm_mall_operation_user (userOrganizeID, userType, userID, clubID, mobile, linkName, STATUS, unionId, bindTime, addTime, delFlag)
-        values(#{organizeId}, #{userType}, #{userId}, #{clubId}, #{mobile}, #{linkName}, #{status}, #{unionId}, #{bindTime}, #{addTime}, #{delFlag})
+        INSERT INTO cm_mall_operation_user (userOrganizeID, userType, userID, clubID, mobile, linkName, STATUS, unionId,
+                                            bindTime, addTime, delFlag)
+        values (#{organizeId}, #{userType}, #{userId}, #{clubId}, #{mobile}, #{linkName}, #{status}, #{unionId},
+                #{bindTime}, #{addTime}, #{delFlag})
     </insert>
     </insert>
     <select id="getLoginUserByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getLoginUserByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        select u.userID             as userId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.serviceProviderId  as serviceProviderId,
-               u.userName           as userName,
-               u.name               as name,
-               u.mobile             as mobile,
-               u.bindMobile         as bindMobile,
-               u.email              as email,
-               u.userIdentity       as userIdentity,
-               u.password           as password,
-               u.guideFlag          as guideFlag,
-               u.manufacturerStatus as shopStatus,
-               cu.id                as operationId,
+        select u.userID                                                  as userId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.serviceProviderId                                       as serviceProviderId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               u.mobile                                                  as mobile,
+               u.bindMobile                                              as bindMobile,
+               u.email                                                   as email,
+               u.userIdentity                                            as userIdentity,
+               u.password                                                as password,
+               u.guideFlag                                               as guideFlag,
+               u.manufacturerStatus                                      as shopStatus,
+               cu.id                                                     as operationId,
                (select status from club where userId = u.userId limit 1) as clubStatus,
                (select status from club where userId = u.userId limit 1) as clubStatus,
-               cu.mobile            as operationMobile
+               cu.mobile                                                 as operationMobile
         from user u
         from user u
                  left join cm_mall_operation_user cu on cu.userID = u.userID
                  left join cm_mall_operation_user cu on cu.userID = u.userID
         where (u.bindMobile = #{mobile} or (cu.mobile = #{mobile} and cu.delFlag != 1))
         where (u.bindMobile = #{mobile} or (cu.mobile = #{mobile} and cu.delFlag != 1))
@@ -184,7 +189,7 @@
     </select>
     </select>
     <update id="updateUserInfo">
     <update id="updateUserInfo">
         update user
         update user
-        set openId = #{openId},
+        set openId  = #{openId},
             unionId = #{unionId}
             unionId = #{unionId}
         where userId = #{userId}
         where userId = #{userId}
     </update>
     </update>
@@ -336,7 +341,7 @@
             o.openid = #{openId}
             o.openid = #{openId}
         </if>
         </if>
         and o.delFlag = '0')
         and o.delFlag = '0')
-        and (u.userIdentity in (1,2,3,4)  and u.userOrganizeID != 0)
+        and (u.userIdentity in (1,2,3,4) and u.userOrganizeID != 0)
         limit 1
         limit 1
     </select>
     </select>
     <update id="updateServiceProviderUnionId">
     <update id="updateServiceProviderUnionId">
@@ -354,7 +359,8 @@
         select p.groundMall AS groundMall
         select p.groundMall AS groundMall
         from product p
         from product p
                  left join cm_organize_product_info copi on copi.productId = p.productID
                  left join cm_organize_product_info copi on copi.productId = p.productID
-        where p.shopId = #{shopId} and copi.validFlag = 2
+        where p.shopId = #{shopId}
+          and copi.validFlag = 2
     </select>
     </select>
 
 
     <select id="getUserIdByOpenId" resultType="java.lang.Integer">
     <select id="getUserIdByOpenId" resultType="java.lang.Integer">
@@ -373,20 +379,20 @@
         limit 1
         limit 1
     </select>
     </select>
     <select id="getOperationUserByInvitationCode" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getOperationUserByInvitationCode" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        SELECT cou.id               as operationId,
-               u.userID             as userId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.userName           as userName,
-               u.name               as name,
-               ifnull(cou.userOrganizeID, 0) as organizeId,
+        SELECT cou.id                                                    as operationId,
+               u.userID                                                  as userId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               ifnull(cou.userOrganizeID, 0)                             as organizeId,
                u.userIdentity,
                u.userIdentity,
-               u.guideFlag          as guideFlag,
+               u.guideFlag                                               as guideFlag,
                (select status from club where userId = u.userId limit 1) as clubStatus,
                (select status from club where userId = u.userId limit 1) as clubStatus,
-               u.manufacturerStatus as shopStatus,
+               u.manufacturerStatus                                      as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
-               cou.mobile           as operationMobile,
-               cou.status           as operationStatus,
+               cou.mobile                                                as operationMobile,
+               cou.status                                                as operationStatus,
                cou.delFlag
                cou.delFlag
         FROM cm_mall_operation_user cou
         FROM cm_mall_operation_user cou
                  LEFT JOIN user u ON u.userID = cou.userID
                  LEFT JOIN user u ON u.userID = cou.userID
@@ -395,20 +401,20 @@
           AND u.userIdentity in (2, 3, 4)
           AND u.userIdentity in (2, 3, 4)
     </select>
     </select>
     <select id="getOperationOrganizeUserByInvitationCode" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getOperationOrganizeUserByInvitationCode" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        SELECT cou.id               as operationId,
-               u.userID             as userId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.userName           as userName,
-               u.name               as name,
-               ifnull(cou.userOrganizeID, 0) as organizeId,
+        SELECT cou.id                                                    as operationId,
+               u.userID                                                  as userId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
+               ifnull(cou.userOrganizeID, 0)                             as organizeId,
                u.userIdentity,
                u.userIdentity,
-               u.guideFlag          as guideFlag,
+               u.guideFlag                                               as guideFlag,
                (select status from club where userId = u.userId limit 1) as clubStatus,
                (select status from club where userId = u.userId limit 1) as clubStatus,
-               u.manufacturerStatus as shopStatus,
+               u.manufacturerStatus                                      as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
-               cou.mobile           as operationMobile,
-               cou.status           as operationStatus,
+               cou.mobile                                                as operationMobile,
+               cou.status                                                as operationStatus,
                cou.delFlag
                cou.delFlag
         FROM cm_mall_operation_user cou
         FROM cm_mall_operation_user cou
                  LEFT JOIN user u ON u.userID = cou.userID
                  LEFT JOIN user u ON u.userID = cou.userID
@@ -417,19 +423,19 @@
           AND u.userIdentity in (2, 3, 4)
           AND u.userIdentity in (2, 3, 4)
     </select>
     </select>
     <select id="getOperationUserByOperationId" resultType="com.caimei365.user.model.vo.UserLoginVo">
     <select id="getOperationUserByOperationId" resultType="com.caimei365.user.model.vo.UserLoginVo">
-        SELECT cou.id               as operationId,
-               u.userID             as userId,
-               u.clubID             as clubId,
-               u.shopID             as shopId,
-               u.userName           as userName,
-               u.name               as name,
+        SELECT cou.id                                                    as operationId,
+               u.userID                                                  as userId,
+               u.clubID                                                  as clubId,
+               u.shopID                                                  as shopId,
+               u.userName                                                as userName,
+               u.name                                                    as name,
                u.userIdentity,
                u.userIdentity,
-               u.guideFlag          as guideFlag,
+               u.guideFlag                                               as guideFlag,
                (select status from club where userId = u.userId limit 1) as clubStatus,
                (select status from club where userId = u.userId limit 1) as clubStatus,
-               u.manufacturerStatus as shopStatus,
+               u.manufacturerStatus                                      as shopStatus,
                cou.invitationCodeTime,
                cou.invitationCodeTime,
-               cou.mobile           as operationMobile,
-               cou.status           as operationStatus,
+               cou.mobile                                                as operationMobile,
+               cou.status                                                as operationStatus,
                cou.delFlag
                cou.delFlag
         FROM cm_mall_operation_user cou
         FROM cm_mall_operation_user cou
                  LEFT JOIN user u ON u.userID = cou.userID
                  LEFT JOIN user u ON u.userID = cou.userID
@@ -479,9 +485,10 @@
         limit 1
         limit 1
     </select>
     </select>
     <select id="getClubSpUserId" resultType="java.lang.Integer">
     <select id="getClubSpUserId" resultType="java.lang.Integer">
-        SELECT s.userID from  serviceprovider s
-        left join club c on c.spId=s.serviceProviderID
-        WHERE  c.clubId = #{clubId}
+        SELECT s.userID
+        from serviceprovider s
+                 left join club c on c.spId = s.serviceProviderID
+        WHERE c.clubId = #{clubId}
         limit 1
         limit 1
     </select>
     </select>
 
 
@@ -491,10 +498,56 @@
         where touristId = #{touristId}
         where touristId = #{touristId}
     </update>
     </update>
 
 
-    <select id = "findTemPass" resultType="java.lang.String">
+    <select id="findTemPass" resultType="java.lang.String">
         select password
         select password
         from cm_temporary_user
         from cm_temporary_user
         where addtime >= NOW() - INTERVAL 10 MINUTE
         where addtime >= NOW() - INTERVAL 10 MINUTE
           and userId = #{userId}
           and userId = #{userId}
     </select>
     </select>
+
+    <select id="findTicket" resultType="com.caimei365.user.model.po.TicketPo">
+        select userId, ticketId, idCard
+        from cm_zyl_ticket
+        where ticketId = #{ticket}
+    </select>
+
+    <update id="updateTicket">
+        update cm_zyl_ticket
+        set userId = #{userId},
+            idCard = #{idCard},
+            name = #{name},
+            mobile = #{mobile},
+            work = #{work},
+            bindTime = now()
+        where ticketId = #{ticket}
+    </update>
+
+    <select id="findTicketUser" resultType="com.caimei365.user.model.po.TicketPo">
+        select userId, ticketId, idCard
+        from cm_zyl_ticket
+        where userId = #{userId}
+    </select>
+
+    <select id="findShopSign" resultType="java.lang.String">
+        select shopIds
+        from cm_zyl_ticket
+        where userId = #{userId}
+    </select>
+
+    <update id="updateShopSign">
+        update cm_zyl_ticket
+        set shopIds = #{shopSign}
+        where userId = #{userId}
+    </update>
+
+    <select id="findShopSignPos" resultType="com.caimei365.user.model.po.ShopSignPo">
+        SELECT id,shopName,shopLogo,(SELECT shopIds FROM cm_zyl_ticket where userId = #{userId}) as shopIds
+        FROM cm_zyl_shop
+    </select>
+
+    <select id="findShopDetail" resultType="com.caimei365.user.model.po.ShopSignPo">
+        SELECT id,shopName,shopLogo,(SELECT shopIds FROM cm_zyl_ticket where userId = #{userId}) as shopIds
+        FROM cm_zyl_shop
+        where id = #{shopId}
+    </select>
 </mapper>
 </mapper>