Authored by chenchao

notice appraise address is Changed

@@ -85,4 +85,18 @@ public class ExpressInfoController { @@ -85,4 +85,18 @@ public class ExpressInfoController {
85 AppraiseAddressResp appraiseAddressResp = expressInfoService.queryAppraiseAddress(uid, orderCode, skup); 85 AppraiseAddressResp appraiseAddressResp = expressInfoService.queryAppraiseAddress(uid, orderCode, skup);
86 return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build(); 86 return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
87 } 87 }
  88 +
  89 + /**
  90 + * 鉴定中心地址
  91 + * @param uid uid
  92 + * @return
  93 + */
  94 + @RequestMapping(params = "method=ufo.order.noticeAppraiseAddressChanged")
  95 + public ApiResponse noticeAppraiseAddressChanged(@RequestParam("uid") Integer uid,
  96 + @RequestParam(value="orderCode")Long orderCode) {
  97 + LOG.info("method=ufo.order.noticeAppraiseAddressChanged in, uid {}, orderCode {}", uid, orderCode);
  98 +
  99 + AppraiseAddressResp appraiseAddressResp = expressInfoService.noticeAppraiseAddressChanged(uid, orderCode);
  100 + return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
  101 + }
88 } 102 }
1 package com.yohoufo.order.model.response; 1 package com.yohoufo.order.model.response;
2 2
3 import com.alibaba.fastjson.annotation.JSONField; 3 import com.alibaba.fastjson.annotation.JSONField;
  4 +import lombok.Getter;
  5 +import lombok.Setter;
4 6
5 /** 7 /**
6 * Created by li.ma on 2018/9/27. 8 * Created by li.ma on 2018/9/27.
@@ -19,6 +21,13 @@ public class AppraiseAddressResp { @@ -19,6 +21,13 @@ public class AppraiseAddressResp {
19 21
20 @JSONField(name="id") 22 @JSONField(name="id")
21 private Integer type; 23 private Integer type;
  24 + /**
  25 + * 是否变更
  26 + */
  27 + @Getter
  28 + @Setter
  29 + @JSONField(name="isChanged")
  30 + private boolean isChanged;
22 31
23 public Integer getType() { 32 public Integer getType() {
24 return type; 33 return type;
@@ -78,6 +78,9 @@ public interface IExpressInfoService { @@ -78,6 +78,9 @@ public interface IExpressInfoService {
78 AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup); 78 AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup);
79 79
80 80
  81 + AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode);
  82 +
  83 +
81 /** 84 /**
82 * 根据订单号获取快递类型 85 * 根据订单号获取快递类型
83 * 1:卖家到鉴定中心 86 * 1:卖家到鉴定中心
@@ -71,14 +71,18 @@ public class AppraiseAddressService { @@ -71,14 +71,18 @@ public class AppraiseAddressService {
71 return address; 71 return address;
72 } 72 }
73 73
74 - private static final String DEFAULT_MOBILE = "13073457202"; 74 + private static final String DEFAULT_MOBILE = "18752002919",
  75 + addressName = "刘优福",
  76 + address = "南京市江宁区苏源大道87号有货仓储物流中心西四楼有货UFO实物鉴定中心";
75 77
76 // 根据默认鉴定中心地址 78 // 根据默认鉴定中心地址
77 public AppraiseAddressResp queryInitAddress() { 79 public AppraiseAddressResp queryInitAddress() {
78 List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList(); 80 List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList();
79 81
80 if (CollectionUtils.isEmpty(appraiseAddressResps)) { 82 if (CollectionUtils.isEmpty(appraiseAddressResps)) {
81 - return new AppraiseAddressResp.builder().setMobile(DEFAULT_MOBILE).setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区望京东园523号楼融科望京中心写字楼A座1208-UFO鉴定中心").build(); 83 + return new AppraiseAddressResp.builder().setMobile(DEFAULT_MOBILE).setType(0)
  84 + .setAddressName(addressName)
  85 + .setAddress(address).build();
82 } 86 }
83 return appraiseAddressResps.get(0); 87 return appraiseAddressResps.get(0);
84 } 88 }
@@ -43,10 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -43,10 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
43 import org.springframework.stereotype.Service; 43 import org.springframework.stereotype.Service;
44 44
45 import javax.annotation.Resource; 45 import javax.annotation.Resource;
46 -import java.util.ArrayList;  
47 -import java.util.Arrays;  
48 -import java.util.List;  
49 -import java.util.Optional; 46 +import java.util.*;
50 import java.util.stream.Collectors; 47 import java.util.stream.Collectors;
51 48
52 /** 49 /**
@@ -1046,4 +1043,45 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -1046,4 +1043,45 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
1046 // 匹配不了,给个娄底的 1043 // 匹配不了,给个娄底的
1047 return resp==null ? appraiseAddressService.queryInitAddress() : resp; 1044 return resp==null ? appraiseAddressService.queryInitAddress() : resp;
1048 } 1045 }
  1046 +
  1047 + /**
  1048 + * 鉴定中心地址变更弹框通知
  1049 + * @param uid
  1050 + * @param orderCode
  1051 + * @return
  1052 + */
  1053 + @Override
  1054 + public AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode) {
  1055 +
  1056 + if (null == uid || orderCode == null) {
  1057 + LOGGER.warn("in noticeAppraiseAddressChanged check in-param fail, uid {}, orderCode {}", uid, orderCode);
  1058 + throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
  1059 + }
  1060 + BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
  1061 + if (Objects.isNull(pbog)){
  1062 + LOGGER.warn("in noticeAppraiseAddressChanged BuyerOrderGoods not exist, uid {}, order code {}", uid, orderCode);
  1063 + return null;
  1064 + }
  1065 + int skup = pbog.getSkup();
  1066 + AddressInfo buyerAddress = findSellerAddressInfo(uid, skup);
  1067 +
  1068 + LOGGER.info("in noticeAppraiseAddressChanged get Address {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
  1069 +
  1070 + // 根据用户id查询默认地址的省份
  1071 + AppraiseAddressResp resp = null;
  1072 + if (null != buyerAddress ) {
  1073 + // 根据产品给的哪些用户的省份匹配到对应的鉴定中心地址
  1074 + resp = appraiseAddressService.queryAddressByAreaCode(buyerAddress.getAreaCode());
  1075 + }
  1076 + // 匹配不了,给个娄底的
  1077 + resp = resp==null ? appraiseAddressService.queryInitAddress() : resp;
  1078 + if (resp.getType() == 1){
  1079 + resp.setChanged(true);
  1080 + }else{
  1081 + resp = null;
  1082 + }
  1083 + return resp;
  1084 + }
  1085 +
  1086 +
1049 } 1087 }
@@ -27,11 +27,11 @@ @@ -27,11 +27,11 @@
27 </appender> 27 </appender>
28 28
29 <appender name="RECOMMEND_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> 29 <appender name="RECOMMEND_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
30 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/recommend.log</file> 30 + <file>/Data/logs/ufo-gateway/recommend.log</file>
31 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 31 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
32 <!-- daily rollover --> 32 <!-- daily rollover -->
33 <fileNamePattern> 33 <fileNamePattern>
34 - ${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/recommend.%d{yyyy-MM-dd}.%i.log.gz 34 + /Data/logs/ufo-gateway/archived/recommend.%d{yyyy-MM-dd}.%i.log.gz
35 </fileNamePattern> 35 </fileNamePattern>
36 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 36 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
37 <!-- or whenever the file size reaches 100MB --> 37 <!-- or whenever the file size reaches 100MB -->
@@ -46,10 +46,10 @@ @@ -46,10 +46,10 @@
46 </appender> 46 </appender>
47 47
48 <appender name="LOGIN_LOW_CLIENT_TYPE_RECORD" class="ch.qos.logback.core.rolling.RollingFileAppender"> 48 <appender name="LOGIN_LOW_CLIENT_TYPE_RECORD" class="ch.qos.logback.core.rolling.RollingFileAppender">
49 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/login_low_clientType_record.log</file> 49 + <file>/Data/logs/ufo-gateway/login_low_clientType_record.log</file>
50 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 50 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
51 <!-- daily rollover --> 51 <!-- daily rollover -->
52 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/login_low_clientType_record.%d{yyyy-MM-dd}.%i.log.gz 52 + <fileNamePattern>/Data/logs/ufo-gateway/archived/login_low_clientType_record.%d{yyyy-MM-dd}.%i.log.gz
53 </fileNamePattern> 53 </fileNamePattern>
54 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 54 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
55 <!-- or whenever the file size reaches 100MB --> 55 <!-- or whenever the file size reaches 100MB -->
@@ -66,10 +66,10 @@ @@ -66,10 +66,10 @@
66 66
67 67
68 <appender name="GRAPH_VERIFY_SWITCH" class="ch.qos.logback.core.rolling.RollingFileAppender"> 68 <appender name="GRAPH_VERIFY_SWITCH" class="ch.qos.logback.core.rolling.RollingFileAppender">
69 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/graph_verify_switch.log</file> 69 + <file>/Data/logs/ufo-gateway/graph_verify_switch.log</file>
70 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 70 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
71 <!-- daily rollover --> 71 <!-- daily rollover -->
72 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/graph_verify_switch.%d{yyyy-MM-dd}.%i.log.gz 72 + <fileNamePattern>/Data/logs/ufo-gateway/archived/graph_verify_switch.%d{yyyy-MM-dd}.%i.log.gz
73 </fileNamePattern> 73 </fileNamePattern>
74 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 74 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
75 <!-- or whenever the file size reaches 100MB --> 75 <!-- or whenever the file size reaches 100MB -->
@@ -85,11 +85,11 @@ @@ -85,11 +85,11 @@
85 </appender> 85 </appender>
86 86
87 <appender name="LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> 87 <appender name="LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
88 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/login.log</file> 88 + <file>/Data/logs/ufo-gateway/login.log</file>
89 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 89 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
90 <!-- daily rollover --> 90 <!-- daily rollover -->
91 <fileNamePattern> 91 <fileNamePattern>
92 - ${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/login.%d{yyyy-MM-dd}.%i.log.gz 92 + /Data/logs/ufo-gateway/archived/login.%d{yyyy-MM-dd}.%i.log.gz
93 </fileNamePattern> 93 </fileNamePattern>
94 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 94 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
95 <!-- or whenever the file size reaches 100MB --> 95 <!-- or whenever the file size reaches 100MB -->
@@ -104,11 +104,11 @@ @@ -104,11 +104,11 @@
104 </appender> 104 </appender>
105 105
106 <appender name="SESSION_LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> 106 <appender name="SESSION_LOGIN_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
107 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/session-login.log</file> 107 + <file>/Data/logs/ufo-gateway/session-login.log</file>
108 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 108 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
109 <!-- daily rollover --> 109 <!-- daily rollover -->
110 <fileNamePattern> 110 <fileNamePattern>
111 - ${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/session-login.%d{yyyy-MM-dd}.%i.log.gz 111 + /Data/logs/ufo-gateway/archived/session-login.%d{yyyy-MM-dd}.%i.log.gz
112 </fileNamePattern> 112 </fileNamePattern>
113 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 113 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
114 <!-- or whenever the file size reaches 100MB --> 114 <!-- or whenever the file size reaches 100MB -->
@@ -124,11 +124,11 @@ @@ -124,11 +124,11 @@
124 124
125 <!-- DEBUG级别日志 appender --> 125 <!-- DEBUG级别日志 appender -->
126 <appender name="ORDER_CLOSE" class="ch.qos.logback.core.rolling.RollingFileAppender"> 126 <appender name="ORDER_CLOSE" class="ch.qos.logback.core.rolling.RollingFileAppender">
127 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/order-close.log</file> 127 + <file>/Data/logs/ufo-gateway/order-close.log</file>
128 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 128 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
129 <!-- daily rollover --> 129 <!-- daily rollover -->
130 <fileNamePattern> 130 <fileNamePattern>
131 - ${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/order-close.%d{yyyy-MM-dd}.%i.log.gz 131 + /Data/logs/ufo-gateway/archived/order-close.%d{yyyy-MM-dd}.%i.log.gz
132 </fileNamePattern> 132 </fileNamePattern>
133 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> 133 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
134 <!-- or whenever the file size reaches 100MB --> 134 <!-- or whenever the file size reaches 100MB -->
@@ -143,10 +143,10 @@ @@ -143,10 +143,10 @@
143 </appender> 143 </appender>
144 144
145 <appender name="MQ_CONSUMER" class="ch.qos.logback.core.rolling.RollingFileAppender"> 145 <appender name="MQ_CONSUMER" class="ch.qos.logback.core.rolling.RollingFileAppender">
146 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/mq-consumer.log</file> 146 + <file>/Data/logs/ufo-gateway/mq-consumer.log</file>
147 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 147 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
148 <!-- 按天回滚 daily --> 148 <!-- 按天回滚 daily -->
149 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/mq-consumer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> 149 + <fileNamePattern>/Data/logs/ufo-gateway/archived/mq-consumer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
150 <!-- 日志最大的历史 60天 --> 150 <!-- 日志最大的历史 60天 -->
151 <maxHistory>${yoho.logs.maxHistory}</maxHistory> 151 <maxHistory>${yoho.logs.maxHistory}</maxHistory>
152 </rollingPolicy> 152 </rollingPolicy>
@@ -159,10 +159,10 @@ @@ -159,10 +159,10 @@
159 </appender> 159 </appender>
160 160
161 <appender name="MQ_PRODUCER" class="ch.qos.logback.core.rolling.RollingFileAppender"> 161 <appender name="MQ_PRODUCER" class="ch.qos.logback.core.rolling.RollingFileAppender">
162 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/mq-producer.log</file> 162 + <file>/Data/logs/ufo-gateway/mq-producer.log</file>
163 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 163 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
164 <!-- 按天回滚 daily --> 164 <!-- 按天回滚 daily -->
165 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/mq-producer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> 165 + <fileNamePattern>/Data/logs/ufo-gateway/archived/mq-producer.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
166 <!-- 日志最大的历史 60天 --> 166 <!-- 日志最大的历史 60天 -->
167 <maxHistory>${yoho.logs.maxHistory}</maxHistory> 167 <maxHistory>${yoho.logs.maxHistory}</maxHistory>
168 </rollingPolicy> 168 </rollingPolicy>
@@ -176,10 +176,10 @@ @@ -176,10 +176,10 @@
176 176
177 177
178 <appender name="SELLER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> 178 <appender name="SELLER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
179 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/seller-order.log</file> 179 + <file>/Data/logs/ufo-gateway/seller-order.log</file>
180 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 180 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
181 <!-- 按天回滚 daily --> 181 <!-- 按天回滚 daily -->
182 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/seller-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> 182 + <fileNamePattern>/Data/logs/ufo-gateway/archived/seller-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
183 <!-- 日志最大的历史 60天 --> 183 <!-- 日志最大的历史 60天 -->
184 <maxHistory>${yoho.logs.maxHistory}</maxHistory> 184 <maxHistory>${yoho.logs.maxHistory}</maxHistory>
185 </rollingPolicy> 185 </rollingPolicy>
@@ -193,10 +193,10 @@ @@ -193,10 +193,10 @@
193 193
194 194
195 <appender name="BUYER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> 195 <appender name="BUYER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
196 - <file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/buyer-order.log</file> 196 + <file>/Data/logs/ufo-gateway/buyer-order.log</file>
197 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 197 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
198 <!-- 按天回滚 daily --> 198 <!-- 按天回滚 daily -->
199 - <fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> 199 + <fileNamePattern>/Data/logs/ufo-gateway/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
200 <!-- 日志最大的历史 60天 --> 200 <!-- 日志最大的历史 60天 -->
201 <maxHistory>${yoho.logs.maxHistory}</maxHistory> 201 <maxHistory>${yoho.logs.maxHistory}</maxHistory>
202 </rollingPolicy> 202 </rollingPolicy>