Commit 9bcf9dca authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents 552a8e62 897b9df9
...@@ -126,6 +126,19 @@ public interface UserRestInterface { ...@@ -126,6 +126,19 @@ public interface UserRestInterface {
return null; return null;
} }
default Integer getBusinessUserCompanyId(){
return getBusinessUserCompanyIds() == null? null : getBusinessUserCompanyIds().get(0);
}
default Integer getBgUserCompanyId(){
UserDTO userDTO = getAdminUserInfoV2();
if(userDTO != null && CollUtil.isNotEmpty(userDTO.getCompanyIds())) {
return userDTO.getCompanyIds().get(0);
} else {
return null;
}
}
default UserDTO getBusinessUserByAppUser(){ default UserDTO getBusinessUserByAppUser(){
String currentUserName = BaseContextHandler.getUsername(); String currentUserName = BaseContextHandler.getUsername();
if (StrUtil.isNotBlank(currentUserName)){ if (StrUtil.isNotBlank(currentUserName)){
......
...@@ -32,159 +32,158 @@ import java.util.List; ...@@ -32,159 +32,158 @@ import java.util.List;
@Slf4j @Slf4j
public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, IntegralUserRecord> { public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, IntegralUserRecord> {
@Autowired @Autowired
UserInfoBiz userInfoBiz; UserInfoBiz userInfoBiz;
@Autowired @Autowired
IntegralUserTotalBiz integralUserTotalBiz; IntegralUserTotalBiz integralUserTotalBiz;
@Autowired @Autowired
IntegralRuleBiz integralRuleBiz; IntegralRuleBiz integralRuleBiz;
@Autowired @Autowired
IntegralUserStatusBiz integralUserStatusBiz; IntegralUserStatusBiz integralUserStatusBiz;
/** /**
* 添加用户积分记录 * 添加用户积分记录
* *
* @param integralUserRecord * @param integralUserRecord
* @return * @return
*/ */
public ObjectRestResponse add(IntegralUserRecordDto integralUserRecord) { public ObjectRestResponse add(IntegralUserRecordDto integralUserRecord) {
log.info("添加积分记录的参数:integralUserRecord = {}", integralUserRecord); log.info("添加积分记录的参数:integralUserRecord = {}", integralUserRecord);
if (integralUserRecord == null || StringUtils.isBlank(integralUserRecord.getIntegralRuleCode())) { if (integralUserRecord == null || StringUtils.isBlank(integralUserRecord.getIntegralRuleCode())) {
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
} }
//如果参数没有积分,说明是消息队列过来的参数,需要查询规则表获取积分数 //如果参数没有积分,说明是消息队列过来的参数,需要查询规则表获取积分数
IntegralRuleDto integralRule = new IntegralRuleDto(); IntegralRuleDto integralRule = new IntegralRuleDto();
integralRule.setCode(integralUserRecord.getIntegralRuleCode()); integralRule.setCode(integralUserRecord.getIntegralRuleCode());
ObjectRestResponse<IntegralRule> ruleObjectRestResponse = integralRuleBiz.getOne(integralRule); ObjectRestResponse<IntegralRule> ruleObjectRestResponse = integralRuleBiz.getOne(integralRule);
if (ruleObjectRestResponse.getData() == null) { if (ruleObjectRestResponse.getData() == null) {
return ObjectRestResponse.createFailedResult(1202, "积分规则不存在"); return ObjectRestResponse.createFailedResult(1202, "积分规则不存在");
} }
IntegralRule oldValue = ruleObjectRestResponse.getData(); IntegralRule oldValue = ruleObjectRestResponse.getData();
if (integralUserRecord.getPoint() == null) { if (integralUserRecord.getPoint() == null) {
Integer point = 0; Integer point = 0;
if (oldValue.getPoint() == 0) {//没有基础分需要计算分数 if (oldValue.getPoint() == 0) {//没有基础分需要计算分数
Integer amount = Integer.parseInt(new BigDecimal(integralUserRecord.getAmount()).divide(new BigDecimal("100"), 0, BigDecimal.ROUND_DOWN).toString()); Integer amount = new BigDecimal(integralUserRecord.getAmount()).intValue();
//Integer amount = Integer.parseInt(integralUserRecord.getAmount()); //Integer amount = Integer.parseInt(integralUserRecord.getAmount());
JSONObject jsonObject = JSONObject.parseObject(oldValue.getOtherRule()); JSONObject jsonObject = JSONObject.parseObject(oldValue.getOtherRule());
log.info("查询的其他规则json信息:jsonObject = {}", jsonObject); log.info("查询的其他规则json信息:jsonObject = {}", jsonObject);
if (jsonObject == null) { if (jsonObject == null) {
point = ruleObjectRestResponse.getData().getPoint(); point = oldValue.getPoint();
} else { } else {
point = jsonObject.getInteger("rule") == null ? 0 * amount : jsonObject.getInteger("rule") * amount; point = jsonObject.getInteger("rule") == null ? 0 * amount : jsonObject.getInteger("rule") * amount;
} }
} else {
} else { point = ruleObjectRestResponse.getData().getPoint();
point = ruleObjectRestResponse.getData().getPoint(); }
} log.info("查询的其他规则积分数:point = {}", point);
log.info("查询的其他规则积分数:point = {}", point); //把规则表中的积分数设置到参数对象中,然后进行后续操作
//把规则表中的积分数设置到参数对象中,然后进行后续操作 integralUserRecord.setPoint(point / 100);
integralUserRecord.setPoint(point); }
}
if (integralUserRecord.getType() == 0) {//获取积分 增加总积分表
if (integralUserRecord.getType() == 0) {//获取积分 增加总积分表 IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto();
IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto(); integralUserTotalDto.setUserId(integralUserRecord.getUserId());
integralUserTotalDto.setUserId(integralUserRecord.getUserId()); integralUserTotalDto.setPoint(integralUserRecord.getPoint());
integralUserTotalDto.setPoint(integralUserRecord.getPoint()); integralUserTotalBiz.update(integralUserTotalDto);
integralUserTotalBiz.update(integralUserTotalDto); } else if (integralUserRecord.getType() == 1) {//扣减积分
} else if (integralUserRecord.getType() == 1) {//扣减积分 ObjectRestResponse<IntegralUserTotal> objectRestResponse = integralUserTotalBiz.getByUser();
ObjectRestResponse<IntegralUserTotal> objectRestResponse = integralUserTotalBiz.getByUser(); if (objectRestResponse.getStatus() == RestCode.SUCCESS.getStatus() && objectRestResponse.getData() != null) {
if (objectRestResponse.getStatus() == RestCode.SUCCESS.getStatus() && objectRestResponse.getData() != null) { IntegralUserTotal integralUserTotal = objectRestResponse.getData();
IntegralUserTotal integralUserTotal = objectRestResponse.getData(); IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto();
IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto(); integralUserTotalDto.setUserId(integralUserTotal.getUserId());
integralUserTotalDto.setUserId(integralUserTotal.getUserId()); integralUserTotalDto.setPoint(-integralUserRecord.getPoint());
integralUserTotalDto.setPoint(-integralUserRecord.getPoint()); integralUserTotalBiz.update(integralUserTotalDto);
integralUserTotalBiz.update(integralUserTotalDto); } else {
} else { return ObjectRestResponse.createFailedResult(1008, "用户积分不足");
return ObjectRestResponse.createFailedResult(1008, "用户积分不足"); }
} }
} insertSelective(integralUserRecord.getIntegralUserRecord());
insertSelective(integralUserRecord.getIntegralUserRecord()); if (oldValue != null) {
if (oldValue != null) { getUserRecordStatus(integralUserRecord, oldValue.getPeriod(), oldValue.getNumber());
getUserRecordStatus(integralUserRecord, oldValue.getPeriod(), oldValue.getNumber()); }
} return ObjectRestResponse.succ();
return ObjectRestResponse.succ(); }
}
/**
/** * 删除一个用户记录
* 删除一个用户记录 *
* * @param id
* @param id * @return
* @return */
*/ public ObjectRestResponse deleteOne(Integer id) {
public ObjectRestResponse deleteOne(Integer id) { log.info("删除用户积分记录的参数:id = {}", id);
log.info("删除用户积分记录的参数:id = {}", id); if (id == null || id <= 0) {
if (id == null || id <= 0) { return ObjectRestResponse.paramIsEmpty();
return ObjectRestResponse.paramIsEmpty(); }
} IntegralUserRecord integralUserRecord = mapper.selectByPrimaryKey(id);
IntegralUserRecord integralUserRecord = mapper.selectByPrimaryKey(id); if (integralUserRecord == null) {
if (integralUserRecord == null) { log.info("删除的用户记录不存在,要删除的id ={}", id);
log.info("删除的用户记录不存在,要删除的id ={}", id); return ObjectRestResponse.createDefaultFail();
return ObjectRestResponse.createDefaultFail(); }
} integralUserRecord.setIsdel(true);
integralUserRecord.setIsdel(true); updateByIdRe(integralUserRecord);
updateByIdRe(integralUserRecord); return ObjectRestResponse.succ();
return ObjectRestResponse.succ(); }
}
/**
/** * 根据获取某个用户的列表
* 根据获取某个用户的列表 *
* * @return
* @return */
*/ public ObjectRestResponse<PageDataVO> getUserList(IntegralUserRecordDto integralUserRecordDto) {
public ObjectRestResponse<PageDataVO> getUserList(IntegralUserRecordDto integralUserRecordDto) { log.info("获取用户积分记录的参数:integralUserRecordDto = {}", integralUserRecordDto.toString());
log.info("获取用户积分记录的参数:integralUserRecordDto = {}", integralUserRecordDto.toString()); AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
AppUserDTO appUserDTO = userInfoBiz.getUserInfo(); if (appUserDTO == null) {
if (appUserDTO == null) { return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
return ObjectRestResponse.createFailedResult(508, "token is null or invalid"); }
} integralUserRecordDto.setUserId(appUserDTO.getUserid());
integralUserRecordDto.setUserId(appUserDTO.getUserid()); Query query = new Query(integralUserRecordDto);
Query query = new Query(integralUserRecordDto); PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByUserId(appUserDTO.getUserid()));
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByUserId(appUserDTO.getUserid())); return ObjectRestResponse.succ(pageDataVO);
return ObjectRestResponse.succ(pageDataVO); }
}
public ObjectRestResponse<List<IntegralUserRecord>> getByUserAndTime(IntegralUserRecordDto integralUserRecordDto) {
public ObjectRestResponse<List<IntegralUserRecord>> getByUserAndTime(IntegralUserRecordDto integralUserRecordDto) { log.info("获取用户积分记录的参数:integralUserRecordDto = {}", integralUserRecordDto.toString());
log.info("获取用户积分记录的参数:integralUserRecordDto = {}", integralUserRecordDto.toString()); if (integralUserRecordDto == null) {
if (integralUserRecordDto == null) { return ObjectRestResponse.paramIsEmpty();
return ObjectRestResponse.paramIsEmpty(); }
} AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
AppUserDTO appUserDTO = userInfoBiz.getUserInfo(); if (appUserDTO == null) {
if (appUserDTO == null) { return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
return ObjectRestResponse.createFailedResult(508, "token is null or invalid"); }
} integralUserRecordDto.setUserId(appUserDTO.getUserid());
integralUserRecordDto.setUserId(appUserDTO.getUserid()); List<IntegralUserRecord> integralUserRecordList = mapper.selectByUserAndTime(integralUserRecordDto);
List<IntegralUserRecord> integralUserRecordList = mapper.selectByUserAndTime(integralUserRecordDto); return ObjectRestResponse.succ(integralUserRecordList);
return ObjectRestResponse.succ(integralUserRecordList); }
}
/**
/** * //判断用户获取积分是否达标
* //判断用户获取积分是否达标 *
* * @param integralUserRecordDto 积分记录实体
* @param integralUserRecordDto 积分记录实体 * @param period 周期
* @param period 周期 * number 周期内可获得积分的次数
* number 周期内可获得积分的次数 */
*/ public void getUserRecordStatus(IntegralUserRecordDto integralUserRecordDto, Integer period, Integer number) {
public void getUserRecordStatus(IntegralUserRecordDto integralUserRecordDto, Integer period, Integer number) {
IntegralUserStatus integralUserStatus = new IntegralUserStatus();
IntegralUserStatus integralUserStatus = new IntegralUserStatus(); integralUserStatus.setUserId(integralUserRecordDto.getUserId());
integralUserStatus.setUserId(integralUserRecordDto.getUserId()); integralUserStatus.setIntegralRuleCode(integralUserRecordDto.getIntegralRuleCode());
integralUserStatus.setIntegralRuleCode(integralUserRecordDto.getIntegralRuleCode()); if (period == IntegralRulePeriod.DAY.getCode()) {//按天
if (period == IntegralRulePeriod.DAY.getCode()) {//按天 integralUserRecordDto.setStartTime(IntegralToolsUtils.getDayStart());
integralUserRecordDto.setStartTime(IntegralToolsUtils.getDayStart()); integralUserRecordDto.setEndTime(IntegralToolsUtils.getDayStart() + 24 * 60 * 60 * 1000);
integralUserRecordDto.setEndTime(IntegralToolsUtils.getDayStart() + 24 * 60 * 60 * 1000); Integer count = mapper.countByUserAndCode(integralUserRecordDto);
Integer count = mapper.countByUserAndCode(integralUserRecordDto); integralUserStatus.setIntegralStatus(count == number);
integralUserStatus.setIntegralStatus(count == number); } else {
} else { integralUserRecordDto.setStartTime(null);
integralUserRecordDto.setStartTime(null); Integer count = mapper.countByUserAndCode(integralUserRecordDto);
Integer count = mapper.countByUserAndCode(integralUserRecordDto); integralUserStatus.setIntegralStatus(true);
integralUserStatus.setIntegralStatus(true); }
} integralUserStatusBiz.save(integralUserStatus);
integralUserStatusBiz.save(integralUserStatus); }
}
} }
...@@ -193,7 +193,7 @@ public class MsgBiz { ...@@ -193,7 +193,7 @@ public class MsgBiz {
return imQuestionBiz.getList(questionParamDto); return imQuestionBiz.getList(questionParamDto);
} }
Query query = new Query(Criteria.where("body.type").in(ids)); Query query = new Query(Criteria.where("body.type").in(ids));
query.addCriteria(Criteria.where("userId").is(userId)); query.addCriteria(Criteria.where("userId").is(userId).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable); query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "time")); query.with(new Sort(Sort.Direction.DESC, "time"));
......
...@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO; import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
...@@ -17,6 +18,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; ...@@ -17,6 +18,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface; import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.admin.vo.AppUserVo; import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.context.BaseContextHandler; import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -83,7 +85,6 @@ import java.util.stream.Collectors; ...@@ -83,7 +85,6 @@ import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*; import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.order.entity.OrderPersonInsurance.STATUS_PAY;
import static com.xxfc.platform.order.pojo.mq.OrderMQDTO.*; import static com.xxfc.platform.order.pojo.mq.OrderMQDTO.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.ILLEGAL_TYPE; import static com.xxfc.platform.universal.constant.DictionaryKey.ILLEGAL_TYPE;
...@@ -885,6 +886,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -885,6 +886,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
//处理后台用户提醒短信的发送 //处理后台用户提醒短信的发送
// orderMsgBiz.handelBgUserMsg4Pay(orvd, baseOrder, appUserDTO, OrderMsgBiz.RENT_PAY); // orderMsgBiz.handelBgUserMsg4Pay(orvd, baseOrder, appUserDTO, OrderMsgBiz.RENT_PAY);
sendOrderMq(orvd, otd, omd, baseOrder, ORDER_PAY); sendOrderMq(orvd, otd, omd, baseOrder, ORDER_PAY);
JSONObject jsonObject = new JSONObject();
jsonObject.put("integralRuleCode", "RENTRV");
jsonObject.put("amount", baseOrder.getGoodsAmount().multiply(new BigDecimal("100")));
jsonObject.put("userId", baseOrder.getUserId());
jsonObject.put("channelId", baseOrder.getNo());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
if (OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) { if (OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) {
sendOrderMq(orvd, otd, omd, baseOrder, ORDER_FINISH); sendOrderMq(orvd, otd, omd, baseOrder, ORDER_FINISH);
//订单完成时,payway为 支付宝,则转支付 //订单完成时,payway为 支付宝,则转支付
......
...@@ -93,7 +93,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> { ...@@ -93,7 +93,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
* @param specialRent * @param specialRent
* @param userDTO * @param userDTO
*/ */
public void addRent(@RequestBody SpecialRent specialRent, UserDTO userDTO) { public void addRent(@RequestBody SpecialRent specialRent, UserDTO userDTO, Integer currentCompanyId) {
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
AssertUtils.isBlank(specialRent.getUnitPrice()); AssertUtils.isBlank(specialRent.getUnitPrice());
if(StrUtil.isBlank(specialRent.getVehicleId())) { if(StrUtil.isBlank(specialRent.getVehicleId())) {
...@@ -123,6 +123,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> { ...@@ -123,6 +123,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
specialRent.setCategoryId(vehicle.getCategoryId()); specialRent.setCategoryId(vehicle.getCategoryId());
specialRent.setGoodsType(vehicle.getGoodsType()); specialRent.setGoodsType(vehicle.getGoodsType());
specialRent.setPriceType(vehicle.getPriceType()); specialRent.setPriceType(vehicle.getPriceType());
specialRent.setPublishCompanyId(currentCompanyId);
//缓存商品信息 //缓存商品信息
specialRent.setGoodsJson(JSONUtil.parse(vehicle).toString()); specialRent.setGoodsJson(JSONUtil.parse(vehicle).toString());
......
...@@ -231,6 +231,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -231,6 +231,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
setStatus(ShuntApply.STATUS_ORDER); setStatus(ShuntApply.STATUS_ORDER);
setOrderStatus(ShuntApply.ORDER_STATUS_TOPAY); setOrderStatus(ShuntApply.ORDER_STATUS_TOPAY);
setRealAmount(bo.getOrder().getRealAmount()); setRealAmount(bo.getOrder().getRealAmount());
setOrderId(bo.getOrder().getId());
}}); }});
return ObjectRestResponse.succ(bo.getOrder()); return ObjectRestResponse.succ(bo.getOrder());
} }
...@@ -363,7 +364,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -363,7 +364,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
shuntApply.setOrderNo(detail.getOrder().getNo()); shuntApply.setOrderNo(detail.getOrder().getNo());
shuntApply.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime()); shuntApply.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime());
shuntApply.setConfirmUserId(userDTO.getId()); shuntApply.setConfirmUserId(userDTO.getId());
shuntApply.setConfirmCompanyId(userDTO.getCompanyId()); shuntApply.setConfirmCompanyId(getBusinessUserCompanyId());
shuntApply.setBookRecordId(detail.getBookRecordId()); shuntApply.setBookRecordId(detail.getBookRecordId());
baseBiz.updateSelectiveByIdRe(shuntApply); baseBiz.updateSelectiveByIdRe(shuntApply);
...@@ -432,7 +433,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -432,7 +433,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> { PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(ShuntApply::getConfirmUserId, userDTO.getId()); w.andEqualTo(ShuntApply::getConfirmCompanyId, getBusinessUserCompanyId());
w.andEqualTo(ShuntApply::getIsBizdel, SYS_FALSE); w.andEqualTo(ShuntApply::getIsBizdel, SYS_FALSE);
if(StrUtil.isNotBlank(dto.getMultiStatus())) { if(StrUtil.isNotBlank(dto.getMultiStatus())) {
w.andIn(ShuntApply::getStatus, CollUtil.toList(dto.getMultiStatus().split(","))); w.andIn(ShuntApply::getStatus, CollUtil.toList(dto.getMultiStatus().split(",")));
......
...@@ -68,7 +68,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -68,7 +68,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
public ObjectRestResponse appBusinessAddRent(@RequestBody SpecialRent specialRent) { public ObjectRestResponse appBusinessAddRent(@RequestBody SpecialRent specialRent) {
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
baseBiz.addRent(specialRent, userDTO); baseBiz.addRent(specialRent, userDTO, getBusinessUserCompanyId());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
...@@ -152,7 +152,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -152,7 +152,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
Query query = new Query(dto); Query query = new Query(dto);
PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> { PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(SpecialRent::getIsDel, SYS_FALSE); w.andEqualTo(SpecialRent::getIsDel, SYS_FALSE);
w.andEqualTo(SpecialRent::getPublishUserId, userDTO.getId()); w.andEqualTo(SpecialRent::getPublishCompanyId, getBusinessUserCompanyId());
return w; return w;
}, " crt_time desc "), SpecialRentVO.class); }, " crt_time desc "), SpecialRentVO.class);
...@@ -208,6 +208,8 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -208,6 +208,8 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
setId(specialRent.getId()); setId(specialRent.getId());
setStatus(SpecialRent.STATUS_ORDER); setStatus(SpecialRent.STATUS_ORDER);
setOrderStatus(SpecialRent.ORDER_STATUS_TOPAY); setOrderStatus(SpecialRent.ORDER_STATUS_TOPAY);
setJoinUserId(getCurrentUserIdInt());
setOrderId(bo.getOrder().getId());
}}); }});
return ObjectRestResponse.succ(bo.getOrder()); return ObjectRestResponse.succ(bo.getOrder());
} }
......
...@@ -67,7 +67,7 @@ public class BgSpecialRentController extends BaseController<SpecialRentBiz, Spec ...@@ -67,7 +67,7 @@ public class BgSpecialRentController extends BaseController<SpecialRentBiz, Spec
@ApiOperation(value = "添加特惠租车") @ApiOperation(value = "添加特惠租车")
public ObjectRestResponse businessAddRent(@RequestBody SpecialRent specialRent) { public ObjectRestResponse businessAddRent(@RequestBody SpecialRent specialRent) {
UserDTO userDTO = getAdminUserInfoV2(); UserDTO userDTO = getAdminUserInfoV2();
baseBiz.addRent(specialRent, userDTO); baseBiz.addRent(specialRent, userDTO, getBgUserCompanyId());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
...@@ -47,12 +47,12 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> { ...@@ -47,12 +47,12 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> {
* @param indexShow 是否首页展示 * @param indexShow 是否首页展示
* @return * @return
*/ */
public ObjectRestResponse<List<Banner>> getAll(Integer indexShow) { public ObjectRestResponse<List<Banner>> getAll(Integer indexShow, Integer location) {
Example example = new Example(Banner.class); Example example = new Example(Banner.class);
if (indexShow != null) { if (indexShow != null) {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow); example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow).andEqualTo("location", location);
} else { } else {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1); example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("location", location);
} }
example.orderBy("rank"); example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example)); return ObjectRestResponse.succ(mapper.selectByExample(example));
......
...@@ -2,7 +2,6 @@ package com.xxfc.platform.uccn.biz; ...@@ -2,7 +2,6 @@ package com.xxfc.platform.uccn.biz;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
...@@ -12,7 +11,6 @@ import com.xxfc.platform.campsite.vo.CampsiteShopPageVo; ...@@ -12,7 +11,6 @@ import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood; import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.feign.TourFeign; import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.uccn.comstnt.ServiceConstant; import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo; import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo; import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo; import com.xxfc.platform.uccn.vo.SummitActivityVo;
...@@ -198,25 +196,7 @@ public class SearchBiz { ...@@ -198,25 +196,7 @@ public class SearchBiz {
} }
} }
}); });
//新闻
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
PageInfo articleList = articleBiz.getArticleList(1, ServiceConstant.NEWS_LIMIT, 1, keyWord);
List<Article> result = articleList == null ? Collections.EMPTY_LIST : articleList.getList() == null ? Collections.EMPTY_LIST : articleList.getList();
articleServiceResultVo.setData(result);
articleServiceResultVo.setTotalCount(articleList.getTotal());
searchResultVo.put(ServiceConstant.NEWS, articleServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
try { try {
latch.await(); latch.await();
} catch (InterruptedException e) { } catch (InterruptedException e) {
......
package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.uccn.biz.BannerBiz;
import com.xxfc.platform.uccn.entity.Banner;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("banner/web")
public class BannerWebController extends BaseController<BannerBiz, Banner> {
@GetMapping(value = "/app/unauth/getAll")
public ObjectRestResponse getAll(@RequestParam(value = "location", defaultValue = "1") Integer location) {
return baseBiz.getAll(1, location);
}
}
\ No newline at end of file
package com.xxfc.platform.uccn.rest; package com.xxfc.platform.uccn.rest;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo; import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood; import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.uccn.biz.SearchBiz; import com.xxfc.platform.uccn.biz.SearchBiz;
import com.xxfc.platform.uccn.comstnt.ServiceConstant; import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo; import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo; import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo; import com.xxfc.platform.uccn.vo.SummitActivityVo;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition; import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.VehicleModelVo; import com.xxfc.platform.vehicle.pojo.VehicleModelVo;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO; import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
...@@ -19,7 +16,10 @@ import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO; ...@@ -19,7 +16,10 @@ import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -106,16 +106,16 @@ public class SearchController { ...@@ -106,16 +106,16 @@ public class SearchController {
campsiteSearchResultVo.put(ServiceConstant.CAMPSITE,campsiteShopPageVoServiceResultVo); campsiteSearchResultVo.put(ServiceConstant.CAMPSITE,campsiteShopPageVoServiceResultVo);
return ObjectRestResponse.succ(campsiteSearchResultVo); return ObjectRestResponse.succ(campsiteSearchResultVo);
case ServiceConstant.NEWS: case ServiceConstant.NEWS:
ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord); // ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord);
PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData(); // PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData();
List<Article> articleList = articlePageDataVO.getList(); // List<Article> articleList = articlePageDataVO.getList();
Long articleTotalCount = articlePageDataVO.getTotal(); // Long articleTotalCount = articlePageDataVO.getTotal();
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>(); // ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
articleServiceResultVo.setTotalCount(articleTotalCount); // articleServiceResultVo.setTotalCount(articleTotalCount);
articleServiceResultVo.setData(articleList); // articleServiceResultVo.setData(articleList);
SearchResultVo articleSearchResult= new SearchResultVo(); // SearchResultVo articleSearchResult= new SearchResultVo();
articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo); // articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo);
return ObjectRestResponse.succ(articleSearchResult); // return ObjectRestResponse.succ(articleSearchResult);
case ServiceConstant.ACTIVITY: case ServiceConstant.ACTIVITY:
ObjectRestResponse<PageDataVO<SummitActivityVo>> summitActivityWithPage = summitActivityController.findSummitActivityWithPage(page, limit, null, keyWord); ObjectRestResponse<PageDataVO<SummitActivityVo>> summitActivityWithPage = summitActivityController.findSummitActivityWithPage(page, limit, null, keyWord);
List<SummitActivityVo> summitActivityVos = summitActivityWithPage.getData().getData(); List<SummitActivityVo> summitActivityVos = summitActivityWithPage.getData().getData();
......
...@@ -21,8 +21,4 @@ public class BannerController extends BaseController<BannerBiz, Banner> { ...@@ -21,8 +21,4 @@ public class BannerController extends BaseController<BannerBiz, Banner> {
return baseBiz.selectList(bannerDto); return baseBiz.selectList(bannerDto);
} }
@GetMapping(value = "/app/unauth/getAll")
public ObjectRestResponse getAll() {
return baseBiz.getAll(1);
}
} }
\ No newline at end of file
...@@ -11,7 +11,6 @@ import com.alipay.api.internal.util.AlipaySignature; ...@@ -11,7 +11,6 @@ import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.*; import com.alipay.api.request.*;
import com.alipay.api.response.*; import com.alipay.api.response.*;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.HTTPSUtils; import com.github.wxiaoqi.security.common.util.HTTPSUtils;
...@@ -21,14 +20,15 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode; ...@@ -21,14 +20,15 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.constant.PayWay; import com.xxfc.platform.universal.constant.PayWay;
import com.xxfc.platform.universal.constant.WxResponseProperties;
import com.xxfc.platform.universal.entity.Dictionary; import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.entity.OrderPay; import com.xxfc.platform.universal.entity.OrderPay;
import com.xxfc.platform.universal.mapper.OrderPayMapper; import com.xxfc.platform.universal.mapper.OrderPayMapper;
import com.xxfc.platform.universal.utils.SignUtils; import com.xxfc.platform.universal.utils.SignUtils;
import com.xxfc.platform.universal.vo.FundPayVo; import com.xxfc.platform.universal.vo.FundPayVo;
import com.xxfc.platform.universal.vo.OrderPayVo; import com.xxfc.platform.universal.vo.OrderPayVo;
import com.xxfc.platform.universal.weixin.api.*; import com.xxfc.platform.universal.weixin.api.WXPay;
import com.xxfc.platform.universal.constant.WxResponseProperties; import com.xxfc.platform.universal.weixin.api.WXSuppToUserPay;
import com.xxfc.platform.universal.weixin.util.HTTPUtils; import com.xxfc.platform.universal.weixin.util.HTTPUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
...@@ -40,7 +40,10 @@ import tk.mybatis.mapper.entity.Example; ...@@ -40,7 +40,10 @@ import tk.mybatis.mapper.entity.Example;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import static com.xxfc.platform.universal.constant.DictionaryKey.PAY_DEMOTION; import static com.xxfc.platform.universal.constant.DictionaryKey.PAY_DEMOTION;
import static com.xxfc.platform.universal.constant.DictionaryKey.UNIVERSAL_PAY; import static com.xxfc.platform.universal.constant.DictionaryKey.UNIVERSAL_PAY;
...@@ -183,8 +186,6 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay>{ ...@@ -183,8 +186,6 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay>{
jsonObject.put("integralRuleCode", "BUYMEMBER"); jsonObject.put("integralRuleCode", "BUYMEMBER");
} }
log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel()); log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
} }
if (StringUtils.isNotBlank(pay.getNotifyUrl())) { if (StringUtils.isNotBlank(pay.getNotifyUrl())) {
String url = pay.getNotifyUrl(); String url = pay.getNotifyUrl();
......
...@@ -72,6 +72,10 @@ public class VehicleVO extends Vehicle { ...@@ -72,6 +72,10 @@ public class VehicleVO extends Vehicle {
private List<VehicleExtensionVO> vehicleExtensions; private List<VehicleExtensionVO> vehicleExtensions;
public void setExtensionVOS(List<VehicleExtensionVO> extensionVOS) {
this.extensionVOS = extensionVOS;
}
private String manageProvinceName; private String manageProvinceName;
private String manageCityName; private String manageCityName;
......
...@@ -100,6 +100,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -100,6 +100,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@Autowired @Autowired
VehicleHolidayPriceInfoBiz vehicleHolidayPriceInfoBiz; VehicleHolidayPriceInfoBiz vehicleHolidayPriceInfoBiz;
@Autowired
VehicleExtensionBiz extensionBiz;
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return userFeign; return userFeign;
} }
...@@ -704,10 +707,25 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -704,10 +707,25 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return ObjectRestResponse.succ(baseBiz.appSelectList(vehicleFindAppDTO)); return ObjectRestResponse.succ(baseBiz.appSelectList(vehicleFindAppDTO));
} }
@GetMapping("app/unauth/website/selectList")
@ApiModelProperty("店铺商品列表(官网)")
@IgnoreUserToken
public ObjectRestResponse<PageDataVO<com.xxfc.platform.vehicle.pojo.vo.VehicleVO>> websiteSelectList(VehicleFindAppDTO vehicleFindAppDTO) {
vehicleFindAppDTO.setState(Vehicle.STATE_UP);
vehicleFindAppDTO.setIsMinPrice(SYS_TRUE);
PageDataVO<com.xxfc.platform.vehicle.pojo.vo.VehicleVO> pageVo = baseBiz.appSelectList(vehicleFindAppDTO);
if(CollUtil.isNotEmpty(pageVo.getData())) {
pageVo.getData().forEach(v -> {
v.setVehicleExtensions(extensionBiz.getTree(v.getId()));
});
}
return ObjectRestResponse.succ(pageVo);
}
@GetMapping("app/unauth/shop/headSelectList") @GetMapping("app/unauth/shop/headSelectList")
@ApiModelProperty("店铺商品列表(头部输入框)") @ApiModelProperty("店铺商品列表(头部输入框)")
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse<PageDataVO<VehicleVO>> shopHeadSelectList(VehicleFindAppDTO vehicleFindAppDTO) { public ObjectRestResponse<PageDataVO<com.xxfc.platform.vehicle.pojo.vo.VehicleVO>> shopHeadSelectList(VehicleFindAppDTO vehicleFindAppDTO) {
vehicleFindAppDTO.setState(Vehicle.STATE_UP); vehicleFindAppDTO.setState(Vehicle.STATE_UP);
vehicleFindAppDTO.setIsMinPrice(SYS_TRUE); vehicleFindAppDTO.setIsMinPrice(SYS_TRUE);
return ObjectRestResponse.succ(baseBiz.appSelectList(vehicleFindAppDTO)); return ObjectRestResponse.succ(baseBiz.appSelectList(vehicleFindAppDTO));
...@@ -723,6 +741,7 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -723,6 +741,7 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
static public class VehicleVO extends Vehicle { static public class VehicleVO extends Vehicle {
private VehicleModel vehicleModel; private VehicleModel vehicleModel;
private List<VehiclePlatCata> vehiclePlatCatas; private List<VehiclePlatCata> vehiclePlatCatas;
private List<VehicleModelCalendarPriceDTO> priceDTOS; private List<VehicleModelCalendarPriceDTO> priceDTOS;
/** /**
* 价格开始日期 * 价格开始日期
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment