Commit b0e606d9 authored by libin's avatar libin

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 6f7879b6 fdd491ce
......@@ -13,24 +13,24 @@ USER_HEADER_URL_DEFAULT=https://xxtest.upyuns.com/image/app/default_%20avatar.pn
#默认昵称
USER_NIKENAME_DEFAULT=XX_
#短信机
ACCESSKEYID=LTAIlXrgxOBAj2Ny
ACCESSKEYSECRET=zo8OkOCF4iygqOjYYoxRKfVRxDvgTI
TEMPLATECODE=SMS_166480010
SIGNNAME=升云
ACCESSKEYID=LTAInxMDwHQL8yg9
ACCESSKEYSECRET=OCKDEiwKGjePCZgPeWMEUFGwGbKYLA
TEMPLATECODE=SMS_170070101
SIGNNAME=滴房车
#微信支付配置
WINXIN_AppID=wxcc2c9b7c87439a6d
WINXIN_AppSecret=279796e8c2963c8a5ddc8270ef642b29
WINXIN_PARTNER_KEY=CNITR89201000CNITR89201000FUWUSH
WINXIN_PARTNER=1512136241
WINXIN_PARTNER_KEY=xxfcXXDfangche74upyuns3AD4334533
WINXIN_PARTNER=1539689201
#ios
APP_ID_IOS=wx3f51779d49171d63
APP_PARTNER_IOS=1492557632
APP_PARTNER_KEY_IOS=89201002892010008920100quanzinet
APP_TRADE_TYPE_IOS=APP
#andoir
APP_ID=wx9c9d978e5698d00f
APP_PARTNER=1514583081
APP_PARTNER_KEY=qwelkjuoivc1398767lkj834123kljic
APP_ID=wx9ed5e51251cf7c61
APP_PARTNER=1539689201
APP_PARTNER_KEY=xxfcXXDfangche74upyuns3AD4334533
APP_TRADE_TYPE=APP
#支付回调
weixinHost=xxtest.upyuns.com
......
......@@ -17,6 +17,12 @@ import java.lang.reflect.InvocationTargetException;
@RestController
@RequestMapping("baseUserMember")
public class BaseUserMemberController extends BaseController<BaseUserMemberBiz, BaseUserMember> {
/**
* 获取用户会员
* @param userId
* @return
*/
@RequestMapping("/findOne/{userId}")
public ObjectRestResponse<AppUserManage> findOneByUserId(@PathVariable Integer userId){
BaseUserMember oneByUserId = baseBiz.findOneByUserId(userId);
......
......@@ -59,8 +59,8 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@ApiOperation("查询")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> get(@PathVariable Integer id){
@RequestMapping(value = "/getAppVersion/{id}",method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id){
return ObjectRestResponse.succ(baseBiz.get(id));
}
......
......@@ -57,16 +57,6 @@ public class BaseOrder implements Serializable {
@ApiModelProperty(value = "订单详情id")
private Integer detailId;
/**
* 订单状态
0--删除
1--创建订单
2--取消
3--待付款
4--待出行
5--出行中(进行中)
6--已完成
*/
@Column(name = "status")
@ApiModelProperty(value = "订单状态"
+"0--删除"
......
package com.xxfc.platform.order.pojo.order;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderMemberDetail;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderTourDetail;
import com.xxfc.platform.vehicle.entity.VehicleUserLicense;
import lombok.Data;
import java.util.List;
@Data
public class OrderListVo extends BaseOrder {
OrderRentVehicleDetail orderRentVehicleDetail;
OrderTourDetail orderTourDetail;
OrderMemberDetail orderMemberDetail;
List<VehicleUserLicense> vehicleUserLicenses;
private String username;
private String vehicleNumberPlat;
private String telephone;
private OrderVehicleCrosstownDto orderVehicleCrosstownDto;
private String startCompanyName;
private String endCompanyName;
}
......@@ -2,6 +2,7 @@ package com.xxfc.platform.order.biz;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -15,6 +16,7 @@ import com.xxfc.platform.order.contant.enumerate.RefundStatusEnum;
import com.xxfc.platform.order.contant.enumerate.RefundTypeEnum;
import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.mapper.BaseOrderMapper;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto;
import com.xxfc.platform.tour.feign.TourFeign;
......@@ -81,7 +83,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
public List<OrderPageVO> pageByParm(Map<String, Object> paramMap){
return mapper.pageByParm(paramMap);
}
public List<OrderPageVO> listOrder(Map<String, Object> paramMap){
public List<OrderListVo> listOrder(Map<String, Object> paramMap){
return mapper.listOrder(paramMap);
}
public List<OrderPageVO> getRentVehicle (Map<String, Object> paramMap) {
......@@ -281,7 +285,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//符合范围
if(IntervalUtil.staticIsInTheInterval(hourLag.toString(), names[0])){
refundGoodsAmont = new BigDecimal(((Double) IntervalUtil.evaluate(dic.getDetail(), new MapContext(){{
refundGoodsAmont = new BigDecimal((IntervalUtil.evaluate(dic.getDetail(), new MapContext(){{
//ga : goodsAmount
set("ga", baseOrder.getGoodsAmount());
}})).toString());
......
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import tk.mybatis.mapper.common.Mapper;
......@@ -18,7 +19,7 @@ public interface BaseOrderMapper extends Mapper<BaseOrder> {
public List<OrderPageVO> pageByParm(Map<String, Object> paramMap);
public List<OrderPageVO> listOrder(Map<String, Object> paramMap);
public List<OrderListVo> listOrder(Map<String, Object> paramMap);
public List<OrderPageVO> getRentVehicle(Map<String, Object> paramMap);
......
......@@ -3,6 +3,8 @@ package com.xxfc.platform.order.rest;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.entity.AppUser;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
......@@ -23,6 +25,7 @@ import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.order.CancelOrderDTO;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderAboutParamDTO;
import com.xxfc.platform.order.pojo.pay.RentVehicleOrderPayVO;
......@@ -33,6 +36,7 @@ import com.xxfc.platform.universal.vo.OrderPayVo;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
......@@ -135,33 +139,63 @@ public class BaseOrderController extends CommonBaseController {
@ApiOperation(value = "获取后台订单列表")
@IgnoreClientToken
@CrossOrigin
public ObjectRestResponse<PageDataVO<OrderPageVO>> selectByUser(QueryOrderList dto) {
public ObjectRestResponse<PageDataVO<OrderListVo>> selectByUser(QueryOrderList dto) {
if (dto.getStartTime() != null) {
if (dto.getEndTime() == null) {
dto.setEndTime(new Date().getTime());
}
}
if(StringUtils.isNotBlank(dto.getPhone())) {
AppUserLogin appUserLogin = userFeign.one(dto.getPhone());
if(appUserLogin != null) {
dto.setUserId(appUserLogin.getId());
}
}
Query query = new Query(dto);
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> baseOrderBiz.listOrder(query.getSuper()));
List<OrderPageVO> list = pageDataVO.getData();
List<Integer> userIds = list.stream().map(OrderPageVO::getUserId).distinct().collect(Collectors.toList());
ObjectRestResponse<List<AppUserVo>> objectRestResponse = userFeign.getByUserIds(userIds);
for (OrderPageVO orderPageVO : list) {
if (objectRestResponse.getData() != null && objectRestResponse.getData().size() > 0) {
for (AppUserVo appUserVo : objectRestResponse.getData()) {
if (appUserVo != null && appUserVo.getUserid() == orderPageVO.getUserId()) {
orderPageVO.setUsername(appUserVo.getNickname());
List<OrderListVo> list = pageDataVO.getData();
List<Integer> userIds = list.stream().map(OrderListVo::getUserId).distinct().collect(Collectors.toList());
if(userIds != null && userIds.size() >0) {
ObjectRestResponse<List<AppUserVo>> objectRestResponse = userFeign.getByUserIds(userIds);
for (OrderListVo orderPageVO : list) {
if (objectRestResponse.getData() != null && objectRestResponse.getData().size() > 0) {
for (AppUserVo appUserVo : objectRestResponse.getData()) {
if (appUserVo != null && appUserVo.getUserid() == orderPageVO.getUserId()) {
orderPageVO.setUsername(appUserVo.getNickname());
// ObjectRestResponse<AppUser> restResponse = userFeign.get(appUserVo.getUserid());
// if(restResponse.isRel()) {
// orderPageVO.setTelephone( restResponse.getData().getUsername());
// }
}
}
}
if (orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getVehicleId() != null) {
RestResponse<Vehicle> restResponse = vehicleFeign.findById(orderPageVO.getOrderRentVehicleDetail().getVehicleId());
log.info("获取车辆信息返回消息:{}", restResponse.getMessage());
if (restResponse.getData() != null) {
orderPageVO.setVehicleNumberPlat(restResponse.getData().getNumberPlate());
}
}
if(orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getStartCompanyId()!= null && orderPageVO.getOrderRentVehicleDetail().getEndCompanyId() != null) {
ObjectRestResponse<CompanyDetail> startResponse = vehicleFeign.getCompanyDetail(orderPageVO.getOrderRentVehicleDetail().getStartCompanyId());
if(startResponse.getData() != null) {
orderPageVO.setStartCompanyName(startResponse.getData().getName());
}
}
}
if (orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getVehicleId() != null) {
RestResponse<Vehicle> restResponse = vehicleFeign.findById(orderPageVO.getOrderRentVehicleDetail().getVehicleId());
log.info("获取车辆信息返回消息:{}", restResponse.getMessage());
if (restResponse.getData() != null) {
orderPageVO.setVehicalNumberPlat(restResponse.getData().getNumberPlate());
}
}
}
ObjectRestResponse<CompanyDetail> restResponse = vehicleFeign.getCompanyDetail(orderPageVO.getOrderRentVehicleDetail().getEndCompanyId());
if(restResponse.getData() != null) {
orderPageVO.setEndCompanyName(restResponse.getData().getName());
}
}
if(orderPageVO.getOrderTourDetail() != null && orderPageVO.getOrderTourDetail().getStartCompanyId()!= null) {
ObjectRestResponse<CompanyDetail> startResponse = vehicleFeign.getCompanyDetail(orderPageVO.getOrderTourDetail().getStartCompanyId());
if(startResponse.getData() != null) {
orderPageVO.setStartCompanyName(startResponse.getData().getName());
}
}
}
}
return new ObjectRestResponse<>().data(pageDataVO);
}
......@@ -171,6 +205,7 @@ public class BaseOrderController extends CommonBaseController {
@ApiOperation(value = "交还车租车订单列表")
@IgnoreClientToken
public ObjectRestResponse<List<OrderPageVO>> getVehicleList(QueryOrderList dto) {
log.info("请求参数:dto = {}", dto);
if (dto.getStartTime() != null) {
if (dto.getEndTime() == null) {
dto.setEndTime(new Date().getTime());
......@@ -396,6 +431,13 @@ public class BaseOrderController extends CommonBaseController {
private Integer userId;
private Integer type;
private String phone;
@ApiModelProperty("当前页码")
Integer page;
@ApiModelProperty("每页限制")
Integer limit;
}
@Data
......
......@@ -166,7 +166,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
//如果用户存在,并且为会员,并且车辆有优惠价
if(null != dto && !NONE.equals(detail.getAppUserDTO()) && !DISCOUNT_STATUS_NONE.equals(vehicleModel.getRentDiscountStatus())) {
if(null != dto && !NONE.getCode().equals(dto.getMemberLevel()) && !DISCOUNT_STATUS_NONE.equals(vehicleModel.getRentDiscountStatus())) {
String[] prices = StrUtil.isBlank(vehicleModel.getRentDiscountPrice())
?new String[]{vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString()}
:vehicleModel.getRentDiscountPrice().split(",");
......
......@@ -39,7 +39,23 @@
</case>
</discriminator>
</resultMap>
<resultMap type="com.xxfc.platform.order.pojo.order.OrderListVo" id="orderListMap">
<result javaType="Integer" column="type" property="type"></result>
<discriminator javaType="Integer" column="type">
<case value="1" resultType="com.xxfc.platform.order.pojo.order.OrderListVo">
<association column="{id=detail_id}" property="orderRentVehicleDetail" select="com.xxfc.platform.order.mapper.OrderRentVehicleDetailMapper.pageByParm" javaType="com.xxfc.platform.order.entity.OrderRentVehicleDetail"></association>
</case>
<case value="2" resultType="com.xxfc.platform.order.pojo.order.OrderListVo">
<association column="detail_id" property="orderTourDetail" select="com.xxfc.platform.order.mapper.OrderTourDetailMapper.selectByPrimaryKey" javaType="com.xxfc.platform.order.entity.OrderTourDetail"></association>
</case>
<case value="3" resultType="com.xxfc.platform.order.pojo.order.OrderListVo">
<association column="detail_id" property="orderMemberDetail" select="com.xxfc.platform.order.mapper.OrderMemberDetailMapper.selectByPrimaryKey" javaType="com.xxfc.platform.order.entity.OrderMemberDetail"></association>
</case>
</discriminator>
</resultMap>
<select id="pageByParm" parameterType="Map" resultMap="orderPageMap">
select *
from base_order
......@@ -74,7 +90,7 @@
order by crt_time desc
</select>
<select id="listOrder" parameterType="Map" resultMap="orderPageMap">
<select id="listOrder" parameterType="Map" resultMap="orderListMap">
select b.*
from base_order b
LEFT JOIN order_rent_vehicle_detail r on r.order_id = b.id
......@@ -83,6 +99,9 @@
<if test="crtUser != null">
and b.crt_user = #{crtUser}
</if>
<if test="userId != null">
and b.user_id = #{userId}
</if>
<if test="status != null">
and b.status = #{status}
</if>
......@@ -92,6 +111,9 @@
<if test="no != null">
and no like CONCAT ("%", #{no}, "%")
</if>
<if test="name != null">
and b.name like CONCAT ("%", #{name}, "%")
</if>
<if test="startTime != null">
and r.start_time between #{startTime} and #{endTime}
or t.start_time between #{startTime} and #{endTime}
......
......@@ -150,27 +150,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
/**
* 删除
* @param
* @return
*/
@ApiOperation("删除")
@PostMapping(value = "/app/del/{id}")
@Transactional(rollbackFor = Exception.class)
public ObjectRestResponse<TourUser> del(@PathVariable Integer id){
try {
TourUser tourUser= new TourUser();
tourUser.setIsdel(1);
baseBiz.updateSelectiveById(tourUser);
return ObjectRestResponse.succ();
} catch (Exception e) {
e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ObjectRestResponse.createDefaultFail();
}
}
}
\ No newline at end of file
......@@ -75,7 +75,7 @@ public class WXPrepay {
if (httpEntity != null) {
// 打印响应内容
String result = EntityUtils.toString(httpEntity, "UTF-8");
// System.out.println(result);
System.out.println(result);
// 过滤
result = result.replaceAll("<![CDATA[|]]>", "");
String prepay_id = Jsoup.parse(result).select("prepay_id").html();
......
......@@ -78,13 +78,16 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
*/
public CompanyDetail getDetailById(Integer id) {
BranchCompany branchCompany = this.getById(id);
List<SysRegion> sysRegions = sysRegionBiz.getRegionsByCodes(new ArrayList<Long>(){{
add(Long.valueOf(branchCompany.getAddrProvince()));
add(Long.valueOf(branchCompany.getAddrCity()));
add(Long.valueOf(branchCompany.getAddrTown()));
}});
CompanyDetail detail = BeanUtil.toBean(branchCompany, CompanyDetail.class);
detail.setSysRegions(sysRegions);
CompanyDetail detail = null;
if(branchCompany != null) {
List<SysRegion> sysRegions = sysRegionBiz.getRegionsByCodes(new ArrayList<Long>(){{
add(Long.valueOf(branchCompany.getAddrProvince()));
add(Long.valueOf(branchCompany.getAddrCity()));
add(Long.valueOf(branchCompany.getAddrTown()));
}});
detail = BeanUtil.toBean(branchCompany, CompanyDetail.class);
detail.setSysRegions(sysRegions);
}
return detail;
}
......
......@@ -105,7 +105,11 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
Page<VehicleModel> pages = PageHelper.startPage(page, limit);
Example example = Example.builder(VehicleModel.class)
.where(WeekendSqls.<VehicleModel>custom().andEqualTo(VehicleModel::getIsdel, 0)).orderByDesc("hot_sign").build();
.where(
WeekendSqls.<VehicleModel>custom()
.andEqualTo(VehicleModel::getIsdel, 0)
.andEqualTo(VehicleModel::getHotSign,1)
).orderByDesc("id").build();
selectByExample(example);
PageInfo<VehicleModel> pageInfo= PageInfo.of(pages.getResult());
......
......@@ -104,7 +104,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
return RestResponse.data(vehicle);
}
@RequestMapping(value = "/vehicleInfo/getByIds", method = RequestMethod.GET)
@RequestMapping(value = "/getByIds", method = RequestMethod.GET)
public RestResponse< List<Vehicle>> getByIds(@RequestParam("ids") List<String> ids){
if(ids == null) {
return RestResponse.codeAndMessage(500, "参数为空!");
......@@ -376,10 +376,9 @@ public class VehicleController extends BaseController<VehicleBiz> {
vpcMap.put(vpc.getParentId(), vpcs);
}
dto.setCatas(vpcMap);
//设置显示是否有车
//dto.setYearNo4Where(Boolean.TRUE);
}
//设置显示是否有车
dto.setYearNo4Where(Boolean.TRUE);
return new ObjectRestResponse<>().data(vehicleBiz.searchUsableModel(dto)).rel(true);
}
......
......@@ -96,7 +96,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/unauthfind/findVehicleModelPage")
@PostMapping(value = "/app/unauth/findVehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ,HttpServletRequest request) {
......@@ -281,8 +281,13 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
return ObjectRestResponse.succ(baseBiz.selectList(vehicleModel));
}
@ApiOperation("查询所有")
/**
* 优质车型
* @param page
* @param limit
* @return
*/
@ApiOperation("优质车型")
@GetMapping(value = "/goodList")
public List<GoodDataVO> goodList(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit){
return baseBiz.goodList(page,limit);
......
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