Commit 21641c58 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents e05de2b1 ed01f730
...@@ -88,6 +88,16 @@ auth: ...@@ -88,6 +88,16 @@ auth:
token-header: x-client-token token-header: x-client-token
id: ace-gate #不填则默认读取spring.application.name id: ace-gate #不填则默认读取spring.application.name
secret: 123456 secret: 123456
servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
max-request-size: 50MB
# 设置单个文件的最大长度
max-file-size: 50MB
# #
# #
#ribbon: #ribbon:
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
public class AppFormat { public class AppFormat {
private static final String[] format = {"ipa", "apk","pxl"}; private static final String[] format = {".ipa", ".apk",".pxl"};
private static final Set formatSet= new HashSet(Arrays.asList(format)); private static final Set formatSet= new HashSet(Arrays.asList(format));
public static Set<String> getFormatSet() { public static Set<String> getFormatSet() {
return formatSet; return formatSet;
......
...@@ -52,10 +52,10 @@ public class AppUserManageDTO { ...@@ -52,10 +52,10 @@ public class AppUserManageDTO {
*/ */
private Integer source; private Integer source;
/** // /**
* 接收前台时间范围 // * 接收前台时间范围
*/ // */
private String[] registrationDate; // private String[] registrationDate;
} }
...@@ -57,7 +57,7 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail ...@@ -57,7 +57,7 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(appUserManageDTO); List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(appUserManageDTO);
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos); PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
if (pageInfo.getList()==null||pageInfo.getList().size()==0) { if (pageInfo.getList()==null||pageInfo.getList().size()==0) {
return null; return pageInfo;
} }
List<Integer> Citys = pageInfo.getList().parallelStream().map(AppUserManageVo::getCityCode).collect(Collectors.toList()); List<Integer> Citys = pageInfo.getList().parallelStream().map(AppUserManageVo::getCityCode).collect(Collectors.toList());
HashSet<Integer> set = new HashSet<>(); HashSet<Integer> set = new HashSet<>();
......
...@@ -271,6 +271,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -271,6 +271,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
SellingWalletPagVo sellingWalletPagVo = new SellingWalletPagVo(); SellingWalletPagVo sellingWalletPagVo = new SellingWalletPagVo();
Example example = new Example(AppUserSellingWater.class); Example example = new Example(AppUserSellingWater.class);
example.setOrderByClause("crt_time DESC");
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
if (waiting != null) { if (waiting != null) {
criteria.andEqualTo("waiting", waiting); criteria.andEqualTo("waiting", waiting);
......
...@@ -235,9 +235,9 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb ...@@ -235,9 +235,9 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
}else if (baseUserMembers.size()==1){ }else if (baseUserMembers.size()==1){
if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null ){ if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null ){
baseUserMember.setIsDel(1); baseUserMember.setTotalNumber(0);
baseUserMember.setRentFreeDays(0);
}else { }else {
baseUserMember.setIsDel(0);
} }
baseUserMember.setUpdTime(System.currentTimeMillis()); baseUserMember.setUpdTime(System.currentTimeMillis());
baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount()+1); baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount()+1);
......
...@@ -80,7 +80,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -80,7 +80,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
walletpg.setWithdrawaling(withDrawaling); walletpg.setWithdrawaling(withDrawaling);
walletpg.setWithdrawals(walletpg.getWithdrawals()==null?new BigDecimal(0):walletpg.getWithdrawals()); walletpg.setWithdrawals(walletpg.getWithdrawals()==null?new BigDecimal(0):walletpg.getWithdrawals());
walletpg.setUnbooked(walletpg.getUnbooked()==null?new BigDecimal(0):walletpg.getUnbooked()); walletpg.setUnbooked(walletpg.getUnbooked()==null?new BigDecimal(0):walletpg.getUnbooked());
walletpg.setTotalAmount(walletpg.getTodayAmount()==null?walletpg.getUnbooked():walletpg.getTotalAmount().add(walletpg.getUnbooked())); walletpg.setTotalAmount(walletpg.getTodayAmount()==null?new BigDecimal(0):walletpg.getTotalAmount());
walletpg.setTotalConsumption(totalConsumpution); walletpg.setTotalConsumption(totalConsumpution);
walletPageVos.add(walletpg); walletPageVos.add(walletpg);
} }
......
...@@ -41,6 +41,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> { ...@@ -41,6 +41,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("stauts", state); criteria.andEqualTo("stauts", state);
criteria.andEqualTo("userId", userId); criteria.andEqualTo("userId", userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example)); PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletCath> walletCaths = walletCathPage.getData(); List<MyWalletCath> walletCaths = walletCathPage.getData();
......
...@@ -19,6 +19,7 @@ import tk.mybatis.mapper.entity.Example; ...@@ -19,6 +19,7 @@ import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -42,6 +43,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -42,6 +43,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
Example example = new Example(MyWalletDetail.class); Example example = new Example(MyWalletDetail.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId); criteria.andEqualTo("userId",userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example)); PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData(); List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData();
...@@ -84,6 +86,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -84,6 +86,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
walletDetailAdminVos.add(walletDetailAdminVo); walletDetailAdminVos.add(walletDetailAdminVo);
walletDetailAdminVo.setSourceName(StringUtils.isEmpty(detailListDTO.getTitle())?detailListDTO.getActivityName():detailListDTO.getTitle()); walletDetailAdminVo.setSourceName(StringUtils.isEmpty(detailListDTO.getTitle())?detailListDTO.getActivityName():detailListDTO.getTitle());
} }
walletDetailAdminVos.sort(Comparator.comparing(WalletDetailAdminVo::getCrtTime).reversed());
pageDataVO.setPageNum(walletDetailFindDTO.getPage()); pageDataVO.setPageNum(walletDetailFindDTO.getPage());
pageDataVO.setPageSize(walletDetailFindDTO.getLimit()); pageDataVO.setPageSize(walletDetailFindDTO.getLimit());
pageDataVO.setTotalCount(walletDetailPage.getTotalCount()); pageDataVO.setTotalCount(walletDetailPage.getTotalCount());
......
...@@ -102,7 +102,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{ ...@@ -102,7 +102,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
try { try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
date = sdf.parse(sdf.format(new Date())); date = sdf.parse(sdf.format(new Date()));
if (time < date.getTime() && time > date.getTime()) { if (time < (date.getTime()+24*3600*1000) && time > date.getTime()) {
isToday = true; isToday = true;
} }
} catch (ParseException e) { } catch (ParseException e) {
...@@ -113,7 +113,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{ ...@@ -113,7 +113,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
//钱包未入账的处理type1-进;2-出 //钱包未入账的处理type1-进;2-出
public void updMyWalletUnbooked(Integer userId,BigDecimal amount,Integer type){ public void updMyWalletUnbooked(Integer userId,BigDecimal amount,Integer type){
log.info("---钱包未入账的处理----userId==="+userId+"----type==="+type); log.info("---钱包未入账的处理updMyWalletUnbooked----userId==="+userId+"----type==="+type);
MyWallet wallet=new MyWallet(); MyWallet wallet=new MyWallet();
wallet.setUserId(userId); wallet.setUserId(userId);
wallet=selectOne(wallet); wallet=selectOne(wallet);
...@@ -134,8 +134,9 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{ ...@@ -134,8 +134,9 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
unbooked=wallet.getUnbooked().subtract(amount); unbooked=wallet.getUnbooked().subtract(amount);
} }
} }
log.info("---钱包未入账的处理updMyWalletUnbooked----userId==="+userId+"----unbooked==="+unbooked);
wallet.setUnbooked(unbooked); wallet.setUnbooked(unbooked);
mapper.updMyWater(wallet); updateSelectiveById(wallet);
} }
} }
......
...@@ -2,6 +2,8 @@ package com.github.wxiaoqi.security.admin.rpc; ...@@ -2,6 +2,8 @@ package com.github.wxiaoqi.security.admin.rpc;
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.Cache;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService; import com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService;
import com.github.wxiaoqi.security.admin.rpc.service.PermissionService; import com.github.wxiaoqi.security.admin.rpc.service.PermissionService;
import com.github.wxiaoqi.security.admin.vo.ImiVo; import com.github.wxiaoqi.security.admin.vo.ImiVo;
...@@ -16,6 +18,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -16,6 +18,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -40,6 +43,8 @@ public class AppUserRest { ...@@ -40,6 +43,8 @@ public class AppUserRest {
@Autowired @Autowired
private UserAuthConfig userAuthConfig; private UserAuthConfig userAuthConfig;
@Autowired
private AppUserLoginBiz appUserLoginBiz;
// @Cache(key="permission") // @Cache(key="permission")
// @RequestMapping(value = "/permissions", method = RequestMethod.GET) // @RequestMapping(value = "/permissions", method = RequestMethod.GET)
...@@ -235,4 +240,19 @@ public class AppUserRest { ...@@ -235,4 +240,19 @@ public class AppUserRest {
public ImiVo findUserInfoByImiId(@PathVariable(value = "imiId") Integer imiId){ public ImiVo findUserInfoByImiId(@PathVariable(value = "imiId") Integer imiId){
return appPermissionService.findUserInoByImiId(imiId); return appPermissionService.findUserInoByImiId(imiId);
} }
@ApiModelProperty("检查手机号是否注册过")
@GetMapping("/unauth/check")
public ObjectRestResponse check(@RequestParam(value = "phone") String phone){
if (StringUtils.isBlank(phone)){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
AppUserLogin rsUserLogin = appUserLoginBiz.checkeUserLogin(phone);
if (rsUserLogin == null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "手机号未注册");
}
return ObjectRestResponse.succ();
}
} }
...@@ -95,8 +95,7 @@ ...@@ -95,8 +95,7 @@
) m ) m
on on
l.id = m.user_id l.id = m.user_id
and m.is_del=0 where 1=1
<if test="mobile !=null"> <if test="mobile !=null">
and l.username like CONCAT('%',#{mobile},'%') and l.username like CONCAT('%',#{mobile},'%')
</if> </if>
...@@ -115,8 +114,6 @@ ...@@ -115,8 +114,6 @@
<if test="source !=null"> <if test="source !=null">
and d.source = #{source} and d.source = #{source}
</if> </if>
order by l.id ASC order by l.id ASC
</select> </select>
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<select id="selectByLeaderId" resultType="com.github.wxiaoqi.security.admin.entity.AppUserRelation"> <select id="selectByLeaderId" resultType="com.github.wxiaoqi.security.admin.entity.AppUserRelation">
select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and userName != ''"> test="userName != null and userName != ''">
WHERE nickname =#{userName} OR realname =#{userName} WHERE nickname =#{userName} OR realname =#{userName}
</if> ) AS `aud` ON aud.userid = aul.id </if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC
</select> </select>
<select id="findUserWithDrawingByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"> <select id="findUserWithDrawingByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
...@@ -30,6 +30,7 @@ FROM ...@@ -30,6 +30,7 @@ FROM
WHERE `nickname`=#{userName} OR `realname`=#{userName} WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>) AS `aud` ON aud.userid = aul.id </if>) AS `aud` ON aud.userid = aul.id
LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono
ORDER BY `crtTime` DESC
</select> </select>
<select id="findpersonalConsumptionsByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"> <select id="findpersonalConsumptionsByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
w.user_id AS `userId`, w.user_id AS `userId`,
w.balance, w.balance,
w.withdrawals, w.withdrawals,
w.total_amount AS `totalAmount`, (w.total_amount+w.unbooked) AS `totalAmount`,
w.today_amount AS `todayAmount`, w.today_amount AS `todayAmount`,
w.unbooked, w.unbooked,
w.is_frozen AS `isFrozen`, w.is_frozen AS `isFrozen`,
...@@ -65,6 +65,6 @@ FROM ...@@ -65,6 +65,6 @@ FROM
</if> ) AS `aul` ON aul.id = w.user_id </if> ) AS `aul` ON aul.id = w.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if test="username != null and username != ''"> INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if test="username != null and username != ''">
WHERE nickname =#{username} OR realname =#{username} WHERE nickname =#{username} OR realname =#{username}
</if> ) AS `aud` ON aud.userid = aul.id </if> ) AS `aud` ON aud.userid = aul.id ORDER BY `totalAmount` DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,6 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -7,6 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
...@@ -34,7 +35,7 @@ public interface ActivityFeign { ...@@ -34,7 +35,7 @@ public interface ActivityFeign {
@RequestMapping(value = "/user/use", method = RequestMethod.POST) @RequestMapping(value = "/user/use", method = RequestMethod.POST)
public BigDecimal use( public BigDecimal use(
@RequestParam(value = "userId") Integer userId, @RequestParam(value = "userId") Integer userId,
@RequestParam(value = "tickerNo") String tickerNo, @RequestParam(value = "tickerNos") List<String> tickerNos,
@RequestParam(value = "orderNo") String orderNo, @RequestParam(value = "orderNo") String orderNo,
@RequestParam(value = "channel") Integer channel, @RequestParam(value = "channel") Integer channel,
@RequestParam(value = "amount") BigDecimal amount, @RequestParam(value = "amount") BigDecimal amount,
......
...@@ -93,6 +93,29 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity ...@@ -93,6 +93,29 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
//判断用户是否已领取或无法领取优惠卷
public ObjectRestResponse checkUserCoupon(Integer userId){
ActivityRule rule = ruleBiz.getActity();
if (rule == null) {
log.error("----没有开启的活动----");
return ObjectRestResponse.createFailedResult(101,"无有效活动");
}
Integer activityId = rule.getId();
ActivityUserJoin userJoin = new ActivityUserJoin();
userJoin.setActivityId(activityId);
userJoin.setUserId(userId);
userJoin= selectOne(userJoin);
if (userJoin == null ) {
log.error("----用户没有此参与活动----userId====" + userId);
return ObjectRestResponse.createFailedResult(102,"不是新用户,无法参与此活动");
}
if(userJoin.getStatus()!=0){
log.error("----用户已领取----userId====" + userId);
return ObjectRestResponse.createFailedResult(103,"用户已领取");
}
return ObjectRestResponse.succ();
}
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ import com.xxfc.platform.activity.vo.UserCouponVo; ...@@ -11,6 +11,7 @@ import com.xxfc.platform.activity.vo.UserCouponVo;
import com.xxfc.platform.universal.weixin.util.Snowflake; import com.xxfc.platform.universal.weixin.util.Snowflake;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.xxfc.platform.activity.mapper.UserCouponMapper; import com.xxfc.platform.activity.mapper.UserCouponMapper;
...@@ -147,28 +148,27 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -147,28 +148,27 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return mapper.getUserCoupon(tickerNo); return mapper.getUserCoupon(tickerNo);
} }
//支付后更新优惠卷状态 //支付后更新优惠卷状态:type.1-
public BigDecimal useTickerNo(Integer userId, String TickerNo, String orderNo,Integer channel,BigDecimal amout,Integer type){ public BigDecimal useTickerNo(Integer userId, List<String> tickerNos, String orderNo,Integer channel,BigDecimal amout,Integer type){
BigDecimal couponAmout=new BigDecimal("0.00"); BigDecimal couponAmout=new BigDecimal("0.00");
if(couponAmout.compareTo(amout) >= 0) { if(couponAmout.compareTo(amout) >= 0) {
return BigDecimal.ZERO; return BigDecimal.ZERO;
} }
if (userId==null||userId==0||StringUtils.isBlank(TickerNo)){ if (userId==null||userId==0||tickerNos==null||tickerNos.size()==0){
log.error("----参数不能为空"); log.error("----参数不能为空");
return couponAmout; return couponAmout;
} }
Example example=new Example(UserCoupon.class); Example example=new Example(UserCoupon.class);
example.createCriteria().andEqualTo("tickerNo",TickerNo).andEqualTo("isDel",0); example.createCriteria().andIn("tickerNo", tickerNos).andEqualTo("isDel",0);
List<UserCoupon> list=selectByExample(example); List<UserCoupon> list=selectByExample(example);
if(list.size()==0){ if(list.size()==0){
log.error(userId+"----没有可用优惠卷--tickerNo==="+TickerNo); log.error(userId+"----没有可用优惠卷--");
return couponAmout; return couponAmout;
} }
for (UserCoupon userCoupon:list) {
UserCoupon userCoupon=list.get(0);
if(userCoupon!=null&&userCoupon.getIsUse()==1){ if(userCoupon!=null&&userCoupon.getIsUse()==1){
log.error(userId+"----该优惠卷已使用--tickerNo=="+TickerNo); log.error(userId+"----该优惠卷已使用--tickerNo==");
return couponAmout; continue;
} }
if (type==1){ if (type==1){
userCoupon.setIsUse(1); userCoupon.setIsUse(1);
...@@ -176,9 +176,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -176,9 +176,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon.setUseTime(System.currentTimeMillis()); userCoupon.setUseTime(System.currentTimeMillis());
updateSelectiveById(userCoupon); updateSelectiveById(userCoupon);
} }
couponAmout=couponAmout.add(getCouponAmout(userCoupon.getCouponId(),channel,amout));
}
return getCouponAmout(userCoupon.getCouponId(),channel,amout); return couponAmout;
} }
public BigDecimal getCouponAmout(Integer couponId,Integer channel,BigDecimal amout) { public BigDecimal getCouponAmout(Integer couponId,Integer channel,BigDecimal amout) {
......
...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@RestController @RestController
@RequestMapping("user") @RequestMapping("user")
...@@ -57,13 +58,13 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz> ...@@ -57,13 +58,13 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/use", method = RequestMethod.POST) @RequestMapping(value = "/use", method = RequestMethod.POST)
public BigDecimal use( public BigDecimal use(
@RequestParam(value = "userId",defaultValue ="0" ) Integer userId, @RequestParam(value = "userId",defaultValue ="0" ) Integer userId,
@RequestParam(value = "tickerNo",defaultValue ="" ) String tickerNo, @RequestParam(value = "tickerNos",defaultValue ="" ) List<String> tickerNos,
@RequestParam(value = "orderNo",defaultValue ="" ) String orderNo, @RequestParam(value = "orderNo",defaultValue ="" ) String orderNo,
@RequestParam(value = "channel",defaultValue ="1" ) Integer channel, @RequestParam(value = "channel",defaultValue ="1" ) Integer channel,
@RequestParam(value = "amount",defaultValue ="0.00" ) BigDecimal amount, @RequestParam(value = "amount",defaultValue ="0.00" ) BigDecimal amount,
@RequestParam(value = "type",defaultValue ="1" ) Integer type @RequestParam(value = "type",defaultValue ="1" ) Integer type
) { ) {
return baseBiz.useTickerNo(userId,tickerNo,orderNo,channel,amount,type); return baseBiz.useTickerNo(userId,tickerNos,orderNo,channel,amount,type);
} }
@ApiOperation("优惠卷取消使用") @ApiOperation("优惠卷取消使用")
...@@ -85,6 +86,17 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz> ...@@ -85,6 +86,17 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
return joinBiz.receiveCoupn(userId); return joinBiz.receiveCoupn(userId);
} }
@ApiOperation("检查用户是否可领取")
@RequestMapping(value = "/coupon/check", method = RequestMethod.GET)
public ObjectRestResponse check() {
AppUserDTO userInfo = getUserInfo();
Integer userId = userInfo.getUserid();
if (userId == null) {
return ObjectRestResponse.createDefaultFail();
}
return joinBiz.checkUserCoupon(userId);
}
......
...@@ -100,16 +100,14 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> { ...@@ -100,16 +100,14 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException { public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
String dirPathToday = File.separator + now.toString(DEFAULT_DATE_TIME_FORMATTER); String dirPathToday = File.separator + now.toString(DEFAULT_DATE_TIME_FORMATTER);
String redisNoKey = RedisKey.UPLOAD_FILE_NO_PREFIX + now.toString(DEFAULT_DATE_TIME_FORMATTER); // String redisNoKey = RedisKey.UPLOAD_FILE_NO_PREFIX + now.toString(DEFAULT_DATE_TIME_FORMATTER);
// Long no = redisTemplate.opsForValue().increment(redisNoKey); // Long no = redisTemplate.opsForValue().increment(redisNoKey);
// if(no.equals(1L)){ // if(no.equals(1L)){
// redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS); // redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
// } // }
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String realFileRelPath = dirPathToday + File.separator+fileName.substring(fileName.lastIndexOf("/")); String realFileRelPath = dirPathToday + File.separator+fileName;
String filePath = uploadPath + realFileRelPath; String filePath = uploadPath + realFileRelPath;
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return ObjectRestResponse.succ(filePath); return ObjectRestResponse.succ(filePath);
} }
......
...@@ -33,30 +33,32 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -33,30 +33,32 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
@RestController @RestController
@RequestMapping("version") @RequestMapping("version")
@IgnoreClientToken @IgnoreClientToken
@Slf4j @Slf4j
public class AppVersionController extends BaseController<AppVersionBiz,AppVersion> { public class AppVersionController extends BaseController<AppVersionBiz, AppVersion> {
//最大上传500MB /**
private Long MAX_DRIVING_LICENSE_SIZE =1024*1024*500L; * 最大上传500MB
private int id; */
private Long MAX_DRIVING_LICENSE_SIZE = 1024 * 1024 * 500L;
@ApiModelProperty("app自动更新") @ApiModelProperty("app自动更新")
@RequestMapping(value ="/app/unauth/info",method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/info", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse info( public ObjectRestResponse info(
@RequestParam(value = "type",defaultValue = "0") Integer type, @RequestParam(value = "type", defaultValue = "0") Integer type,
@RequestParam(value = "version",defaultValue = "") String version, @RequestParam(value = "version", defaultValue = "") String version,
@RequestParam(value = "isH5",defaultValue = "0") Integer isH5 @RequestParam(value = "isH5", defaultValue = "0") Integer isH5
){ ) {
ObjectRestResponse restResponse=null; ObjectRestResponse restResponse = null;
if (isH5!=null&&isH5==1){ if (isH5 != null && isH5 == 1) {
restResponse= baseBiz.getVersionH5(type); restResponse = baseBiz.getVersionH5(type);
}else { } else {
restResponse=baseBiz.getVersion(version,type); restResponse = baseBiz.getVersion(version, type);
} }
return restResponse; return restResponse;
} }
...@@ -64,52 +66,54 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -64,52 +66,54 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@Override @Override
@ApiOperation("添加") @ApiOperation("添加")
@RequestMapping(value = "/background/add",method = RequestMethod.POST) @RequestMapping(value = "/background/add", method = RequestMethod.POST)
public ObjectRestResponse<AppVersion> add(@RequestBody AppVersion appVersion){ public ObjectRestResponse<AppVersion> add(@RequestBody AppVersion appVersion) {
baseBiz.insertAppVersion(appVersion); baseBiz.insertAppVersion(appVersion);
return new ObjectRestResponse<AppVersion>(); return new ObjectRestResponse<AppVersion>();
} }
@ApiOperation("查询一条") @ApiOperation("查询一条")
@RequestMapping(value = "/background/getAppVersion/{id}",method = RequestMethod.GET) @RequestMapping(value = "/background/getAppVersion/{id}", method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id){ public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id) {
return ObjectRestResponse.succ(baseBiz.get(id)); return ObjectRestResponse.succ(baseBiz.get(id));
} }
@ApiOperation("查询所有") @ApiOperation("查询所有")
@RequestMapping(value = "/background/getAppVersions",method = RequestMethod.POST) @RequestMapping(value = "/background/getAppVersions", method = RequestMethod.POST)
public ObjectRestResponse<PageInfo<AppVersion>> getAppVersions(@RequestBody appVersionQuery query){ public ObjectRestResponse<PageInfo<AppVersion>> getAppVersions(@RequestBody appVersionQuery query) {
return ObjectRestResponse.succ(baseBiz.getAll(query)); return ObjectRestResponse.succ(baseBiz.getAll(query));
} }
@Override @Override
@ApiOperation("修改") @ApiOperation("修改")
@RequestMapping(value = "/background/update",method = RequestMethod.PUT) @RequestMapping(value = "/background/update", method = RequestMethod.PUT)
public ObjectRestResponse<AppVersion> update(@RequestBody AppVersion appVersion){ public ObjectRestResponse<AppVersion> update(@RequestBody AppVersion appVersion) {
baseBiz.updateAppVersionById(appVersion); baseBiz.updateAppVersionById(appVersion);
return new ObjectRestResponse<AppVersion>(); return new ObjectRestResponse<AppVersion>();
} }
@ApiOperation("删除") @ApiOperation("删除")
@DeleteMapping(value = "/background/remove/{id}") @DeleteMapping(value = "/background/remove/{id}")
public ObjectRestResponse<AppVersion> remove(@PathVariable Integer id){ public ObjectRestResponse<AppVersion> remove(@PathVariable Integer id) {
baseBiz.remove(id); baseBiz.remove(id);
return new ObjectRestResponse<AppVersion>(); return new ObjectRestResponse<AppVersion>();
} }
@PostMapping(value = "/upload/installationPackage") @PostMapping(value = "/upload/installationPackage")
@ApiOperation(value = "上传app安装包") @ApiOperation(value = "上传app安装包")
public ObjectRestResponse uploadInstallationPackage(@RequestParam("file") MultipartFile file) public ObjectRestResponse uploadInstallationPackage(@RequestParam MultipartFile file)
throws Exception { throws Exception {
Assert.notNull(file);
//文件类型 //文件类型
String contentType = file.getContentType(); String contentType = file.getContentType();
log.debug("contentType"+contentType); String name = file.getOriginalFilename();
String content = name.substring(name.lastIndexOf("."));
System.out.println("file.getSize()" + file.getSize());
System.out.println("content"+content);
System.out.println("contentType" + contentType);
//判断上传的文件格式 //判断上传的文件格式
if (!judgeFormat(contentType)||file.getSize() > MAX_DRIVING_LICENSE_SIZE) { if (!judgeFormat(content) || file.getSize() > MAX_DRIVING_LICENSE_SIZE) {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
...@@ -117,8 +121,6 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -117,8 +121,6 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
} }
@IgnoreUserToken @IgnoreUserToken
@GetMapping(value = "/download/installationPackage/{realFileRelPath}") //匹配的是href中的download请求 @GetMapping(value = "/download/installationPackage/{realFileRelPath}") //匹配的是href中的download请求
@ApiOperation(value = "下载app安装包") @ApiOperation(value = "下载app安装包")
...@@ -128,11 +130,12 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -128,11 +130,12 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
/** /**
* 判断上传的文件格式 * 判断上传的文件格式
*
* @param contentType * @param contentType
* @return * @return
*/ */
private boolean judgeFormat(String contentType){ private boolean judgeFormat(String contentType) {
if (AppFormat.getFormatSet().size()==0) { if (AppFormat.getFormatSet().size() == 0) {
return true; return true;
} }
for (String format : AppFormat.getFormatSet()) { for (String format : AppFormat.getFormatSet()) {
......
...@@ -2,7 +2,7 @@ servlet: ...@@ -2,7 +2,7 @@ servlet:
multipart: multipart:
# 启用上传处理,默认是true # 启用上传处理,默认是true
enabled: true enabled: true
# 当上传文件达到1MB的时候进行磁盘写入 # 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB file-size-threshold: 20MB
# 设置最大的请求文件的大小 # 设置最大的请求文件的大小
max-request-size: 50MB max-request-size: 50MB
......
...@@ -39,6 +39,7 @@ import java.math.BigDecimal; ...@@ -39,6 +39,7 @@ import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.*; import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
...@@ -141,7 +142,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -141,7 +142,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//如果有使用优惠券,则扣减 //如果有使用优惠券,则扣减
if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) < 0) { if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) < 0) {
activityFeign.use(bo.getAppUserDTO().getUserid(), bo.getTickerNo().get(0), bo.getOrder().getNo(), channel, bo.getOrder().getGoodsAmount(), ActivityFeign.TYPE_USE); activityFeign.use(bo.getAppUserDTO().getUserid(), bo.getTickerNo(), bo.getOrder().getNo(), channel, bo.getOrder().getGoodsAmount(), ActivityFeign.TYPE_USE);
} }
//获取可用车辆 //获取可用车辆
...@@ -245,9 +246,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -245,9 +246,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//优惠券处理 //优惠券处理
//待完成 //待完成
if(null != detail.getTickerNo() && detail.getTickerNo().size() > 0) { if(null != detail.getTickerNo() && detail.getTickerNo().size() > 0) {
couponAmount = activityFeign.use(dto.getUserid(), detail.getTickerNo().get(0), detail.getOrder().getNo(), channel, goodsAmount, ActivityFeign.TYPE_NO_USE); couponAmount = activityFeign.use(dto.getUserid(), detail.getTickerNo(), detail.getOrder().getNo(), channel, goodsAmount, ActivityFeign.TYPE_NO_USE);
if(couponAmount.compareTo(BigDecimal.ZERO) > 0) { if(couponAmount.compareTo(BigDecimal.ZERO) > 0) {
detail.getOrder().setCouponTickerNos(detail.getTickerNo().get(0)); detail.getOrder().setCouponTickerNos(detail.getTickerNo().stream().collect(Collectors.joining(",")));
} }
} }
......
...@@ -140,7 +140,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -140,7 +140,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//如果有使用优惠券,则扣减 //如果有使用优惠券,则扣减
if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) < 0) { if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) < 0) {
activityFeign.use(bo.getAppUserDTO().getUserid(), bo.getTickerNo().get(0), bo.getOrder().getNo(), channel, bo.getOrder().getGoodsAmount(), ActivityFeign.TYPE_USE); activityFeign.use(bo.getAppUserDTO().getUserid(), bo.getTickerNo(), bo.getOrder().getNo(), channel, bo.getOrder().getGoodsAmount(), ActivityFeign.TYPE_USE);
} }
super.handleDetail(bo); super.handleDetail(bo);
...@@ -217,9 +217,10 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -217,9 +217,10 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//优惠券处理 //优惠券处理
//待完成 //待完成
if(null != detail.getTickerNo() && detail.getTickerNo().size() > 0) { if(null != detail.getTickerNo() && detail.getTickerNo().size() > 0) {
couponAmount = activityFeign.use(dto.getUserid(), detail.getTickerNo().get(0), detail.getOrder().getNo(), channel, goodsAmount, ActivityFeign.TYPE_NO_USE); couponAmount = activityFeign.use(dto.getUserid(), detail.getTickerNo(), detail.getOrder().getNo(), channel, goodsAmount, ActivityFeign.TYPE_NO_USE);
if(couponAmount.compareTo(BigDecimal.ZERO) > 0) { if(couponAmount.compareTo(BigDecimal.ZERO) > 0) {
detail.getOrder().setCouponTickerNos(detail.getTickerNo().get(0)); detail.getOrder().setCouponTickerNos(detail.getTickerNo()
.stream().collect(Collectors.joining(",")));
} }
} }
......
...@@ -80,9 +80,11 @@ public class UploadService { ...@@ -80,9 +80,11 @@ public class UploadService {
file.mkdirs(); file.mkdirs();
} }
realFileRelPath=filePath + "/" + no + ".jpg"; String str="/" + no + ".jpg";
realFileRelPath = realFileRelPath+str;
filePath=filePath +str;
//将文件写入指定位置 //将文件写入指定位置
ImgBase64Util.generateImage(imgFile,realFileRelPath); ImgBase64Util.generateImage(imgFile,filePath);
realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath; realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
return realFileRelPath; return realFileRelPath;
} }
......
...@@ -9,7 +9,7 @@ servlet: ...@@ -9,7 +9,7 @@ servlet:
multipart: multipart:
# 启用上传处理,默认是true # 启用上传处理,默认是true
enabled: true enabled: true
# 当上传文件达到1MB的时候进行磁盘写入 # 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB file-size-threshold: 20MB
# 设置最大的请求文件的大小 # 设置最大的请求文件的大小
max-request-size: 50MB max-request-size: 50MB
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment