Commit 6c618efb authored by 周健威's avatar 周健威

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

parents b922fd0b 716a5455
package com.github.wxiaoqi.security.admin.constant;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class AppFormat {
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;
}
}
...@@ -62,6 +62,13 @@ public class AppUserSellingWater implements Serializable { ...@@ -62,6 +62,13 @@ public class AppUserSellingWater implements Serializable {
@Column(name = "order_no") @Column(name = "order_no")
@ApiModelProperty(value = "订单号") @ApiModelProperty(value = "订单号")
private String orderNo; private String orderNo;
/**
* 订单号
*/
@Column(name = "order_type")
@ApiModelProperty(value = "1-租车;2-旅游;3-会员;4-营地")
private Integer orderType;
/** /**
* 商品id * 商品id
......
...@@ -103,15 +103,18 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -103,15 +103,18 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
Integer parentId = relation.getParentId(); Integer parentId = relation.getParentId();
log.info("购买计算用户拥金----payOrderWater--------userId===" + userId + "---parentId===" + parentId); log.info("购买计算用户拥金----payOrderWater--------userId===" + userId + "---parentId===" + parentId);
BigDecimal amount = new BigDecimal("0.00");
//商品类型
Integer orderType=0;
for (OrderGoodsDTO goodsDto : goodsDTOList) { for (OrderGoodsDTO goodsDto : goodsDTOList) {
//商品id //商品id
Integer goodId = goodsDto.getGoodId(); Integer goodId = goodsDto.getGoodId();
//商品价格 //商品价格
BigDecimal price = goodsDto.getPrice(); BigDecimal price = goodsDto.getPrice();
//商品类型
Integer type = goodsDto.getType(); orderType = goodsDto.getType();
//商品比例 //商品比例
Integer extract = commissionBiz.getExtract(type, goodId); Integer extract = commissionBiz.getExtract(orderType, goodId);
AppUserVo userVo = detailBiz.getUserInfoById(parentId); AppUserVo userVo = detailBiz.getUserInfoById(parentId);
Integer positionId = 6; Integer positionId = 6;
if (userVo != null) { if (userVo != null) {
...@@ -137,6 +140,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -137,6 +140,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater.setPositionId(positionId); sellingWater.setPositionId(positionId);
sellingWater.setOrderId(orderId); sellingWater.setOrderId(orderId);
sellingWater.setOrderNo(orderNo); sellingWater.setOrderNo(orderNo);
sellingWater.setOrderType(orderType);
sellingWater.setGoodId(goodId); sellingWater.setGoodId(goodId);
sellingWater.setTitle(goodsDto.getTitle()); sellingWater.setTitle(goodsDto.getTitle());
sellingWater.setImg(goodsDto.getImg()); sellingWater.setImg(goodsDto.getImg());
...@@ -145,18 +149,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -145,18 +149,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater.setGoodNumber(goodsDto.getGoodNumber()); sellingWater.setGoodNumber(goodsDto.getGoodNumber());
sellingWater.setCommission(commission); sellingWater.setCommission(commission);
insertSelective(sellingWater); insertSelective(sellingWater);
log.info("购买计算用户拥成功----payOrderWater--------userId===" + userId+"----type===="+type); log.info("购买计算用户拥成功----payOrderWater--------userId===" + userId);
if(type==null){ amount = amount.add(commission);
continue;
}
if(type==3){
finishOrderWater(orderWaterDTO);
}else if(type==2){
myWaterBiz.updMyWalletUnbooked(userId,commission);
}
} }
} }
log.info("购买计算用户未入账----payOrderWater--------userId===" + parentId+"----amount===="+amount+"--orderType==="+orderType);
if(orderType==3){
finishOrderWater(orderWaterDTO);
}else if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(parentId,amount,1);
}
} }
//订单完成计算用户拥金 //订单完成计算用户拥金
...@@ -170,14 +172,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -170,14 +172,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
List<AppUserSellingWater> list = getWaterList(orderId); List<AppUserSellingWater> list = getWaterList(orderId);
BigDecimal amount = new BigDecimal("0.00"); BigDecimal amount = new BigDecimal("0.00");
Integer userId = 0; Integer userId = 0;
Integer orderType=0;
if (list.size() > 0) { if (list.size() > 0) {
for (AppUserSellingWater sellingWater : list) { for (AppUserSellingWater sellingWater : list) {
Integer id = sellingWater.getId(); Integer id = sellingWater.getId();
orderType=sellingWater.getOrderType();
userId = sellingWater.getUserId(); userId = sellingWater.getUserId();
sellingWater.setWaiting(1); sellingWater.setWaiting(1);
updateById(sellingWater); updateById(sellingWater);
BigDecimal commission = sellingWater.getCommission(); BigDecimal commission = sellingWater.getCommission();
log.info("订单完成计算用户拥金----finishOrderWater----id====" + id + "---commission==" + commission); log.info("订单完成计算用户拥金----finishOrderWater----id====" + id + "---commission==" + commission+"----orderType==="+orderType);
amount = amount.add(commission); amount = amount.add(commission);
} }
} }
...@@ -191,6 +195,10 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -191,6 +195,10 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
detail.setCono(orderId); detail.setCono(orderId);
detail.setSource(1); detail.setSource(1);
myWaterBiz.updMyWater(detail); myWaterBiz.updMyWater(detail);
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,amount,2);
}
} }
} }
...@@ -205,10 +213,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -205,10 +213,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
} }
List<AppUserSellingWater> list = getWaterList(orderId); List<AppUserSellingWater> list = getWaterList(orderId);
BigDecimal amount = new BigDecimal("0.00"); BigDecimal amount = new BigDecimal("0.00");
BigDecimal unbooked = new BigDecimal("0.00");
Integer userId = 0; Integer userId = 0;
Integer orderType=0;
if (list.size() > 0) { if (list.size() > 0) {
for (AppUserSellingWater sellingWater : list) { for (AppUserSellingWater sellingWater : list) {
Integer id = sellingWater.getId(); Integer id = sellingWater.getId();
orderType=sellingWater.getOrderType();
userId = sellingWater.getUserId(); userId = sellingWater.getUserId();
sellingWater.setWaiting(1); sellingWater.setWaiting(1);
updateById(sellingWater); updateById(sellingWater);
...@@ -216,10 +227,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -216,10 +227,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater.setStatus(1); sellingWater.setStatus(1);
insertSelective(sellingWater); insertSelective(sellingWater);
BigDecimal commission = sellingWater.getCommission(); BigDecimal commission = sellingWater.getCommission();
log.info("订单完成计算用户拥金----refundOrderWater----id====" + id + "---commission==" + commission); log.info("订单完成计算用户拥金----refundOrderWater----id====" + id + "---commission==" + commission+"---orderType===="+orderType);
unbooked=unbooked.add(commission);
} }
} }
log.info("订单完成计算用户拥金----refundOrderWater----orderId====" + orderId + "---amount==" + amount); log.info("订单完成计算用户拥金----refundOrderWater----orderId====" + orderId + "---amount==" + amount+"---unbooked==="+unbooked);
int r = amount.compareTo(BigDecimal.ZERO); int r = amount.compareTo(BigDecimal.ZERO);
//更新钱包 //更新钱包
if (r == 1 && userId > 0) { if (r == 1 && userId > 0) {
...@@ -230,6 +242,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -230,6 +242,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
detail.setSource(1); detail.setSource(1);
myWaterBiz.updMyWater(detail); myWaterBiz.updMyWater(detail);
} }
if(orderType==1||orderType==2){
myWaterBiz.updMyWalletUnbooked(userId,unbooked,2);
}
} }
......
...@@ -193,6 +193,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb ...@@ -193,6 +193,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
* @return * @return
*/ */
public BaseUserMemberVO findOneByUserId(Integer userId) { public BaseUserMemberVO findOneByUserId(Integer userId) {
BaseUserMemberVO baseUserMemberVO= mapper.getBaseUserMemberVOByUserId(userId); BaseUserMemberVO baseUserMemberVO= mapper.getBaseUserMemberVOByUserId(userId);
if (baseUserMemberVO!=null) { if (baseUserMemberVO!=null) {
return baseUserMemberVO; return baseUserMemberVO;
...@@ -218,23 +219,38 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb ...@@ -218,23 +219,38 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
BaseUserMember baseUserMember = new BaseUserMember(); BaseUserMember baseUserMember = new BaseUserMember();
BeanUtilsBean.getInstance().copyProperties(baseUserMember,baseUserMemberVO); BeanUtilsBean.getInstance().copyProperties(baseUserMember,baseUserMemberVO);
if (baseUserMembers==null||baseUserMembers.size()==0) { if (baseUserMembers==null||baseUserMembers.size()==0) {
if (baseUserMemberVO.getMemberLevel()==null||baseUserMember.getValidTime()==null) return;
baseUserMember.setCrtTime(System.currentTimeMillis()); if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null ) return;
baseUserMember.setIsDel(0); baseUserMember.setCrtTime(System.currentTimeMillis());
baseUserMember.setPayCount(0); baseUserMember.setIsDel(0);
baseUserMember.setCardLeave(1); baseUserMember.setPayCount(0);
baseUserMember.setRecentRecharge(System.currentTimeMillis()); baseUserMember.setCardLeave(1);
Integer buyCount = baseUserMember.getBuyCount()==null? 0:baseUserMember.getBuyCount(); baseUserMember.setRecentRecharge(System.currentTimeMillis());
baseUserMember.setBuyCount(buyCount+1); Integer buyCount = baseUserMember.getBuyCount() == null ? 0 : baseUserMember.getBuyCount();
insertSelective(baseUserMember); baseUserMember.setBuyCount(buyCount + 1);
return; insertSelective(baseUserMember);
return;
}else if (baseUserMembers.size()==1){ }else if (baseUserMembers.size()==1){
baseUserMember.setUpdTime(System.currentTimeMillis()); if (baseUserMemberVO.getMemberLevel() == null || baseUserMember.getValidTime() == null ){
getMyBiz().updateSelectiveById(baseUserMember); baseUserMember.setIsDel(1);
}else {
baseUserMember.setIsDel(0);
}
baseUserMember.setUpdTime(System.currentTimeMillis());
baseUserMember.setBuyCount(baseUserMembers.get(0).getBuyCount()+1);
baseUserMember.setId(baseUserMembers.get(0).getId());
mapper.updateByPrimaryKeySelective(baseUserMember);
}else { }else {
throw new BaseException("Member purchase repeat!"); throw new BaseException("Member purchase repeat!");
} }
} }
} }
\ No newline at end of file
...@@ -72,13 +72,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{ ...@@ -72,13 +72,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
if (lastTime!=null&&(lastTime==0||isToday(lastTime))){ if (lastTime!=null&&(lastTime==0||isToday(lastTime))){
todayAmount=wallet.getTodayAmount().add(amount); todayAmount=wallet.getTodayAmount().add(amount);
} }
//只有拥金才会未入账
if (wallet.getUnbooked().compareTo(amount)>0&&walletDetail.getSource()!=null&&walletDetail.getSource()==1){
unbooked=wallet.getUnbooked().subtract(amount);
}
} }
unbooked=wallet.getUnbooked().subtract(unbooked);
log.info("---我的钱包入账----userId==="+userId+"----balance===="+balance+"----totalAmount===="+totalAmount+"---todayAmount==="+todayAmount+"---unbooked=="+unbooked); log.info("---我的钱包入账----userId==="+userId+"----balance===="+balance+"----totalAmount===="+totalAmount+"---todayAmount==="+todayAmount+"---unbooked=="+unbooked);
walletDetail.setItype(0); walletDetail.setItype(0);
walletDetail.setBalance(oldBalance); walletDetail.setBalance(oldBalance);
...@@ -116,18 +111,29 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{ ...@@ -116,18 +111,29 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
return isToday; return isToday;
} }
//钱包未入账的添加 //钱包未入账的处理type1-进;2-出
public void updMyWalletUnbooked(Integer userId,BigDecimal amount){ public void updMyWalletUnbooked(Integer userId,BigDecimal amount,Integer type){
log.info("---钱包未入账的处理----userId==="+userId+"----type==="+type);
MyWallet wallet=new MyWallet(); MyWallet wallet=new MyWallet();
wallet.setUserId(userId); wallet.setUserId(userId);
wallet=selectOne(wallet); wallet=selectOne(wallet);
BigDecimal unbooked=new BigDecimal("0.00");
if(wallet==null){ if(wallet==null){
wallet=new MyWallet(); wallet=new MyWallet();
wallet.setUserId(userId); wallet.setUserId(userId);
wallet.setUnbooked(amount); if (type==1){
unbooked=amount;
}
wallet.setUnbooked(unbooked);
insertSelective(wallet); insertSelective(wallet);
}else { }else {
BigDecimal unbooked=wallet.getUnbooked().add(amount); if (type==1){
unbooked=wallet.getUnbooked().add(amount);
}else {
if (wallet.getUnbooked().compareTo(amount)>0){
unbooked=wallet.getUnbooked().subtract(amount);
}
}
wallet.setUnbooked(unbooked); wallet.setUnbooked(unbooked);
mapper.updMyWater(wallet); mapper.updMyWater(wallet);
} }
......
...@@ -89,7 +89,7 @@ public class WaterMQHandler { ...@@ -89,7 +89,7 @@ public class WaterMQHandler {
setImg(orderMQDTO.getPicture()); setImg(orderMQDTO.getPicture());
setPrice(orderMQDTO.getGoodsAmount()); setPrice(orderMQDTO.getGoodsAmount());
setTitle(orderMQDTO.getName()); setTitle(orderMQDTO.getName());
setType(OrderGoodsDTO.TYPE_RENT); setType(OrderGoodsDTO.TYPE_TOUR);
}}); }});
}} }}
); );
......
...@@ -54,7 +54,7 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba ...@@ -54,7 +54,7 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba
return null; return null;
} }
@GetMapping("/Manage/getMembers") @GetMapping("/manage/getMembers")
public ObjectRestResponse getMembers(){ public ObjectRestResponse getMembers(){
Example exa = Example.builder(BaseUserMemberLevel.class).where( Example exa = Example.builder(BaseUserMemberLevel.class).where(
WeekendSqls.<BaseUserMemberLevel>custom() WeekendSqls.<BaseUserMemberLevel>custom()
...@@ -66,7 +66,7 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba ...@@ -66,7 +66,7 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba
@DeleteMapping("/Manage/delMembershipGrade/{id}") @DeleteMapping("/manage/delMembershipGrade/{id}")
public ObjectRestResponse delMembershipGrade(@PathVariable Integer id){ public ObjectRestResponse delMembershipGrade(@PathVariable Integer id){
BaseUserMemberLevel baseUserMemberLevel = new BaseUserMemberLevel(); BaseUserMemberLevel baseUserMemberLevel = new BaseUserMemberLevel();
baseUserMemberLevel.setId(id); baseUserMemberLevel.setId(id);
......
...@@ -95,10 +95,7 @@ ...@@ -95,10 +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},'%')
...@@ -118,6 +115,8 @@ ...@@ -118,6 +115,8 @@
<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>
......
...@@ -97,7 +97,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> { ...@@ -97,7 +97,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
public RestResponse 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);
...@@ -111,7 +111,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> { ...@@ -111,7 +111,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
String filePath = uploadPath + realFileRelPath; String filePath = uploadPath + realFileRelPath;
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(filePath); return ObjectRestResponse.succ(filePath);
} }
......
package com.xxfc.platform.app.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
@Configuration
public class FileUploadConfig {
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
// 单个数据大小
factory.setMaxFileSize("51200KB");
/// 总上传数据大小
factory.setMaxRequestSize("51200KB");
return factory.createMultipartConfig();
}
}
package com.xxfc.platform.app.rest; package com.xxfc.platform.app.rest;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.constant.AppFormat;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
...@@ -17,6 +18,7 @@ import com.xxfc.platform.vehicle.constant.ResCode.ResCode; ...@@ -17,6 +18,7 @@ import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
...@@ -36,6 +38,7 @@ import java.util.List; ...@@ -36,6 +38,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("version") @RequestMapping("version")
@IgnoreClientToken @IgnoreClientToken
@Slf4j
public class AppVersionController extends BaseController<AppVersionBiz,AppVersion> { public class AppVersionController extends BaseController<AppVersionBiz,AppVersion> {
//最大上传500MB //最大上传500MB
private Long MAX_DRIVING_LICENSE_SIZE =1024*1024*500L; private Long MAX_DRIVING_LICENSE_SIZE =1024*1024*500L;
...@@ -68,7 +71,7 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -68,7 +71,7 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
} }
@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));
...@@ -82,7 +85,7 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -82,7 +85,7 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@Override @Override
@ApiOperation("修改") @ApiOperation("修改")
@RequestMapping(value = "/background/update/{id}",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>();
...@@ -99,17 +102,17 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -99,17 +102,17 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@PostMapping(value = "/upload/installationPackage") @PostMapping(value = "/upload/installationPackage")
@ApiOperation(value = "上传app安装包") @ApiOperation(value = "上传app安装包")
public RestResponse uploadInstallationPackage(@RequestParam("file") MultipartFile file) public ObjectRestResponse uploadInstallationPackage(@RequestParam("file") MultipartFile file)
throws Exception { throws Exception {
Assert.notNull(file); Assert.notNull(file);
String contentType = file.getContentType(); //文件类型 //文件类型
//// String fileName = file.getOriginalFilename(); //文件名 String contentType = file.getContentType();
if (!contentType.equals("apk") && !contentType.equals("ipa")) { log.debug("contentType"+contentType);
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode()); //判断上传的文件格式
} if (!judgeFormat(contentType)||file.getSize() > MAX_DRIVING_LICENSE_SIZE) {
if (file.getSize() > MAX_DRIVING_LICENSE_SIZE) { return ObjectRestResponse.createDefaultFail();
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} }
return baseBiz.uploadDrivingLicense(file); return baseBiz.uploadDrivingLicense(file);
} }
...@@ -123,4 +126,21 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio ...@@ -123,4 +126,21 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
return baseBiz.downloadInstallationPackage(realFileRelPath); return baseBiz.downloadInstallationPackage(realFileRelPath);
} }
/**
* 判断上传的文件格式
* @param contentType
* @return
*/
private boolean judgeFormat(String contentType){
if (AppFormat.getFormatSet().size()==0) {
return true;
}
for (String format : AppFormat.getFormatSet()) {
if (format.equals(contentType)) {
return true;
}
}
return false;
}
} }
\ No newline at end of file
servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到1MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
max-request-size: 50MB
# 设置单个文件的最大长度
max-file-size: 50MB
\ No newline at end of file
...@@ -14,7 +14,7 @@ public class CCPRestSmsUtils { ...@@ -14,7 +14,7 @@ public class CCPRestSmsUtils {
restAPI.init("app.cloopen.com", "8883"); restAPI.init("app.cloopen.com", "8883");
restAPI.setAccount("8aaf070865e6b6eb0165ecd776700559", restAPI.setAccount("8aaf070865e6b6eb0165ecd776700559",
"3fe5e2f053674f23b029a9a9fc9503f0"); "3fe5e2f053674f23b029a9a9fc9503f0");
restAPI.setAppId("8a216da86812593601684bec10581ab5"); restAPI.setAppId("8a216da86bfdbeb5016c0d2543670a06");
} }
public static Map<String, Object> sendTemplateSMS(String phoneNumbers, String[] params, String templateId) { public static Map<String, Object> sendTemplateSMS(String phoneNumbers, String[] params, String templateId) {
......
...@@ -10,21 +10,21 @@ import org.springframework.stereotype.Service; ...@@ -10,21 +10,21 @@ import org.springframework.stereotype.Service;
public class CCPRestSmsBiz{ public class CCPRestSmsBiz{
//租车订单通知(普通用户)1 //租车订单通知(普通用户)1
public static final String TEMPLATE_ID_ORDER = "457270"; public static final String TEMPLATE_ID_ORDER = "458626";
//租车订单短信(会员权益)2 //租车订单短信(会员权益)2
public static final String TEMPLATE_ID_ORDER_MEMBER = "457271"; public static final String TEMPLATE_ID_ORDER_MEMBER = "458625";
//旅游订单短信3 //旅游订单短信3
public static final String TEMPLATE_ID_ORDER_TOUR = "457272"; public static final String TEMPLATE_ID_ORDER_TOUR = "458624";
//加入会员通知4 //加入会员通知4
public static final String TEMPLATE_ID_MEMBER = "457273"; public static final String TEMPLATE_ID_MEMBER = "458623";
//租/还车公司相同(订单支付后立即发送给相关负责人)5 //租/还车公司相同(订单支付后立即发送给相关负责人)5
public static final String TEMPLATE_ID_TAAKE_CAR = "457501"; public static final String TEMPLATE_ID_TAAKE_CAR = "458622";
//租/还车公司不同(发给租车公司负责人,订单支付后发送)6 //租/还车公司不同(发给租车公司负责人,订单支付后发送)6
public static final String TEMPLATE_ID_DIFFERENT_TAAKE_CAR = "457502"; public static final String TEMPLATE_ID_DIFFERENT_TAAKE_CAR = "458621";
// 租/还车公司不同(发给还车公司负责人,订单出车后发))(相同不发)7 // 租/还车公司不同(发给还车公司负责人,订单出车后发))(相同不发)7
public static final String TEMPLATE_ID_ALSO_CAR = "457503"; public static final String TEMPLATE_ID_ALSO_CAR = "458620";
//取消订单8 //取消订单8
public static final String TEMPLATE_ID_CANCEL = "457506"; public static final String TEMPLATE_ID_CANCEL = "458627";
//发送模板消息 //发送模板消息
......
...@@ -4,4 +4,14 @@ logging: ...@@ -4,4 +4,14 @@ logging:
com.xxfc.platform.universal: com.xxfc.platform.universal:
debug debug
com.xxfc.platform.common: com.xxfc.platform.common:
debug debug
\ No newline at end of file servlet:
multipart:
# 启用上传处理,默认是true
enabled: true
# 当上传文件达到1MB的时候进行磁盘写入
file-size-threshold: 20MB
# 设置最大的请求文件的大小
max-request-size: 50MB
# 设置单个文件的最大长度
max-file-size: 50MB
\ No newline at end of file
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