|
@@ -80,8 +80,9 @@ public class NiuniuService {
|
|
|
UserInfoDto userInfoDto = JSONObject.parseObject(String.valueOf(result.getData()),UserInfoDto.class);
|
|
UserInfoDto userInfoDto = JSONObject.parseObject(String.valueOf(result.getData()),UserInfoDto.class);
|
|
|
if (dashboardDto==null){
|
|
if (dashboardDto==null){
|
|
|
dashboardDto= new DashboardDto();
|
|
dashboardDto= new DashboardDto();
|
|
|
- dashboardDto.setBrokerage_price(userInfoDto.getBrokerage_price());
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ dashboardDto.setBrokerage_price(userInfoDto.getBrokerage_price());
|
|
|
log.info("{} 更新用户信息:{}", DateUtils.formatDate(new Date()),JSONObject.toJSONString(result));
|
|
log.info("{} 更新用户信息:{}", DateUtils.formatDate(new Date()),JSONObject.toJSONString(result));
|
|
|
return result;
|
|
return result;
|
|
|
} catch (ConnectException e) {
|
|
} catch (ConnectException e) {
|
|
@@ -113,8 +114,9 @@ public class NiuniuService {
|
|
|
|
|
|
|
|
@Scheduled(cron = "12 0/2 * * * ? ")
|
|
@Scheduled(cron = "12 0/2 * * * ? ")
|
|
|
public void updatePinTuan() {
|
|
public void updatePinTuan() {
|
|
|
|
|
+ userInfo();
|
|
|
HttpResult httpResult = pinTuan();
|
|
HttpResult httpResult = pinTuan();
|
|
|
- if (pinTuan()==null){
|
|
|
|
|
|
|
+ if (httpResult==null){
|
|
|
throw new RuntimeException("更新拼团信息失败");
|
|
throw new RuntimeException("更新拼团信息失败");
|
|
|
}
|
|
}
|
|
|
PinTuanDto pinTuanDto = JSONObject.parseObject(String.valueOf(httpResult.getData()),PinTuanDto.class);
|
|
PinTuanDto pinTuanDto = JSONObject.parseObject(String.valueOf(httpResult.getData()),PinTuanDto.class);
|
|
@@ -123,8 +125,8 @@ public class NiuniuService {
|
|
|
}
|
|
}
|
|
|
if (dashboardDto==null){
|
|
if (dashboardDto==null){
|
|
|
dashboardDto= new DashboardDto();
|
|
dashboardDto= new DashboardDto();
|
|
|
- dashboardDto.setPinTuanDto(pinTuanDto);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ dashboardDto.setPinTuanDto(pinTuanDto);
|
|
|
if (!pinTuanDto.getAlready_pinzhong().equals(lastPintuanDto.getAlready_pinzhong())){
|
|
if (!pinTuanDto.getAlready_pinzhong().equals(lastPintuanDto.getAlready_pinzhong())){
|
|
|
log.info("你拼中了 {} 个商品,请尽快处理",(pinTuanDto.getAlready_pinzhong()-lastPintuanDto.getAlready_pinzhong()));
|
|
log.info("你拼中了 {} 个商品,请尽快处理",(pinTuanDto.getAlready_pinzhong()-lastPintuanDto.getAlready_pinzhong()));
|
|
|
lastPintuanDto=pinTuanDto;
|
|
lastPintuanDto=pinTuanDto;
|
|
@@ -134,6 +136,8 @@ public class NiuniuService {
|
|
|
|
|
|
|
|
@Scheduled(cron = "0/5 * * * * ? ")
|
|
@Scheduled(cron = "0/5 * * * * ? ")
|
|
|
public void sendDashboardWs() {
|
|
public void sendDashboardWs() {
|
|
|
- dashboardWs.send(JSONObject.toJSONString(dashboardDto, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
|
|
|
|
+ if (dashboardDto!=null){
|
|
|
|
|
+ dashboardWs.send(JSONObject.toJSONString(dashboardDto, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|