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

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

parents e05de2b1 ed01f730
......@@ -88,6 +88,16 @@ auth:
token-header: x-client-token
id: ace-gate #不填则默认读取spring.application.name
secret: 123456
servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
max-request-size: 50MB
# 设置单个文件的最大长度
max-file-size: 50MB
#
#
#ribbon:
......
......@@ -6,7 +6,7 @@ import java.util.List;
import java.util.Set;
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));
public static Set<String> getFormatSet() {
return formatSet;
......
......@@ -52,10 +52,10 @@ public class AppUserManageDTO {
*/
private Integer source;
/**
* 接收前台时间范围
*/
private String[] registrationDate;
// /**
// * 接收前台时间范围
// */
// private String[] registrationDate;
}
......@@ -57,7 +57,7 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(appUserManageDTO);
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
if (pageInfo.getList()==null||pageInfo.getList().size()==0) {
return null;
return pageInfo;
}
List<Integer> Citys = pageInfo.getList().parallelStream().map(AppUserManageVo::getCityCode).collect(Collectors.toList());
HashSet<Integer> set = new HashSet<>();
......
......@@ -271,6 +271,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
SellingWalletPagVo sellingWalletPagVo = new SellingWalletPagVo();
Example example = new Example(AppUserSellingWater.class);
example.setOrderByClause("crt_time DESC");
Example.Criteria criteria = example.createCriteria();
if (waiting != null) {
criteria.andEqualTo("waiting", waiting);
......
......@@ -235,9 +235,9 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
}else if (baseUserMembers.size()==1){
if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null ){
baseUserMember.setIsDel(1);
baseUserMember.setTotalNumber(0);
baseUserMember.setRentFreeDays(0);
}else {
baseUserMember.setIsDel(0);
}
baseUserMember.setUpdTime(System.currentTimeMillis());
baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount()+1);
......
......@@ -80,7 +80,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
walletpg.setWithdrawaling(withDrawaling);
walletpg.setWithdrawals(walletpg.getWithdrawals()==null?new BigDecimal(0):walletpg.getWithdrawals());
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);
walletPageVos.add(walletpg);
}
......
......@@ -41,6 +41,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("stauts", state);
criteria.andEqualTo("userId", userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletCath> walletCaths = walletCathPage.getData();
......
......@@ -19,6 +19,7 @@ import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -42,6 +43,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
Example example = new Example(MyWalletDetail.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData();
......@@ -84,6 +86,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
walletDetailAdminVos.add(walletDetailAdminVo);
walletDetailAdminVo.setSourceName(StringUtils.isEmpty(detailListDTO.getTitle())?detailListDTO.getActivityName():detailListDTO.getTitle());
}
walletDetailAdminVos.sort(Comparator.comparing(WalletDetailAdminVo::getCrtTime).reversed());
pageDataVO.setPageNum(walletDetailFindDTO.getPage());
pageDataVO.setPageSize(walletDetailFindDTO.getLimit());
pageDataVO.setTotalCount(walletDetailPage.getTotalCount());
......
......@@ -102,7 +102,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
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;
}
} catch (ParseException e) {
......@@ -113,7 +113,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
//钱包未入账的处理type1-进;2-出
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();
wallet.setUserId(userId);
wallet=selectOne(wallet);
......@@ -134,8 +134,9 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
unbooked=wallet.getUnbooked().subtract(amount);
}
}
log.info("---钱包未入账的处理updMyWalletUnbooked----userId==="+userId+"----unbooked==="+unbooked);
wallet.setUnbooked(unbooked);
mapper.updMyWater(wallet);
updateSelectiveById(wallet);
}
}
......
......@@ -2,6 +2,8 @@ package com.github.wxiaoqi.security.admin.rpc;
import com.ace.cache.annotation.Cache;
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.PermissionService;
import com.github.wxiaoqi.security.admin.vo.ImiVo;
......@@ -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.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -40,6 +43,8 @@ public class AppUserRest {
@Autowired
private UserAuthConfig userAuthConfig;
@Autowired
private AppUserLoginBiz appUserLoginBiz;
// @Cache(key="permission")
// @RequestMapping(value = "/permissions", method = RequestMethod.GET)
......@@ -235,4 +240,19 @@ public class AppUserRest {
public ImiVo findUserInfoByImiId(@PathVariable(value = "imiId") Integer 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 @@
) m
on
l.id = m.user_id
and m.is_del=0
where 1=1
<if test="mobile !=null">
and l.username like CONCAT('%',#{mobile},'%')
</if>
......@@ -115,8 +114,6 @@
<if test="source !=null">
and d.source = #{source}
</if>
order by l.id ASC
</select>
......
......@@ -4,6 +4,6 @@
<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>
</mapper>
\ No newline at end of file
......@@ -24,7 +24,7 @@
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and 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 id="findUserWithDrawingByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
......@@ -30,6 +30,7 @@ FROM
WHERE `nickname`=#{userName} OR `realname`=#{userName}
</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
ORDER BY `crtTime` DESC
</select>
<select id="findpersonalConsumptionsByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
......@@ -51,7 +51,7 @@
w.user_id AS `userId`,
w.balance,
w.withdrawals,
w.total_amount AS `totalAmount`,
(w.total_amount+w.unbooked) AS `totalAmount`,
w.today_amount AS `todayAmount`,
w.unbooked,
w.is_frozen AS `isFrozen`,
......@@ -65,6 +65,6 @@ FROM
</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 != ''">
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>
</mapper>
\ No newline at end of file
......@@ -7,6 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -34,7 +35,7 @@ public interface ActivityFeign {
@RequestMapping(value = "/user/use", method = RequestMethod.POST)
public BigDecimal use(
@RequestParam(value = "userId") Integer userId,
@RequestParam(value = "tickerNo") String tickerNo,
@RequestParam(value = "tickerNos") List<String> tickerNos,
@RequestParam(value = "orderNo") String orderNo,
@RequestParam(value = "channel") Integer channel,
@RequestParam(value = "amount") BigDecimal amount,
......
......@@ -93,6 +93,29 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
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;
import com.xxfc.platform.universal.weixin.util.Snowflake;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxfc.platform.activity.mapper.UserCouponMapper;
......@@ -147,38 +148,37 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return mapper.getUserCoupon(tickerNo);
}
//支付后更新优惠卷状态
public BigDecimal useTickerNo(Integer userId, String TickerNo, String orderNo,Integer channel,BigDecimal amout,Integer type){
//支付后更新优惠卷状态:type.1-
public BigDecimal useTickerNo(Integer userId, List<String> tickerNos, String orderNo,Integer channel,BigDecimal amout,Integer type){
BigDecimal couponAmout=new BigDecimal("0.00");
if(couponAmout.compareTo(amout) >= 0) {
return BigDecimal.ZERO;
}
if (userId==null||userId==0||StringUtils.isBlank(TickerNo)){
if (userId==null||userId==0||tickerNos==null||tickerNos.size()==0){
log.error("----参数不能为空");
return couponAmout;
}
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);
if(list.size()==0){
log.error(userId+"----没有可用优惠卷--tickerNo==="+TickerNo);
log.error(userId+"----没有可用优惠卷--");
return couponAmout;
}
UserCoupon userCoupon=list.get(0);
if(userCoupon!=null&&userCoupon.getIsUse()==1){
log.error(userId+"----该优惠卷已使用--tickerNo=="+TickerNo);
return couponAmout;
}
if (type==1){
userCoupon.setIsUse(1);
userCoupon.setOrderNo(orderNo);
userCoupon.setUseTime(System.currentTimeMillis());
updateSelectiveById(userCoupon);
for (UserCoupon userCoupon:list) {
if(userCoupon!=null&&userCoupon.getIsUse()==1){
log.error(userId+"----该优惠卷已使用--tickerNo==");
continue;
}
if (type==1){
userCoupon.setIsUse(1);
userCoupon.setOrderNo(orderNo);
userCoupon.setUseTime(System.currentTimeMillis());
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) {
......
......@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
@RestController
@RequestMapping("user")
......@@ -57,13 +58,13 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/use", method = RequestMethod.POST)
public BigDecimal use(
@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 = "channel",defaultValue ="1" ) Integer channel,
@RequestParam(value = "amount",defaultValue ="0.00" ) BigDecimal amount,
@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("优惠卷取消使用")
......@@ -85,6 +86,17 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
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> {
public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException {
DateTime now = DateTime.now();
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);
// if(no.equals(1L)){
// redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
// }
String fileName = file.getOriginalFilename();
String realFileRelPath = dirPathToday + File.separator+fileName.substring(fileName.lastIndexOf("/"));
String realFileRelPath = dirPathToday + File.separator+fileName;
String filePath = uploadPath + realFileRelPath;
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return ObjectRestResponse.succ(filePath);
}
......
......@@ -33,83 +33,87 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@RestController
@RequestMapping("version")
@IgnoreClientToken
@Slf4j
public class AppVersionController extends BaseController<AppVersionBiz,AppVersion> {
//最大上传500MB
private Long MAX_DRIVING_LICENSE_SIZE =1024*1024*500L;
private int id;
public class AppVersionController extends BaseController<AppVersionBiz, AppVersion> {
/**
* 最大上传500MB
*/
private Long MAX_DRIVING_LICENSE_SIZE = 1024 * 1024 * 500L;
@ApiModelProperty("app自动更新")
@RequestMapping(value ="/app/unauth/info",method = RequestMethod.GET)
@RequestMapping(value = "/app/unauth/info", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse info(
@RequestParam(value = "type",defaultValue = "0") Integer type,
@RequestParam(value = "version",defaultValue = "") String version,
@RequestParam(value = "isH5",defaultValue = "0") Integer isH5
){
ObjectRestResponse restResponse=null;
if (isH5!=null&&isH5==1){
restResponse= baseBiz.getVersionH5(type);
}else {
restResponse=baseBiz.getVersion(version,type);
}
@RequestParam(value = "type", defaultValue = "0") Integer type,
@RequestParam(value = "version", defaultValue = "") String version,
@RequestParam(value = "isH5", defaultValue = "0") Integer isH5
) {
ObjectRestResponse restResponse = null;
if (isH5 != null && isH5 == 1) {
restResponse = baseBiz.getVersionH5(type);
} else {
restResponse = baseBiz.getVersion(version, type);
}
return restResponse;
}
@Override
@ApiOperation("添加")
@RequestMapping(value = "/background/add",method = RequestMethod.POST)
public ObjectRestResponse<AppVersion> add(@RequestBody AppVersion appVersion){
@RequestMapping(value = "/background/add", method = RequestMethod.POST)
public ObjectRestResponse<AppVersion> add(@RequestBody AppVersion appVersion) {
baseBiz.insertAppVersion(appVersion);
return new ObjectRestResponse<AppVersion>();
}
@ApiOperation("查询一条")
@RequestMapping(value = "/background/getAppVersion/{id}",method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id){
@RequestMapping(value = "/background/getAppVersion/{id}", method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id) {
return ObjectRestResponse.succ(baseBiz.get(id));
}
@ApiOperation("查询所有")
@RequestMapping(value = "/background/getAppVersions",method = RequestMethod.POST)
public ObjectRestResponse<PageInfo<AppVersion>> getAppVersions(@RequestBody appVersionQuery query){
@RequestMapping(value = "/background/getAppVersions", method = RequestMethod.POST)
public ObjectRestResponse<PageInfo<AppVersion>> getAppVersions(@RequestBody appVersionQuery query) {
return ObjectRestResponse.succ(baseBiz.getAll(query));
}
@Override
@ApiOperation("修改")
@RequestMapping(value = "/background/update",method = RequestMethod.PUT)
public ObjectRestResponse<AppVersion> update(@RequestBody AppVersion appVersion){
@RequestMapping(value = "/background/update", method = RequestMethod.PUT)
public ObjectRestResponse<AppVersion> update(@RequestBody AppVersion appVersion) {
baseBiz.updateAppVersionById(appVersion);
return new ObjectRestResponse<AppVersion>();
}
@ApiOperation("删除")
@DeleteMapping(value = "/background/remove/{id}")
public ObjectRestResponse<AppVersion> remove(@PathVariable Integer id){
public ObjectRestResponse<AppVersion> remove(@PathVariable Integer id) {
baseBiz.remove(id);
return new ObjectRestResponse<AppVersion>();
}
@PostMapping(value = "/upload/installationPackage")
@ApiOperation(value = "上传app安装包")
public ObjectRestResponse uploadInstallationPackage(@RequestParam("file") MultipartFile file)
public ObjectRestResponse uploadInstallationPackage(@RequestParam MultipartFile file)
throws Exception {
Assert.notNull(file);
//文件类型
String contentType = file.getContentType();
log.debug("contentType"+contentType);
//判断上传的文件格式
if (!judgeFormat(contentType)||file.getSize() > MAX_DRIVING_LICENSE_SIZE) {
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(content) || file.getSize() > MAX_DRIVING_LICENSE_SIZE) {
return ObjectRestResponse.createDefaultFail();
}
......@@ -117,8 +121,6 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
}
@IgnoreUserToken
@GetMapping(value = "/download/installationPackage/{realFileRelPath}") //匹配的是href中的download请求
@ApiOperation(value = "下载app安装包")
......@@ -128,11 +130,12 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
/**
* 判断上传的文件格式
*
* @param contentType
* @return
*/
private boolean judgeFormat(String contentType){
if (AppFormat.getFormatSet().size()==0) {
private boolean judgeFormat(String contentType) {
if (AppFormat.getFormatSet().size() == 0) {
return true;
}
for (String format : AppFormat.getFormatSet()) {
......
......@@ -2,7 +2,7 @@ servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到1MB的时候进行磁盘写入
# 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
max-request-size: 50MB
......
......@@ -39,6 +39,7 @@ import java.math.BigDecimal;
import java.util.HashMap;
import java.util.HashSet;
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.common.constant.CommonConstants.SYS_FALSE;
......@@ -141,7 +142,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//如果有使用优惠券,则扣减
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
//优惠券处理
//待完成
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) {
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
//如果有使用优惠券,则扣减
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);
......@@ -217,9 +217,10 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//优惠券处理
//待完成
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) {
detail.getOrder().setCouponTickerNos(detail.getTickerNo().get(0));
detail.getOrder().setCouponTickerNos(detail.getTickerNo()
.stream().collect(Collectors.joining(",")));
}
}
......
......@@ -80,9 +80,11 @@ public class UploadService {
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;
return realFileRelPath;
}
......
......@@ -9,7 +9,7 @@ servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到1MB的时候进行磁盘写入
# 当上传文件达到20MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
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