From 4739c5ea01d36ec755dd848887230c88006d88fb Mon Sep 17 00:00:00 2001
From: hupeng
Date: Fri, 6 Mar 2020 11:36:27 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=A8=E5=BA=97=E6=A0=B8?=
=?UTF-8?q?=E9=94=80=E4=B8=8E=E5=85=85=E5=80=BC=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
shell/start.sh | 2 +-
shell/stop.sh | 2 +-
.../controller/StoreBargainController.java | 2 +-
.../service/impl/YxStoreOrderServiceImpl.java | 55 ++++++++---
.../web/controller/StoreOrderController.java | 89 ++++++++++++++++--
.../order/web/dto/ConfirmOrderDTO.java | 4 +-
.../order/web/param/OrderVerifyParam.java | 20 ++++
.../order/web/vo/YxStoreOrderQueryVo.java | 7 ++
.../modules/shop/entity/YxSystemStore.java | 81 +++++++++++++++++
.../shop/mapper/YxSystemStoreMapper.java | 40 ++++++++
.../modules/shop/mapping/SystemStoreMap.java | 17 ++++
.../shop/service/YxSystemStoreService.java | 37 ++++++++
.../impl/YxStoreProductServiceImpl.java | 11 ++-
.../impl/YxSystemStoreServiceImpl.java | 66 ++++++++++++++
.../controller/YxSystemStoreController.java | 91 +++++++++++++++++++
.../modules/shop/web/dto/ProductDTO.java | 9 +-
.../web/param/YxSystemStoreQueryParam.java | 22 +++++
.../shop/web/vo/YxSystemStoreQueryVo.java | 73 +++++++++++++++
.../impl/YxUserRechargeServiceImpl.java | 34 +++++--
.../user/web/controller/UserController.java | 1 -
.../controller/UserRechargeController.java | 2 +-
.../web/controller/WechatController.java | 40 +++-----
.../mapper/shop/YxSystemStoreMapper.xml | 18 ++++
.../java/co/yixiang/test/CodeGenerator.java | 4 +-
.../java/co/yixiang/enums/OrderInfoEnum.java | 15 ++-
.../yixiang/mp/service/YxTemplateService.java | 23 +++++
.../shop/rest/StoreOrderController.java | 55 ++++++++---
.../shop/rest/SystemStoreController.java | 2 +-
.../shop/rest/UserRechargeController.java | 3 +
.../shop/service/YxStoreOrderService.java | 2 +-
.../dto/YxStoreOrderQueryCriteria.java | 3 +
.../service/impl/YxStoreOrderServiceImpl.java | 8 +-
32 files changed, 749 insertions(+), 89 deletions(-)
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/order/web/param/OrderVerifyParam.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemStore.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemStoreMapper.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/mapping/SystemStoreMap.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreService.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/YxSystemStoreController.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemStoreQueryParam.java
create mode 100644 yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemStoreQueryVo.java
create mode 100644 yshop-api/src/main/resources/mapper/shop/YxSystemStoreMapper.xml
diff --git a/shell/start.sh b/shell/start.sh
index f3a0c92e..fa305a27 100644
--- a/shell/start.sh
+++ b/shell/start.sh
@@ -1 +1 @@
-nohup java -jar yshop-api-1.9.jar --spring.profiles.active=prod &
\ No newline at end of file
+nohup java -jar yshop-api-2.0.jar --spring.profiles.active=prod &
\ No newline at end of file
diff --git a/shell/stop.sh b/shell/stop.sh
index 9182c277..f87788a5 100644
--- a/shell/stop.sh
+++ b/shell/stop.sh
@@ -1,4 +1,4 @@
-PID=$(ps -ef | grep yshop-api-1.9.jar | grep -v grep | awk '{ print $2 }')
+PID=$(ps -ef | grep yshop-api-2.0.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ];then
echo Application is already stopped
else
diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java
index e8f8a630..b78dc3a8 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java
@@ -273,7 +273,7 @@ public class StoreBargainController extends BaseController {
return ApiResult.fail("未配置h5地址");
}
String apiUrl = systemConfigService.getData("api_url");
- if(StrUtil.isEmpty(siteUrl)){
+ if(StrUtil.isEmpty(apiUrl)){
return ApiResult.fail("未配置api地址");
}
int uid = SecurityUtils.getUserId().intValue();
diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
index 2183183f..25531267 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
@@ -48,11 +48,9 @@ import co.yixiang.modules.shop.entity.YxStoreCart;
import co.yixiang.modules.shop.entity.YxStoreCouponUser;
import co.yixiang.modules.shop.mapper.YxStoreCartMapper;
import co.yixiang.modules.shop.mapper.YxStoreCouponUserMapper;
-import co.yixiang.modules.shop.service.YxStoreCouponUserService;
-import co.yixiang.modules.shop.service.YxStoreProductReplyService;
-import co.yixiang.modules.shop.service.YxStoreProductService;
-import co.yixiang.modules.shop.service.YxSystemConfigService;
+import co.yixiang.modules.shop.service.*;
import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo;
+import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
import co.yixiang.modules.user.entity.YxUser;
import co.yixiang.modules.user.entity.YxUserBill;
import co.yixiang.modules.user.entity.YxWechatUser;
@@ -148,6 +146,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl 0){
if(pinkService.pinkIngCount(order.getPinkId()) > 0){
statusDTO.set_class("state-nfh");
@@ -887,10 +886,17 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl list = new ArrayList<>();
list.add("收货地址填错了");
list.add("与描述不符");
- list.add("信了息填错,重新拍\\");
+ list.add("信息填错了,重新拍");
list.add("收到商品损坏了");
list.add("未按预定时间发货");
list.add("其它原因");
@@ -659,6 +702,40 @@ public class StoreOrderController extends BaseController {
return ApiResult.ok(expressInfo);
}
+ /**
+ * 订单核销
+ */
+ @PostMapping("/order/order_verific")
+ @ApiOperation(value = "订单核销",notes = "订单核销")
+ public ApiResult
+ *
+ * @author hupeng
+ * @since 2020-03-04
+ */
+@Slf4j
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class YxSystemStoreServiceImpl extends BaseServiceImpl implements YxSystemStoreService {
+
+ @Autowired
+ private YxSystemStoreMapper yxSystemStoreMapper;
+
+ @Autowired
+ private SystemStoreMap storeMap;
+
+ @Override
+ public YxSystemStoreQueryVo getStoreInfo() {
+ YxSystemStore systemStore = new YxSystemStore();
+ systemStore.setIsDel(0);
+ YxSystemStore yxSystemStore = yxSystemStoreMapper.selectOne(Wrappers.query(systemStore));
+ if(yxSystemStore == null) return null;
+ String mention = RedisUtil.get("store_self_mention");
+ if(mention == null || Integer.valueOf(mention) == 2) return null;
+ return storeMap.toDto(yxSystemStore);
+ }
+
+ @Override
+ public YxSystemStoreQueryVo getYxSystemStoreById(Serializable id) throws Exception{
+ return yxSystemStoreMapper.getYxSystemStoreById(id);
+ }
+
+ @Override
+ public Paging getYxSystemStorePageList(YxSystemStoreQueryParam yxSystemStoreQueryParam) throws Exception{
+ Page page = setPageParam(yxSystemStoreQueryParam,OrderItem.desc("create_time"));
+ IPage iPage = yxSystemStoreMapper.getYxSystemStorePageList(page,yxSystemStoreQueryParam);
+ return new Paging(iPage);
+ }
+
+}
diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/YxSystemStoreController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/YxSystemStoreController.java
new file mode 100644
index 00000000..37a619f0
--- /dev/null
+++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/YxSystemStoreController.java
@@ -0,0 +1,91 @@
+package co.yixiang.modules.shop.web.controller;
+
+import co.yixiang.modules.shop.entity.YxSystemStore;
+import co.yixiang.modules.shop.service.YxSystemStoreService;
+import co.yixiang.modules.shop.web.param.YxSystemStoreQueryParam;
+import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
+import co.yixiang.common.web.controller.BaseController;
+import co.yixiang.common.api.ApiResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+import co.yixiang.common.web.vo.Paging;
+import co.yixiang.common.web.param.IdParam;
+
+/**
+ *
+ * 门店自提 前端控制器
+ *
+ *
+ * @author hupeng
+ * @since 2020-03-04
+ */
+@Slf4j
+@RestController
+@RequestMapping("/yxSystemStore")
+@Api("门店自提 API")
+public class YxSystemStoreController extends BaseController {
+
+ @Autowired
+ private YxSystemStoreService yxSystemStoreService;
+
+ /**
+ * 添加门店自提
+ */
+ @PostMapping("/add")
+ @ApiOperation(value = "添加YxSystemStore对象",notes = "添加门店自提",response = ApiResult.class)
+ public ApiResult addYxSystemStore(@Valid @RequestBody YxSystemStore yxSystemStore) throws Exception{
+ boolean flag = yxSystemStoreService.save(yxSystemStore);
+ return ApiResult.result(flag);
+ }
+
+ /**
+ * 修改门店自提
+ */
+ @PostMapping("/update")
+ @ApiOperation(value = "修改YxSystemStore对象",notes = "修改门店自提",response = ApiResult.class)
+ public ApiResult updateYxSystemStore(@Valid @RequestBody YxSystemStore yxSystemStore) throws Exception{
+ boolean flag = yxSystemStoreService.updateById(yxSystemStore);
+ return ApiResult.result(flag);
+ }
+
+ /**
+ * 删除门店自提
+ */
+ @PostMapping("/delete")
+ @ApiOperation(value = "删除YxSystemStore对象",notes = "删除门店自提",response = ApiResult.class)
+ public ApiResult deleteYxSystemStore(@Valid @RequestBody IdParam idParam) throws Exception{
+ boolean flag = yxSystemStoreService.removeById(idParam.getId());
+ return ApiResult.result(flag);
+ }
+
+ /**
+ * 获取门店自提
+ */
+ @PostMapping("/info")
+ @ApiOperation(value = "获取YxSystemStore对象详情",notes = "查看门店自提",response = YxSystemStoreQueryVo.class)
+ public ApiResult getYxSystemStore(@Valid @RequestBody IdParam idParam) throws Exception{
+ YxSystemStoreQueryVo yxSystemStoreQueryVo = yxSystemStoreService.getYxSystemStoreById(idParam.getId());
+ return ApiResult.ok(yxSystemStoreQueryVo);
+ }
+
+ /**
+ * 门店自提分页列表
+ */
+ @PostMapping("/getPageList")
+ @ApiOperation(value = "获取YxSystemStore分页列表",notes = "门店自提分页列表",response = YxSystemStoreQueryVo.class)
+ public ApiResult> getYxSystemStorePageList(@Valid @RequestBody(required = false) YxSystemStoreQueryParam yxSystemStoreQueryParam) throws Exception{
+ Paging paging = yxSystemStoreService.getYxSystemStorePageList(yxSystemStoreQueryParam);
+ return ApiResult.ok(paging);
+ }
+
+}
+
diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java
index 2ad83ab3..1e2671cd 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java
@@ -5,6 +5,7 @@ import co.yixiang.modules.shop.entity.YxStoreProductAttrValue;
import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo;
import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo;
import co.yixiang.modules.shop.web.vo.YxStoreProductReplyQueryVo;
+import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -30,8 +31,6 @@ public class ProductDTO extends QueryParam {
//todo
private List goodList = new ArrayList();
- //todo
- private String mapKay = "";
//todo
private Integer merId = 0;
@@ -53,8 +52,10 @@ public class ProductDTO extends QueryParam {
private YxStoreProductQueryVo storeInfo;
- //todo
- private Map system_store = new LinkedHashMap<>();
+ private String mapKey;
+
+ //门店
+ private YxSystemStoreQueryVo systemStore;
private Integer uid = 0;
diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemStoreQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemStoreQueryParam.java
new file mode 100644
index 00000000..a952e16a
--- /dev/null
+++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemStoreQueryParam.java
@@ -0,0 +1,22 @@
+package co.yixiang.modules.shop.web.param;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import co.yixiang.common.web.param.QueryParam;
+
+/**
+ *
+ * 门店自提 查询参数对象
+ *
+ *
+ * @author hupeng
+ * @date 2020-03-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="YxSystemStoreQueryParam对象", description="门店自提查询参数")
+public class YxSystemStoreQueryParam extends QueryParam {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemStoreQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemStoreQueryVo.java
new file mode 100644
index 00000000..6bc1646f
--- /dev/null
+++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemStoreQueryVo.java
@@ -0,0 +1,73 @@
+package co.yixiang.modules.shop.web.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+import java.util.Date;
+
+/**
+ *
+ * 门店自提 查询结果对象
+ *
+ *
+ * @author hupeng
+ * @date 2020-03-04
+ */
+@Data
+@ApiModel(value = "YxSystemStoreQueryVo对象", description = "门店自提查询参数")
+public class YxSystemStoreQueryVo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private Integer id;
+
+ @ApiModelProperty(value = "门店名称")
+ private String name;
+
+ @ApiModelProperty(value = "简介")
+ private String introduction;
+
+ @ApiModelProperty(value = "手机号码")
+ private String phone;
+
+ @ApiModelProperty(value = "省市区")
+ private String address;
+
+ @ApiModelProperty(value = "详细地址")
+ private String detailedAddress;
+
+ @ApiModelProperty(value = "门店logo")
+ private String image;
+
+ @ApiModelProperty(value = "纬度")
+ private String latitude;
+
+ @ApiModelProperty(value = "经度")
+ private String longitude;
+
+ @ApiModelProperty(value = "核销有效日期")
+ private String validTime;
+
+ private String latlng;
+
+ public String getLatlng(){
+ return latitude+","+longitude;
+ }
+
+ @ApiModelProperty(value = "每日营业开关时间")
+ private String dayTime;
+
+ @ApiModelProperty(value = "添加时间")
+ private Integer addTime;
+
+ private Date dayTimeEnd;
+
+ private Date dayTimeStart;
+
+ private Date validTimeEnd;
+
+ private Date validTimeStart;
+
+}
\ No newline at end of file
diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java
index dcd158bc..08f72e8a 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java
@@ -9,12 +9,11 @@
package co.yixiang.modules.user.service.impl;
import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.common.web.vo.Paging;
-import co.yixiang.enums.AppFromEnum;
-import co.yixiang.enums.BillEnum;
-import co.yixiang.enums.OrderInfoEnum;
-import co.yixiang.enums.PayTypeEnum;
+import co.yixiang.enums.*;
import co.yixiang.modules.user.entity.YxUser;
import co.yixiang.modules.user.entity.YxUserBill;
import co.yixiang.modules.user.entity.YxUserRecharge;
@@ -22,9 +21,12 @@ import co.yixiang.modules.user.mapper.YxUserMapper;
import co.yixiang.modules.user.mapper.YxUserRechargeMapper;
import co.yixiang.modules.user.service.YxUserBillService;
import co.yixiang.modules.user.service.YxUserRechargeService;
+import co.yixiang.modules.user.service.YxWechatUserService;
import co.yixiang.modules.user.web.param.RechargeParam;
import co.yixiang.modules.user.web.param.YxUserRechargeQueryParam;
import co.yixiang.modules.user.web.vo.YxUserRechargeQueryVo;
+import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo;
+import co.yixiang.mp.service.YxTemplateService;
import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
@@ -32,6 +34,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -56,6 +59,8 @@ public class YxUserRechargeServiceImpl extends BaseServiceImpl userInfo(){
int uid = SecurityUtils.getUserId().intValue();
- System.out.println("aa:"+uid);
//update count
yxUserService.setUserSpreadCount(uid);
return ApiResult.ok(yxUserService.getYxUserById(uid));
diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java
index 320a87ed..db3b6ee0 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java
@@ -97,7 +97,7 @@ public class UserRechargeController extends BaseController {
"公众号充值", price,BillDetailEnum.TYPE_1.getValue());
Map jsConfig = new HashMap<>();
jsConfig.put("appId",result.getAppId());
- jsConfig.put("timeStamp",result.getTimeStamp());
+ jsConfig.put("timestamp",result.getTimeStamp());
jsConfig.put("nonceStr",result.getNonceStr());
jsConfig.put("package",result.getPackageValue());
jsConfig.put("signType",result.getSignType());
diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java
index a76a5535..190e00f8 100644
--- a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java
+++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java
@@ -32,6 +32,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
@@ -87,42 +88,25 @@ public class WechatController extends BaseController {
@ApiOperation(value = "jssdk配置",notes = "jssdk配置")
public ApiResult