developrelease_toaliyun_real
| @@ -130,7 +130,6 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| wxCarCmdLog.setCreateDate(currentDate); | |||
| wxCarCmdLog.setUpdateDate(currentDate); | |||
| String tenantId = null; | |||
| WxPark parkQ = new WxPark(); | |||
| parkQ.setVendorType(EnumCarVendor.CAR_TJD.getCode()); | |||
| parkQ.setParkId(parkId); | |||
| @@ -141,7 +140,6 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| map.put(TJDUtil.TJD_ERR_MSG, "车场未找到" + parkId); | |||
| return map; | |||
| } else { | |||
| tenantId = park.getTenantId(); | |||
| wxCarCmdLog.updateTenantInfo(park); | |||
| } | |||
| @@ -159,7 +157,7 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| if (StringUtils.isNotBlank(carNumber)) { | |||
| // 根据车牌查找用户 | |||
| WxCUserCar userCarQ = new WxCUserCar(); | |||
| userCarQ.setTenantId(tenantId); | |||
| userCarQ.updateTenantInfo(park); | |||
| userCarQ.setCarNumber(carNumber); | |||
| userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||
| // TODO 可能多用户关联同一张车牌 | |||
| @@ -182,7 +180,7 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| try { | |||
| // 保存WxCarPayRecord | |||
| WxCarPayRecord record = new WxCarPayRecord(); | |||
| record.setTenantId(tenantId); | |||
| record.updateTenantInfo(park); | |||
| record.setVendorType(wxCarCmdLog.getVendorType()); | |||
| record.setSynId(tradeId); | |||
| record.setParkId(parkId); | |||
| @@ -193,7 +191,7 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| } | |||
| record.setPhone(phoneStrs); | |||
| WxCarPayRecord query = new WxCarPayRecord(); | |||
| query.setTenantId(tenantId); | |||
| query.updateTenantInfo(park); | |||
| query.setParkId(parkId); | |||
| query.setSynId(tradeId); | |||
| PageInfo<WxCarPayRecord> page = wxCarPayRecordService.findCarPayListByPage(query,1,1); | |||
| @@ -344,7 +342,6 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| wxCarCmdLog.setCreateDate(currentDate); | |||
| wxCarCmdLog.setUpdateDate(currentDate); | |||
| String tenantId = null; | |||
| WxPark parkQ = new WxPark(); | |||
| parkQ.setVendorType(EnumCarVendor.CAR_TJD.getCode()); | |||
| parkQ.setParkId(parkId); | |||
| @@ -354,9 +351,6 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| map.put(TJDUtil.TJD_IS_SUC, TJDUtil.TJD_ERR_1); | |||
| map.put(TJDUtil.TJD_ERR_MSG, "车场未找到" + parkId); | |||
| return map; | |||
| } else { | |||
| tenantId = park.getTenantId(); | |||
| wxCarCmdLog.setTenantId(tenantId); | |||
| } | |||
| try { | |||
| @@ -371,7 +365,7 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| try { | |||
| // 保存WxCarPayRecord | |||
| WxCarPayRecord record = new WxCarPayRecord(); | |||
| record.setTenantId(tenantId); | |||
| record.updateTenantInfo(park); | |||
| record.setVendorType(wxCarCmdLog.getVendorType()); | |||
| record.setParkId(parkId); | |||
| record.setParkName(parkName); | |||
| @@ -383,7 +377,7 @@ public class WxCarTJDCallBackController extends BaseController { | |||
| } | |||
| WxCarPayRecord query = new WxCarPayRecord(); | |||
| record.setTenantId(tenantId); | |||
| record.updateTenantInfo(park); | |||
| record.setParkId(parkId); | |||
| record.setPlateNumber(carNumber); | |||
| query.setSynId(tradeId); | |||
| @@ -76,7 +76,7 @@ public class WxDeviceScreenAdController extends BaseController { | |||
| if (wxDevice == null) | |||
| return new ResultData(ErrorCode.DEVICE_NOT_FOUND); | |||
| WxScreenAd wxScreenAd = new WxScreenAd(); | |||
| wxScreenAd.setTenantId(wxDevice.getTenantId()); | |||
| wxScreenAd.updateTenantInfo(wxDevice); | |||
| wxScreenAd.setStatus(EnumScreenAdStatus.VALID.getCode()); | |||
| PageInfo<WxScreenAd> page = wxScreenAdService.listAsPage(wxScreenAd,pageNum,pageSize); | |||
| page.getList().stream().forEach(s->{ | |||
| @@ -2,7 +2,7 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantVEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -11,7 +11,7 @@ import java.util.Date; | |||
| @TableName(value = "wx_business") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBusiness extends BaseTenantEntity { | |||
| public class WxBusiness extends TenantVEntity { | |||
| protected Integer id; | |||
| @@ -1,5 +1,7 @@ | |||
| package com.iformall.domain.po.base; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -13,6 +15,10 @@ public class BaseTenantEntity extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| @TableField(exist = false) | |||
| @JsonProperty(access = JsonProperty.Access.READ_ONLY) | |||
| private TenantEntity tenantInfo; | |||
| public void updateTenantInfo(TenantEntity info) { | |||
| setTenantId(info.getTenantId()); | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package com.iformall.domain.po.base; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| /** | |||
| * @author Stormeye | |||
| * @date 2019/4/24 14:32 | |||
| */ | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TenantVEntity extends BaseEntity { | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| @TableField(exist = false) | |||
| @JsonProperty(access = JsonProperty.Access.READ_ONLY) | |||
| private TenantEntity tenantInfo; | |||
| public void updateTenantInfo(TenantEntity info) { | |||
| setTenantId(info.getTenantId()); | |||
| } | |||
| public void updateTenantInfo(TenantVEntity info) { | |||
| setTenantId(info.getTenantId()); | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| return new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| }}; | |||
| } | |||
| } | |||
| @@ -328,7 +328,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| user.setScore(addScoreNumber); | |||
| // 3. 记录历史 | |||
| recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.LOGIN); | |||
| recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.LOGIN); | |||
| return addScoreNumber; | |||
| } | |||
| @@ -404,7 +404,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| updateScore(userCar.getCUserId(), addScoreNumber); | |||
| // 4. 记录历史 | |||
| recordScoreHistory(addScoreNumber, userCar.getTenantId(), userCar.getCUserId(), EnumScoreType.BIND_CAR); | |||
| recordScoreHistory(addScoreNumber, userCar.getTenantInfo(), userCar.getCUserId(), EnumScoreType.BIND_CAR); | |||
| return addScoreNumber; | |||
| } | |||
| @@ -420,7 +420,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| updateScore(user.getId(), addScoreNumber); | |||
| // 4. 记录历史 | |||
| recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.WECHAT_PERSION); | |||
| recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.WECHAT_PERSION); | |||
| return addScoreNumber; | |||
| } | |||
| @@ -436,13 +436,13 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| updateScore(user.getId(), addScoreNumber); | |||
| // 4. 记录历史 | |||
| recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.WECHAT_PHONE); | |||
| recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.WECHAT_PHONE); | |||
| return addScoreNumber; | |||
| } | |||
| private int checkCompleteInfoScoreCount(WxCUser cUser) { | |||
| WxScoreHistory scoreHistory = new WxScoreHistory(); | |||
| scoreHistory.setTenantId(cUser.getTenantId()); | |||
| scoreHistory.updateTenantInfo(cUser); | |||
| scoreHistory.setCUserId(cUser.getId()); | |||
| scoreHistory.setScoreType(EnumScoreType.COMPLETE_INFO.getCode()); | |||
| return wxScoreHistoryMapper.countList(scoreHistory); | |||
| @@ -465,7 +465,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| updateScore(user.getId(), addScoreNumber); | |||
| // 4. 记录历史 | |||
| recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.COMPLETE_INFO); | |||
| recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.COMPLETE_INFO); | |||
| return addScoreNumber; | |||
| } | |||
| @@ -490,14 +490,14 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| if (userInfo.getPhone() != null) { | |||
| WxCUser wxCUser = new WxCUser(); | |||
| wxCUser.setId(userInfo.getId()); | |||
| wxCUser.setTenantId(userInfo.getTenantId()); | |||
| wxCUser.updateTenantInfo(userInfo); | |||
| wxCUser.setPhone(userInfo.getPhone()); | |||
| wxCUser.setScore(score); | |||
| wxCUserService.saveOrUpdate(wxCUser);; | |||
| } | |||
| // 2. 记录历史 | |||
| recordReduceScoreHistory(scoreNum, reason, userInfo.getTenantId(), userInfo.getId(), EnumScoreType.MEM_REDUCE); | |||
| recordReduceScoreHistory(scoreNum, reason, userInfo.getTenantInfo(), userInfo.getId(), EnumScoreType.MEM_REDUCE); | |||
| return score; | |||
| } | |||
| @@ -505,7 +505,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxScoreHistory history = new WxScoreHistory(); | |||
| history.setId(idWorker.nextId()); | |||
| history.setTenantId(userInfo.getTenantId()); | |||
| history.updateTenantInfo(userInfo); | |||
| history.setCUserId(userInfo.getId()); | |||
| history.setCreateDate(new Date()); | |||
| history.setScoreType(wechatPhone.getCode()); | |||
| @@ -513,11 +513,11 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| wxScoreHistoryMapper.insert(history); | |||
| } | |||
| private void recordScoreHistory(int addScoreNumber, String tenantId, Long id, EnumScoreType wechatPhone) { | |||
| private void recordScoreHistory(int addScoreNumber, TenantEntity tenantEntity, Long id, EnumScoreType wechatPhone) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxScoreHistory history = new WxScoreHistory(); | |||
| history.setId(idWorker.nextId()); | |||
| history.setTenantId(tenantId); | |||
| history.updateTenantInfo(tenantEntity); | |||
| history.setCUserId(id); | |||
| history.setCreateDate(new Date()); | |||
| history.setScoreType(wechatPhone.getCode()); | |||
| @@ -542,11 +542,11 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| wxScoreHistoryMapper.insert(history); | |||
| } | |||
| private void recordReduceScoreHistory(int reduceScore, String reason, String tenantId, Long id, EnumScoreType wechatPhone) { | |||
| private void recordReduceScoreHistory(int reduceScore, String reason, TenantEntity tenantEntity, Long id, EnumScoreType wechatPhone) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxScoreHistory history = new WxScoreHistory(); | |||
| history.setId(idWorker.nextId()); | |||
| history.setTenantId(tenantId); | |||
| history.updateTenantInfo(tenantEntity); | |||
| history.setCUserId(id); | |||
| history.setCreateDate(new Date()); | |||
| history.setScoreType(wechatPhone.getCode()); | |||