Merge branch 'dev' of http://139.159.177.244:3000/hurui/hai-server into dev
commit
757745d08e
@ -0,0 +1,103 @@ |
|||||||
|
package com.cweb.controller; |
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hai.common.exception.ErrorCode; |
||||||
|
import com.hai.common.exception.ErrorHelp; |
||||||
|
import com.hai.common.exception.SysCode; |
||||||
|
import com.hai.common.security.SessionObject; |
||||||
|
import com.hai.common.security.UserCenter; |
||||||
|
import com.hai.common.utils.ResponseMsgUtil; |
||||||
|
import com.hai.model.ResponseData; |
||||||
|
import com.hai.model.UserInfoModel; |
||||||
|
import com.hai.service.*; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Controller; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Auther: 胡锐 |
||||||
|
* @Description: |
||||||
|
* @Date: 2021/3/11 22:16 |
||||||
|
*/ |
||||||
|
@Controller |
||||||
|
@RequestMapping(value = "/coupon") |
||||||
|
@Api(value = "卡卷接口") |
||||||
|
public class HighCouponController { |
||||||
|
|
||||||
|
private static Logger log = LoggerFactory.getLogger(HighCouponController.class); |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private UserCenter userCenter; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighMerchantService highMerchantService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighCouponService highCouponService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighCouponHandselService highCouponHandselService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighCouponCodeService highCouponCodeService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighApproveService highApproveService; |
||||||
|
|
||||||
|
@RequestMapping(value="/getCouponList",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "卡卷列表") |
||||||
|
public ResponseData getCouponList(@RequestParam(name = "regionId", required = true) Long regionId, |
||||||
|
@RequestParam(name = "merchantId", required = false) Long merchantId, |
||||||
|
@RequestParam(name = "couponName", required = false) String couponName, |
||||||
|
@RequestParam(name = "couponType", required = false) Integer couponType, |
||||||
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||||
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { |
||||||
|
try { |
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>(); |
||||||
|
|
||||||
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||||
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||||
|
if (userInfoModel.getBsCompany() == null) { |
||||||
|
log.error("HighCouponController -> getCouponList() error!","权限不足"); |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||||
|
} |
||||||
|
map.put("regionId", regionId); |
||||||
|
map.put("merchantId", merchantId); |
||||||
|
map.put("couponName", couponName); |
||||||
|
map.put("couponType", couponType); |
||||||
|
map.put("status", 2); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); |
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighCouponController -> getCouponList() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value="/getCouponById",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "卡卷信息") |
||||||
|
public ResponseData getCouponById(@RequestParam(name = "couponId", required = true) Long couponId) { |
||||||
|
try { |
||||||
|
|
||||||
|
return ResponseMsgUtil.success(highCouponService.getCouponById(couponId)); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighCouponController -> getCouponById() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,106 @@ |
|||||||
|
package com.cweb.controller; |
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hai.common.exception.ErrorCode; |
||||||
|
import com.hai.common.exception.ErrorHelp; |
||||||
|
import com.hai.common.exception.SysCode; |
||||||
|
import com.hai.common.security.SessionObject; |
||||||
|
import com.hai.common.security.UserCenter; |
||||||
|
import com.hai.common.utils.MemberValidateUtil; |
||||||
|
import com.hai.common.utils.ResponseMsgUtil; |
||||||
|
import com.hai.entity.HighMerchant; |
||||||
|
import com.hai.entity.HighMerchantStore; |
||||||
|
import com.hai.model.HighMerchantStoreModel; |
||||||
|
import com.hai.model.ResponseData; |
||||||
|
import com.hai.model.UserInfoModel; |
||||||
|
import com.hai.service.HighMerchantService; |
||||||
|
import com.hai.service.HighMerchantStoreService; |
||||||
|
import com.hai.service.SecUserService; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Controller; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Auther: 胡锐 |
||||||
|
* @Description: |
||||||
|
* @Date: 2021/3/9 20:58 |
||||||
|
*/ |
||||||
|
@Controller |
||||||
|
@RequestMapping(value = "/highMerchantStore") |
||||||
|
@Api(value = "商户门店接口") |
||||||
|
public class HighMerchantStoreController { |
||||||
|
|
||||||
|
private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private UserCenter userCenter; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighMerchantStoreService highMerchantStoreService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighMerchantService highMerchantService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private SecUserService secUserService; |
||||||
|
|
||||||
|
@RequestMapping(value="/getMerchantStoreById",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "根据id查询商户门店") |
||||||
|
public ResponseData getMerchantStoreById(@RequestParam(name = "id", required = true) Long id) { |
||||||
|
try { |
||||||
|
|
||||||
|
return ResponseMsgUtil.success(highMerchantStoreService.getMerchantStoreById(id)); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighMerchantStoreController -> getMerchantStoreById() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value="/getStoreListByCompany",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "根据公司 查询商户门店列表") |
||||||
|
public ResponseData getStoreListByCompany(@RequestParam(name = "merchantId", required = false) Long merchantId, |
||||||
|
@RequestParam(name = "telephone", required = false) String telephone, |
||||||
|
@RequestParam(name = "storeName", required = false) String storeName, |
||||||
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||||
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, |
||||||
|
HttpServletRequest request) { |
||||||
|
try { |
||||||
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||||
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||||
|
if (userInfoModel.getBsCompany() == null) { |
||||||
|
log.error("HighMerchantStoreController -> getStoreListByCompany() error!","权限不足"); |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||||
|
} |
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>(); |
||||||
|
map.put("companyId", userInfoModel.getBsCompany().getId()); |
||||||
|
map.put("merchantId", merchantId); |
||||||
|
map.put("telephone", telephone); |
||||||
|
map.put("storeName", storeName); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(highMerchantStoreService.getMerchantStoreList(map))); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighMerchantStoreController -> getStoreListByCompany() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1,5 +1,8 @@ |
|||||||
|
# 微信配置 |
||||||
wxAppId=wx8d49e2f83025229d |
wxAppId=wx8d49e2f83025229d |
||||||
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df |
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df |
||||||
|
mch_id=1603942866 |
||||||
|
api_key=HfkjWxPayHaiShengGuang0123456789 |
||||||
|
|
||||||
fileUrl=/home/project/hsg/filesystem |
fileUrl=/home/project/hsg/filesystem |
||||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||||
|
Loading…
Reference in new issue