yshop1.4.2 商品新增多图评价,订单新增快递查询,导出最新sql
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#### 项目简介
|
#### 项目简介
|
||||||
yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀、优惠券、积分、分销等功能,更适合企业或个人二次开发;;
|
yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀、优惠券、积分、分销、会员等功能,更适合企业或个人二次开发;;
|
||||||
|
|
||||||
**开发文档** 【[查看文档](https://gitee.com/guchengwuyue/yshopmall/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83?sort_id=1718722)】
|
**开发文档** 【[查看文档](https://gitee.com/guchengwuyue/yshopmall/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83?sort_id=1718722)】
|
||||||
|
|
||||||
@ -141,6 +141,9 @@ yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2
|
|||||||
- 1.7、会员后台新增余额调整
|
- 1.7、会员后台新增余额调整
|
||||||
- 1.8、修复新增配置数据有时候不成功问题等
|
- 1.8、修复新增配置数据有时候不成功问题等
|
||||||
- 1.4.1个人中心新增账单流水
|
- 1.4.1个人中心新增账单流水
|
||||||
|
- yshop1.4.2 发布更新如下:
|
||||||
|
-1.商品新增多图评价
|
||||||
|
-2.订单新增快递查询
|
||||||
|
|
||||||
|
|
||||||
#### 反馈交流
|
#### 反馈交流
|
||||||
|
190
sql/yxshop.sql
190
sql/yxshop.sql
File diff suppressed because one or more lines are too long
@ -116,6 +116,8 @@ public class YxStoreOrder extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "快递名称/送货人姓名")
|
@ApiModelProperty(value = "快递名称/送货人姓名")
|
||||||
private String deliveryName;
|
private String deliveryName;
|
||||||
|
|
||||||
|
private String deliverySn;
|
||||||
|
|
||||||
@ApiModelProperty(value = "发货类型")
|
@ApiModelProperty(value = "发货类型")
|
||||||
private String deliveryType;
|
private String deliveryType;
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ import co.yixiang.common.web.controller.BaseController;
|
|||||||
import co.yixiang.common.web.param.IdParam;
|
import co.yixiang.common.web.param.IdParam;
|
||||||
import co.yixiang.common.web.vo.Paging;
|
import co.yixiang.common.web.vo.Paging;
|
||||||
import co.yixiang.exception.ErrorRequestException;
|
import co.yixiang.exception.ErrorRequestException;
|
||||||
|
import co.yixiang.express.ExpressService;
|
||||||
|
import co.yixiang.express.dao.ExpressInfo;
|
||||||
import co.yixiang.modules.activity.service.YxStorePinkService;
|
import co.yixiang.modules.activity.service.YxStorePinkService;
|
||||||
import co.yixiang.modules.order.entity.YxStoreOrder;
|
import co.yixiang.modules.order.entity.YxStoreOrder;
|
||||||
import co.yixiang.modules.order.entity.YxStoreOrderCartInfo;
|
import co.yixiang.modules.order.entity.YxStoreOrderCartInfo;
|
||||||
@ -14,10 +16,7 @@ import co.yixiang.modules.order.service.YxStoreOrderCartInfoService;
|
|||||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||||
import co.yixiang.modules.order.service.YxStoreOrderStatusService;
|
import co.yixiang.modules.order.service.YxStoreOrderStatusService;
|
||||||
import co.yixiang.modules.order.web.dto.*;
|
import co.yixiang.modules.order.web.dto.*;
|
||||||
import co.yixiang.modules.order.web.param.OrderParam;
|
import co.yixiang.modules.order.web.param.*;
|
||||||
import co.yixiang.modules.order.web.param.PayParam;
|
|
||||||
import co.yixiang.modules.order.web.param.RefundParam;
|
|
||||||
import co.yixiang.modules.order.web.param.YxStoreOrderQueryParam;
|
|
||||||
import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
|
import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
|
||||||
import co.yixiang.modules.shop.entity.YxStoreProductReply;
|
import co.yixiang.modules.shop.entity.YxStoreProductReply;
|
||||||
import co.yixiang.modules.shop.service.YxStoreCartService;
|
import co.yixiang.modules.shop.service.YxStoreCartService;
|
||||||
@ -68,6 +67,7 @@ public class StoreOrderController extends BaseController {
|
|||||||
private final YxStoreCouponUserService couponUserService;
|
private final YxStoreCouponUserService couponUserService;
|
||||||
private final YxSystemConfigService systemConfigService;
|
private final YxSystemConfigService systemConfigService;
|
||||||
private final YxStorePinkService storePinkService;
|
private final YxStorePinkService storePinkService;
|
||||||
|
private final ExpressService expressService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -510,5 +510,19 @@ public class StoreOrderController extends BaseController {
|
|||||||
return ApiResult.ok("ok");
|
return ApiResult.ok("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**@Valid
|
||||||
|
* 获取物流信息,根据传的订单编号 ShipperCode快递公司编号 和物流单号,
|
||||||
|
*/
|
||||||
|
@PostMapping("/order/express")
|
||||||
|
@ApiOperation(value = "获取物流信息",notes = "获取物流信息",response = ExpressParam.class)
|
||||||
|
public ApiResult<Object> express( @RequestBody ExpressParam expressInfoDo){
|
||||||
|
ExpressInfo expressInfo = expressService.getExpressInfo(expressInfoDo.getOrderCode(),
|
||||||
|
expressInfoDo.getShipperCode(), expressInfoDo.getLogisticCode());
|
||||||
|
if(!expressInfo.isSuccess()) return ApiResult.fail(expressInfo.getReason());
|
||||||
|
return ApiResult.ok(expressInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package co.yixiang.modules.order.web.param;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ExpressParam
|
||||||
|
* @Author hupeng <610796224@qq.com>
|
||||||
|
* @Date 2019/12/9
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class ExpressParam implements Serializable {
|
||||||
|
//@NotBlank()
|
||||||
|
private String orderCode;
|
||||||
|
private String shipperCode;
|
||||||
|
private String logisticCode;
|
||||||
|
}
|
@ -116,6 +116,8 @@ public class YxStoreOrderQueryVo implements Serializable {
|
|||||||
@ApiModelProperty(value = "快递名称/送货人姓名")
|
@ApiModelProperty(value = "快递名称/送货人姓名")
|
||||||
private String deliveryName;
|
private String deliveryName;
|
||||||
|
|
||||||
|
private String deliverySn;
|
||||||
|
|
||||||
@ApiModelProperty(value = "发货类型")
|
@ApiModelProperty(value = "发货类型")
|
||||||
private String deliveryType;
|
private String deliveryType;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public interface YxStoreProductReplyMapper extends BaseMapper<YxStoreProductRepl
|
|||||||
|
|
||||||
@Select("select A.product_score as productScore,A.service_score as serviceScore," +
|
@Select("select A.product_score as productScore,A.service_score as serviceScore," +
|
||||||
"A.comment,A.merchant_reply_content as merchantReplyContent," +
|
"A.comment,A.merchant_reply_content as merchantReplyContent," +
|
||||||
"A.merchant_reply_time as merchantReplyTime,A.pics,A.add_time as addTime," +
|
"A.merchant_reply_time as merchantReplyTime,A.pics as pictures,A.add_time as addTime," +
|
||||||
"B.nickname,B.avatar,C.cart_info as cartInfo" +
|
"B.nickname,B.avatar,C.cart_info as cartInfo" +
|
||||||
" from yx_store_product_reply A left join yx_user B " +
|
" from yx_store_product_reply A left join yx_user B " +
|
||||||
"on A.uid = B.uid left join yx_store_order_cart_info C on A.unique = C.unique" +
|
"on A.uid = B.uid left join yx_store_order_cart_info C on A.unique = C.unique" +
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package co.yixiang.modules.shop.web.vo;
|
package co.yixiang.modules.shop.web.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -7,6 +8,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,6 +46,19 @@ public class YxStoreProductReplyQueryVo implements Serializable {
|
|||||||
@ApiModelProperty(value = "评论图片")
|
@ApiModelProperty(value = "评论图片")
|
||||||
private String[] pics;
|
private String[] pics;
|
||||||
|
|
||||||
|
private String pictures;
|
||||||
|
|
||||||
|
private String[] picturesArr;
|
||||||
|
|
||||||
|
public String[] getPicturesArr() {
|
||||||
|
if(StrUtil.isNotEmpty(pictures)){
|
||||||
|
return pictures.split(",");
|
||||||
|
}else{
|
||||||
|
return new String[]{};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "评论时间")
|
@ApiModelProperty(value = "评论时间")
|
||||||
private Integer addTime;
|
private Integer addTime;
|
||||||
|
|
||||||
@ -63,7 +78,6 @@ public class YxStoreProductReplyQueryVo implements Serializable {
|
|||||||
private String suk;
|
private String suk;
|
||||||
|
|
||||||
|
|
||||||
private String pictures;
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private String cartInfo;
|
private String cartInfo;
|
||||||
|
@ -133,9 +133,9 @@ yshop:
|
|||||||
|
|
||||||
# 快鸟物流查询配置
|
# 快鸟物流查询配置
|
||||||
express:
|
express:
|
||||||
enable: false
|
enable: true
|
||||||
appId: "XXXXXXXXX"
|
appId:
|
||||||
appKey: "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
appKey:
|
||||||
vendors:
|
vendors:
|
||||||
- code: "ZTO"
|
- code: "ZTO"
|
||||||
name: "中通快递"
|
name: "中通快递"
|
||||||
|
@ -142,9 +142,9 @@ yshop:
|
|||||||
|
|
||||||
# 快鸟物流查询配置
|
# 快鸟物流查询配置
|
||||||
express:
|
express:
|
||||||
enable: false
|
enable: true
|
||||||
appId: "XXXXXXXXX"
|
appId: 1607734
|
||||||
appKey: "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
appKey:
|
||||||
vendors:
|
vendors:
|
||||||
- code: "ZTO"
|
- code: "ZTO"
|
||||||
name: "中通快递"
|
name: "中通快递"
|
||||||
|
@ -134,6 +134,10 @@ public class YxStoreOrder implements Serializable {
|
|||||||
@Column(name = "delivery_name")
|
@Column(name = "delivery_name")
|
||||||
private String deliveryName;
|
private String deliveryName;
|
||||||
|
|
||||||
|
@Column(name = "delivery_sn")
|
||||||
|
private String deliverySn;
|
||||||
|
|
||||||
|
|
||||||
// 发货类型
|
// 发货类型
|
||||||
@Column(name = "delivery_type")
|
@Column(name = "delivery_type")
|
||||||
private String deliveryType;
|
private String deliveryType;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package co.yixiang.modules.shop.rest;
|
package co.yixiang.modules.shop.rest;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import co.yixiang.exception.BadRequestException;
|
import co.yixiang.exception.BadRequestException;
|
||||||
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
||||||
@ -8,6 +9,8 @@ import co.yixiang.modules.shop.service.YxStoreOrderService;
|
|||||||
import co.yixiang.aop.log.Log;
|
import co.yixiang.aop.log.Log;
|
||||||
import co.yixiang.modules.shop.service.YxStoreOrderStatusService;
|
import co.yixiang.modules.shop.service.YxStoreOrderStatusService;
|
||||||
import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
|
import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
|
||||||
|
import co.yixiang.modules.system.service.DictDetailService;
|
||||||
|
import co.yixiang.modules.system.service.dto.DictDetailDTO;
|
||||||
import co.yixiang.utils.OrderUtil;
|
import co.yixiang.utils.OrderUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@ -33,6 +36,9 @@ public class YxStoreOrderController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private YxStoreOrderStatusService yxStoreOrderStatusService;
|
private YxStoreOrderStatusService yxStoreOrderStatusService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DictDetailService dictDetailService;
|
||||||
|
|
||||||
@GetMapping(value = "/data/count")
|
@GetMapping(value = "/data/count")
|
||||||
//@PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
|
//@PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
|
||||||
public ResponseEntity getCount(){
|
public ResponseEntity getCount(){
|
||||||
@ -114,8 +120,17 @@ public class YxStoreOrderController {
|
|||||||
@PutMapping(value = "/yxStoreOrder")
|
@PutMapping(value = "/yxStoreOrder")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
|
||||||
public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources){
|
public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources){
|
||||||
|
|
||||||
|
DictDetailDTO dictDetailDTO = dictDetailService.findById(Long.valueOf(resources
|
||||||
|
.getDeliveryName()));
|
||||||
|
if(ObjectUtil.isNull(dictDetailDTO)){
|
||||||
|
throw new BadRequestException("请先添加快递公司");
|
||||||
|
}
|
||||||
resources.setStatus(1);
|
resources.setStatus(1);
|
||||||
resources.setDeliveryType("express");
|
resources.setDeliveryType("express");
|
||||||
|
resources.setDeliveryName(dictDetailDTO.getLabel());
|
||||||
|
resources.setDeliverySn(dictDetailDTO.getValue());
|
||||||
|
|
||||||
yxStoreOrderService.update(resources);
|
yxStoreOrderService.update(resources);
|
||||||
|
|
||||||
YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
|
YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package co.yixiang.modules.system.rest;
|
package co.yixiang.modules.system.rest;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import co.yixiang.exception.BadRequestException;
|
import co.yixiang.exception.BadRequestException;
|
||||||
import co.yixiang.aop.log.Log;
|
import co.yixiang.aop.log.Log;
|
||||||
import co.yixiang.modules.system.domain.Dict;
|
import co.yixiang.modules.system.domain.Dict;
|
||||||
@ -37,6 +38,7 @@ public class DictController {
|
|||||||
@PostMapping(value = "/dict")
|
@PostMapping(value = "/dict")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody Dict resources){
|
public ResponseEntity create(@Validated @RequestBody Dict resources){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||||
}
|
}
|
||||||
@ -47,6 +49,7 @@ public class DictController {
|
|||||||
@PutMapping(value = "/dict")
|
@PutMapping(value = "/dict")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')")
|
||||||
public ResponseEntity update(@Validated(Dict.Update.class) @RequestBody Dict resources){
|
public ResponseEntity update(@Validated(Dict.Update.class) @RequestBody Dict resources){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
dictService.update(resources);
|
dictService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -55,6 +58,7 @@ public class DictController {
|
|||||||
@DeleteMapping(value = "/dict/{id}")
|
@DeleteMapping(value = "/dict/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
dictService.delete(id);
|
dictService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package co.yixiang.modules.system.rest;
|
package co.yixiang.modules.system.rest;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import co.yixiang.exception.BadRequestException;
|
import co.yixiang.exception.BadRequestException;
|
||||||
import co.yixiang.aop.log.Log;
|
import co.yixiang.aop.log.Log;
|
||||||
import co.yixiang.modules.system.domain.DictDetail;
|
import co.yixiang.modules.system.domain.DictDetail;
|
||||||
@ -56,6 +57,7 @@ public class DictDetailController {
|
|||||||
@PostMapping(value = "/dictDetail")
|
@PostMapping(value = "/dictDetail")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody DictDetail resources){
|
public ResponseEntity create(@Validated @RequestBody DictDetail resources){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||||
}
|
}
|
||||||
@ -66,6 +68,7 @@ public class DictDetailController {
|
|||||||
@PutMapping(value = "/dictDetail")
|
@PutMapping(value = "/dictDetail")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')")
|
||||||
public ResponseEntity update(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources){
|
public ResponseEntity update(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
dictDetailService.update(resources);
|
dictDetailService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -74,6 +77,7 @@ public class DictDetailController {
|
|||||||
@DeleteMapping(value = "/dictDetail/{id}")
|
@DeleteMapping(value = "/dictDetail/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
|
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||||
dictDetailService.delete(id);
|
dictDetailService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -51,16 +51,16 @@ public class ExpressService {
|
|||||||
/**
|
/**
|
||||||
* 获取物流信息
|
* 获取物流信息
|
||||||
*
|
*
|
||||||
* @param expCode
|
* @param OrderCode
|
||||||
* @param expNo
|
* @param ShipperCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ExpressInfo getExpressInfo(String expCode, String expNo) {
|
public ExpressInfo getExpressInfo(String OrderCode,String ShipperCode, String LogisticCode) {
|
||||||
try {
|
try {
|
||||||
String result = getOrderTracesByJson(expCode, expNo);
|
String result = getOrderTracesByJson(OrderCode,ShipperCode, LogisticCode);
|
||||||
ObjectMapper objMap = new ObjectMapper();
|
ObjectMapper objMap = new ObjectMapper();
|
||||||
ExpressInfo ei = objMap.readValue(result, ExpressInfo.class);
|
ExpressInfo ei = objMap.readValue(result, ExpressInfo.class);
|
||||||
ei.setShipperName(getVendorName(expCode));
|
ei.setShipperName(getVendorName(ShipperCode));
|
||||||
return ei;
|
return ei;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
@ -74,12 +74,12 @@ public class ExpressService {
|
|||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private String getOrderTracesByJson(String expCode, String expNo) throws Exception {
|
private String getOrderTracesByJson(String OrderCode,String ShipperCode, String LogisticCode) throws Exception {
|
||||||
if (!properties.isEnable()) {
|
if (!properties.isEnable()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String requestData = "{'OrderCode':'','ShipperCode':'" + expCode + "','LogisticCode':'" + expNo + "'}";
|
String requestData = "{'OrderCode':'"+OrderCode+"','ShipperCode':'" + ShipperCode + "','LogisticCode':'" + LogisticCode + "'}";
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
|
params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
package co.yixiang.express.dao;
|
package co.yixiang.express.dao;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ import java.util.List;
|
|||||||
* @author bejson.com (i@bejson.com)
|
* @author bejson.com (i@bejson.com)
|
||||||
* @website http://www.bejson.com/java2pojo/
|
* @website http://www.bejson.com/java2pojo/
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class ExpressInfo {
|
public class ExpressInfo {
|
||||||
|
|
||||||
@JsonProperty("LogisticCode")
|
@JsonProperty("LogisticCode")
|
||||||
@ -32,81 +34,8 @@ public class ExpressInfo {
|
|||||||
|
|
||||||
private String ShipperName;
|
private String ShipperName;
|
||||||
|
|
||||||
public String getLogisticCode() {
|
@JsonProperty("OrderCode")
|
||||||
return LogisticCode;
|
private String OrderCode;
|
||||||
}
|
|
||||||
|
|
||||||
public void setLogisticCode(String LogisticCode) {
|
|
||||||
this.LogisticCode = LogisticCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getShipperCode() {
|
|
||||||
return ShipperCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipperCode(String ShipperCode) {
|
|
||||||
this.ShipperCode = ShipperCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Traces> getTraces() {
|
|
||||||
return Traces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTraces(List<Traces> Traces) {
|
|
||||||
this.Traces = Traces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getState() {
|
|
||||||
return State;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setState(String State) {
|
|
||||||
this.State = State;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEBusinessID() {
|
|
||||||
return EBusinessID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEBusinessID(String EBusinessID) {
|
|
||||||
this.EBusinessID = EBusinessID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getSuccess() {
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSuccess(boolean Success) {
|
|
||||||
this.Success = Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReason() {
|
|
||||||
return Reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReason(String Reason) {
|
|
||||||
this.Reason = Reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getShipperName() {
|
|
||||||
return ShipperName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipperName(String shipperName) {
|
|
||||||
ShipperName = shipperName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ExpressInfo{" +
|
|
||||||
"LogisticCode='" + LogisticCode + '\'' +
|
|
||||||
", ShipperCode='" + ShipperCode + '\'' +
|
|
||||||
", Traces=" + Traces +
|
|
||||||
", State='" + State + '\'' +
|
|
||||||
", EBusinessID='" + EBusinessID + '\'' +
|
|
||||||
", Success=" + Success +
|
|
||||||
", Reason=" + Reason +
|
|
||||||
", ShipperName='" + ShipperName + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user