Pārlūkot izejas kodu

多店铺-相同在售店铺、汇付支付回调

chenguo 6 dienas atpakaļ
vecāks
revīzija
ce7ff0068e

+ 2 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -109,6 +109,8 @@ public class CompanyServiceImpl implements ICompanyService
     @Override
     public Company selectCompanyById(Long companyId){
         Company company = companyMapper.selectCompanyById(companyId);
+        if(company == null)
+            return null;
         List<CompanyMiniapp> miniApp = companyMiniappService.getMiniAppListByCompanyList(Collections.singletonList(company.getCompanyId()));
         company.setMiniAppMaster(GET_MINI_APP_STR.apply(0, miniApp));
         company.setMiniAppServer(GET_MINI_APP_STR.apply(1, miniApp));

+ 6 - 3
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -240,9 +240,12 @@ public interface FsStoreProductScrmMapper
             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "where p.is_del=0 and p.is_show=1 and p.is_audit = '1' and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}")
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count);
-    @Select("select p.* from fs_store_product_scrm p " +
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
-            "where p.is_del=0 and p.is_show=1 and p.is_audit = '1'  and  p.is_best=1 and p.is_display=1 order by p.sort desc,p.product_id desc")
+    @Select("SELECT COUNT(*) OVER (PARTITION BY fsp.product_name) AS storeCount,p1.storeIds,fsp.* " +
+            "FROM fs_store_product_scrm fsp " +
+            "left join (select GROUP_CONCAT(distinct fsp1.store_id SEPARATOR ',' ) AS storeIds,fsp1.product_name " +
+            "from  fs_store_product_scrm fsp1 group by fsp1.product_name) p1 on p1.product_name = fsp.product_name "+
+            "inner join fs_store_scrm fs on fs.store_id = fsp.store_id and fs.is_audit = 1 " +
+            "where fsp.is_del=0 and fsp.is_show=1 and fsp.is_audit = '1' and fsp.is_best=1 and fsp.is_display=1 order by fsp.sort desc,fsp.product_id desc")
     List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery();
     @Select("select p.* from fs_store_product_scrm p " +
             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java

@@ -79,4 +79,6 @@ public interface FsStoreScrmMapper
     int batchUpdateStatusByIds(@Param("ids") List<Long> ids, @Param("status") Integer status);
 
     List<FsStoreRecommendListVO> storeRecommendList();
+
+    List<FsStoreScrm> selectFsStoreByStoreIds(String[] storeId);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java

@@ -23,6 +23,8 @@ public interface IFsStoreScrmService
      */
     public FsStoreScrm selectFsStoreByStoreId(Long storeId);
 
+    public List<FsStoreScrm> selectFsStoreByStoreIds(String[] storeId);
+
     /**
      * 查询店铺管理列表
      *

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -52,6 +52,11 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
         return fsStoreMapper.selectFsStoreByStoreId(storeId);
     }
 
+    @Override
+    public List<FsStoreScrm> selectFsStoreByStoreIds(String[] storeId) {
+        return fsStoreMapper.selectFsStoreByStoreIds(storeId);
+    }
+
     /**
      * 查询店铺管理列表
      *

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListQueryVO.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Map;
 
 @Data
 public class FsStoreProductListQueryVO implements Serializable
@@ -53,6 +54,13 @@ public class FsStoreProductListQueryVO implements Serializable
     private String precautions;
     private String isAudit;
 
+    //商品店铺数量
+    private int storeCount;
+    //商品存在的店铺ids
+    private String storeIds;
+
+    private Long storeId;
+
 
 
 

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductQueryVO.java

@@ -138,4 +138,6 @@ public class FsStoreProductQueryVO implements Serializable
     private String precautions;
     private String isAudit;
 
+    private String storeId;
+
 }

+ 2 - 0
fs-service/src/main/resources/application-dev-yjb.yml

@@ -134,6 +134,8 @@ spring:
                         config:
                             multi-statement-allow: true
 
+spring.jackson.mapper.accept-case-insensitive-properties:  true
+
 rocketmq:
     name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
     producer:

+ 9 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -290,4 +290,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-</mapper>
+
+    <!-- selectFsStoreByStoreIds -->
+    <select id="selectFsStoreByStoreIds" resultType="com.fs.hisStore.domain.FsStoreScrm">
+        select * from fs_store_scrm where store_id in
+        <foreach item="storeId" collection="array" open="(" separator="," close=")">
+            #{storeId}
+        </foreach>
+    </select>
+</mapper>

+ 91 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/HuifuPayScrmController.java

@@ -0,0 +1,91 @@
+package com.fs.app.controller.store;
+
+import com.alibaba.fastjson.JSON;
+import com.fs.course.service.IFsCourseProductOrderService;
+import com.fs.course.service.IFsUserCourseOrderService;
+import com.fs.course.service.IFsUserVipOrderService;
+import com.fs.his.service.IFsInquiryOrderService;
+import com.fs.his.service.IFsIntegralOrderService;
+import com.fs.his.service.IFsPackageOrderService;
+import com.fs.his.service.IFsStoreOrderService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.huifuPay.domain.HuiFuOnlinePay;
+import com.fs.huifuPay.domain.HuiFuOnlineRefund;
+import com.fs.huifuPay.domain.HuiFuResult;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping(value="/store/app/hfPay")
+public class HuifuPayScrmController {
+    @Autowired
+    private IFsInquiryOrderService inquiryOrderService;
+    @Autowired
+    private IFsStoreOrderScrmService storeOrderService;
+    @Autowired
+    private IFsPackageOrderService packageOrderService;
+    @Autowired
+    private IFsUserCourseOrderService courseOrderService;
+    @Autowired
+    private IFsUserVipOrderService vipOrderService;
+    @Autowired
+    private IFsIntegralOrderService integralOrderService;
+    @Autowired
+    private IFsCourseProductOrderService courseProductOrderService;
+
+    org.slf4j.Logger logger= LoggerFactory.getLogger(getClass());
+    @RequestMapping("/payNotifyUrl")
+    public String asyncMessage(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
+        HuiFuResult huiFuResult = JSON.parseObject(resp_data, HuiFuResult.class);
+        logger.info("汇付支付回调:"+huiFuResult);
+        if(huiFuResult.getResp_code().equals("00000000") && huiFuResult.getNotify_type().equals("1")){
+            String[] orderId=huiFuResult.getReq_seq_id().split("-");
+            switch (orderId[0]){
+                case "inquiry":
+                    inquiryOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "store":
+                    storeOrderService.payConfirm(1,null,orderId[1],huiFuResult.getHf_seq_id(),huiFuResult.getOut_trans_id(),huiFuResult.getParty_order_id());
+                    break;
+                case "package":
+                    packageOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "course":
+                    courseOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "appvip":
+                    vipOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "integral":
+                    integralOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "product":
+                    courseProductOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+            }
+        }
+
+        return "ok";
+    }
+
+
+    @RequestMapping("/payOnlineNotifyUrl")
+    public String asyncHuFuOnlinePay(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
+        HuiFuOnlinePay huFuResult = JSON.parseObject(resp_data, HuiFuOnlinePay.class);
+        return "ok";
+    }
+    @RequestMapping("/onlineRefund")
+    public String onlineRefund(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
+        HuiFuOnlineRefund huFuResult = JSON.parseObject(resp_data, HuiFuOnlineRefund.class);
+        return "ok";
+    }
+
+    @RequestMapping("/refundNotifyUrl")
+    public String refundMessage(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
+        System.out.println(resp_data);
+        return "ok";
+    }
+}

+ 11 - 5
fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java

@@ -5,11 +5,9 @@ import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
 import com.fs.common.core.domain.R;
 import com.fs.common.param.BaseQueryParam;
+import com.fs.common.utils.StringUtils;
 import com.fs.erp.service.IErpGoodsService;
-import com.fs.hisStore.domain.FsStoreProductAttrScrm;
-import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
-import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
-import com.fs.hisStore.domain.FsStoreProductRelationScrm;
+import com.fs.hisStore.domain.*;
 import com.fs.hisStore.param.*;
 import com.fs.hisStore.service.*;
 import com.fs.hisStore.vo.FsStoreCartVO;
@@ -53,6 +51,9 @@ public class ProductScrmController extends AppBaseController {
     private IFsStoreProductRelationScrmService productRelationService;
     @Autowired
     IErpGoodsService goodsService;
+
+    @Autowired
+    private IFsStoreScrmService storeScrmService;
     /**
      * 获取用户信息
      * @param request
@@ -101,6 +102,11 @@ public class ProductScrmController extends AppBaseController {
         if(product==null){
             return R.error("商品不存在或已下架");
         }
+        //增加店铺信息
+        FsStoreScrm fsStoreScrm = null;
+        if(StringUtils.isNotEmpty(product.getStoreId())){
+            fsStoreScrm = storeScrmService.selectFsStoreByStoreId(Long.parseLong(product.getStoreId()));
+        }
         List<FsStoreProductAttrScrm> productAttr=attrService.selectFsStoreProductAttrByProductId(product.getProductId());
         List<FsStoreProductAttrValueScrm> productValues=attrValueService.selectFsStoreProductAttrValueByProductId(product.getProductId());
 
@@ -197,7 +203,7 @@ public class ProductScrmController extends AppBaseController {
                 productRelationService.insertFsStoreProductRelation(relation);
             }
         }
-        return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
+        return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues).put("store",fsStoreScrm);
     }
 
     @Login

+ 4 - 4
fs-user-app/src/main/java/com/fs/app/controller/store/StoreScrmController.java

@@ -68,7 +68,7 @@ public class StoreScrmController extends BaseController
     /**
      * 新增店铺管理
      */
-    //@Login
+    @Login
     @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
     @PostMapping
     public AjaxResult add(@RequestBody FsStoreScrm fsStore)
@@ -80,7 +80,7 @@ public class StoreScrmController extends BaseController
     /**
      * 修改店铺管理
      */
-    //@Login
+    @Login
     @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
     @PutMapping
     public AjaxResult edit(@RequestBody FsStoreScrm fsStore)
@@ -95,7 +95,7 @@ public class StoreScrmController extends BaseController
     /**
      * 删除店铺管理
      */
-    //@Login
+    @Login
     @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
 	@DeleteMapping("/{storeIds}")
     public AjaxResult remove(@PathVariable Long[] storeIds)
@@ -106,7 +106,7 @@ public class StoreScrmController extends BaseController
     /**
      * 重置店铺密码
      * */
-    //@Login
+    @Login
     @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","重置店铺密码"},isStoreLog = true)
     @PutMapping("/refresh/{storeId}")
     public AjaxResult refresh(Long storeId)