Commit 3ae4af10 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 85a107d5 cf3cb901
......@@ -28,7 +28,7 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
//获取用户职位的折扣
public Integer getExtract(Integer userId){
public AppUserPosition getExtract(Integer userId){
return mapper.getExtractByUserId(userId);
}
......
......@@ -203,11 +203,14 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
List<InviteMemberBO> inviteMemberBOS = new ArrayList<>();
InviteMemberBO inviteMemberBO;
for (AppUserRelation appUserRelation : appUserRelations) {
if (userIdAndUserLoginMap==null || userIdAndUserDetailMap==null){
continue;
}
inviteMemberBO = new InviteMemberBO();
inviteMemberBO.setBindTime(appUserRelation.getBindTime());
inviteMemberBO.setJoinTime(appUserRelation.getBindTime());
inviteMemberBO.setUsername(userIdAndUserLoginMap.get(appUserRelation.getUserId()).getUsername());
inviteMemberBO.setHeadUrl(userIdAndUserDetailMap.get(appUserRelation.getUserId()).getHeadimgurl());
inviteMemberBO.setUsername(userIdAndUserLoginMap==null?"":userIdAndUserLoginMap.get(appUserRelation.getUserId())==null?"":userIdAndUserLoginMap.get(appUserRelation.getUserId()).getUsername());
inviteMemberBO.setHeadUrl(userIdAndUserDetailMap==null?"":userIdAndUserDetailMap.get(appUserRelation.getUserId())==null?"":userIdAndUserDetailMap.get(appUserRelation.getUserId()).getHeadimgurl());
inviteMemberBOS.add(inviteMemberBO);
}
inviteMemberVo.setTotalCount(pageDataVO.getTotalCount().intValue());
......
......@@ -103,6 +103,21 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
Integer parentId = relation.getParentId();
log.info("购买计算用户拥金----payOrderWater--------userId===" + userId + "---parentId===" + parentId);
Integer positionId = 6;
Integer level = 0;
AppUserPosition position=positionBiz.getExtract(parentId);
if (position!=null){
positionId=position.getId();
}
AppUserPosition position1=positionBiz.getExtract(userId);
if (position!=null){
level=position1.getLevel();
}
log.info("购买计算用户拥金----payOrderWater--------userId===" + userId + "---positionId===" + positionId+"---level==="+level);
if(level!=0){
log.info("购买计算用户拥金----payOrderWater--------userId===" + userId +"----无法享受拥金");
return;
}
BigDecimal amount = new BigDecimal("0.00");
//商品类型
Integer orderType=0;
......@@ -115,13 +130,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
orderType = goodsDto.getType();
//商品比例
Integer extract = commissionBiz.getExtract(orderType, goodId);
AppUserVo userVo = detailBiz.getUserInfoById(parentId);
Integer positionId = 6;
if (userVo != null) {
positionId = userVo.getPositionId();
}
if (extract == null || extract == 0) {
extract = positionBiz.getExtract(parentId);
extract = position.getExtract();
}
log.info("购买计算用户拥金----payOrderWater--------userId===" + userId + "---extract===" + extract);
if (extract != null && extract > 0) {
......@@ -184,23 +195,25 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log.info("订单完成计算用户拥金----finishOrderWater----id====" + id + "---commission==" + commission+"----orderType==="+orderType);
amount = amount.add(commission);
}
}
log.info("订单完成计算用户拥金----finishOrderWater----orderId====" + orderId + "---amount==" + amount);
int r = amount.compareTo(BigDecimal.ZERO);
//更新钱包
if (r == 1 && userId > 0) {
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setAmount(amount);
detail.setCono(orderId);
detail.setSource(1);
myWaterBiz.updMyWater(detail);
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,amount,2);
}
log.info("订单完成计算用户拥金----finishOrderWater----orderId====" + orderId + "---amount==" + amount);
int r = amount.compareTo(BigDecimal.ZERO);
//更新钱包
if (r == 1 && userId > 0) {
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setAmount(amount);
detail.setCono(orderId);
detail.setSource(1);
myWaterBiz.updMyWater(detail);
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,amount,2);
}
}
}
}
//订单退款计算用户拥金
......@@ -230,20 +243,20 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log.info("订单完成计算用户拥金----refundOrderWater----id====" + id + "---commission==" + commission+"---orderType===="+orderType);
unbooked=unbooked.add(commission);
}
}
log.info("订单完成计算用户拥金----refundOrderWater----orderId====" + orderId + "---amount==" + amount+"---unbooked==="+unbooked);
int r = amount.compareTo(BigDecimal.ZERO);
//更新钱包
if (r == 1 && userId > 0) {
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setAmount(amount);
detail.setCono(orderId);
detail.setSource(1);
myWaterBiz.updMyWater(detail);
}
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,unbooked,2);
log.info("订单完成计算用户拥金----refundOrderWater----orderId====" + orderId + "---amount==" + amount+"---unbooked==="+unbooked);
int r = amount.compareTo(BigDecimal.ZERO);
//更新钱包
if (r == 1 && userId > 0) {
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setAmount(amount);
detail.setCono(orderId);
detail.setSource(1);
myWaterBiz.updMyWater(detail);
}
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,unbooked,2);
}
}
}
......
......@@ -113,7 +113,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
//钱包未入账的处理type1-进;2-出
public void updMyWalletUnbooked(Integer userId,BigDecimal amount,Integer type){
log.info("---钱包未入账的处理updMyWalletUnbooked----userId==="+userId+"----type==="+type);
log.info("---钱包未入账的处理updMyWalletUnbooked----userId==="+userId+"----type==="+type+"---amount==="+amount);
MyWallet wallet=new MyWallet();
wallet.setUserId(userId);
wallet=selectOne(wallet);
......
......@@ -17,6 +17,6 @@ import java.util.List;
public interface AppUserPositionMapper extends Mapper<AppUserPosition> {
Integer getExtractByUserId(@Param("userId")Integer userId);
AppUserPosition getExtractByUserId(@Param("userId")Integer userId);
}
......@@ -16,8 +16,8 @@
<result property="isDel" column="is_del"/>
</resultMap>
<select id="getExtractByUserId" resultType="Integer">
SELECT p.extract FROM app_user_detail d LEFT JOIN app_user_position p
<select id="getExtractByUserId" resultMap="appUserPositionMap">
SELECT p.* FROM app_user_detail d LEFT JOIN app_user_position p
ON d.position_id=p.id
WHERE d.userid=#{userId} LIMIT 1
</select>
......
......@@ -23,10 +23,10 @@ FROM
(select id,user_id,source,amount,cono,itype,activity_id,activity_name,`crt_time` FROM `my_wallet_detail` <if test="sourceType != null">
WHERE `source`=#{sourceType}
</if>) AS `wd`
LEFT JOIN (SELECT id,username FROM `app_user_login`<if test="phone != null and phone != ''">
INNER JOIN (SELECT id,username FROM `app_user_login`<if test="phone != null and phone != ''">
WHERE `username`=#{phone}
</if>) AS `aul` ON aul.id = wd.user_id
LEFT JOIN (SELECT userid,nickname,realname FROM `app_user_detail`<if test="userName != null and userName != ''">
INNER JOIN (SELECT userid,nickname,realname FROM `app_user_detail`<if test="userName != null and userName != ''">
WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>) AS `aud` ON aud.userid = aul.id
LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono
......
......@@ -108,12 +108,12 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
addPoint(objectRestResponse.getData(),integralSignRecord, appUserDTO, integralSignRecord.getSignDays());
return ObjectRestResponse.succ(objectRestResponse.getData().getPoint());
}
return ObjectRestResponse.createFailedResult(1006,"签到次数已达到上限,请下次再来");
return ObjectRestResponse.createFailedResult(1006,"今日已签到!");
}
} else {
return ObjectRestResponse.createFailedResult(1003,"签到规则不存在!");
}
}
}
return ObjectRestResponse.succ();
}
......
......@@ -58,10 +58,10 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
return ObjectRestResponse.createFailedResult(1202, "积分规则不存在");
}
Integer point = 0;
if(ruleObjectRestResponse.getData().getPoint() == 0) {//没有基础分需要计算分数
IntegralRule oldValue = ruleObjectRestResponse.getData();
if(oldValue.getPoint() == 0) {//没有基础分需要计算分数
Integer amount = Integer.parseInt(new BigDecimal(integralUserRecord.getAmount()).divide(new BigDecimal("100"), 0, BigDecimal.ROUND_DOWN).toString());
JSONObject jsonObject = JSONObject.parseObject(ruleObjectRestResponse.getData().getOtherRule());
JSONObject jsonObject = JSONObject.parseObject(oldValue.getOtherRule());
log.info("查询的其他规则json信息:jsonObject = {}", jsonObject);
if(jsonObject == null) {
point = ruleObjectRestResponse.getData().getPoint();
......
......@@ -11,4 +11,5 @@ import java.util.List;
public class QuestionListVo extends ImQuestion {
List<ImComment> imComment;
List<ImPraise> imPraise;
private boolean isPraise;
}
......@@ -10,11 +10,13 @@ import com.xxfc.platform.im.entity.ImPraise;
import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImPraiseMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.map.HashedMap;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
......@@ -91,4 +93,12 @@ public class ImPraiseBiz extends BaseBiz<ImPraiseMapper, ImPraise> {
return list;
}
public boolean isExist(Long userId, Long questionId) {
Map<String, Object> map = new HashedMap<>();
map.put("userId", userId);
map.put("questionId",questionId);
List<ImPraise> list = mapper.selectByUserIdAndQuestionId(map);
return list.size() > 0 ? true : false;
}
}
......@@ -12,6 +12,7 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
import com.xxfc.platform.im.dto.UpdateTypeEnum;
import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImQuestionMapper;
import com.xxfc.platform.im.vo.QuestionListVo;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,6 +29,8 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
@Autowired
MQSenderFeign mqSenderFeign;
@Autowired
ImPraiseBiz imPraiseBiz;
/**
* 获取列表
*
......@@ -36,8 +39,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
*/
public ObjectRestResponse getList(QuestionParamDto questionParamDto) {
Query query = new Query(questionParamDto);
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getQuestionList(query.getSuper()));
return new ObjectRestResponse<>().data(pageDataVO);
PageDataVO<QuestionListVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getQuestionList(query.getSuper()));
pageDataVO.getData().forEach((a) -> a.setPraise(imPraiseBiz.isExist(a.getUserId(), a.getId())));
return new ObjectRestResponse<>().data(pageDataVO);
}
......
......@@ -57,17 +57,23 @@ public class MsgBiz {
Query query = null;
List<Msg> msgList = null;
if (type != null) {
query = new Query(Criteria.where("body.type").is(type)).with(pageable);
query = new Query(Criteria.where("body.type").is(type));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
goodPageInfo.setPageSize(totalSize%limit == 0 ?totalSize/limit : totalSize/limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
} else {
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
query = new Query(Criteria.where("body.type").in(ids)).with(pageable);
query = new Query(Criteria.where("body.type").in(ids));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
goodPageInfo.setPageSize(totalSize%limit == 0 ?totalSize/limit : totalSize/limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
}
......@@ -81,10 +87,13 @@ public class MsgBiz {
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
Query query = new Query(Criteria.where("body.type").in(ids)).with(pageable);
Query query = new Query(Criteria.where("body.type").in(ids));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = mongoTemplate.find(query, Msg.class, "s_msg");
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
goodPageInfo.setPageSize(totalSize%limit == 0 ?totalSize/limit : totalSize/limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
}
......
......@@ -4,6 +4,7 @@ import com.xxfc.platform.im.entity.ImPraise;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Map;
public interface ImPraiseMapper extends Mapper<ImPraise> {
......@@ -11,4 +12,6 @@ public interface ImPraiseMapper extends Mapper<ImPraise> {
List<ImPraise> selectByQuestionIdAndTime(ImPraise imPraise);
List<ImPraise> selectByUserIdAndQuestionId(Map<String, Object> param);
}
\ No newline at end of file
......@@ -24,4 +24,10 @@
where question_id = #{questionId} and is_del = 0 and visible = 1
and time between #{startTime} and #{endTime}
</select>
<select id="selectByUserIdAndQuestionId" resultType="com.xxfc.platform.im.entity.ImPraise" parameterType="java.util.Map">
select * from im_praise
where question_id = #{questionId} and is_del = 0 and visible = 1
and user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
package com.xxfc.platform.order.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 租车订单详情
......@@ -297,7 +300,7 @@ public class OrderRentVehicleDetail implements Serializable {
/**
* 是否处理违章 0--未处理;1--已处理
*/
@ApiModelProperty(value = "是否购买免赔")
@ApiModelProperty(value = "是否处理违章")
@Column(name = "handel_violation")
private Integer handelViolation;
......
......@@ -123,4 +123,7 @@ public class OrderVehicleCrosstown {
* 驾驶人Id
*/
private String userLicenseId;
//操作人ID
private Integer orperaterId;
}
\ No newline at end of file
......@@ -27,4 +27,6 @@ public class OrderVehicleCrosstownDto extends OrderVehicleCrosstown {
private String licenseIdCard;
private String vehicleNumberPlat;
private String username;
}
......@@ -172,7 +172,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setOrderId(orderPageVo.getId());
orderVehicleCrosstownDto.setOrderNo(orderPageVo.getNo());
List<OrderVehicleCrosstown> orderVehicleCrosstowns = orderVehicalCrosstownBiz.selectByOrderId(orderVehicleCrosstownDto);
List<OrderVehicleCrosstownDto> orderVehicleCrosstowns = orderVehicalCrosstownBiz.selectByOrderId(orderVehicleCrosstownDto);
if(orderVehicleCrosstowns != null && orderVehicleCrosstowns.size() > 0) {
List<OrderUserLicense> orderUserLicenses = orderUserLicenseBiz.selectByIds(orderVehicleCrosstowns.get(0).getUserLicenseId()).getData();
if(orderUserLicenses != null && orderUserLicenses.size() > 0) {
......
......@@ -92,7 +92,7 @@ public class OrderTourVerificationBiz{
}
// 出发时间 是否已经发车
Date departureDate = tourFeign.selectDepartureDataBySpeId(tourDetail.getSpePriceId());
/* Date departureDate = tourFeign.selectDepartureDataBySpeId(tourDetail.getSpePriceId());
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(), tourDetail.getGoodId());
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
LocalTime localDepartureTime = LocalTime.ofSecondOfDay(departureTime);
......@@ -113,7 +113,7 @@ public class OrderTourVerificationBiz{
if (departureStatus==1){
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
}
}*/
baseOrder=new BaseOrder();
......
......@@ -2,8 +2,11 @@ package com.xxfc.platform.order.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.user.UserInfoBiz;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderUserLicense;
......@@ -30,9 +33,12 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
@Autowired
OrderUserLicenseBiz orderUserLicenseBiz;
@Autowired
UserInfoBiz userInfoBiz;
@Autowired
VehicleFeign vehicleFeign;
@Autowired
UserFeign userFeign;
@Autowired
private OrderRentVehicleBiz orderRentVehicleBiz;
......@@ -43,21 +49,45 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return selectById(id);
}
public List<OrderVehicleCrosstown> selectByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
return mapper.selectByOrderId(orderVehicleCrosstownDto);
public List<OrderVehicleCrosstownDto> selectByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
List<OrderVehicleCrosstownDto> list = mapper.selectByOrderId(orderVehicleCrosstownDto);
for(OrderVehicleCrosstownDto value : list) {
if (value.getOrperaterId() != null) {
ObjectRestResponse<AppUserDTO> objectRestResponse = userFeign.userDetailById(value.getOrperaterId());
if(objectRestResponse.getData() != null) {
value.setUsername(objectRestResponse.getData().getNickname());
}
}
if(value.getUserLicenseId() != null) {
List<OrderUserLicense> orderUserLicenses = orderUserLicenseBiz.selectByIds(value.getUserLicenseId()).getData();
if(orderUserLicenses != null && orderUserLicenses.size() > 0) {
value.setLicenseIdCard(orderUserLicenses.get(0).getLicenseIdCard());
value.setLicenseImg(orderUserLicenses.get(0).getLicenseImg());
value.setLicenseName(orderUserLicenses.get(0).getLicenseName());
value.setLicensePhone(orderUserLicenses.get(0).getLicensePhone());
}
}
}
return list;
}
public ObjectRestResponse<OrderVehicleCrosstownDto> add(OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
log.info("添加的参数:orderVehicaleCrosstown = {}", orderVehicleCrosstownDto);
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
if (orderVehicleCrosstownDto == null || orderVehicleCrosstownDto.getOrderId() == null ) {
return ObjectRestResponse.createFailedResult(500, "参数为空!");
}
orderVehicleCrosstownDto.setOrperaterId(appUserDTO.getUserid());
BaseOrder baseOrder = baseOrderBiz.selectById(orderVehicleCrosstownDto.getOrderId());
if(baseOrder == null) {
return ObjectRestResponse.createFailedResult(500,"订单不存在!");
}
OrderRentVehicleDetail orderRentVehicleDetail = orderRentVehicleBiz.selectById(baseOrder.getDetailId());
List<OrderVehicleCrosstown> oldValue = orderVehicalCrosstownBiz.selectByOrderId(orderVehicleCrosstownDto);
List<OrderVehicleCrosstownDto> oldValue = orderVehicalCrosstownBiz.selectByOrderId(orderVehicleCrosstownDto);
if (oldValue .size() == 1) {
//已有直接返回
//交车完成 设置订单状态为出行中
......
......@@ -8,6 +8,6 @@ import java.util.List;
public interface OrderVehicaleCrosstownMapper extends Mapper<OrderVehicleCrosstown> {
List<OrderVehicleCrosstown> selectByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto);
List<OrderVehicleCrosstownDto> selectByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto);
}
\ No newline at end of file
......@@ -20,8 +20,11 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.order.biz.BaseOrderBiz;
import com.xxfc.platform.order.biz.OrderMemberDetailBiz;
import com.xxfc.platform.order.biz.OrderUserLicenseBiz;
import com.xxfc.platform.order.biz.OrderVehicalCrosstownBiz;
import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderUserLicense;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.order.*;
import com.xxfc.platform.order.pojo.pay.OrderPayDTO;
......@@ -73,6 +76,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@Autowired
OrderMemberDetailBiz orderMemberDetailBiz;
@Autowired
OrderUserLicenseBiz orderUserLicenseBiz;
@Autowired
OrderVehicalCrosstownBiz orderVehicalCrosstownBiz;
@Override
public UserFeign getUserFeign() {
......@@ -178,6 +185,19 @@ public class BaseOrderController extends CommonBaseController implements UserRes
if (restResponse.getData() != null) {
orderPageVO.setVehicleNumberPlat(restResponse.getData().getNumberPlate());
}
if(StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
List<OrderUserLicense> orderUserLicenses = orderUserLicenseBiz.selectByIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData();
if(orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getLicenseIdCard());
orderVehicleCrosstownDto.setLicenseImg(orderUserLicenses.get(0).getLicenseImg());
orderVehicleCrosstownDto.setLicenseName(orderUserLicenses.get(0).getLicenseName());
orderVehicleCrosstownDto.setLicensePhone(orderUserLicenses.get(0).getLicensePhone());
orderPageVO.setOrderVehicleCrosstownDto(orderVehicleCrosstownDto);
}
}
}
if(orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getStartCompanyId()!= null && orderPageVO.getOrderRentVehicleDetail().getEndCompanyId() != null) {
ObjectRestResponse<CompanyDetail> startResponse = vehicleFeign.getCompanyDetail(orderPageVO.getOrderRentVehicleDetail().getStartCompanyId());
......@@ -197,6 +217,8 @@ public class BaseOrderController extends CommonBaseController implements UserRes
orderPageVO.setStartCompanyName(startResponse.getData().getName());
}
}
}
}
......
......@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(value = "/orderVehicle")
@RequestMapping(value = "orderVehicle")
@Api(value = "交还车记录", tags = {"交还车记录"})
@Slf4j
public class OrderVehicleCrosstownController {
......@@ -34,6 +34,7 @@ public class OrderVehicleCrosstownController {
@ApiOperation(value = "添加交还车记录")
@Transactional
public ObjectRestResponse<OrderVehicleCrosstownDto> add(@RequestBody OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
return orderVehicalCrosstownBiz.add(orderVehicleCrosstownDto);
}
......@@ -45,7 +46,7 @@ public class OrderVehicleCrosstownController {
@GetMapping(value = "/getByOrderId")
@ApiOperation(value = "根据订单Id获取所有记录信息")
public ObjectRestResponse<List<OrderVehicleCrosstown>> getByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
public ObjectRestResponse<List<OrderVehicleCrosstownDto>> getByOrderId(OrderVehicleCrosstownDto orderVehicleCrosstownDto) {
if (orderVehicleCrosstownDto == null) {
return ObjectRestResponse.createFailedResult(500, "参数orderId为空");
}
......
......@@ -28,7 +28,7 @@
<result column="user_license_id" jdbcType="VARCHAR" property="userLicenseId"/>
</resultMap>
<select id="selectByOrderId" parameterType="com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto" resultMap="BaseResultMap">
<select id="selectByOrderId" parameterType="com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto" resultType="com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto">
select *
from order_vehicle_crosstown
<where>
......
......@@ -11,4 +11,5 @@ import java.util.List;
public class VehicleAndModelInfoVo extends Vehicle {
VehicleModel vehicleModel;
List<VehicleBookRecord> vehicleBookRecord;
private String endCompanyName;
}
package com.xxfc.platform.vehicle.pojo;
import com.xxfc.platform.vehicle.entity.VehicleWarningRule;
import lombok.Data;
import java.util.Date;
......@@ -9,7 +10,7 @@ import java.util.Date;
*
*/
@Data
public class VehicleWarningMsgQueryVo {
public class VehicleWarningMsgQueryVo{
public Integer id;
/**
......@@ -66,4 +67,6 @@ public class VehicleWarningMsgQueryVo {
private Date createTime;
private Date updateTime;
VehicleWarningRule vehicleWarningRule;
}
......@@ -71,6 +71,13 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return mapper.selectByPrimaryKey(id);
}
public List<BranchCompany> selectByZoneId(Integer zoneId) {
if(zoneId == null) {
return null;
}
return mapper.selectByZoneId(zoneId);
}
/**
* 获取公司信息
* @param id
......
......@@ -2,7 +2,6 @@ package com.xxfc.platform.vehicle.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.ace.cache.annotation.Cache;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
......@@ -317,6 +316,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
Map<String,List<String>> yearMonthAndDate = Maps.newHashMap();
DateTime startDay =DateTime.parse(bookVehicleVo.getBookStartDate(),DEFAULT_DATE_TIME_FORMATTER);
DateTime endDay =DateTime.parse(bookVehicleVo.getBookEndDate(), DEFAULT_DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod(yearMonthAndDate,startDay,endDay);
if(yearMonthAndDate.size()>3){//连续的日期最多夸3个月
......@@ -1088,6 +1089,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
public PageDataVO<VehicleAndModelInfoVo> getAllVehicle(VehiclePlanDto vehiclePlanDto) {
Query query = new Query(vehiclePlanDto);
PageDataVO<VehicleAndModelInfoVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getAllVehicle(query.getSuper()));
for(VehicleAndModelInfoVo vehicleAndModelInfoVo : pageDataVO.getData()) {
CompanyDetail restResponse = branchCompanyBiz.getDetailById(vehicleAndModelInfoVo.getParkBranchCompanyId());
if(restResponse != null) {
vehicleAndModelInfoVo.setEndCompanyName(restResponse.getName());
}
}
return pageDataVO;
}
......
package com.xxfc.platform.vehicle.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.google.common.collect.Maps;
......@@ -72,7 +70,6 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
}
}
return predictableHours;
}
// public static void main(String[] args) {
......
......@@ -14,6 +14,7 @@ import com.xxfc.platform.vehicle.entity.VehicleWarningRule;
import com.xxfc.platform.vehicle.mapper.VehicleMapper;
import com.xxfc.platform.vehicle.mapper.VehicleWarningMsgMapper;
import com.xxfc.platform.vehicle.mapper.VehicleWarningRuleMapper;
import com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import com.xxfc.platform.vehicle.util.JSUtil;
import com.xxfc.platform.vehicle.pojo.AddVehicleWarningMsgVo;
......@@ -213,8 +214,9 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
}
}
public List<VehicleWarningMsg> getAllByParam(VehiclePlanDto vehiclePlanDto) {
return mapper.getAllByparam(vehiclePlanDto);
public List<VehicleWarningMsgQueryVo> getAllByParam(VehiclePlanDto vehiclePlanDto) {
List<VehicleWarningMsgQueryVo> list = mapper.getAllByparam(vehiclePlanDto);
return list;
}
}
......@@ -8,4 +8,5 @@ import java.util.List;
public interface BranchCompanyMapper extends Mapper<BranchCompany> {
List<BranchCompany> search(@Param("lon") String lon, @Param("lat") String lat, @Param("addrCity") Integer addrCity);
List<BranchCompany> selectByZoneId(Integer zoneId);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.VehicleWarningMsg;
import com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo;
import com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import tk.mybatis.mapper.common.Mapper;
......@@ -16,6 +17,6 @@ public interface VehicleWarningMsgMapper extends Mapper<VehicleWarningMsg> {
public List<VehicleWarningMsg> getMsgByVehicle(String vehicleId);
public List<VehicleWarningMsg> getAllByparam(VehiclePlanDto vehiclePlanDto);
public List<VehicleWarningMsgQueryVo> getAllByparam(VehiclePlanDto vehiclePlanDto);
}
......@@ -4,6 +4,5 @@ import com.xxfc.platform.vehicle.entity.VehicleWarningRule;
import tk.mybatis.mapper.common.Mapper;
public interface VehicleWarningRuleMapper extends Mapper<VehicleWarningRule> {
VehicleWarningRule getOne(Integer id);
}
......@@ -91,6 +91,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return RestResponse.data(baseBiz.add(branchCompanyVo));
}
@RequestMapping(value ="/app/unauth/getByZone",method = RequestMethod.GET)
public RestResponse getByZoneId(Integer zoneId) {
return RestResponse.suc( baseBiz.selectByZoneId(zoneId));
}
@RequestMapping(value ="/upload/companyPic",method = RequestMethod.POST)
public RestResponse uploadCompanyPic(@RequestParam("file") MultipartFile file)
throws Exception{
......
......@@ -26,7 +26,6 @@ import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.entity.VehicleWarningMsg;
import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import io.swagger.annotations.Api;
......@@ -425,7 +424,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
//获取统计信息
List<VehicleCountVo> vehicleCountVos = baseBiz.countVehicleByParam(vehiclePlanDto);
//获取警告信息
List<VehicleWarningMsg> vehicleWarningMsgs = vehicleWarningMsgBiz.getAllByParam(vehiclePlanDto);
List<VehicleWarningMsgQueryVo> vehicleWarningMsgs = vehicleWarningMsgBiz.getAllByParam(vehiclePlanDto);
//获取列表
PageDataVO<VehicleAndModelInfoVo> pageDataVO = baseBiz.getAllVehicle(vehiclePlanDto);
Map<String, Object> map = Maps.newHashMap();
......
......@@ -39,4 +39,8 @@
order by distance asc
</if>
</select>
<select id="selectByZoneId" parameterType="java.lang.Integer" resultType="com.xxfc.platform.vehicle.entity.BranchCompany">
select * from branch_company
where zone_id = #{zoneId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleWarningMsgMapper">
<resultMap type="com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo" id="vehicleListMap">
<result javaType="Integer" column="id" property="id"></result>
<association column="rule_id" property="vehicleWarningRule" select="com.xxfc.platform.vehicle.mapper.VehicleWarningRuleMapper.selectByPrimaryKey" javaType="com.xxfc.platform.vehicle.entity.VehicleWarningRule"></association>
</resultMap>
<select id="getByPage" resultType="com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo"
parameterType="com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo">
select
......@@ -25,7 +32,7 @@
where vehicle_id = #{_parameter}
</select>
<select id="getAllByparam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningMsg" >
<select id="getAllByparam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto" resultMap="vehicleListMap" >
select w.*
from vehicle_warning_msg w
left join vehicle v on w.vehicle_id = v.id
......
......@@ -5,6 +5,8 @@
<select id="getByPage" parameterType="com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningMsg" >
</select>
<select id="getOne" resultType="com.xxfc.platform.vehicle.entity.VehicleWarningRule" parameterType="java.lang.Integer">
select * from vehicle_warning_rule where id = #{id}
</select>
</mapper>
\ No newline at end of file
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