Forráskód Böngészése

新增用户积分记录表

大大的豆芽 9 hónapja
szülő
commit
336dd3555e

+ 73 - 70
yiqi-admin/src/main/java/com/yiqi/admin/controller/core/SysStoreIntracityExpressController.java

@@ -48,6 +48,7 @@ public class SysStoreIntracityExpressController extends BaseController {
 
     /**
      * 创建微信同城配送门店
+     *
      * @param intracityExpressCreateStoreRequest
      * @return
      * @throws Exception
@@ -55,13 +56,14 @@ public class SysStoreIntracityExpressController extends BaseController {
     @ApiOperation("创建微信同城配送门店")
     @PostMapping(value = "createStore")
     public R<IntracityExpressCreateStoreResult> createStore(@RequestBody IntracityExpressCreateStoreRequest intracityExpressCreateStoreRequest)
-            throws Exception{
+            throws Exception {
         return R.ok(sysStoreIntracityExpressService.createStore(intracityExpressCreateStoreRequest));
     }
 
 
     /**
      * 获取微信同城配送门店详情
+     *
      * @param intracityExpressStoreInfoRequest
      * @return
      * @throws Exception
@@ -69,12 +71,13 @@ public class SysStoreIntracityExpressController extends BaseController {
     @ApiOperation("获取微信同城配送门店详情")
     @PostMapping(value = "getStoreInfo")
     public R<IntracityExpressStoreInfoResult> getStoreInfo(@RequestBody IntracityExpressStoreInfoRequest intracityExpressStoreInfoRequest)
-            throws Exception{
+            throws Exception {
         return R.ok(sysStoreIntracityExpressService.getStoreInfo(intracityExpressStoreInfoRequest));
     }
 
     /**
      * 修改微信同城配送门店信息
+     *
      * @param intracityExpressStoreUpdateRequest
      * @return
      * @throws Exception
@@ -82,18 +85,18 @@ public class SysStoreIntracityExpressController extends BaseController {
     @ApiOperation("修改微信同城配送门店信息")
     @PostMapping(value = "updateStore")
     public R<IntracityExpressBaseResult> updateStore(@RequestBody IntracityExpressStoreUpdateRequest intracityExpressStoreUpdateRequest)
-            throws Exception{
+            throws Exception {
         return R.ok(sysStoreIntracityExpressService.updateStore(intracityExpressStoreUpdateRequest));
     }
 
     @ApiOperation("查询门店余额")
     @GetMapping(value = "getStoreBalance")
-    public R<IntracityExpressStoreBalanceInfoResult> getStoreBalance() throws Exception{
+    public R<IntracityExpressStoreBalanceInfoResult> getStoreBalance() throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         IntracityExpressStoreBalanceInfoRequest request = new IntracityExpressStoreBalanceInfoRequest();
@@ -110,81 +113,81 @@ public class SysStoreIntracityExpressController extends BaseController {
     @ApiOperation("门店流水查询")
     @GetMapping(value = "queryFlow")
     public R<IntracityExpressQueryFlowResult> queryFlow(@RequestParam @ApiParam("1:充值流水, 2:消费流水,3:退款流水") Integer flow_type
-            , @RequestParam @ApiParam("查询日期") String searchDate) throws Exception{
+            , @RequestParam @ApiParam("查询日期") String searchDate) throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         IntracityExpressQueryFlowRequest request = new IntracityExpressQueryFlowRequest();
         request.setWx_store_id(sysStore.getWxStoreId());
         request.setFlow_type(flow_type);
-        request.setBegin_time((int)(DateUtils.strToDate(searchDate).getTime()/1000));
-        request.setEnd_time((int)(DateUtils.strToDate(searchDate).getTime()/1000 + 24*3600));
+        request.setBegin_time((int) (DateUtils.strToDate(searchDate).getTime() / 1000));
+        request.setEnd_time((int) (DateUtils.strToDate(searchDate).getTime() / 1000 + 24 * 3600));
         return R.ok(sysStoreIntracityExpressService.queryFlow(request));
     }
 
     @ApiOperation("充值余额")
     @GetMapping(value = "chargeBalance")
     public R<IntracityExpressStoreBalanceChargeResult> chargeBalance(@RequestParam String service_trans_id
-            ,@RequestParam Integer amount) throws Exception{
+            , @RequestParam Integer amount) throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         IntracityExpressStoreBalanceChargeRequest request = new IntracityExpressStoreBalanceChargeRequest();
         request.setWx_store_id(sysStore.getWxStoreId());
         request.setService_trans_id(service_trans_id);
-        request.setAmount(amount*100);
+        request.setAmount(amount * 100);
         return R.ok(sysStoreIntracityExpressService.storeBalanceCharge(request));
     }
 
     @ApiOperation("查询支持同城配送的城市")
     @PostMapping(value = "getCity")
-    public R<IntracityExpressGetCityResult> getCity(@RequestBody IntracityExpressGetCityRequest request) throws Exception{
+    public R<IntracityExpressGetCityResult> getCity(@RequestBody IntracityExpressGetCityRequest request) throws Exception {
         return R.ok(sysStoreIntracityExpressService.getCity(request));
     }
 
     @ApiOperation("获取同城配送预估价格")
     @GetMapping(value = "getExpressPrice")
-    public R getExpressPrice(@RequestParam @ApiParam("订单编号") String orderNo) throws Exception{
+    public R getExpressPrice(@RequestParam @ApiParam("订单编号") String orderNo) throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         OrderCloth orderCloth = orderClothService.getOne(new QueryWrapper<OrderCloth>().lambda()
-                .eq(OrderCloth::getOrderNo,orderNo)
-                .eq(OrderCloth::getOrgId,SecurityUtils.getLoginUser().getOrgId())
-                .eq(OrderCloth::getSourceType,SecurityUtils.getLoginUser().getSourceType()));
-        if(orderCloth == null){
+                .eq(OrderCloth::getOrderNo, orderNo)
+                .eq(OrderCloth::getOrgId, SecurityUtils.getLoginUser().getOrgId())
+                .eq(OrderCloth::getSourceType, SecurityUtils.getLoginUser().getSourceType()));
+        if (orderCloth == null) {
             throw new ServiceException("未查询到订单");
         }
 
         IntracityExpressPreAddOrderRequest request = new IntracityExpressPreAddOrderRequest();
         request.setCargo_name("衣物");
         request.setCargo(new IntracityExpressPreAddOrderRequest
-                .CargoInfo("衣物",orderCloth.getAppointmentCount()/5 + 1
-                ,1000,orderCloth.getAppointmentCount()));
-        request.setUser_sandbox(SystemEnv.PROD.getCode().equals(SystemEnvConfig.env)?0:1);
+                .CargoInfo("衣物", orderCloth.getAppointmentCount() / 5 + 1
+                , 1000, orderCloth.getAppointmentCount()));
+        request.setUser_sandbox(SystemEnv.PROD.getCode().equals(SystemEnvConfig.env) ? 0 : 1);
 
-        if(orderCloth.getOrderStatus().equals(ClothOrderStatusType.APPOINTMENT.getCode())){
+        if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.APPOINTMENT.getCode())) {
             //同城配送订单只能由商家地址发货,所以如果是上门收衣的话,先把门店地址改为客户地址,查询完后再改回来
             OrderClothDeliveryAddress orderClothDeliveryAddress
                     = orderClothDeliveryAddressService.getOne(new QueryWrapper<OrderClothDeliveryAddress>().lambda()
-                    .eq(OrderClothDeliveryAddress::getOrderNo,orderNo)
+                    .eq(OrderClothDeliveryAddress::getOrderNo, orderNo)
                     .eq(OrderClothDeliveryAddress::getClothOrderType, ClothOrderDeliveryType.collectCloth.getCode()));
-            if(orderClothDeliveryAddress == null){
+            if (orderClothDeliveryAddress == null) {
                 throw new ServiceException("未查询到收衣配送信息");
             }
-            sysStoreIntracityExpressService.updateStoreInfo(sysStore,orderClothDeliveryAddress);
+            sysStoreIntracityExpressService.updateStoreInfo(sysStore, orderClothDeliveryAddress);
             request.setWx_store_id(sysStore.getWxStoreId());
             request.setUser_name(sysStore.getContactName());
             request.setUser_phone(sysStore.getContactPhone());
@@ -197,13 +200,13 @@ public class SysStoreIntracityExpressController extends BaseController {
             sysStoreIntracityExpressService.updateStoreInfo(sysStore);
             return R.ok(result);
 
-        }else if(orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_SEND.getCode())){
+        } else if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_SEND.getCode())) {
             //同城配送订单只能由商家地址发货,所以如果是上门收衣的话,先把门店地址改为客户地址,查询完后再改回来
             OrderClothDeliveryAddress orderClothDeliveryAddress
                     = orderClothDeliveryAddressService.getOne(new QueryWrapper<OrderClothDeliveryAddress>().lambda()
-                    .eq(OrderClothDeliveryAddress::getOrderNo,orderNo)
+                    .eq(OrderClothDeliveryAddress::getOrderNo, orderNo)
                     .eq(OrderClothDeliveryAddress::getClothOrderType, ClothOrderDeliveryType.collectCloth.getCode()));
-            if(orderClothDeliveryAddress == null){
+            if (orderClothDeliveryAddress == null) {
                 throw new ServiceException("未查询到收衣配送信息");
             }
             request.setWx_store_id(sysStore.getWxStoreId());
@@ -214,19 +217,19 @@ public class SysStoreIntracityExpressController extends BaseController {
             request.setUser_lat(orderClothDeliveryAddress.getLatitude().doubleValue());
             request.setUser_lng(orderClothDeliveryAddress.getLongitude().doubleValue());
             return R.ok(sysStoreIntracityExpressService.preAddOrder(request));
-        }else{
+        } else {
             throw new ServiceException("订单状态不正确");
         }
     }
 
     @ApiOperation("取消订单")
     @GetMapping(value = "cancel")
-    public R cancel(@RequestParam String orderNo) throws Exception{
+    public R cancel(@RequestParam String orderNo) throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         IntracityExpressCancelOrderRequest request = new IntracityExpressCancelOrderRequest();
@@ -238,30 +241,30 @@ public class SysStoreIntracityExpressController extends BaseController {
     @ApiOperation("获取配送单明细")
     @GetMapping(value = "getOrderInfo")
     public R<IntracityExpressOrderInfoResult> getOrderInfo(@RequestParam @ApiParam("订单编号") String orderNo
-            ,@RequestParam @ApiParam("0:收衣,1:取衣") String deliveryType) throws Exception{
+            , @RequestParam @ApiParam("0:收衣,1:取衣") String deliveryType) throws Exception {
         SysStore sysStore = sysStoreService.getById(SecurityUtils.getLoginUser().getOrgId());
-        if(sysStore == null){
+        if (sysStore == null) {
             throw new ServiceException("未查询到门店");
         }
-        if(StringUtils.isEmpty(sysStore.getWxStoreId())){
+        if (StringUtils.isEmpty(sysStore.getWxStoreId())) {
             throw new ServiceException("未配置微信门店,请联系管理员进行配置");
         }
         OrderCloth orderCloth = orderClothService.getOne(new QueryWrapper<OrderCloth>().lambda()
-                .eq(OrderCloth::getOrderNo,orderNo)
-                .eq(OrderCloth::getOrgId,SecurityUtils.getLoginUser().getOrgId())
-                .eq(OrderCloth::getSourceType,SecurityUtils.getLoginUser().getSourceType()));
-        if(orderCloth == null){
+                .eq(OrderCloth::getOrderNo, orderNo)
+                .eq(OrderCloth::getOrgId, SecurityUtils.getLoginUser().getOrgId())
+                .eq(OrderCloth::getSourceType, SecurityUtils.getLoginUser().getSourceType()));
+        if (orderCloth == null) {
             throw new ServiceException("未查询到订单");
         }
 
         OrderClothDeliveryAddress orderClothDeliveryAddress = orderClothDeliveryAddressService.getOne(
                 new QueryWrapper<OrderClothDeliveryAddress>().lambda()
-                        .eq(OrderClothDeliveryAddress::getOrderId,orderCloth.getId())
-                        .eq(OrderClothDeliveryAddress::getClothOrderType,deliveryType));
-        if(orderClothDeliveryAddress == null){
+                        .eq(OrderClothDeliveryAddress::getOrderId, orderCloth.getId())
+                        .eq(OrderClothDeliveryAddress::getClothOrderType, deliveryType));
+        if (orderClothDeliveryAddress == null) {
             throw new ServiceException("未查询到配送订单");
         }
-        if(!orderClothDeliveryAddress.getDeliveryWay().equals(ClothOrderDeliveryWay.intracityExpress.getCode())){
+        if (!orderClothDeliveryAddress.getDeliveryWay().equals(ClothOrderDeliveryWay.intracityExpress.getCode())) {
             throw new ServiceException("该配送不是同城配送,无法查询");
         }
         IntracityExpressOrderInfoRequest request = new IntracityExpressOrderInfoRequest();
@@ -273,60 +276,60 @@ public class SysStoreIntracityExpressController extends BaseController {
 
     @ApiOperation("模拟订单状态回调")
     @PostMapping(value = "mocknotify")
-    public R<IntracityExpressBaseResult> mocknotify(IntracityExpressMockNotifyRequest request) throws Exception{
+    public R<IntracityExpressBaseResult> mocknotify(IntracityExpressMockNotifyRequest request) throws Exception {
         return R.ok(sysStoreIntracityExpressService.mocknotify(request));
     }
 
     @ApiOperation("配送订单状态通知回调")
     @PostMapping(value = "statusChange")
     public IntracityExpressOrderStatusChangeVO statusChange(
-            @RequestBody IntracityExpressOrderStatusChangeDTO intracityExpressOrderStatusChangeDTO) throws Exception{
+            @RequestBody IntracityExpressOrderStatusChangeDTO intracityExpressOrderStatusChangeDTO) throws Exception {
         logger.info("api statusChange");
         logger.info("params:" + JSON.toJSONString(intracityExpressOrderStatusChangeDTO));
         OrderClothDeliveryAddress orderClothDeliveryAddress = orderClothDeliveryAddressService.getOne(
                 new QueryWrapper<OrderClothDeliveryAddress>().lambda()
-                        .eq(OrderClothDeliveryAddress::getThirdDeliveryOrderNo,intracityExpressOrderStatusChangeDTO.getStore_order_id()));
-        if(orderClothDeliveryAddress == null){
+                        .eq(OrderClothDeliveryAddress::getThirdDeliveryOrderNo, intracityExpressOrderStatusChangeDTO.getStore_order_id()));
+        if (orderClothDeliveryAddress == null) {
             throw new ServiceException("未查询到配送信息");
         }
         OrderCloth orderCloth = orderClothService.getOne(
-                new QueryWrapper<OrderCloth>().lambda().eq(OrderCloth::getId,orderClothDeliveryAddress.getOrderId()));
-        if(orderCloth == null){
+                new QueryWrapper<OrderCloth>().lambda().eq(OrderCloth::getId, orderClothDeliveryAddress.getOrderId()));
+        if (orderCloth == null) {
             throw new ServiceException("未查询到洗衣订单");
         }
-        switch (intracityExpressOrderStatusChangeDTO.getOrder_status()){
+        switch (intracityExpressOrderStatusChangeDTO.getOrder_status()) {
             case 60000:
 //            case 20000:
             case 20001://配送方取消订单
             {
-                if(orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_DOOR.getCode())
-                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_TO_DOOR.getCode())){
+                if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_DOOR.getCode())
+                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_TO_DOOR.getCode())) {
                     orderClothService.update(new UpdateWrapper<OrderCloth>().lambda()
-                            .set(OrderCloth::getOrderStatus,ClothOrderStatusType.APPOINTMENT.getCode())
-                            .eq(OrderCloth::getId,orderCloth.getId()));
+                            .set(OrderCloth::getOrderStatus, ClothOrderStatusType.APPOINTMENT.getCode())
+                            .eq(OrderCloth::getId, orderCloth.getId()));
                 }
-                if(orderCloth.getOrderStatus().equals(ClothOrderStatusType.SENDING.getCode())){
+                if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.SENDING.getCode())) {
                     orderClothService.update(new UpdateWrapper<OrderCloth>().lambda()
-                            .set(OrderCloth::getOrderStatus,ClothOrderStatusType.WAITING_TO_SEND.getCode())
-                            .eq(OrderCloth::getId,orderCloth.getId()));
+                            .set(OrderCloth::getOrderStatus, ClothOrderStatusType.WAITING_TO_SEND.getCode())
+                            .eq(OrderCloth::getId, orderCloth.getId()));
                 }
                 break;
             }
             case 70000://配送完成
             {
-                if(orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.collectCloth.getCode())
+                if (orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.collectCloth.getCode())
                         && (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_DOOR.getCode())
-                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_TO_DOOR.getCode()))){
+                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_TO_DOOR.getCode()))) {
                     orderClothService.update(new UpdateWrapper<OrderCloth>().lambda()
-                            .set(OrderCloth::getOrderStatus,ClothOrderStatusType.HAS_TAKING.getCode())
-                            .eq(OrderCloth::getId,orderCloth.getId()));
+                            .set(OrderCloth::getOrderStatus, ClothOrderStatusType.HAS_TAKING.getCode())
+                            .eq(OrderCloth::getId, orderCloth.getId()));
                 }
-                if(orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.takeCloth.getCode())
+                if (orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.takeCloth.getCode())
                         && (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAITING_TO_SEND.getCode())
-                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.SENDING.getCode()))){
+                        || orderCloth.getOrderStatus().equals(ClothOrderStatusType.SENDING.getCode()))) {
                     orderClothService.update(new UpdateWrapper<OrderCloth>().lambda()
-                            .set(OrderCloth::getOrderStatus,ClothOrderStatusType.FINISH.getCode())
-                            .eq(OrderCloth::getId,orderCloth.getId()));
+                            .set(OrderCloth::getOrderStatus, ClothOrderStatusType.FINISH.getCode())
+                            .eq(OrderCloth::getId, orderCloth.getId()));
                 }
                 break;
             }

+ 1 - 0
yiqi-api/src/main/java/com/yiqi/api/controller/WeAppUserController.java

@@ -167,6 +167,7 @@ public class WeAppUserController extends BaseController {
         AppUser appUser = new AppUser();
         appUser.setPhoneNumber(appUserRegistDTO.getPhone());
         appUser.setRealName(appUserRegistDTO.getRealName());
+        appUser.setNickName(appUserRegistDTO.getRealName());
         appUser.setIsUsePayPassword(SysBoolType.NO.getCode());
         appUser.setLevel(1);
         appUser.setPassword(appUserRegistDTO.getPassword());

+ 31 - 31
yiqi-common/src/main/java/com/yiqi/core/domain/dto/wx/IntracityExpressAddOrderRequest.java

@@ -26,35 +26,35 @@ import java.util.List;
 public class IntracityExpressAddOrderRequest {
 
     @JsonProperty("wx_store_id")
-    @ApiModelProperty(value = "微信门店编号",required = true)
+    @ApiModelProperty(value = "微信门店编号", required = true)
     private String wx_store_id;
 
     @JsonProperty("store_order_id")
-    @ApiModelProperty(value = "门店订单编号",required = true)
+    @ApiModelProperty(value = "门店订单编号", required = true)
     private String store_order_id;
 
     @JsonProperty("user_openid")
-    @ApiModelProperty(value = "收货用户openid",required = true)
+    @ApiModelProperty(value = "收货用户openid", required = true)
     private String user_openid;
 
     @JsonProperty("user_name")
-    @ApiModelProperty(value = "收件人姓名",required = true)
+    @ApiModelProperty(value = "收件人姓名", required = true)
     private String user_name;
 
     @JsonProperty("user_phone")
-    @ApiModelProperty(value = "收件人手机号",required = true)
+    @ApiModelProperty(value = "收件人手机号", required = true)
     private String user_phone;
 
     @JsonProperty("user_lng")
-    @ApiModelProperty(value = "收件用户位置经度",required = true)
+    @ApiModelProperty(value = "收件用户位置经度", required = true)
     private double user_lng;
 
     @JsonProperty("user_lat")
-    @ApiModelProperty(value = "收件用户位置维度",required = true)
+    @ApiModelProperty(value = "收件用户位置维度", required = true)
     private double user_lat;
 
     @JsonProperty("user_address")
-    @ApiModelProperty(value = "收件用户详细地址",required = true)
+    @ApiModelProperty(value = "收件用户详细地址", required = true)
     private String user_address;
 
     @JsonProperty("use_sandbox")
@@ -62,14 +62,14 @@ public class IntracityExpressAddOrderRequest {
     private Integer use_sandbox;
 
     @JsonProperty("order_detail_path")
-    @ApiModelProperty(value = "跳转商家订单页面路径,物流轨迹页面跳转到商家小程序的订单页面路径参数,期望向用户展示商品订单详情",required = true)
+    @ApiModelProperty(value = "跳转商家订单页面路径,物流轨迹页面跳转到商家小程序的订单页面路径参数,期望向用户展示商品订单详情", required = true)
     private String order_detail_path;
 
     @JsonProperty("callback_url")
     @ApiModelProperty(value = "订单状态回调地址")
     private String callback_url;
 
-    @ApiModelProperty(value = "商品信息",required = true)
+    @ApiModelProperty(value = "商品信息", required = true)
     private CargoInfo cargo;
 
     public String toJson() {
@@ -77,17 +77,17 @@ public class IntracityExpressAddOrderRequest {
     }
 
     @Data
-    public static class CargoInfo{
+    public static class CargoInfo {
         @JsonProperty("cargo_name")
-        @ApiModelProperty(value = "商品名称",required = true)
+        @ApiModelProperty(value = "商品名称", required = true)
         private String cargo_name;
 
         @JsonProperty("cargo_weight")
-        @ApiModelProperty(value = "商品总重量",required = true)
+        @ApiModelProperty(value = "商品总重量", required = true)
         private Integer cargo_weight;
 
         @JsonProperty("cargo_price")
-        @ApiModelProperty(value = "商品总价格",required = true)
+        @ApiModelProperty(value = "商品总价格", required = true)
         private Integer cargo_price;
 
         @JsonProperty("cargo_type")
@@ -95,16 +95,16 @@ public class IntracityExpressAddOrderRequest {
         private Integer cargo_type = 3;
 
         @JsonProperty("cargo_num")
-        @ApiModelProperty(value = "商品数量",required = true)
+        @ApiModelProperty(value = "商品数量", required = true)
         private Integer cargo_num;
 
         @JsonProperty("item_list")
-        @ApiModelProperty(value = "物品列表",required = true)
+        @ApiModelProperty(value = "物品列表", required = true)
         private List<ItemDetail> item_list = new ArrayList<>();
     }
 
     @Data
-    public static class ItemDetail{
+    public static class ItemDetail {
         @JsonProperty("item_name")
         @ApiModelProperty("物品名称")
         private String item_name;
@@ -123,20 +123,20 @@ public class IntracityExpressAddOrderRequest {
         }
     }
 
-    public static IntracityExpressAddOrderRequest build(OrderCloth orderCloth, OrderClothDeliveryAddress orderClothDeliveryAddress, SysStore sysStore, String user_openid){
+    public static IntracityExpressAddOrderRequest build(OrderCloth orderCloth, OrderClothDeliveryAddress orderClothDeliveryAddress, SysStore sysStore, String user_openid) {
         IntracityExpressAddOrderRequest request = new IntracityExpressAddOrderRequest();
         request.setStore_order_id(orderClothDeliveryAddress.getThirdDeliveryOrderNo());
         CargoInfo cargoInfo = new CargoInfo();
         cargoInfo.setCargo_name("服装");
 
-        if(orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.collectCloth.getCode())){
+        if (orderClothDeliveryAddress.getClothOrderType().equals(ClothOrderDeliveryType.collectCloth.getCode())) {
             cargoInfo.setCargo_num(orderCloth.getAppointmentCount());
-            cargoInfo.setCargo_weight(orderCloth.getAppointmentCount()/5 + 1);
-            cargoInfo.getItem_list().add(new ItemDetail("待洗衣物",sysStore.getCompanyPic(),orderCloth.getAppointmentCount()));
-        }else{
+            cargoInfo.setCargo_weight(orderCloth.getAppointmentCount() / 5 + 1);
+            cargoInfo.getItem_list().add(new ItemDetail("待洗衣物", sysStore.getCompanyPic(), orderCloth.getAppointmentCount()));
+        } else {
             cargoInfo.setCargo_num(orderCloth.getOrderClothCount());
-            cargoInfo.setCargo_weight(orderCloth.getOrderClothCount()/5 + 1);
-            cargoInfo.getItem_list().add(new ItemDetail("洗好衣物",sysStore.getCompanyPic(),orderCloth.getOrderClothCount()));
+            cargoInfo.setCargo_weight(orderCloth.getOrderClothCount() / 5 + 1);
+            cargoInfo.getItem_list().add(new ItemDetail("洗好衣物", sysStore.getCompanyPic(), orderCloth.getOrderClothCount()));
         }
 
         cargoInfo.setCargo_price(1000);
@@ -144,28 +144,28 @@ public class IntracityExpressAddOrderRequest {
         request.setWx_store_id(sysStore.getWxStoreId());
         request.setOrder_detail_path("/pageExt/makes/detail?type=order&id=" + orderCloth.getId());
         request.setCallback_url(SystemEnvConfig.baseUrl + "/" + UrlConstants.managerApi + "/store/intracity/express/statusChange");
-        request.setUse_sandbox(SystemEnvConfig.env.equals(SystemEnv.PROD.getCode())?0:1);
+        request.setUse_sandbox(SystemEnvConfig.env.equals(SystemEnv.PROD.getCode()) ? 0 : 1);
         request.setUser_openid(user_openid);
-        if(orderCloth.getOrderStatus().equals(ClothOrderStatusType.APPOINTMENT.getCode())){
-            if(SystemEnvConfig.env.equals(SystemEnv.PROD.getCode())){
+        if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.APPOINTMENT.getCode())) {
+            if (SystemEnvConfig.env.equals(SystemEnv.PROD.getCode())) {
                 request.setUser_name(sysStore.getContactName());
                 request.setUser_phone(sysStore.getContactPhone());
                 request.setUser_address(sysStore.getAddress()
                         + sysStore.getAddressDetail());
-            }else{
+            } else {
                 request.setUser_name("顺丰同城");
                 request.setUser_phone("13881979410");
                 request.setUser_address("北京市海淀区学清嘉创大厦A座15层");
             }
             request.setUser_lat(sysStore.getLatitude().doubleValue());
             request.setUser_lng(sysStore.getLongitude().doubleValue());
-        }else{
-            if(SystemEnvConfig.env.equals(SystemEnv.PROD.getCode())){
+        } else {
+            if (SystemEnvConfig.env.equals(SystemEnv.PROD.getCode())) {
                 request.setUser_name(orderClothDeliveryAddress.getContactName());
                 request.setUser_phone(orderClothDeliveryAddress.getContactPhone());
                 request.setUser_address(orderClothDeliveryAddress.getAddress()
                         + orderClothDeliveryAddress.getAddressDetail());
-            }else{
+            } else {
                 request.setUser_name("顺丰同城");
                 request.setUser_phone("13881979410");
                 request.setUser_address("北京市海淀区学清嘉创大厦A座15层");

+ 1 - 0
yiqi-common/src/main/java/com/yiqi/core/domain/dto/wx/IntracityExpressCreateStoreRequest.java

@@ -35,6 +35,7 @@ public class IntracityExpressCreateStoreRequest {
 
     @Data
     public static class AddressInfo{
+
         @ApiModelProperty("省/自治区/直辖市")
         private String province;
 

+ 3 - 1
yiqi-core/src/main/java/com/yiqi/app/service/impl/AppUserServiceImpl.java

@@ -7,6 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -79,9 +80,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
             isRegist = true;
             user = new AppUser();
             user.setPhoneNumber(phoneNoInfo.getPurePhoneNumber());
-            user.setRealName("");
+            user.setRealName("user-" + RandomUtil.randomNumbers(8));
             user.setStatus(UserStatus.OK.getCode());
             user.setSex("0");
+            user.setLevel(1);
             user.setUnionId(result.getUnionid());
             user.setWxOpenId(result.getOpenid());
             user.setCreateTime(DateUtils.getNowDate());

+ 51 - 40
yiqi-core/src/main/java/com/yiqi/core/service/impl/SysStoreIntracityExpressServiceImpl.java

@@ -13,9 +13,12 @@ import com.yiqi.core.domain.vo.wx.*;
 import com.yiqi.core.service.ISysStoreIntracityExpressService;
 import com.yiqi.order.domain.OrderClothDeliveryAddress;
 import com.yiqi.system.domain.SysStore;
+import com.yiqi.system.service.ISysStoreService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.logging.Logger;
+
 /**
  * @author xiaohei
  * @date 2024/1/31
@@ -23,27 +26,35 @@ import org.springframework.stereotype.Service;
 @Service
 public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityExpressService {
 
+    private static final Logger logger = Logger.getLogger(SysStoreIntracityExpressServiceImpl.class.getName());
     @Autowired
     private CompositeWxMaService compositeWxMaService;
     @Autowired
     private WxMaProperties wxMaProperties;
+    @Autowired
+    private ISysStoreService sysStoreService;
 
     @Override
     public IntracityExpressCreateStoreResult createStore(IntracityExpressCreateStoreRequest intracityExpressCreateStoreRequest)
-            throws Exception{
-        IntracityExpressCreateStoreResult result =  IntracityExpressCreateStoreResult.fromJson(
-                httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/createstore",intracityExpressCreateStoreRequest.toJson()));
-        if(result.getErrcode() != 0){
+            throws Exception {
+        IntracityExpressCreateStoreResult result = IntracityExpressCreateStoreResult.fromJson(
+                httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/createstore", intracityExpressCreateStoreRequest.toJson()));
+        if (result.getErrcode() != 0) {
+            logger.warning("同城配送创建门店失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
             throw new ServiceException("同城配送创建门店失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
+        //更新门店信息
+        SysStore sysStore = sysStoreService.getById(Long.parseLong(result.getOut_store_id().replace("store", "")));
+        sysStore.setWxStoreId(result.getWx_store_id());
+        sysStoreService.updateById(sysStore);
         return result;
     }
 
     @Override
     public IntracityExpressStoreInfoResult getStoreInfo(IntracityExpressStoreInfoRequest intracityExpressStoreInfoRequest) throws Exception {
         IntracityExpressStoreInfoResult result = IntracityExpressStoreInfoResult.fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/querystore"
-                ,intracityExpressStoreInfoRequest.toJson()));
-        if(result.getErrcode() != 0){
+                , intracityExpressStoreInfoRequest.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店查询失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -51,10 +62,10 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressBaseResult updateStore(IntracityExpressStoreUpdateRequest intracityExpressStoreUpdateRequest) throws Exception {
-        IntracityExpressBaseResult result =  IntracityExpressBaseResult
+        IntracityExpressBaseResult result = IntracityExpressBaseResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/updatestore"
-                        ,intracityExpressStoreUpdateRequest.toJson()));
-        if(result.getErrcode() != 0){
+                        , intracityExpressStoreUpdateRequest.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店修改失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -62,10 +73,10 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressStoreBalanceInfoResult getStoreBalance(IntracityExpressStoreBalanceInfoRequest request) throws Exception {
-        IntracityExpressStoreBalanceInfoResult result =  IntracityExpressStoreBalanceInfoResult
+        IntracityExpressStoreBalanceInfoResult result = IntracityExpressStoreBalanceInfoResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/balancequery"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店获取余额失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -73,10 +84,10 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressStoreBalanceChargeResult storeBalanceCharge(IntracityExpressStoreBalanceChargeRequest request) throws Exception {
-        IntracityExpressStoreBalanceChargeResult result =  IntracityExpressStoreBalanceChargeResult
+        IntracityExpressStoreBalanceChargeResult result = IntracityExpressStoreBalanceChargeResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/storecharge"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店充值失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -84,9 +95,9 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressPreAddOrderResult preAddOrder(IntracityExpressPreAddOrderRequest request) throws Exception {
-        IntracityExpressPreAddOrderResult result =  IntracityExpressPreAddOrderResult
+        IntracityExpressPreAddOrderResult result = IntracityExpressPreAddOrderResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/preaddorder"
-                        ,request.toJson()));
+                        , request.toJson()));
 //        if(result.getErrcode() != 0){
 //            throw new ServiceException("同城配送查询运费失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
 //        }
@@ -95,26 +106,26 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressBaseResult addOrder(IntracityExpressAddOrderRequest request) throws Exception {
-        IntracityExpressBaseResult result =  IntracityExpressBaseResult
+        IntracityExpressBaseResult result = IntracityExpressBaseResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/addorder"
-                        ,request.toJson()));
+                        , request.toJson()));
         return result;
     }
 
     @Override
     public IntracityExpressBaseResult cancelOrder(IntracityExpressCancelOrderRequest request) throws Exception {
-        IntracityExpressBaseResult result =  IntracityExpressBaseResult
+        IntracityExpressBaseResult result = IntracityExpressBaseResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/cancelorder"
-                        ,request.toJson()));
+                        , request.toJson()));
         return result;
     }
 
     @Override
     public IntracityExpressGetCityResult getCity(IntracityExpressGetCityRequest request) throws Exception {
-        IntracityExpressGetCityResult result =  IntracityExpressGetCityResult
+        IntracityExpressGetCityResult result = IntracityExpressGetCityResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/getcity"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送查询支持同城配送的城市失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -122,10 +133,10 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressQueryFlowResult queryFlow(IntracityExpressQueryFlowRequest request) throws Exception {
-        IntracityExpressQueryFlowResult result =  IntracityExpressQueryFlowResult
+        IntracityExpressQueryFlowResult result = IntracityExpressQueryFlowResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/queryflow"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店运费流水查询失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -133,10 +144,10 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressOrderInfoResult getOrderInfo(IntracityExpressOrderInfoRequest request) throws Exception {
-        IntracityExpressOrderInfoResult result =  IntracityExpressOrderInfoResult
+        IntracityExpressOrderInfoResult result = IntracityExpressOrderInfoResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/queryorder"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店运费流水查询失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
@@ -144,32 +155,32 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
 
     @Override
     public IntracityExpressBaseResult mocknotify(IntracityExpressMockNotifyRequest request) throws Exception {
-        IntracityExpressBaseResult result =  IntracityExpressBaseResult
+        IntracityExpressBaseResult result = IntracityExpressBaseResult
                 .fromJson(httpPost("https://api.weixin.qq.com/cgi-bin/express/intracity/mocknotify"
-                        ,request.toJson()));
-        if(result.getErrcode() != 0){
+                        , request.toJson()));
+        if (result.getErrcode() != 0) {
             throw new ServiceException("同城配送门店模拟订单状态失败,errcode:" + result.getErrcode() + ";errmsg:" + result.getErrmsg());
         }
         return result;
     }
 
-    private String httpPost(String url,String body) throws Exception{
-        JsonObject reqforsign = AES_Enc.getReqForSign(WxAppApiAESSecretDTO.build(url,wxMaProperties)
+    private String httpPost(String url, String body) throws Exception {
+        JsonObject reqforsign = AES_Enc.getReqForSign(WxAppApiAESSecretDTO.build(url, wxMaProperties)
                 , JSONObject.parseObject(body));
         HttpResponse response = HttpRequest.post(url + "?access_token=" + compositeWxMaService.getWxapp().getAccessToken())
                 .header("Wechatmp-Appid", wxMaProperties.getAppid())
                 .header("Wechatmp-TimeStamp", reqforsign.get("req_ts").getAsString())
-                .header("Wechatmp-Signature", RSA_Sign.getSignature(WxAppApiRSASecretDTO.build(url,wxMaProperties),reqforsign))
+                .header("Wechatmp-Signature", RSA_Sign.getSignature(WxAppApiRSASecretDTO.build(url, wxMaProperties), reqforsign))
                 .header("Content-Type", "application/json;charset=utf-8")
                 .body(reqforsign.get("req_data").getAsString())
                 .execute();
-        String respData = AES_Dec.getRealResp(WxAppApiAESSecretDTO.build(url,wxMaProperties)
-                ,Integer.parseInt(response.header("Wechatmp-TimeStamp")),response.body());
+        String respData = AES_Dec.getRealResp(WxAppApiAESSecretDTO.build(url, wxMaProperties)
+                , Integer.parseInt(response.header("Wechatmp-TimeStamp")), response.body());
         return respData;
     }
 
     @Override
-    public void updateStoreInfo(SysStore sysStore, OrderClothDeliveryAddress orderClothDeliveryAddress) throws Exception{
+    public void updateStoreInfo(SysStore sysStore, OrderClothDeliveryAddress orderClothDeliveryAddress) throws Exception {
         IntracityExpressStoreUpdateRequest.KeyInfo keyInfo = new IntracityExpressStoreUpdateRequest.KeyInfo();
         keyInfo.setWx_store_id(sysStore.getWxStoreId());
         IntracityExpressStoreUpdateRequest request = new IntracityExpressStoreUpdateRequest();
@@ -190,7 +201,7 @@ public class SysStoreIntracityExpressServiceImpl implements ISysStoreIntracityEx
     }
 
     @Override
-    public void updateStoreInfo(SysStore sysStore) throws Exception{
+    public void updateStoreInfo(SysStore sysStore) throws Exception {
         IntracityExpressStoreUpdateRequest.KeyInfo keyInfo = new IntracityExpressStoreUpdateRequest.KeyInfo();
         keyInfo.setWx_store_id(sysStore.getWxStoreId());
         IntracityExpressStoreUpdateRequest request = new IntracityExpressStoreUpdateRequest();

+ 1 - 0
yiqi-core/src/main/resources/mapper/app/AppFeedbackMapper.xml

@@ -41,6 +41,7 @@
                 and status = #{status}
             </if>
         </where>
+        order by id desc
     </select>
 
     <select id="selectAppFeedbackById" parameterType="Long"