| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("确认顾客å°åº") |
| | | @PostMapping("/confirmArrived") |
| | | @RequiresPermissions("business:orders:update") |
| | | public ApiResponse confirmArrived(@RequestBody ConfirmArriveDTO dto) { |
| | | ordersService.confirmCustomerArrived(dto.getOrderId(), dto.getShopId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æå¨è§¦å订åç»ç®") |
| | | @PostMapping("/settle") |
| | | @RequiresPermissions("business:orders:update") |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: pro |
| | | # JSONè¿åé
ç½® |
| | | jackson: |
| | | # é»è®¤æ¶åº |
| | |
| | | |
| | | // ç»çº¬åº¦æ°´å°å¤ç |
| | | InputStream uploadStream = is; |
| | | if (latitude != null && longitude != null) { |
| | | if (latitude != null && longitude != null && latitude > 0 && longitude > 0) { |
| | | try { |
| | | JSONObject geoResult = MapUtil.reverseGeocode(latitude, longitude); |
| | | String address = geoResult != null ? geoResult.getString("formatted_addresses") : ""; |
| | |
| | | |
| | | public static final String HEADER_KEY = "token"; |
| | | |
| | | public static final String SHOP_HEADER_KEY = "shopToken"; |
| | | |
| | | |
| | | |
| | | public static final String MEMBER_ID = "MEMBER_ID"; |
| | | |
| | | public static final String SHOP_ID = "SHOP_ID"; |
| | |
| | | } |
| | | }else if (beanType.isAnnotationPresent(LoginShopRequired.class)) { |
| | | //è·åtoken |
| | | String token = request.getHeader(JwtTokenUtil.HEADER_KEY); // ä» http 请æ±å¤´ä¸ååº token |
| | | String token = request.getHeader(JwtTokenUtil.SHOP_HEADER_KEY); // ä» http 请æ±å¤´ä¸ååº token |
| | | if (StringUtils.isNotBlank(token)) { |
| | | checkShopLogin(request,response); |
| | | checkShopLogin(token,request,response); |
| | | } else { |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE.getCode(),"æªç»å½"); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE.getCode(),"æªç»å½"); |
| | | } |
| | | }else if (handlerMethod.hasMethodAnnotation(LoginShopRequired.class)){ |
| | | //è·åtoken |
| | | String token = request.getHeader(JwtTokenUtil.HEADER_KEY); // ä» http 请æ±å¤´ä¸ååº token |
| | | String token = request.getHeader(JwtTokenUtil.SHOP_HEADER_KEY); // ä» http 请æ±å¤´ä¸ååº token |
| | | if (StringUtils.isNotBlank(token)) { |
| | | checkShopLogin(request,response); |
| | | checkShopLogin(token,request,response); |
| | | } else { |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE.getCode(),"æªç»å½"); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE.getCode(),"æªç»å½"); |
| | | } |
| | | }else if (beanType.isAnnotationPresent(LoginDriverRequired.class)) { |
| | | //è·åtoken |
| | |
| | | } |
| | | |
| | | |
| | | public Boolean checkShopLogin(HttpServletRequest request, HttpServletResponse response){ |
| | | String token = request.getHeader(JwtTokenUtil.HEADER_KEY); |
| | | public Boolean checkShopLogin(String token,HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | if(!token.startsWith(Constants.TWO+"")){ |
| | | throw new BusinessException(ResponseStatus.TOKEN_EXCEED_TIME); |
| | | throw new BusinessException(ResponseStatus.SHOP_TOKEN_EXCEED_TIME); |
| | | } |
| | | String tokenRedis = (String) redisTemplate.opsForValue().get(Constants.REDIS_TOKEN_KEY+token); |
| | | if(StringUtils.isBlank(tokenRedis)){ |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE); |
| | | } |
| | | ShopInfo shop = JSONObject.parseObject(tokenRedis, ShopInfo.class); |
| | | if(Objects.isNull(shop)){ |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE); |
| | | } |
| | | String openid = shop.getOpenid(); |
| | | Integer shopId = getTokenId(token); |
| | |
| | | } |
| | | String dbOpenid = dao.queryForObject(" select ifnull(openid,'') from shop_info where id = ?", String.class, shopId); |
| | | if(StringUtils.isBlank(dbOpenid)||!openid.equals(dbOpenid)){ |
| | | throw new BusinessException(ResponseStatus.TOKEN_EXCEED_TIME); |
| | | throw new BusinessException(ResponseStatus.SHOP_TOKEN_EXCEED_TIME); |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from shop_info where id = ?", Integer.class, shopId); |
| | | if (count != null && count > 0) { |
| | | request.setAttribute(JwtTokenUtil.SHOP_ID, shop.getId()); |
| | | return true; |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE.getCode(),"ç¨æ·ä¿¡æ¯åºé"); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE.getCode(),"ç¨æ·ä¿¡æ¯åºé"); |
| | | } |
| | | } catch (IllegalArgumentException | JwtException e) { |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE); |
| | | throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE); |
| | | } |
| | | } |
| | | |
| | |
| | | public static final String USER_AGREEMENT ="USER_AGREEMENT" ; |
| | | public static final String PRIVACY_AGREEMENT ="PRIVACY_AGREEMENT" ; |
| | | |
| | | public static final String STORE_RISK_COMMITMENT = "STORE_RISK_COMMITMENT"; |
| | | public static final String STORE_COOPERATION_AGREEMENT = "STORE_COOPERATION_AGREEMENT"; |
| | | public static final String STORE_LUGGAGE_STORAGE_NOTICE = "STORE_LUGGAGE_STORAGE_NOTICE"; |
| | | public static final String STORE_PRIVACY_POLICY = "STORE_PRIVACY_POLICY"; |
| | | public static final String OWNER_LUGGAGE_STORAGE_NOTICE = "OWNER_LUGGAGE_STORAGE_NOTICE"; |
| | | public static final String OWNER_SERVICE_AGREEMENT = "OWNER_SERVICE_AGREEMENT"; |
| | | public static final String OWNER_RISK_COMMITMENT = "OWNER_RISK_COMMITMENT"; |
| | | public static final String ERRAND_RISK_COMMITMENT = "ERRAND_RISK_COMMITMENT"; |
| | | public static final String ERRAND_SERVICE_AGREEMENT = "ERRAND_SERVICE_AGREEMENT"; |
| | | public static final String ERRAND_LUGGAGE_STORAGE_NOTICE = "ERRAND_LUGGAGE_STORAGE_NOTICE"; |
| | | public static final String USER_SERVICE_AGREEMENT = "USER_SERVICE_AGREEMENT"; |
| | | public static final String USER_PRIVACY_POLICY = "USER_PRIVACY_POLICY"; |
| | | public static final String DRIVER_PRIVACY_POLICY = "DRIVER_PRIVACY_POLICY"; |
| | | public static final String PRICE_DESCRIPTION = "PRICE_DESCRIPTION"; |
| | | public static final String PROHIBITED_ITEMS = "PROHIBITED_ITEMS"; |
| | | |
| | | public static final String ACCESS_ID="ACCESS_ID"; |
| | | public static final String BUCKETNAME = "BUCKETNAME"; |
| | | |
| | |
| | | public static final Integer FOUR = 4; |
| | | public static final Integer SIX = 6; |
| | | public static final Integer FIVE = 5; |
| | | public static final Integer SEVEN = 7; |
| | | public static final String INENTITY_FILES = "INENTITY_FILES"; |
| | | public static final String MEMBER_FILES = "MEMBER_FILES"; |
| | | public static final String CATEGORY_FILES = "CATEGORY_FILES"; |
| | |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | return "å¾
åä»¶"; |
| | | }else{ |
| | | return Constants.equalsInteger(type,Constants.ONE)?"å·²å°åº":"å·²éè¾¾"; |
| | | return "å·²éè¾¾"; |
| | | } |
| | | } |
| | | return c.getValue(); |
| | |
| | | waitDeliver(2, "å¾
é
é", new int[]{OrderStatus.accepted.status}), |
| | | waitReceive(3, "å¾
æ¶è´§", new int[]{ OrderStatus.delivering.status, OrderStatus.arrived.status}), |
| | | finished(4, "已宿", new int[]{OrderStatus.finished.status}), |
| | | refund(5, "鿬¾", new int[]{OrderStatus.cancelled.status}), |
| | | refund(5, "åæ¶", new int[]{OrderStatus.cancelled.status}), |
| | | home(6, "é¦é¡µæ¥è¯¢", new int[]{OrderStatus.waitPay.status, OrderStatus.waitDeposit.status, OrderStatus.deposited.status |
| | | , OrderStatus.accepted.status, OrderStatus.delivering.status, OrderStatus.arrived.status}) |
| | | , OrderStatus.accepted.status, OrderStatus.delivering.status, OrderStatus.arrived.status}), |
| | | shopHome(7, "é¨åºé¦é¡µæ¥è¯¢", new int[]{OrderStatus.waitDeposit.status, OrderStatus.deposited.status |
| | | , OrderStatus.delivering.status, OrderStatus.arrived.status}) |
| | | ; |
| | | private final int key; |
| | | private final String desc; |
| | |
| | | NOT_ALLOWED(5110, "ä¸å
许çæä½"), |
| | | BE_OVERDUE(5112, "æªç»å½"), |
| | | TOKEN_EXCEED_TIME(5113, "对ä¸èµ·ï¼ç»å½å·²å¤±æï¼"), |
| | | |
| | | SHOP_BE_OVERDUE(51121, "æªç»å½"), |
| | | SHOP_TOKEN_EXCEED_TIME(51131, "对ä¸èµ·ï¼ç»å½å·²å¤±æï¼"), |
| | | ; |
| | | |
| | | private int code; |
| | |
| | | return connectionHttp(url, "POST", data, "application/json"); |
| | | } |
| | | } |
| | | public static String postJson(String url, String data, String authorization) { |
| | | if(url.startsWith("https://")){ |
| | | return connection(url, "POST", data, "application/json", true, authorization); |
| | | }else{ |
| | | return connectionHttp(url, "POST", data, "application/json", authorization); |
| | | } |
| | | } |
| | | public static String uploadTempMedia(String urlString ,String fileUrl){ |
| | | HttpsURLConnection conn= null; |
| | | try { |
| | |
| | | |
| | | } |
| | | public static String connection(String url,String method,String data,String contentType,boolean ignoreSSL){ |
| | | return connection(url, method, data, contentType, ignoreSSL, null); |
| | | } |
| | | public static String connection(String url,String method,String data,String contentType,boolean ignoreSSL, String authorization){ |
| | | HttpsURLConnection connection = null; |
| | | try { |
| | | URL _url = new URL(url); |
| | |
| | | connection.setUseCaches(false); |
| | | if(contentType != null){ |
| | | connection.setRequestProperty("Content-Type", contentType); |
| | | } |
| | | if(authorization != null){ |
| | | connection.setRequestProperty("Authorization", authorization); |
| | | } |
| | | |
| | | if(ignoreSSL){ |
| | |
| | | return null; |
| | | } |
| | | public static String connectionHttp(String url,String method,String data,String contentType ){ |
| | | return connectionHttp(url, method, data, contentType, null); |
| | | } |
| | | public static String connectionHttp(String url,String method,String data,String contentType, String authorization ){ |
| | | HttpURLConnection connection = null; |
| | | try { |
| | | URL _url = new URL(url); |
| | |
| | | if(contentType != null){ |
| | | connection.setRequestProperty("Content-Type", contentType); |
| | | } |
| | | if(authorization != null){ |
| | | connection.setRequestProperty("Authorization", authorization); |
| | | } |
| | | |
| | | connection.connect(); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.utils.jpush; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Base64; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æå
æ¨éå·¥å
·ç±»ï¼åºäºJPush REST APIï¼ |
| | | * |
| | | * @author rk |
| | | * @date 2026/04/24 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class JPushUtil { |
| | | |
| | | private static final String PUSH_URL = "https://bjapi.push.jiguang.cn/v3/push"; |
| | | |
| | | private static String authHeader; |
| | | private static boolean apnsProduction; |
| | | |
| | | @Value("${jpush.appKey:}") |
| | | private String appKey; |
| | | |
| | | @Value("${jpush.masterSecret:}") |
| | | private String masterSecret; |
| | | |
| | | @Value("${jpush.apnsProduction:false}") |
| | | private boolean apnsProd; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | if (StringUtils.isNotBlank(appKey) && StringUtils.isNotBlank(masterSecret)) { |
| | | authHeader = "Basic " + Base64.getEncoder().encodeToString((appKey + ":" + masterSecret).getBytes()); |
| | | apnsProduction = apnsProd; |
| | | log.info("JPush initialized, appKey={}", appKey); |
| | | } else { |
| | | log.warn("JPush not configured, push disabled"); |
| | | } |
| | | } |
| | | |
| | | // ==================== éç¥æ æ¨é ==================== |
| | | |
| | | /** |
| | | * æå«åæ¨ééç¥ |
| | | * |
| | | * @param alias å«åï¼å¦ä¼åID/叿ºID/é¨åºIDï¼ |
| | | * @param title éç¥æ é¢ |
| | | * @param content éç¥å
容 |
| | | * @param extras éå åæ®µï¼å¯éï¼ |
| | | * @return æ¯å¦æ¨éæå |
| | | */ |
| | | public static boolean sendByAlias(String alias, String title, String content, Map<String, String> extras) { |
| | | return sendByAliases(Collections.singletonList(alias), title, content, extras); |
| | | } |
| | | |
| | | /** |
| | | * æå«åæ¹éæ¨ééç¥ |
| | | */ |
| | | public static boolean sendByAliases(List<String> aliases, String title, String content, Map<String, String> extras) { |
| | | if (!available() || aliases == null || aliases.isEmpty()) { |
| | | return false; |
| | | } |
| | | JSONObject body = buildNotificationBody(aliases, "alias", title, content, extras); |
| | | return doPush(body, "sendByAliases"); |
| | | } |
| | | |
| | | /** |
| | | * æRegistrationIdæ¨ééç¥ |
| | | */ |
| | | public static boolean sendByRegId(String regId, String title, String content, Map<String, String> extras) { |
| | | return sendByRegIds(Collections.singletonList(regId), title, content, extras); |
| | | } |
| | | |
| | | /** |
| | | * æRegistrationIdæ¹éæ¨ééç¥ |
| | | */ |
| | | public static boolean sendByRegIds(List<String> regIds, String title, String content, Map<String, String> extras) { |
| | | if (!available() || regIds == null || regIds.isEmpty()) { |
| | | return false; |
| | | } |
| | | JSONObject body = buildNotificationBody(regIds, "registration_id", title, content, extras); |
| | | return doPush(body, "sendByRegIds"); |
| | | } |
| | | |
| | | /** |
| | | * å¹¿ææ¨ééç¥ï¼æ¨éç»ææç¨æ·ï¼ |
| | | */ |
| | | public static boolean sendToAll(String title, String content, Map<String, String> extras) { |
| | | if (!available()) { |
| | | return false; |
| | | } |
| | | JSONObject body = buildNotificationBody(null, "all", title, content, extras); |
| | | return doPush(body, "sendToAll"); |
| | | } |
| | | |
| | | // ==================== èªå®ä¹æ¶æ¯ï¼é黿¨éï¼ä¸æ¾ç¤ºéç¥æ ï¼ ==================== |
| | | |
| | | /** |
| | | * æå«åæ¨éèªå®ä¹æ¶æ¯ |
| | | */ |
| | | public static boolean sendMessageByAlias(String alias, String content, Map<String, String> extras) { |
| | | return sendMessagesByAlias(Collections.singletonList(alias), content, extras); |
| | | } |
| | | |
| | | /** |
| | | * æå«åæ¹éæ¨éèªå®ä¹æ¶æ¯ |
| | | */ |
| | | public static boolean sendMessagesByAlias(List<String> aliases, String content, Map<String, String> extras) { |
| | | if (!available() || aliases == null || aliases.isEmpty()) { |
| | | return false; |
| | | } |
| | | JSONObject body = buildMessageBody(aliases, "alias", content, extras); |
| | | return doPush(body, "sendMessageByAlias"); |
| | | } |
| | | |
| | | // ==================== å
鍿¹æ³ ==================== |
| | | |
| | | private static boolean available() { |
| | | return StringUtils.isNotBlank(authHeader); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºéç¥æ æ¨é请æ±ä½ |
| | | */ |
| | | private static JSONObject buildNotificationBody(List<String> targets, String audienceType, |
| | | String title, String content, Map<String, String> extras) { |
| | | JSONObject body = new JSONObject(); |
| | | // platform |
| | | body.put("platform", "all"); |
| | | |
| | | // audience |
| | | if ("all".equals(audienceType)) { |
| | | body.put("audience", "all"); |
| | | } else { |
| | | JSONObject audience = new JSONObject(); |
| | | JSONArray arr = new JSONArray(); |
| | | arr.addAll(targets); |
| | | audience.put(audienceType, arr); |
| | | body.put("audience", audience); |
| | | } |
| | | |
| | | // notification |
| | | JSONObject notification = new JSONObject(); |
| | | |
| | | // Android |
| | | JSONObject android = new JSONObject(); |
| | | android.put("title", title); |
| | | android.put("alert", content); |
| | | if (extras != null && !extras.isEmpty()) { |
| | | android.put("extras", mapToJson(extras)); |
| | | } |
| | | notification.put("android", android); |
| | | |
| | | // iOS |
| | | JSONObject ios = new JSONObject(); |
| | | ios.put("alert", content); |
| | | ios.put("sound", "default"); |
| | | if (extras != null && !extras.isEmpty()) { |
| | | ios.put("extras", mapToJson(extras)); |
| | | } |
| | | notification.put("ios", ios); |
| | | |
| | | body.put("notification", notification); |
| | | |
| | | // options |
| | | JSONObject options = new JSONObject(); |
| | | options.put("apns_production", apnsProduction); |
| | | body.put("options", options); |
| | | |
| | | return body; |
| | | } |
| | | |
| | | /** |
| | | * æå»ºèªå®ä¹æ¶æ¯è¯·æ±ä½ï¼ä¸æ¾ç¤ºéç¥æ ï¼ |
| | | */ |
| | | private static JSONObject buildMessageBody(List<String> targets, String audienceType, |
| | | String content, Map<String, String> extras) { |
| | | JSONObject body = new JSONObject(); |
| | | body.put("platform", "all"); |
| | | |
| | | JSONObject audience = new JSONObject(); |
| | | JSONArray arr = new JSONArray(); |
| | | arr.addAll(targets); |
| | | audience.put(audienceType, arr); |
| | | body.put("audience", audience); |
| | | |
| | | // message |
| | | JSONObject message = new JSONObject(); |
| | | message.put("msg_content", content); |
| | | if (extras != null && !extras.isEmpty()) { |
| | | message.put("extras", mapToJson(extras)); |
| | | } |
| | | body.put("message", message); |
| | | |
| | | JSONObject options = new JSONObject(); |
| | | options.put("apns_production", apnsProduction); |
| | | body.put("options", options); |
| | | |
| | | return body; |
| | | } |
| | | |
| | | /** |
| | | * Map<String, String> â JSONObject |
| | | */ |
| | | private static JSONObject mapToJson(Map<String, String> map) { |
| | | JSONObject json = new JSONObject(); |
| | | json.putAll(map); |
| | | return json; |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡æ¨éè¯·æ± |
| | | */ |
| | | private static boolean doPush(JSONObject body, String action) { |
| | | try { |
| | | String response = HttpsUtil.postJson(PUSH_URL, body.toJSONString(), authHeader); |
| | | log.info("JPush {}, response={}", action, response); |
| | | if (StringUtils.isNotBlank(response)) { |
| | | JSONObject resp = JSONObject.parseObject(response); |
| | | return resp.containsKey("msg_id") || (resp.containsKey("statusCode") && resp.getIntValue("statusCode") == 0); |
| | | } |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("JPush {} error", action, e); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | @ExcelColumn(name = "ç¶æ", index = 8, width = 8, valueMapping = "0=å¯ç¨ï¼1=ç¦ç¨ï¼") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审æ¹ç¶æï¼0=å¾
审æ¹ï¼1=审æ¹éè¿ï¼2=审æ¹é©³å", example = "0") |
| | | @ExcelColumn(name = "审æ¹ç¶æ", index = 9, width = 10, valueMapping = "0=å¾
审æ¹ï¼1=审æ¹éè¿ï¼2=审æ¹é©³å") |
| | | @ApiModelProperty(value = "审æ¹ç¶æï¼0=å¾
审æ¹ï¼1=审æ¹éè¿ï¼2=审æ¹é©³åï¼3=å·²æ¯ä»æ¼éï¼99=æªè®¤è¯ï¼", example = "0") |
| | | @ExcelColumn(name = "审æ¹ç¶æ", index = 9, width = 10, valueMapping = "审æ¹ç¶æï¼0=å¾
审æ¹ï¼1=审æ¹éè¿ï¼2=审æ¹é©³åï¼3=å·²æ¯ä»æ¼éï¼99=æªè®¤è¯ï¼") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "OPENID(APP)") |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createTimeEnd; |
| | | |
| | | // ---- çå¸åºä¿¡æ¯ï¼éæ°æ®åºåæ®µï¼ ---- |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ç份主é®") |
| | | private Integer provinceId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ç份åç§°") |
| | | private String provinceName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åå¸ä¸»é®") |
| | | private Integer cityId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åå¸åç§°") |
| | | private String cityName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åºå¿ä¸»é®") |
| | | private Integer districtId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åºå¿åç§°") |
| | | private String districtName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "订å主é®", required = true) |
| | | private Integer orderId; |
| | | |
| | | @NotNull(message = "é¨åºä¸»é®ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "å½åæä½é¨åºä¸»é®", required = true) |
| | | private Integer shopId; |
| | | } |
| | |
| | | package com.doumee.dao.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String carColor; |
| | | |
| | | @ApiModelProperty(value = "é©¾é©¶è¯æææå¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date cardStartDate; |
| | | |
| | | @ApiModelProperty(value = "é©¾é©¶è¯æææç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date cardEndDate; |
| | | |
| | | @NotEmpty(message = "èº«ä»½è¯æ£é¢ç
§ä¸è½ä¸ºç©º") |
| | |
| | | @ApiModelProperty(value = "订åç¶æï¼å¯éï¼ä¸ä¼ æ¥å
¨é¨ï¼", example = "0") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "åå¹¶ç¶æï¼å¯éï¼ä¸ä¼ æ¥å
¨é¨ï¼: 0=å¾
æ¯ä» 1=å¾
æ ¸éª 2=å¾
é
é 3=å¾
æ¶è´§ 4=已宿 5=鿬¾", example = "0") |
| | | @ApiModelProperty(value = "åå¹¶ç¶æï¼å¯éï¼ä¸ä¼ æ¥å
¨é¨ï¼: 0=å¾
æ¯ä» 1=å¾
æ ¸éª 2=å¾
é
é 3=å¾
æ¶è´§ 4=已宿 5=鿬¾ 6ä¼åé¦é¡µ 7é¨åºå¾
å¤ç订å", example = "0") |
| | | private Integer combinedStatus; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.List; |
| | | |
| | |
| | | @ApiModel("é¨åºæ ¸é请æ±") |
| | | public class ShopVerifyDTO { |
| | | |
| | | @NotBlank(message = "æ ¸éç ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "ä¼åæ ¸éç ", required = true) |
| | | private String verifyCode; |
| | | @NotNull(message = "订å主é®ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "订å主é®", required = true) |
| | | private Integer orderId; |
| | | |
| | | @Size(max = 3, message = "æå¤ä¸ä¼ 3å¼ å¾ç") |
| | | @ApiModelProperty(value = "å¾çå°ååè¡¨ï¼æå¤3å¼ ") |
| | |
| | | @ApiModelProperty(value = "æå¡è¯å") |
| | | private String score; |
| | | |
| | | @ApiModelProperty(value = "叿ºå®çº§ï¼5=S 4=A 3=B 2=C 1=D") |
| | | private Integer driverLevel; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç¶æï¼0=å¾
å®¡æ¹ 1=审æ¹éè¿ 2=审æ¹é©³å") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸å¤æ³¨ï¼é©³ååå ï¼") |
| | | private String auditRemark; |
| | | |
| | | @ApiModelProperty(value = "仿¥é¢è®¡ä½£é(å)") |
| | | private Long todayCommission; |
| | | |
| | |
| | | @ApiModelProperty(value = "å¾
é
éè®¢åæ°é") |
| | | private Integer waitDeliverCount; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¥åä¸ï¼0=å·²ä¸çº¿ï¼1=æ¥åä¸", example = "0") |
| | | private Integer acceptingStatus; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 叿ºç´¯è®¡ç»è®¡ |
| | | * |
| | | * @author rk |
| | | * @date 2026/04/24 |
| | | */ |
| | | @Data |
| | | @ApiModel("叿ºç´¯è®¡ç»è®¡") |
| | | public class DriverStatsVO { |
| | | |
| | | @ApiModelProperty(value = "累计佣é(å)") |
| | | private Long totalCommission; |
| | | |
| | | @ApiModelProperty(value = "å¾
ç»ç®ä½£é(å)") |
| | | private Long pendingCommission; |
| | | |
| | | @ApiModelProperty(value = "è®¢åæ»æ°") |
| | | private Integer totalOrderCount; |
| | | |
| | | @ApiModelProperty(value = "é±å
ä½é¢(å)") |
| | | private Long balance; |
| | | |
| | | } |
| | |
| | | |
| | | // ---- 龿 ---- |
| | | |
| | | @ApiModelProperty(value = "é¾æç¶æ: 0=æ 龿 1=åå¨é¾æ 2=å¾
æ¯ä»é¾æ 3=龿已æ¯ä»") |
| | | //é¾æç¶æ: 0=æªå°åºæªé¾æ 1=æªå°åºåå¨é¾æ 2=å·²å°åºæªåå¨é¾æ 3=å·²å°åºå¾
æ¯ä»é¾æ 4=龿已æ¯ä» |
| | | @ApiModelProperty(value = "é¾æç¶æ: 0=æªå°åºæªé¾æ 1=æªå°åºåå¨é¾æ 2=å·²å°åºæªé¾æ 3=å·²å°åºå¾
æ¯ä»é¾æ 4=龿已æ¯ä»") |
| | | private Integer overdueStatus; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦é¾æ") |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "订å夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "é¢è®¡åä»¶æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date expectedTakeTime; |
| | |
| | | |
| | | // ---- 龿 ---- |
| | | |
| | | @ApiModelProperty(value = "é¾æç¶æï¼0=æªå°åºæªé¾æï¼1=æªå°åºåå¨é¾æï¼2=å·²å°åºæªé¾æï¼3=å·²å°åºå¾
æ¯ä»é¾æï¼4=龿已æ¯ä»") |
| | | private Integer overdueStatus; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦é¾æ") |
| | | private Boolean overdue; |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å¹³å°ä¿¡æ¯ï¼å
³äºæä»¬ãåè®®çï¼ |
| | | * |
| | |
| | | @ApiModelProperty(value = "å
³äºæä»¬") |
| | | private String aboutUs; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·åè®®") |
| | | private String userAgreement; |
| | | |
| | | @ApiModelProperty(value = "éç§åè®®") |
| | | private String privacyAgreement; |
| | | |
| | | @ApiModelProperty(value = "è§èé¡»ç¥") |
| | | private String serverIntroduce; |
| | | @ApiModelProperty(value = "å议须ç¥å表ï¼key=æä¸¾ç¼ç ï¼value=坿æ¬å
容") |
| | | private Map<String, String> agreements; |
| | | } |
| | |
| | | import com.doumee.dao.vo.AccountResponse; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 叿ºæ³¨åä¿¡æ¯Serviceå®ä¹ |
| | |
| | | com.doumee.dao.vo.DriverCenterVO getDriverCenterInfo(Integer memberId); |
| | | |
| | | /** |
| | | * 叿ºç´¯è®¡ç»è®¡ï¼ç´¯è®¡ä½£éãå¾
ç»ç®ä½£éãè®¢åæ»æ°ãé±å
ä½é¢ï¼ |
| | | */ |
| | | com.doumee.dao.vo.DriverStatsVO getDriverStats(Integer memberId); |
| | | |
| | | /** |
| | | * 叿ºæ¢å大å
- å页æ¥è¯¢å¯æ¢è®¢å |
| | | * |
| | | * @param memberId å½åç»å½ä¼åä¸»é® |
| | |
| | | */ |
| | | void confirmDeliver(Integer driverId, DriverDeliverDTO dto); |
| | | |
| | | /** |
| | | * 叿ºä¿®æ¹å¯ç |
| | | * |
| | | * @param driverId 叿ºä¸»é® |
| | | * @param newPassword æ°å¯ç |
| | | * @param token å½åtokenï¼ä¿®æ¹æå忏
é¤ï¼ |
| | | */ |
| | | void changePassword(Integer driverId, String newPassword, String token); |
| | | |
| | | /** |
| | | * è·å叿ºè¿è¡ä¸è®¢åæ°é |
| | | * |
| | | * @param driverId 叿ºä¸»é® |
| | | * @return [å·²æ¢åæ°é, æ´¾é䏿°é] |
| | | */ |
| | | Map<String, Integer> getActiveOrderCount(Integer driverId); |
| | | |
| | | } |
| | |
| | | void shopVerifyOrder(String verifyCode, Integer shopId, List<String> images, String remark); |
| | | |
| | | /** |
| | | * é¨åºæ ¸éï¼èªå¨è¯å«ä¼åæ ¸éç /叿ºæ ¸éç ï¼ |
| | | * |
| | | * @param verifyCode æ ¸éç |
| | | * @param shopId é¨åºä¸»é® |
| | | * @param images å¾ç |
| | | * @param remark 夿³¨ |
| | | */ |
| | | void verifyOrder(String verifyCode, Integer shopId, List<String> images, String remark); |
| | | |
| | | /** |
| | | * é¨åºéè¿è®¢å䏻鮿 ¸é |
| | | * |
| | | * @param orderId 订åä¸»é® |
| | | * @param shopId é¨åºä¸»é® |
| | | * @param images å¾ç |
| | | * @param remark 夿³¨ |
| | | */ |
| | | void verifyOrderByShopId(Integer orderId, Integer shopId, List<String> images, String remark); |
| | | |
| | | /** |
| | | * é¨åºç«¯æ¥è¯¢è®¢å详æ
|
| | | * æ¯ææè®¢åä¸»é®ææ ¸éç æ¥è¯¢ï¼å¤ç¨ä¼å端详æ
é»è¾ |
| | | * |
| | |
| | | */ |
| | | ShopSalesStatsVO getShopSalesStats(Integer shopId, Integer period); |
| | | |
| | | /** |
| | | * é¨åºä¿®æ¹å¯ç |
| | | * |
| | | * @param shopId é¨åºä¸»é® |
| | | * @param newPassword æ°å¯ç |
| | | * @param token å½åtokenï¼ä¿®æ¹æå忏
é¤ï¼ |
| | | */ |
| | | void changePassword(Integer shopId, String newPassword, String token); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.impl.AreasBizImpl; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import com.doumee.dao.business.ShopInfoMapper; |
| | | import com.doumee.dao.business.OrdersDetailMapper; |
| | | import com.doumee.dao.business.RevenueMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.AreasService; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.biz.system.OperationConfigBiz; |
| | | import com.doumee.dao.business.OrderLogMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.DriverInfo; |
| | | import com.doumee.dao.business.model.OrderLog; |
| | | import com.doumee.dao.business.model.OrderComment; |
| | | import com.doumee.dao.business.model.ShopInfo; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Multifile; |
| | | import com.doumee.dao.business.model.Smsrecord; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.OrdersDetail; |
| | | import com.doumee.dao.business.model.Revenue; |
| | | import com.doumee.dao.dto.*; |
| | | import com.doumee.dao.vo.AccountResponse; |
| | | import com.doumee.dao.vo.DriverCenterVO; |
| | | import com.doumee.dao.vo.DriverGrabOrderVO; |
| | | import com.doumee.dao.vo.DriverOrderDetailVO; |
| | | import com.doumee.core.utils.aliyun.AliSmsService; |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.service.business.DriverInfoService; |
| | | import com.doumee.service.business.NoticeService; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | |
| | | @Autowired |
| | | private AreasBizImpl areasBiz; |
| | | |
| | | /** |
| | | * åé订åç«å
ä¿¡éç¥ |
| | |
| | | member.setUpdateTime(now); |
| | | member.setTelephone(telephone); |
| | | member.setNickName(telephone.substring(0, 3) + "****" + telephone.substring(7)); |
| | | member.setName(telephone); |
| | | member.setName(member.getNickName()); |
| | | member.setUserType(Constants.ONE); |
| | | member.setBusinessStatus(Constants.ZERO); |
| | | member.setPassword(secure.encryptPassword(defaultPassword, salt)); |
| | |
| | | |
| | | // åå»ºå¸æºåºç¡ä¿¡æ¯ |
| | | DriverInfo driverInfo = new DriverInfo(); |
| | | driverInfo.setId(member.getId()); |
| | | driverInfo.setDeleted(Constants.ZERO); |
| | | driverInfo.setCreateTime(now); |
| | | driverInfo.setUpdateTime(now); |
| | | driverInfo.setTelephone(telephone); |
| | | driverInfo.setName(member.getNickName()); |
| | | driverInfo.setMemberId(member.getId()); |
| | | driverInfo.setStatus(Constants.ZERO); |
| | | driverInfo.setAuditStatus(null); |
| | | driverInfo.setAuditStatus(99); |
| | | driverInfoMapper.insert(driverInfo); |
| | | } |
| | | |
| | |
| | | .set(DriverInfo::getAliAccount, request.getAliAccount()) |
| | | .set(DriverInfo::getAliName, request.getAliName()) |
| | | .set(DriverInfo::getUpdateTime, now) |
| | | .set(DriverInfo::getAuditStatus, Constants.ZERO) |
| | | .set(DriverInfo::getAuditRemark, null) |
| | | .set(DriverInfo::getAuditTime, null) |
| | | .eq(DriverInfo::getId, driverInfo.getId())); |
| | |
| | | @Override |
| | | public DriverInfo getVerifyDetail(Integer memberId) { |
| | | DriverInfo driverInfo = driverInfoMapper.selectOne(new QueryWrapper<DriverInfo>().lambda() |
| | | .eq(DriverInfo::getMemberId, memberId) |
| | | .eq(DriverInfo::getId, memberId) |
| | | .eq(DriverInfo::getDeleted, Constants.ZERO) |
| | | .last("limit 1")); |
| | | if (Objects.isNull(driverInfo)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | // æ¼æ¥å¾çåç¼ |
| | | String imgPrefix = ""; |
| | | try { |
| | | imgPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.DRIVER_FILES).getCode(); |
| | | } catch (Exception e) { |
| | | // æªé
ç½®æ¶å¿½ç¥ |
| | | } |
| | | driverInfo.setImgPrefix(imgPrefix); |
| | | // æ¥è¯¢è½¦è¾ç±»ååç§°åæ¯å¦éè¦é©¾é©¶è¯ |
| | | if (driverInfo.getCarType() != null) { |
| | | Category category = categoryMapper.selectById(driverInfo.getCarType()); |
| | | if (Objects.nonNull(category)) { |
| | | driverInfo.setCarTypeName(category.getName()); |
| | | driverInfo.setNeedLicense(Constants.equalsInteger(Integer.valueOf(category.getOtherField()), Constants.ONE) ? Constants.ONE : Constants.ZERO); |
| | | } |
| | | } |
| | | // æ¥è¯¢çå¸åºä¿¡æ¯ |
| | | if (driverInfo.getAreaId() != null) { |
| | | Areas district = areasBiz.resolveArea(driverInfo.getAreaId()); |
| | | if (district != null) { |
| | | driverInfo.setDistrictId(district.getId()); |
| | | driverInfo.setDistrictName(district.getName()); |
| | | driverInfo.setCityId(district.getCityId()); |
| | | driverInfo.setCityName(district.getCityName()); |
| | | driverInfo.setProvinceId(district.getProvinceId()); |
| | | driverInfo.setProvinceName(district.getProvinceName()); |
| | | } |
| | | } |
| | | // æ¥è¯¢ç
§çå表 |
| | |
| | | vo.setImgUrl(driver.getImgurl()); |
| | | vo.setCarCode(driver.getCarCode()); |
| | | vo.setScore(driver.getScore() != null ? driver.getScore().toPlainString() : "0"); |
| | | vo.setDriverLevel(driver.getDriverLevel()); |
| | | vo.setAuditStatus(driver.getAuditStatus()); |
| | | vo.setAuditRemark(driver.getAuditRemark()); |
| | | vo.setBalance(driver.getBalance() != null ? driver.getBalance() : 0L); |
| | | |
| | | vo.setAcceptingStatus(driver.getAcceptingStatus()); |
| | | // 头åå
¨è·¯å¾ |
| | | if (StringUtils.isNotBlank(driver.getImgurl())) { |
| | | String imgPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | |
| | | .eq(Orders::getDeleted, Constants.ZERO) |
| | | .eq(Orders::getStatus, Constants.OrderStatus.delivering.getStatus())); |
| | | vo.setWaitDeliverCount(waitDeliverCount.intValue()); |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public com.doumee.dao.vo.DriverStatsVO getDriverStats(Integer memberId) { |
| | | DriverInfo driver = driverInfoMapper.selectOne(new QueryWrapper<DriverInfo>().lambda() |
| | | .eq(DriverInfo::getId, memberId) |
| | | .eq(DriverInfo::getDeleted, Constants.ZERO) |
| | | .last("limit 1")); |
| | | if (driver == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "叿ºä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | |
| | | com.doumee.dao.vo.DriverStatsVO vo = new com.doumee.dao.vo.DriverStatsVO(); |
| | | |
| | | // 累计佣éï¼type=0(å®æè®¢å) + vaildStatus=1(å·²å
¥è´¦) |
| | | QueryWrapper<Revenue> totalWrapper = new QueryWrapper<>(); |
| | | totalWrapper.lambda() |
| | | .eq(Revenue::getMemberId, memberId) |
| | | .eq(Revenue::getMemberType, Constants.ONE) |
| | | .eq(Revenue::getType, Constants.ZERO) |
| | | .eq(Revenue::getVaildStatus, Constants.ONE) |
| | | .eq(Revenue::getDeleted, Constants.ZERO); |
| | | totalWrapper.select("IFNULL(SUM(AMOUNT),0) as amount"); |
| | | Revenue totalResult = revenueMapper.selectOne(totalWrapper); |
| | | vo.setTotalCommission(totalResult != null && totalResult.getAmount() != null ? totalResult.getAmount() : 0L); |
| | | |
| | | // å¾
ç»ç®ä½£éï¼type=0(å®æè®¢å) + vaildStatus=0(å
¥è´¦ä¸) |
| | | QueryWrapper<Revenue> pendingWrapper = new QueryWrapper<>(); |
| | | pendingWrapper.lambda() |
| | | .eq(Revenue::getMemberId, memberId) |
| | | .eq(Revenue::getMemberType, Constants.ONE) |
| | | .eq(Revenue::getType, Constants.ZERO) |
| | | .eq(Revenue::getVaildStatus, Constants.ZERO) |
| | | .eq(Revenue::getDeleted, Constants.ZERO); |
| | | pendingWrapper.select("IFNULL(SUM(AMOUNT),0) as amount"); |
| | | Revenue pendingResult = revenueMapper.selectOne(pendingWrapper); |
| | | vo.setPendingCommission(pendingResult != null && pendingResult.getAmount() != null ? pendingResult.getAmount() : 0L); |
| | | |
| | | // è®¢åæ»æ° |
| | | Long totalOrderCount = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getAcceptDriver, driver.getId()) |
| | | .eq(Orders::getDeleted, Constants.ZERO)); |
| | | vo.setTotalOrderCount(totalOrderCount.intValue()); |
| | | |
| | | // é±å
ä½é¢ |
| | | vo.setBalance(driver.getBalance() != null ? driver.getBalance() : 0L); |
| | | |
| | | return vo; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void changePassword(Integer driverId, String newPassword, String token) { |
| | | if (StringUtils.isBlank(newPassword)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | // æ ¡éªå¯ç å¿
须忶å
å«åæ¯åæ°å |
| | | boolean hasLetter = newPassword.chars().anyMatch(Character::isLetter); |
| | | boolean hasDigit = newPassword.chars().anyMatch(Character::isDigit); |
| | | if (!hasLetter || !hasDigit) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å¯ç å¿
须忶å
å«åæ¯åæ°å"); |
| | | } |
| | | // æ¥è¯¢å¸æºå¯¹åºçä¼å |
| | | DriverInfo driverInfo = driverInfoMapper.selectById(driverId); |
| | | if (driverInfo == null || driverInfo.getMemberId() == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Member member = memberMapper.selectById(driverInfo.getMemberId()); |
| | | if (member == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | // å 坿°å¯ç å¹¶æ´æ° |
| | | String salt = RandomStringUtils.randomAlphanumeric(6); |
| | | String encryptPwd = secure.encryptPassword(newPassword, salt); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getPassword, encryptPwd) |
| | | .set(Member::getSalt, salt) |
| | | .eq(Member::getId, member.getId())); |
| | | // æ¸
é¤tokenï¼å¼ºå¶éæ°ç»å½ |
| | | if (StringUtils.isNotBlank(token)) { |
| | | redisTemplate.delete(token); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Integer> getActiveOrderCount(Integer driverId) { |
| | | // å·²æ¢å(status=3)æ°é |
| | | Long grabbed = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getAcceptDriver, driverId) |
| | | .eq(Orders::getStatus, Constants.OrderStatus.accepted.getStatus()) |
| | | .eq(Orders::getDeleted, Constants.ZERO)); |
| | | // æ´¾éä¸(status=4)æ°é |
| | | Long delivering = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getAcceptDriver, driverId) |
| | | .eq(Orders::getStatus, Constants.OrderStatus.delivering.getStatus()) |
| | | .eq(Orders::getDeleted, Constants.ZERO)); |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | result.put("grabbedCount", grabbed != null ? grabbed.intValue() : 0); |
| | | result.put("deliveringCount", delivering != null ? delivering.intValue() : 0); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Random; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | public PlatformAboutVO getPlatformAboutUs(){ |
| | | PlatformAboutVO vo = new PlatformAboutVO(); |
| | | vo.setAboutUs(StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ABOUT_US).getCode())); |
| | | vo.setUserAgreement(StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.USER_AGREEMENT).getCode())); |
| | | vo.setPrivacyAgreement(StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PRIVACY_AGREEMENT).getCode())); |
| | | vo.setServerIntroduce(StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SERVER_INTRODUCE).getCode())); |
| | | |
| | | Map<String, String> agreements = new LinkedHashMap<>(); |
| | | String[] agreementKeys = { |
| | | Constants.STORE_RISK_COMMITMENT, |
| | | Constants.STORE_COOPERATION_AGREEMENT, |
| | | Constants.STORE_LUGGAGE_STORAGE_NOTICE, |
| | | Constants.STORE_PRIVACY_POLICY, |
| | | Constants.OWNER_LUGGAGE_STORAGE_NOTICE, |
| | | Constants.OWNER_SERVICE_AGREEMENT, |
| | | Constants.OWNER_RISK_COMMITMENT, |
| | | Constants.ERRAND_RISK_COMMITMENT, |
| | | Constants.ERRAND_SERVICE_AGREEMENT, |
| | | Constants.ERRAND_LUGGAGE_STORAGE_NOTICE, |
| | | Constants.USER_SERVICE_AGREEMENT, |
| | | Constants.USER_PRIVACY_POLICY, |
| | | Constants.DRIVER_PRIVACY_POLICY, |
| | | Constants.PRICE_DESCRIPTION, |
| | | Constants.PROHIBITED_ITEMS |
| | | }; |
| | | for (String key : agreementKeys) { |
| | | try { |
| | | String value = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.SYSTEM, key).getCode()); |
| | | agreements.put(key, value); |
| | | } catch (Exception e) { |
| | | agreements.put(key, null); |
| | | } |
| | | } |
| | | vo.setAgreements(agreements); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | // ç©åæç» |
| | | vo.setDetailList(buildDetailList(details)); |
| | | |
| | | // é¾æä¿¡æ¯ï¼ä»
å¾
åä»¶ç¶æè®¡ç®ï¼ |
| | | if (Integer.valueOf(Constants.OrderStatus.arrived.getStatus()).equals(o.getStatus())) { |
| | | OverdueFeeVO overdueInfo = calculateOverdueFeeInternal(o, details); |
| | | vo.setOverdue(overdueInfo.getOverdue()); |
| | | vo.setOverdueDays(overdueInfo.getOverdueDays()); |
| | | vo.setOverdueFee(overdueInfo.getOverdueFee()); |
| | | } |
| | | // é¾æç¶æ |
| | | fillOverdueStatus(vo, o, details); |
| | | voList.add(vo); |
| | | } |
| | | } |
| | |
| | | .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID") |
| | | .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID") |
| | | .leftJoin("driver_info d on d.id = t.ACCEPT_DRIVER") |
| | | .eq(Orders::getPayStatus, Constants.ONE) |
| | | .and(w -> w.eq(Orders::getDepositShopId, shopId).or().eq(Orders::getTakeShopId, shopId)) |
| | | .eq(status != null, Orders::getStatus, status) |
| | | .in(statusList != null, Orders::getStatus, statusList) |
| | | .eq(Orders::getPayStatus, Constants.ONE); |
| | | |
| | | // é¨åºå¾
å¤ç订åï¼æä¸å¡ç¯èåºåé¨åºè§è² |
| | | if (combinedStatus != null && Constants.equalsInteger(combinedStatus, Constants.SEVEN)) { |
| | | wrapper.and(w -> w |
| | | .and(w1 -> w1.eq(Orders::getDepositShopId, shopId) |
| | | .in(Orders::getStatus, Constants.OrderStatus.waitDeposit.getStatus(), |
| | | Constants.OrderStatus.deposited.getStatus())) |
| | | .or(w2 -> w2.eq(Orders::getTakeShopId, shopId) |
| | | .in(Orders::getStatus, Constants.OrderStatus.delivering.getStatus(), |
| | | Constants.OrderStatus.arrived.getStatus())) |
| | | ); |
| | | } else { |
| | | wrapper.and(w -> w.eq(Orders::getDepositShopId, shopId).or().eq(Orders::getTakeShopId, shopId)); |
| | | } |
| | | |
| | | wrapper.eq(status != null, Orders::getStatus, status) |
| | | .in(statusList != null && !Constants.equalsInteger(combinedStatus, Constants.SEVEN), Orders::getStatus, statusList) |
| | | .orderByDesc(Orders::getCreateTime); |
| | | |
| | | IPage<Orders> orderPage = ordersMapper.selectJoinPage(p, Orders.class, wrapper); |
| | |
| | | Constants.equalsInteger(o.getType(), Constants.ZERO)?o.getType():Objects.nonNull(o.getTakeShopId())?Constants.ONE:Constants.TWO) |
| | | ); |
| | | vo.setCreateTime(o.getCreateTime()); |
| | | vo.setRemark(o.getRemark()); |
| | | vo.setExpectedTakeTime(o.getExpectedTakeTime()); |
| | | |
| | | vo.setDepositShopName(o.getDepositShopName()); |
| | |
| | | |
| | | vo.setDetailList(buildDetailList(details)); |
| | | |
| | | if (Integer.valueOf(Constants.OrderStatus.arrived.getStatus()).equals(o.getStatus())) { |
| | | OverdueFeeVO overdueInfo = calculateOverdueFeeInternal(o, details); |
| | | vo.setOverdue(overdueInfo.getOverdue()); |
| | | vo.setOverdueDays(overdueInfo.getOverdueDays()); |
| | | vo.setOverdueFee(overdueInfo.getOverdueFee()); |
| | | } |
| | | |
| | | // é¾æç¶æ |
| | | fillOverdueStatus(vo, o, details); |
| | | |
| | | // if (Integer.valueOf(Constants.OrderStatus.arrived.getStatus()).equals(o.getStatus())) { |
| | | // OverdueFeeVO overdueInfo = calculateOverdueFeeInternal(o, details); |
| | | // vo.setOverdue(overdueInfo.getOverdue()); |
| | | // vo.setOverdueDays(overdueInfo.getOverdueDays()); |
| | | // vo.setOverdueFee(overdueInfo.getOverdueFee()); |
| | | // } |
| | | voList.add(vo); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (order == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "订åä¸åå¨"); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "æ ¸éç æ æ"); |
| | | } |
| | | return buildOrderDetailVO(order, false); |
| | | } |
| | |
| | | .eq(OrdersDetail::getDeleted, Constants.ZERO)); |
| | | vo.setDetailList(buildDetailList(details)); |
| | | |
| | | // é¾æç¶æï¼0=æ 龿 1=åå¨é¾æ 2=å¾
æ¯ä»é¾æ 3=龿已æ¯ä» |
| | | if (Constants.equalsInteger(order.getOverdueStatus(), Constants.TWO)) { |
| | | // è®¢åæ è®°å·²æ¯ä»é¾æ |
| | | vo.setOverdueStatus(Constants.THREE); |
| | | vo.setOverdue(true); |
| | | vo.setOverdueDays(order.getOverdueDays()); |
| | | vo.setOverdueFee(order.getOverdueAmount()); |
| | | } else if (Constants.equalsInteger(order.getOverdueStatus(), Constants.ONE)) { |
| | | // è®¢åæ è®°å¾
æ¯ä»é¾æ |
| | | vo.setOverdueStatus(Constants.TWO); |
| | | vo.setOverdue(true); |
| | | vo.setOverdueDays(order.getOverdueDays()); |
| | | vo.setOverdueFee(order.getOverdueAmount()); |
| | | } else if (order.getConfirmArriveTime() != null) { |
| | | // 已确认å°åºï¼æ 龿 |
| | | vo.setOverdueStatus(Constants.ZERO); |
| | | vo.setOverdue(false); |
| | | vo.setOverdueDays(0); |
| | | vo.setOverdueFee(0L); |
| | | } else { |
| | | // æªç¡®è®¤å°åºï¼è®¡ç®å®é
龿 |
| | | OverdueFeeVO overdueInfo = calculateOverdueFeeInternal(order, details); |
| | | if (overdueInfo.getOverdue() != null && overdueInfo.getOverdue() |
| | | && overdueInfo.getOverdueFee() != null && overdueInfo.getOverdueFee() > 0) { |
| | | vo.setOverdueStatus(Constants.ONE); |
| | | vo.setOverdue(true); |
| | | vo.setOverdueDays(overdueInfo.getOverdueDays()); |
| | | vo.setOverdueFee(overdueInfo.getOverdueFee()); |
| | | } else { |
| | | vo.setOverdueStatus(Constants.ZERO); |
| | | vo.setOverdue(false); |
| | | vo.setOverdueDays(0); |
| | | vo.setOverdueFee(0L); |
| | | } |
| | | } |
| | | // é¾æç¶æï¼0=æªå°åºæªé¾æ 1=æªå°åºåå¨é¾æ 2=å·²å°åºæªé¾æ 3=å·²å°åºå¾
æ¯ä»é¾æ 4=龿已æ¯ä» |
| | | fillOverdueStatus(vo, order, details); |
| | | |
| | | // 鿬¾ä¿¡æ¯ï¼status=99åæ¶æ¶è¿åï¼ |
| | | if (order.getStatus() != null && |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class, BusinessException.class}) |
| | | public void verifyOrder(String verifyCode, Integer shopId, List<String> images, String remark) { |
| | | if (StringUtils.isBlank(verifyCode)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ ¸éç ä¸è½ä¸ºç©º"); |
| | | } |
| | | // å
æ¥ä¼åæ ¸éç |
| | | Orders query = new Orders(); |
| | | query.setMemberVerifyCode(verifyCode); |
| | | query.setDeleted(Constants.ZERO); |
| | | Orders byMemberCode = findOne(query); |
| | | if (byMemberCode != null) { |
| | | shopVerifyOrder(verifyCode, shopId, images, remark); |
| | | } else { |
| | | driverVerifyOrder(verifyCode, images, remark, shopId); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class, BusinessException.class}) |
| | | public void verifyOrderByShopId(Integer orderId, Integer shopId, List<String> images, String remark) { |
| | | if (orderId == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "订å主é®ä¸è½ä¸ºç©º"); |
| | | } |
| | | // æ ¹æ®è®¢å䏻鮿¥æ¾è®¢å |
| | | Orders order = ordersMapper.selectOne(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getId, orderId) |
| | | .eq(Orders::getDeleted, Constants.ZERO) |
| | | .last("limit 1")); |
| | | if (order == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "订åä¸åå¨"); |
| | | } |
| | | |
| | | // æ¥è¯¢é¨åºåç§°ç¨äºæ¥å¿ |
| | | String shopName = ""; |
| | | ShopInfo shopInfo = shopInfoMapper.selectById(shopId); |
| | | if (shopInfo != null) { |
| | | shopName = shopInfo.getName() != null ? shopInfo.getName() : ""; |
| | | } |
| | | |
| | | Integer status = order.getStatus(); |
| | | Date now = new Date(); |
| | | if (Constants.equalsInteger(status, Constants.OrderStatus.waitDeposit.getStatus())) { |
| | | // å¾
å¯å(1) â å·²å¯å(2)ï¼ä¸¤ç§ç±»åéç¨ |
| | | // æ ¡éªå½åé¨åºæ¯å¦ä¸ºè®¢åçåä»¶é¨åº |
| | | if (!shopId.equals(order.getDepositShopId())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "该订åä¸å±äºå½åé¨åºï¼æ æ³æ ¸é"); |
| | | } |
| | | order.setStatus(Constants.OrderStatus.deposited.getStatus()); |
| | | order.setDepositTime(now); |
| | | // éæ¾å½åæ ¸éç ï¼çææ°çæ ¸éç ä¾åä»¶æ¶ä½¿ç¨ |
| | | String verifyCode = order.getMemberVerifyCode(); |
| | | if (StringUtils.isNotBlank(verifyCode)) { |
| | | releaseVerifyCode(verifyCode); |
| | | } |
| | | order.setMemberVerifyCode(generateVerifyCode()); |
| | | ordersMapper.updateById(order); |
| | | // ä¿åå¯åå¾çï¼obj_type=2 订åå¯åå¾çï¼æå¤3å¼ ï¼ |
| | | saveVerifyImages(order.getId(), images, Constants.FileType.ORDER_DEPOSIT.getKey(), shopId); |
| | | // è®°å½è®¢åæ¥å¿ |
| | | saveShopVerifyLog(order, Constants.OrderLogType.shopDeposit, Constants.OrderLogType.shopDeposit.format(shopName), remark, shopId); |
| | | // éç¥ä¼åï¼é¨åºæ ¸éæå |
| | | if (Constants.equalsInteger(order.getType(), Constants.ONE)) { |
| | | // å¼å°å¯å â å¾
æ¢å |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_GRAB, order.getId(), |
| | | "orderNo", order.getCode()); |
| | | } else { |
| | | // å°±å°å¯å â å¾
åä»¶æé |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_PICKUP_REMIND, order.getId(), |
| | | "orderNo", order.getCode(), "shopName", shopName); |
| | | } |
| | | } else if (Constants.equalsInteger(status, Constants.OrderStatus.arrived.getStatus())) { |
| | | // å¼å°å¯å + æ åä»¶é¨åº â æ æ³æ ¸éï¼å®¢æ·èªåï¼æ é¨åºæä½ï¼ |
| | | if (Constants.equalsInteger(order.getType(), Constants.ONE) && order.getTakeShopId() == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "è¯¥è®¢åæ åä»¶é¨åºï¼æ æ³æ ¸é"); |
| | | } |
| | | // æ ¡éªåä»¶é¨åºä¸å½åç»å½é¨åºä¸è´ |
| | | if (!shopId.equals(order.getTakeShopId())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "该订åä¸å±äºå½åé¨åºï¼æ æ³æ ¸é"); |
| | | } |
| | | // æ ¡éªæ¯å¦å·²ç¡®è®¤é¡¾å®¢å°åº |
| | | if (order.getConfirmArriveTime() == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "请å
确认顾客å°åº"); |
| | | } |
| | | // æ ¡éªæ¯å¦åå¨å¾
å¤ççé¾æè´¹ç¨ |
| | | if (Constants.equalsInteger(order.getOverdueStatus(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "åå¨é¾æè´¹ç¨å¾
å¤çï¼è¯·å
å®æé¾æè´¹ç¨æ¯ä»"); |
| | | } |
| | | // å¾
åä»¶(5) â 已宿(7) |
| | | order.setStatus(Constants.OrderStatus.finished.getStatus()); |
| | | order.setConfirmArriveTime(now); |
| | | ordersMapper.updateById(order); |
| | | // 订å宿ï¼éæ¾æ ¸éç |
| | | String verifyCode = order.getMemberVerifyCode(); |
| | | if (StringUtils.isNotBlank(verifyCode)) { |
| | | releaseVerifyCode(verifyCode); |
| | | } |
| | | // ä¿ååºåºå¾çï¼obj_type=13 é¨åºåºåºå¾çï¼æå¤3å¼ ï¼ |
| | | saveVerifyImages(order.getId(), images, Constants.FileType.STORE_OUT.getKey(), shopId); |
| | | // çææ¶çè®°å½ |
| | | calculateAndSaveOrderFees(order.getId()); |
| | | generateRevenueRecords(order.getId()); |
| | | // è®°å½è®¢åæ¥å¿ |
| | | saveShopVerifyLog(order, Constants.OrderLogType.shopTake, Constants.OrderLogType.shopTake.format(shopName), remark, shopId); |
| | | // éç¥ä¼åï¼è®¢å已宿 |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.FINISHED, order.getId(), |
| | | "orderNo", order.getCode()); |
| | | // éç¥åä»¶é¨åºååä»¶é¨åºï¼è®¢å已宿 |
| | | String settleDays = operationConfigBiz.getConfig().getSettlementDate(); |
| | | notifyBothShops(order, Constants.ShopOrderNotify.FINISHED, |
| | | "orderNo", order.getCode(), |
| | | "settleDays", settleDays != null ? settleDays : "7"); |
| | | // éç¥å¸æºï¼è®¢å已宿 |
| | | if (order.getAcceptDriver() != null) { |
| | | sendDriverNotice(order.getAcceptDriver(), Constants.DriverOrderNotify.FINISHED, order.getId(), |
| | | "orderNo", order.getCode(), |
| | | "settleDays", settleDays != null ? settleDays : "7"); |
| | | } |
| | | } else { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½å订åç¶æä¸å
è®¸æ ¸é"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class, BusinessException.class}) |
| | | public void shopVerifyOrder(String verifyCode, Integer shopId, List<String> images, String remark) { |
| | | if (StringUtils.isBlank(verifyCode)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ ¸éç ä¸è½ä¸ºç©º"); |
| | |
| | | // æ ¡éªåä»¶é¨åºä¸å½åç»å½é¨åºä¸è´ |
| | | if (!shopId.equals(order.getTakeShopId())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "该订åä¸å±äºå½åé¨åºï¼æ æ³æ ¸é"); |
| | | } |
| | | // æ ¡éªæ¯å¦å·²ç¡®è®¤é¡¾å®¢å°åº |
| | | if (order.getConfirmArriveTime() == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "请å
确认顾客å°åº"); |
| | | } |
| | | // æ ¡éªæ¯å¦åå¨å¾
å¤ççé¾æè´¹ç¨ |
| | | if (Constants.equalsInteger(order.getOverdueStatus(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "åå¨é¾æè´¹ç¨å¾
å¤çï¼è¯·å
å®æé¾æè´¹ç¨æ¯ä»"); |
| | | } |
| | | // å¾
åä»¶(5) â 已宿(7) |
| | | order.setStatus(Constants.OrderStatus.finished.getStatus()); |
| | |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * å¡«å
é¾æç¶æå° VOï¼MyOrderVOï¼ |
| | | * overdueStatus: 0=æªå°åºæªé¾æ 1=æªå°åºåå¨é¾æ 2=å·²å°åºæªé¾æ 3=å·²å°åºå¾
æ¯ä»é¾æ 4=龿已æ¯ä» |
| | | */ |
| | | private void fillOverdueStatus(MyOrderVO vo, Orders order, List<OrdersDetail> details) { |
| | | Integer[] result = calcOverdueStatus(order, details); |
| | | vo.setOverdueStatus(result[0]); |
| | | vo.setOverdue(result[1] == 1); |
| | | vo.setOverdueDays(result[2]); |
| | | vo.setOverdueFee(result[3].longValue()); |
| | | } |
| | | |
| | | /** |
| | | * å¡«å
é¾æç¶æå° VOï¼MyOrderDetailVOï¼ |
| | | */ |
| | | private void fillOverdueStatus(MyOrderDetailVO vo, Orders order, List<OrdersDetail> details) { |
| | | Integer[] result = calcOverdueStatus(order, details); |
| | | vo.setOverdueStatus(result[0]); |
| | | vo.setOverdue(result[1] == 1); |
| | | vo.setOverdueDays(result[2]); |
| | | vo.setOverdueFee(result[3].longValue()); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®é¾æç¶æ |
| | | * @return [overdueStatus, isOverdue(0/1), overdueDays, overdueFee] |
| | | */ |
| | | private Integer[] calcOverdueStatus(Orders order, List<OrdersDetail> details) { |
| | | // 4=龿已æ¯ä»ï¼è®¢å overdueStatus=2ï¼ |
| | | if (Constants.equalsInteger(order.getOverdueStatus(), Constants.TWO)) { |
| | | return new Integer[]{4, 1, order.getOverdueDays(), order.getOverdueAmount() != null ? order.getOverdueAmount().intValue() : 0}; |
| | | } |
| | | // 3=å·²å°åºå¾
æ¯ä»é¾æï¼è®¢å overdueStatus=1ï¼ |
| | | if (Constants.equalsInteger(order.getOverdueStatus(), Constants.ONE)) { |
| | | return new Integer[]{3, 1, order.getOverdueDays(), order.getOverdueAmount() != null ? order.getOverdueAmount().intValue() : 0}; |
| | | } |
| | | // 计ç®å®æ¶é¾æ |
| | | OverdueFeeVO overdueInfo = calculateOverdueFeeInternal(order, details); |
| | | boolean hasOverdue = overdueInfo.getOverdue() != null && overdueInfo.getOverdue() |
| | | && overdueInfo.getOverdueFee() != null && overdueInfo.getOverdueFee() > 0; |
| | | if (order.getConfirmArriveTime() != null) { |
| | | // å·²å°åº |
| | | int days = hasOverdue ? overdueInfo.getOverdueDays() : 0; |
| | | long fee = hasOverdue ? overdueInfo.getOverdueFee() : 0L; |
| | | return new Integer[]{2, hasOverdue ? 1 : 0, days, (int) fee}; |
| | | } else { |
| | | // æªå°åº |
| | | if (hasOverdue) { |
| | | return new Integer[]{1, 1, overdueInfo.getOverdueDays(), overdueInfo.getOverdueFee().intValue()}; |
| | | } else { |
| | | return new Integer[]{0, 0, 0, 0}; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * é¾æè´¹ç¨å
é¨è®¡ç®ï¼ä¸æ¥åºï¼æ¥å颿¥è¯¢çæ°æ®ï¼ |
| | | * ä¾å页çå·²æ¥è¯¢æç»çä¸å¡åºæ¯å¤ç¨ï¼é¿å
é夿¥è¯¢ |
| | | */ |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.RevenueMapper; |
| | | import com.doumee.dao.business.WithdrawalOrdersMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.ShopInfoMapper; |
| | | import com.doumee.dao.business.model.Revenue; |
| | | import com.doumee.dao.business.model.ShopInfo; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.WithdrawalOrders; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.dto.RevenueQueryDTO; |
| | | import com.doumee.dao.vo.RevenueStatisticsVO; |
| | | import com.doumee.dao.vo.RevenueSummaryVO; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Driver; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private DriverInfoMapper driverInfoMapper; |
| | | |
| | | @Override |
| | | public Integer create(Revenue revenue) { |
| | |
| | | |
| | | @Override |
| | | public RevenueStatisticsVO getDriverRevenueStatistics(Integer memberId) { |
| | | Member member = memberMapper.selectById(memberId); |
| | | if (member == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "ç¨æ·ä¸åå¨"); |
| | | DriverInfo driverInfo = driverInfoMapper.selectById(memberId); |
| | | if (driverInfo == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "叿ºä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | return buildRevenueStatistics(memberId, Constants.ONE, member.getAmount()); |
| | | return buildRevenueStatistics(memberId, Constants.ONE, driverInfo.getBalance()); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void changePassword(Integer shopId, String newPassword, String token) { |
| | | if (StringUtils.isBlank(newPassword)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | // æ ¡éªå¯ç å¿
须忶å
å«åæ¯åæ°å |
| | | boolean hasLetter = newPassword.chars().anyMatch(Character::isLetter); |
| | | boolean hasDigit = newPassword.chars().anyMatch(Character::isDigit); |
| | | if (!hasLetter || !hasDigit) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å¯ç å¿
须忶å
å«åæ¯åæ°å"); |
| | | } |
| | | // æ¥è¯¢é¨åº |
| | | ShopInfo shopInfo = shopInfoMapper.selectById(shopId); |
| | | if (shopInfo == null || Constants.equalsInteger(shopInfo.getDeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | // éæ°çæsaltï¼å 坿°å¯ç å¹¶æ´æ° |
| | | String salt = RandomStringUtils.randomAlphabetic(6); |
| | | shopInfo.setPassword(Utils.Secure.encryptPassword(newPassword, salt)); |
| | | shopInfo.setSalt(salt); |
| | | shopInfoMapper.updateById(shopInfo); |
| | | // æ¸
é¤tokenï¼å¼ºå¶éæ°ç»å½ |
| | | if (StringUtils.isNotBlank(token)) { |
| | | redisTemplate.delete(token); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | des_pwd: 123456SDFKDJF |
| | | |
| | | jpush: |
| | | appKey: |
| | | masterSecret: |
| | | apnsProduction: false |
| | | |
| | | knife4j: |
| | | enable: true |
| | | basic: |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/gtzxinglijicun?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | url: jdbc:mysql://rm-bp1qxtf4wy100fur3yo.mysql.rds.aliyuncs.com:3306/gtzxinglijicun?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: gtzxinglijicun |
| | | password: gtzxljc@2026 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | redis: |
| | |
| | | pay: |
| | | appId: wxb1b59320e803dc6c |
| | | appSecret: eb93785c7bca3f0ff0364b0e26bfeb59 |
| | | mchId: 1229817002 #åæ·å· |
| | | mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM #åæ·ç§é¥ |
| | | apiV3Key: 7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB #apiV3Key |
| | | serialNumer: 3FE90C2F3D40A56E1C51926F31B8A8D22426CCE0 #åæ·è¯ä¹¦åºåå· |
| | | notifyUrl: http://xiaopiqiu2.natapp1.cc/web/wxPayNotify |
| | | refundNotifyUrl: http://xiaopiqiu2.natapp1.cc/web/wxRefundNotify |
| | | v3NotifyUrl: http://xiaopiqiu2.natapp1.cc/web/api/wxPayV3Notify |
| | | v3RefundNotifyUrl: http://xiaopiqiu2.natapp1.cc/web/api/wxRefundV3Notify |
| | | keyPath: D:\DouMee\1229817002_20220310_cert\apiclient_cert.p12 |
| | | privateCertPath: D:\DouMee\1229817002_20220310_cert\apiclient_cert.pem |
| | | privateKeyPath: D:\DouMee\1229817002_20220310_cert\apiclient_key.pem |
| | | pubKeyPath: D:\DouMee\1229817002_20220310_cert\pub_key.pem #åæ·æ¯ä»å
¬é¥ |
| | | mchId: 1629568742 #åæ·å· |
| | | apiV3Key: NJTLJSTZYXZRGScaiwubuzichanbu666 #apiV3Key |
| | | serialNumer: 25D19D18217F4588841E5CD1AA0D1533DE8AF84A #åæ·è¯ä¹¦åºåå· |
| | | privateKeyPath: pay/pro/wx/apiclient_key.pem |
| | | v3NotifyUrl: https://llfc.lmpro.cn/nyx_web/web/api/wxPayV3Notify |
| | | v3RefundNotifyUrl: https://llfc.lmpro.cn/nyx_web/web/api/wxRefundV3Notify |
| | | |
| | | typeId: jinkuai |
| | | |
| | | alipay: |
| | | pay: |
| | | appId: 2021006146626440 |
| | | privateKey: MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC0zIy4Ej8yG34uQ8zECWu12INdTWYuvSudhrf1qtUrPx4FO9vDGc8NdPz63M3y+akWh9o8gsl7qQqOoB7o8gYebLTzF2ZP3ByxgkNRGUwZBIi0iL/28eq/2uDCWnqNBDEeFQpfWeRcErC28LCB6JSI7F6owH78LiU8pNO0pVvqwvcLovlVee4UDtLThBegUxkkHXq4EM9yutkfps1ruDiTGFYyTjS8g9BmNJ7rJoRSKTE85Gl8OYp1SuFbyurPEaFLBW9yGHbsqMqegys2PwV6PxZq3WBbFMiuWI5fane+VL2jyVoV36CYPS2GFjq0stuUHZvPL1uYk+bwAAei7a2JAgMBAAECggEBAJMnTX1gNJl28Qt82YPRWx6F292r6nguNfqftMi6Q4hQdgGyh5rTPcfpKSKRZvrVIz+YURMhLBZ/Ln2Ja78ThdFrjxewOvDS6XO830d5vIs8OnweNYgrvHJtFrR5afeuqr+eRnP3OTuLZtNvMWp6v7J2GFFnY7OjZ2Flkn4cfKSkqnLQnZ/oDKA/a40OclHRmaQZcS5YkGZqeR+NssanUDad89IVz7NU0kXTbaXjbGHyJscLr6hM3otdfrYsboJ5XHLOnnpSLptv3I0HSUeHBSdhAbP5Hlot+xOo6EbeougefmT2FZWaDA+kPHgajCOdZHW3v+13Xp+PioRW0IPcsLUCgYEA+11Fqm+tpP351tdkJyW+weTy0/OnvUuSVQP/0/kvzQ84kjfkxdoyTKe6kT8+K5b5dkCQhGRfWgb7/amKEe1loCQsujf7/6aebUgTevrOs96LErMT1fCqId1t/MWgXVFpzo8n2OTks2r0nleHY7C9VZiPIbGBQDbkJChIFRAiRXsCgYEAuCIg2p4RrlOG/i4/r1xKmOIwba9snTBnAB8/bri913xMy055OVF6P46hC6d/J25QNqYGODBBF4kmiBuco+vtuz6C94Uo3h/oYD3jetmwlAnRWjEl9Z3Pkf5cbE+o5KBZmUa+M7BTrBDutzdRDqX2SANvnoDWVF03teY9lcVNL8sCgYEAoFdeEhtNC/tKfKZG58XnCe4Oi+9YJ6LmRD7Z2RCSUl8MOhFXaHIINeekVfSeptWWab1DsoAIZvgflC6quUbS1bVdpqgBopFZa+JXMtJ8OjaSRipfU9BB5npGJ8C0y/Ib6TxeMbfIvz5RrhOtdIUQMWKwotCE3z5khz/+wxjYk7MCgYBrMesgeo9ehl/7T99hboA7GssIv+yiYhBEoOxjwAc9EK8AWNH3zXg20gjtaPh8cxsdhW/vfCAY3I5jBHgfcfU3YcAK6ymMjtTQWpc46MyEkmafdCdeIx45JvSVVZbEaplewzFtlARSEpV2ciytM276I43yn5ynBpGtQrmtnGxAGwKBgQCy8imu84IhC+BivLRYdsQ+hMsqs0nih4wfVPKWr6K64QO6CZ4riL76lppH8UBG5EXtRd6cjBbORgvQtr22OJxFcj8WuZjBvYvvCOsTE0jGMdiyBqx9k0PsLrtlVZPFP4kj9vDSFNIyAgIOiAmYY4kBtGfhQqRcDgZK+mgHY0zMbg== |
| | | appCertPath: foo/pro/appCertPublicKey_2021006146626440.crt |
| | | alipayPublicCertPath: pro/dev/alipayCertPublicKey_RSA2.crt |
| | | rootCertPath: foo/pro/alipayRootCert.crt |
| | | appId: 2021006147660139 |
| | | privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEeqqkZztBHfK+vpyBi6ejgDTHZuZ3yiuXds+lRBbMo/g24F5trH+oLHW0gMhSxihFfQBBIpVBXDsPQK4ZkhDWTaOBktnU1UMRoOEiaaZU6EiWy10ePFUmpdXpkCQEp7rc88OwI90p58S3+L+Ckak60WqNwJBdB5YGBaUunryBA78U4zW1KNY7JvoRnZDcFMQiczikwUzhO7EAi0yVrVpsVsc9s87mcS4uOJKx4qb2E83r9RJ1z30db+cIIZRiLP2oNZBLYzgKpOouE+uIgxhQzlh6cOASNZQulXuUjoT/+Y9w4njfl4TmKIXWcJFKIMc6kMiux9tTncpp0TqRwk1tAgMBAAECggEALkSYtJheusnbpRFr95G0i2sggqh3s1PXihZ/dXKgT9Z5GCsj8X3Cng7CNRxykBN73kk+axhCv56Bhej8Vqcv8ddcnqG/TEBgR+Fzws/QTIRau6/uILWic7RvuE2qPbJl7aw1s9/uL/UVPSGFr7CvgltYVUM4e7/Sk1529JCK4XJfoXP5tKJ3OaXssvaFnCKEU8IGQkjRG+lUZJhAHVtClGHtgrhevgRhy2zre5wp2qSa8d/MqrPruSYS02hn9b5Nl6i2PlUS6dGlJ4lrxYTG22ukYYoxAPNPS7gnvmveXonWP7b5tPhKRpZjnoySojz3WECUlhz/v8wM1cDrpq+GQQKBgQDsc7y2rlx4f77a7ORfb5/qWHCOJs1cIzggj0kJ7TgFGe71kbCQ5nywD/Fe5V9OwbW+DCxOME+SrrHeiK4axWiu5si/1JlurJoxNy+4k4ywk3ZA3Nv2aBhlPqfkwDhJ0z7Mgsq2c/YgnVddmSvKZoC39wA77ovks4GDxaBOt8N7PQKBgQDUuPGgzkwcgb60UdaxfMbacrPsW26vDxaE4ceuXo2m8KDiCIqkF2y9r6AdWMTgGGSJwOsk7+FP+21VdRivCg9HcOLWngveUc6xDIuqKHVpemMo3SdCF4Wqf96rRc3VOBr5cfIdWxeorZf5umMyKnIAjAFETOOrK7eLTTmjyLD98QKBgB82S+Plcklpu3zUpnS+nGJn2Du7fYI7F+6cW2zXBn0N5lA+Mgt+kVkAUcFQD9uqkF4M51BO6kIXk10nt6vLAT2NM1S3MKW+XQBAI6l+uKSaYpK/VL3bEdVThwAYK5X7L5/5Z97bwdKeUmkFjhVCoJ0oGrzOiWLgGymUzct2UHSVAoGBAMb+7Cs+Ub0pMrmFBY6r52pbey1Uq0pglvRgMmhQU7sjx50r2GaA81zPer15WVM5/nNPYaoALYqg7jrPe/PjOT/fvpR+7SNg7DZ8QftANfYiY7jKifst/gDt9ePLPS6FedZ4XcJQgOVu34jicAFx64vPbS/zrddm4iEScSVijRBBAoGAXCheERsx8+n16Us/DttXFUa1nc7+D8WR6buM1QMZgQCVF2qp3XtM+FusCKL4+q1+dtag8svLjJFp9QbaAXqX8Zk7rn8wUHbDloPTPy9XWgrPowyL9MPU+e/Rq8Hr6TWPDBd4TU64YzIEfBQYpJXfZbXhVYmK3o7xHXKB1x4vvEM= |
| | | appCertPath: pay/pro/appCertPublicKey.crt |
| | | alipayPublicCertPath: pay/pro/alipayCertPublicKey_RSA2.crt |
| | | rootCertPath: pay/pro/alipayRootCert.crt |
| | | |
| | | upload: |
| | | type: blob |
| | | |
| | | qiwei: |
| | | serviceurl: https://wecom-qyapi.unilever-china.com/ |
| | | |
| | | |
| | | type: ftp |
| | | |
| | | # è
¾è®¯å°å¾apikey |
| | | tencent_key: WE3BZ-HN6WS-ONDOH-62QCV-MNL6F-5NFNE |
| | | tencent_key: |
| | | |
| | | # é«å¾·å°å¾apikey |
| | | geocode_map_key: |
| | | geocode_map_key: 9a6c1f0eff2e5aa91989ca9d4c21e262 |
| | | |
| | | qiwei: |
| | | serviceurl: https://qyapi.weixin.qq.com |
| | | |
| | | |
| | | aes: |
| | | encrypt: |
| | | open: true # æ¯å¦å¼å¯å å¯ true or false |
| | | showLog: true # æ¯å¦æå°å è§£å¯log true or false |
| | | publicKey: mN4Yn8Or8r7SH1w3 # AESå¯é¥ |
| | | privateKey: # RSAç§é¥ |
| | | time: 600000 |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "é¨åºéåºç»å½", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/logOutShop") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse logOutShop() { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.SHOP_HEADER_KEY); |
| | | memberService.logOut(token,getShopId(), Constants.TWO); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºéåºç»å½", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/logOutDriver") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse logOutDriver() { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | memberService.logOut(token,getDriverId(), Constants.ONE); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | @LoginRequired |
| | | @ApiOperation(value = "ç¨æ·æ³¨é", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/logOff") |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | |
| | | return ApiResponse.success("æ¥è¯¢æå", noticeService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "é¨åºæ è®°å
¨é¨å·²è¯»", notes = "æ è®°å½åç¨æ·æææªè¯»éç¥ä¸ºå·²è¯»") |
| | | @PostMapping("/shopReadAllNotice") |
| | | @ApiImplicitParams({ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºéç¥æ¶æ¯å页", notes = "æªè¯»ä¼å
ï¼æ¶é´ååº") |
| | | @PostMapping("/driverNoticePage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<PageData<Notice>> driverNoticePage(@RequestBody PageWrap<Notice> pageWrap) { |
| | | if (pageWrap.getModel() == null) { |
| | | pageWrap.setModel(new Notice()); |
| | | } |
| | | pageWrap.getModel().setUserId(this.getDriverId()); |
| | | pageWrap.getModel().setUserType(Constants.ONE); |
| | | return ApiResponse.success("æ¥è¯¢æå", noticeService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæ è®°å
¨é¨å·²è¯»", notes = "æ è®°å½åç¨æ·æææªè¯»éç¥ä¸ºå·²è¯»") |
| | | @PostMapping("/driverReadAllNotice") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse driverReadAllNotice() { |
| | | noticeService.readAllNotice(Constants.ONE, this.getDriverId()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 叿ºéªè¯ç ç»å½æ¥å£ |
| | |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "叿ºç´¯è®¡ç»è®¡", notes = "累计佣éãå¾
ç»ç®ä½£éãè®¢åæ»æ°ãé±å
ä½é¢") |
| | | @GetMapping("/stats") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<com.doumee.dao.vo.DriverStatsVO> stats() { |
| | | return ApiResponse.success("æä½æå", driverInfoService.getDriverStats(this.getDriverId())); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "叿ºæ¢å大å
", notes = "å页æ¥è¯¢å¯æ¢çå¼å°å¯å订å") |
| | | @PostMapping("/grabOrderHall") |
| | | @ApiImplicitParams({ |
| | |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "叿ºä¿®æ¹å¯ç ", notes = "æ°å¯ç å¿
须忶å
å«åæ¯åæ°åï¼ä¿®æ¹æååééæ°ç»å½") |
| | | @GetMapping("/changePassword") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse changePassword(@RequestParam String newPassword) { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | driverInfoService.changePassword(this.getDriverId(), newPassword, token); |
| | | return ApiResponse.success("å¯ç ä¿®æ¹æåï¼è¯·éæ°ç»å½"); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "è¿è¡ä¸è®¢åæ°é", notes = "è¿åå·²æ¢ååæ´¾éä¸çè®¢åæ°é") |
| | | @GetMapping("/activeOrderCount") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<Map<String, Integer>> activeOrderCount() { |
| | | return ApiResponse.success("æä½æå", driverInfoService.getActiveOrderCount(this.getDriverId())); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | |
| | | import com.doumee.dao.dto.CommentOrderDTO; |
| | | import com.doumee.dao.dto.ConfirmArriveDTO; |
| | | import com.doumee.dao.dto.CreateOrderDTO; |
| | | import com.doumee.dao.dto.DriverVerifyDTO; |
| | | import com.doumee.dao.dto.ShopVerifyDTO; |
| | | import com.doumee.dao.dto.StoreOutDTO; |
| | | import com.doumee.dao.dto.MyOrderDTO; |
| | |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "é¨åºæ ¸éæ¶ä»¶", notes = "é¨åºéè¿æ ¸éç 确认æ¶ä»¶/åä»¶") |
| | | @ApiOperation(value = "é¨åºæ ¸é", notes = "é¨åºéè¿è®¢å主é®ç¡®è®¤å¯å/åä»¶") |
| | | @PostMapping("/shopVerify") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "é¨åºtokenå¼", required = true) |
| | | }) |
| | | public ApiResponse shopVerify(@RequestBody @Validated ShopVerifyDTO dto) { |
| | | ordersService.shopVerifyOrder(dto.getVerifyCode(), getShopId(), dto.getImages(), dto.getRemark()); |
| | | return ApiResponse.success("æ ¸éæå"); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "æ ¸é叿ºç ", notes = "å¼å°å¯å䏿åä»¶é¨åºç订åï¼éè¿å¸æºæ ¸éç 确认å°åº") |
| | | @PostMapping("/driverVerify") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse driverVerify(@RequestBody @Validated DriverVerifyDTO dto) { |
| | | ordersService.driverVerifyOrder(dto.getVerifyCode(), dto.getImages(), dto.getRemark(), getShopId()); |
| | | ordersService.verifyOrderByShopId(dto.getOrderId(), getShopId(), dto.getImages(), dto.getRemark()); |
| | | return ApiResponse.success("æ ¸éæå"); |
| | | } |
| | | |
| | |
| | | }) |
| | | public ApiResponse<MyOrderDetailVO> shopDetail(@RequestParam(required = false) Integer orderId, |
| | | @RequestParam(required = false) String verifyCode) { |
| | | return ApiResponse.success("æ¥è¯¢æå", ordersService.findShopOrderDetail(orderId, verifyCode)); |
| | | MyOrderDetailVO myOrderDetailVO = ordersService.findShopOrderDetail(orderId, verifyCode); |
| | | myOrderDetailVO.setMemberVerifyCode(null); |
| | | return ApiResponse.success("æ¥è¯¢æå", myOrderDetailVO); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | |
| | | @Autowired |
| | | private RevenueService revenueService; |
| | | |
| | | @LoginRequired |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæµæ°´å页", notes = "å°ç¨åºç«¯") |
| | | @PostMapping("/driverPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<PageData<Revenue>> driverPage(@RequestBody @Validated PageWrap<RevenueQueryDTO> pageWrap) { |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.findDriverRevenuePage(pageWrap, getMemberId())); |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.findDriverRevenuePage(pageWrap, getDriverId())); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæµæ°´æ¶æ¯ç»è®¡", notes = "æ ¹æ®æ¥è¯¢æ¡ä»¶ç»è®¡æ¶å
¥ä¸æ¯åº") |
| | | @PostMapping("/driverSummary") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<RevenueSummaryVO> driverSummary(@RequestBody RevenueQueryDTO queryDTO) { |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.getDriverRevenueSummary(queryDTO, getMemberId())); |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.getDriverRevenueSummary(queryDTO, getDriverId())); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | |
| | | |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | |
| | | return ApiResponse.success("æä½æå", ordersService.payShopDeposit(getMemberId())); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @Trace |
| | | @ApiOperation(value = "é¨åºä¿®æ¹å¯ç ", notes = "æ°å¯ç å¿
须忶å
å«åæ¯åæ°åï¼ä¿®æ¹æååééæ°ç»å½") |
| | | @PostMapping("/changePassword") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "é¨åºtokenå¼", required = true), |
| | | }) |
| | | public ApiResponse changePassword(@RequestParam String newPassword) { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | shopInfoService.changePassword(this.getShopId(), newPassword, token); |
| | | return ApiResponse.success("å¯ç ä¿®æ¹æåï¼è¯·éæ°ç»å½"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | @Autowired |
| | | private RevenueService revenueService; |
| | | |
| | | @LoginRequired |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæç°ç³è¯·", notes = "å°ç¨åºç«¯") |
| | | @PostMapping("/driverApply") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse driverApply(@RequestBody @Validated WithdrawalDTO dto) { |
| | | withdrawalOrdersService.applyDriverWithdrawal(dto, getMemberId()); |
| | | withdrawalOrdersService.applyDriverWithdrawal(dto, getDriverId()); |
| | | return ApiResponse.success("æç°ç³è¯·å·²æäº¤"); |
| | | } |
| | | |
| | |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.getShopRevenueStatistics(getShopId())); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæ¶çç»è®¡", notes = "å½åç»å½å¸æºçæ¶ç/æç°ç»è®¡") |
| | | @GetMapping("/driverStatistics") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<RevenueStatisticsVO> driverStatistics() { |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.getDriverRevenueStatistics(getMemberId())); |
| | | return ApiResponse.success("æ¥è¯¢æå", revenueService.getDriverRevenueStatistics(getDriverId())); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "æç°è¯¦æ
", notes = "æ ¹æ®æç°ä¸»é®æ¥è¯¢è¯¦æ
ï¼å«å®¡æ¹äººä¿¡æ¯ï¼") |
| | | @GetMapping("/detail/{id}") |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "é¨åºæç°è¯¦æ
", notes = "æ ¹æ®æç°ä¸»é®æ¥è¯¢è¯¦æ
ï¼å«å®¡æ¹äººä¿¡æ¯ï¼") |
| | | @GetMapping("/shopDetail/{id}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "id", value = "æç°è®°å½ä¸»é®", required = true) |
| | | }) |
| | | public ApiResponse<WithdrawalOrders> detail(@PathVariable Integer id) { |
| | | public ApiResponse<WithdrawalOrders> shopDetail(@PathVariable Integer id) { |
| | | return ApiResponse.success("æ¥è¯¢æå", withdrawalOrdersService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @LoginDriverRequired |
| | | @ApiOperation(value = "叿ºæç°è¯¦æ
", notes = "æ ¹æ®æç°ä¸»é®æ¥è¯¢è¯¦æ
ï¼å«å®¡æ¹äººä¿¡æ¯ï¼") |
| | | @GetMapping("/driverDetail/{id}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "id", value = "æç°è®°å½ä¸»é®", required = true) |
| | | }) |
| | | public ApiResponse<WithdrawalOrders> driverDetail(@PathVariable Integer id) { |
| | | return ApiResponse.success("æ¥è¯¢æå", withdrawalOrdersService.findById(id)); |
| | | } |
| | | |