Merge remote-tracking branch 'origin/test' into dev
This commit is contained in:
@@ -28,18 +28,29 @@ public class TbVersionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@Log("版本管理 新增")
|
||||||
@ApiOperation("新增版本")
|
@ApiOperation("新增版本")
|
||||||
public ResponseEntity<Object> createTbVersion(@Validated @RequestBody TbVersion resources){
|
public ResponseEntity<Object> createTbVersion(@Validated @RequestBody TbVersion resources){
|
||||||
return new ResponseEntity<>(tbVersionService.create(resources),HttpStatus.CREATED);
|
return new ResponseEntity<>(tbVersionService.create(resources),HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
@Log("版本管理 修改")
|
||||||
@ApiOperation("修改版本")
|
@ApiOperation("修改版本")
|
||||||
public ResponseEntity<Object> updateTbVersion(@Validated @RequestBody TbVersion resources){
|
public ResponseEntity<Object> updateTbVersion(@Validated @RequestBody TbVersion resources){
|
||||||
tbVersionService.update(resources);
|
tbVersionService.update(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("upSel")
|
||||||
|
@Log("版本管理 修改选中")
|
||||||
|
@ApiOperation("修改当前选中")
|
||||||
|
public ResponseEntity<Object> updateSel(@Validated @RequestBody TbVersion resources){
|
||||||
|
tbVersionService.updateSel(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@ApiOperation("删除版本")
|
@ApiOperation("删除版本")
|
||||||
public ResponseEntity<Object> deleteTbVersion(@RequestBody Integer[] ids) {
|
public ResponseEntity<Object> deleteTbVersion(@RequestBody Integer[] ids) {
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class TbPlaceController {
|
|||||||
public ResponseEntity<Object> createOrder(
|
public ResponseEntity<Object> createOrder(
|
||||||
@RequestBody CreateOrderDTO createOrderDTO
|
@RequestBody CreateOrderDTO createOrderDTO
|
||||||
) {
|
) {
|
||||||
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, true));
|
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, !createOrderDTO.isPostPay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@AnonymousAccess
|
@AnonymousAccess
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package cn.ysk.cashier.controller.shop;
|
package cn.ysk.cashier.controller.shop;
|
||||||
|
|
||||||
|
import cn.ysk.cashier.exception.BadRequestException;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbShopExtend;
|
import cn.ysk.cashier.mybatis.entity.TbShopExtend;
|
||||||
import cn.ysk.cashier.mybatis.service.TbShopExtendService;
|
import cn.ysk.cashier.mybatis.service.TbShopExtendService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -51,8 +53,11 @@ public class TbShopExtendController {
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation("通过id修改")
|
@ApiOperation("通过id修改")
|
||||||
public ResponseEntity<Object> update(@RequestBody TbShopExtend tbShopExtend) {
|
public ResponseEntity<Object> update(@RequestBody TbShopExtend tbShopExtend) {
|
||||||
tbShopExtend.setUpdateTime(new Date());
|
if (tbShopExtend.getId() != null) {
|
||||||
tbShopExtendService.updateById(tbShopExtend);
|
tbShopExtendService.updateById(tbShopExtend);
|
||||||
|
} else {
|
||||||
|
tbShopExtendService.saveInfo(tbShopExtend);
|
||||||
|
}
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class TbVersionDto implements Serializable {
|
|||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
/** LDBL_APP;WX; */
|
/** PC;APP; */
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
/** ios;android; */
|
/** ios;android; */
|
||||||
@@ -22,9 +22,12 @@ public class TbVersionDto implements Serializable {
|
|||||||
|
|
||||||
/** 版本号 */
|
/** 版本号 */
|
||||||
private String version;
|
private String version;
|
||||||
|
/** 下载地址 */
|
||||||
|
private String url;
|
||||||
|
|
||||||
/** 0:不更新;1:更新 */
|
/** 是否强制更新 0:否 1:是 */
|
||||||
private Integer isUp;
|
private Integer isUp;
|
||||||
|
private Integer sel;
|
||||||
|
|
||||||
/** 更新提示内容 */
|
/** 更新提示内容 */
|
||||||
private String message;
|
private String message;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import lombok.Data;
|
|||||||
public class TbVersionQueryCriteria{
|
public class TbVersionQueryCriteria{
|
||||||
|
|
||||||
@Query
|
@Query
|
||||||
/** LDBL-APP;WX; */
|
/** PC;APP; */
|
||||||
private String source;
|
private String source;
|
||||||
@Query
|
@Query
|
||||||
/** ios;android; */
|
/** ios;android; */
|
||||||
@@ -21,7 +21,7 @@ public class TbVersionQueryCriteria{
|
|||||||
/** 版本号 */
|
/** 版本号 */
|
||||||
private String version;
|
private String version;
|
||||||
@Query
|
@Query
|
||||||
/** 0:不更新;1:更新 */
|
/** 是否强制更新 0:否 1:是*/
|
||||||
private Integer isUp;
|
private Integer isUp;
|
||||||
|
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ import javax.persistence.Id;
|
|||||||
public class StockCountDTO {
|
public class StockCountDTO {
|
||||||
private String shopId;
|
private String shopId;
|
||||||
@Id
|
@Id
|
||||||
|
private Long skuId;
|
||||||
private Long proId;
|
private Long proId;
|
||||||
private String proName;
|
private String proName;
|
||||||
private Integer isStock;
|
private Integer isStock;
|
||||||
private String skuName;
|
private String skuName;
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
// 消耗数
|
||||||
private Integer stockCount;
|
private Integer stockCount;
|
||||||
|
// 当前库存
|
||||||
private Integer stockNumber;
|
private Integer stockNumber;
|
||||||
private String specSnap;
|
private String specSnap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,5 @@ public class AddCartDTO {
|
|||||||
private Integer num;
|
private Integer num;
|
||||||
private boolean isPack;
|
private boolean isPack;
|
||||||
private boolean isGift;
|
private boolean isGift;
|
||||||
|
private Integer cartId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class CreateOrderDTO {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private Long tableId;
|
private String tableId;
|
||||||
private String note;
|
private String note;
|
||||||
private boolean postPay;
|
private boolean postPay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package cn.ysk.cashier.dto.shoptable;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -13,4 +15,8 @@ public class PayDTO {
|
|||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String payType;
|
private String payType;
|
||||||
|
@Min(0)
|
||||||
|
@Max(1)
|
||||||
|
private Double discount;
|
||||||
|
private Integer vipUserId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class PendingDTO {
|
|||||||
private String masterId;
|
private String masterId;
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
private Long tableId;
|
private String tableId;
|
||||||
private Integer vipUserId;
|
private Integer vipUserId;
|
||||||
@NotNull
|
@NotNull
|
||||||
private Boolean isPending;
|
private Boolean isPending;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package cn.ysk.cashier.mybatis.entity;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,6 +25,7 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||||||
private String autokey;
|
private String autokey;
|
||||||
//值
|
//值
|
||||||
private String value;
|
private String value;
|
||||||
|
private String detail;
|
||||||
//更新时间
|
//更新时间
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
//创建时间
|
//创建时间
|
||||||
@@ -93,5 +95,47 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||||||
public void setCreateTime(Date createTime) {
|
public void setCreateTime(Date createTime) {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDetail() {
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetail(String detail) {
|
||||||
|
this.detail = detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* index_bg:店铺首页背景图
|
||||||
|
* my_bg: 我的页面背景图
|
||||||
|
* member_bg:会员卡页面背景图
|
||||||
|
* shopinfo_bg:商品列表顶部背景图
|
||||||
|
* @param autokey
|
||||||
|
*/
|
||||||
|
public void initAutoKey(String autokey,Integer shopId) {
|
||||||
|
if (StringUtils.isBlank(name)) {
|
||||||
|
switch (autokey) {
|
||||||
|
case "index_bg":
|
||||||
|
this.name = "店铺首页背景图";
|
||||||
|
this.detail="建议尺寸: 375*600 ";
|
||||||
|
break;
|
||||||
|
case "my_bg":
|
||||||
|
this.name = "我的页面背景图";
|
||||||
|
this.detail="建议尺寸: 375*200";
|
||||||
|
break;
|
||||||
|
case "member_bg":
|
||||||
|
this.name = "会员卡页面背景图";
|
||||||
|
this.detail="建议尺寸: 315*152";
|
||||||
|
break;
|
||||||
|
case "shopinfo_bg":
|
||||||
|
this.name = "商品列表顶部背景图";
|
||||||
|
this.detail="建议尺寸: 375*120";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.type="img";
|
||||||
|
this.shopId=shopId;
|
||||||
|
this.autokey = autokey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select;
|
|||||||
public interface ShopUserMapper extends BaseMapper<TbShopUser> {
|
public interface ShopUserMapper extends BaseMapper<TbShopUser> {
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
"SELECT su.id as id, su.head_img as headImg, su.name as nickName, su.sex as sex, " +
|
"SELECT su.id as id, su.user_id as user_id, su.head_img as headImg, su.name as nickName, su.sex as sex, " +
|
||||||
"su.amount as amount, 0 as totalScore, su.telephone as telephone, u.last_log_in_at as lastLoginAt, " +
|
"su.amount as amount, 0 as totalScore, su.telephone as telephone, u.last_log_in_at as lastLoginAt, " +
|
||||||
"su.birth_day as birthDay, su.is_vip as isVip, su.created_at as createAt " +
|
"su.birth_day as birthDay, su.is_vip as isVip, su.created_at as createAt " +
|
||||||
"FROM tb_shop_user su " +
|
"FROM tb_shop_user su " +
|
||||||
|
|||||||
@@ -2,13 +2,10 @@ package cn.ysk.cashier.mybatis.mapper;
|
|||||||
|
|
||||||
import cn.ysk.cashier.pojo.product.TbProductSku;
|
import cn.ysk.cashier.pojo.product.TbProductSku;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {
|
public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {
|
||||||
|
|
||||||
@@ -22,6 +19,9 @@ public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {
|
|||||||
@Update("update tb_product_sku set stock_number=stock_number+#{addNum} WHERE id=#{skuId}")
|
@Update("update tb_product_sku set stock_number=stock_number+#{addNum} WHERE id=#{skuId}")
|
||||||
int incrStock(@Param("skuId") Integer skuId, @Param("addNum") Integer addNum);
|
int incrStock(@Param("skuId") Integer skuId, @Param("addNum") Integer addNum);
|
||||||
|
|
||||||
|
@Update("update tb_product_sku set real_sales_number=real_sales_number+#{num} WHERE id=#{skuId}")
|
||||||
|
int incrRealSalesNumber(@Param("skuId") Integer skuId, @Param("num") Integer num);
|
||||||
|
|
||||||
@Update("update tb_product_sku set stock_number=stock_number-#{num} WHERE id=#{id} and stock_number-#{num} >= 0")
|
@Update("update tb_product_sku set stock_number=stock_number-#{num} WHERE id=#{id} and stock_number-#{num} >= 0")
|
||||||
int decrStock(String id, int num);
|
int decrStock(String id, int num);
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import cn.ysk.cashier.utils.PageUtil;
|
import cn.ysk.cashier.utils.PageUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺扩展信息(TbShopExtend)表服务实现类
|
* 店铺扩展信息(TbShopExtend)表服务实现类
|
||||||
@@ -40,6 +41,7 @@ public class TbShopExtendServiceImpl extends ServiceImpl<TbShopExtendMapper, TbS
|
|||||||
}
|
}
|
||||||
wrapper.orderByDesc("create_time");
|
wrapper.orderByDesc("create_time");
|
||||||
Page<TbShopExtend> ipage = tbShopExtendmapper.selectPage(page, wrapper);
|
Page<TbShopExtend> ipage = tbShopExtendmapper.selectPage(page, wrapper);
|
||||||
|
checkAndInitialize(ipage,criteria.getShopId());
|
||||||
return PageUtil.toPage(ipage.getRecords(), ipage.getTotal());
|
return PageUtil.toPage(ipage.getRecords(), ipage.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,5 +55,43 @@ public class TbShopExtendServiceImpl extends ServiceImpl<TbShopExtendMapper, TbS
|
|||||||
}
|
}
|
||||||
tbShopExtendmapper.insert(tbShopExtend);
|
tbShopExtendmapper.insert(tbShopExtend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<TbShopExtend> checkAndInitialize(Page<TbShopExtend> ipage, Integer shopId) {
|
||||||
|
List<TbShopExtend> newRecords = new ArrayList<>();
|
||||||
|
List<String> requiredAutokeys = Arrays.asList("index_bg", "my_bg", "member_bg", "shopinfo_bg");
|
||||||
|
|
||||||
|
if (ipage == null || ipage.getRecords() == null || ipage.getRecords().isEmpty()) {
|
||||||
|
// ipage 为空,直接创建包含四种类型数据的新 Page 对象
|
||||||
|
for (String key : requiredAutokeys) {
|
||||||
|
TbShopExtend newRecord = new TbShopExtend();
|
||||||
|
newRecord.initAutoKey(key, shopId);
|
||||||
|
newRecords.add(newRecord);
|
||||||
|
}
|
||||||
|
return new Page<TbShopExtend>(1, newRecords.size(), newRecords.size()) // pageNum, pageSize, total
|
||||||
|
.setRecords(newRecords);
|
||||||
|
} else {
|
||||||
|
// ipage 不为空,补充缺失的数据
|
||||||
|
List<TbShopExtend> shopExtends = ipage.getRecords();
|
||||||
|
Set<String> existingAutokeys = shopExtends.stream()
|
||||||
|
.map(TbShopExtend::getAutokey)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
List<String> missingAutokeys = requiredAutokeys.stream()
|
||||||
|
.filter(key -> !existingAutokeys.contains(key))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (String key : missingAutokeys) {
|
||||||
|
TbShopExtend newRecord = new TbShopExtend();
|
||||||
|
newRecord.initAutoKey(key, shopId);
|
||||||
|
newRecords.add(newRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新现有记录并将新记录添加到原来的列表中
|
||||||
|
shopExtends.addAll(newRecords);
|
||||||
|
|
||||||
|
return new Page<TbShopExtend>(ipage.getCurrent(), ipage.getSize(), ipage.getTotal() + newRecords.size())
|
||||||
|
.setRecords(shopExtends);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class TbVersion implements Serializable {
|
|||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@Column(name = "`source`")
|
@Column(name = "`source`")
|
||||||
@ApiModelProperty(value = "LDBL-APP;WX;")
|
@ApiModelProperty(value = "PC;APP;")
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
@Column(name = "`type`")
|
@Column(name = "`type`")
|
||||||
@@ -30,10 +30,17 @@ public class TbVersion implements Serializable {
|
|||||||
@ApiModelProperty(value = "版本号")
|
@ApiModelProperty(value = "版本号")
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
|
@Column(name = "`url`")
|
||||||
|
@ApiModelProperty(value = "下载地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
@Column(name = "`is_up`")
|
@Column(name = "`is_up`")
|
||||||
@ApiModelProperty(value = "0:不更新;1:更新")
|
@ApiModelProperty(value = "是否强制更新 0:否 1:是")
|
||||||
private Integer isUp;
|
private Integer isUp;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选中 0:否 1:是")
|
||||||
|
private Integer sel;
|
||||||
|
|
||||||
@Column(name = "`message`")
|
@Column(name = "`message`")
|
||||||
@ApiModelProperty(value = "更新提示内容")
|
@ApiModelProperty(value = "更新提示内容")
|
||||||
private String message;
|
private String message;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.ysk.cashier.pojo.TbVersion;
|
|||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,4 +16,15 @@ public interface TbVersionRepository extends JpaRepository<TbVersion, Integer>,
|
|||||||
|
|
||||||
@Query("SELECT count(1) FROM TbVersion WHERE source = :source AND type =:type AND version =:version")
|
@Query("SELECT count(1) FROM TbVersion WHERE source = :source AND type =:type AND version =:version")
|
||||||
int isExist(@Param("source") String source, @Param("type") String type, @Param("version") String version);
|
int isExist(@Param("source") String source, @Param("type") String type, @Param("version") String version);
|
||||||
|
|
||||||
|
@Query("SELECT count(1) FROM TbVersion WHERE source = :source AND version =:version")
|
||||||
|
int isExist(@Param("source") String source, @Param("version") String version);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("update TbVersion version set version.sel=CASE" +
|
||||||
|
" WHEN version.source=:source AND version.id=:id THEN 1 " +
|
||||||
|
" WHEN version.source=:source AND version.id!=:id THEN 0 " +
|
||||||
|
" ELSE version.sel END " +
|
||||||
|
" WHERE version.source = :source")
|
||||||
|
int updateSelBySource(@Param("source") String source, @Param("id") Integer id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ public interface StockCountRepository extends JpaRepository<StockCountDTO, Integ
|
|||||||
List<StockCountDTO> countStock( @Param("startTime") String startTime, @Param("endTime") String endTime);
|
List<StockCountDTO> countStock( @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
@Query(value = "SELECT\n" +
|
@Query(value = "SELECT\n" +
|
||||||
"pro.shop_id AS shop_id,\n" +
|
"info.shop_id AS shop_id,\n" +
|
||||||
"pro.id AS pro_id,\n" +
|
"info.product_id AS pro_id,\n" +
|
||||||
"info.product_name AS pro_name,\n" +
|
"info.product_name AS pro_name,\n" +
|
||||||
|
"info.product_sku_id AS sku_id,\n" +
|
||||||
"pro.is_stock,\n" +
|
"pro.is_stock,\n" +
|
||||||
"info.product_sku_name AS sku_name,\n" +
|
"info.product_sku_name AS sku_name,\n" +
|
||||||
"unit.NAME AS unit_name,\n" +
|
"unit.NAME AS unit_name,\n" +
|
||||||
@@ -57,11 +58,6 @@ public interface StockCountRepository extends JpaRepository<StockCountDTO, Integ
|
|||||||
"AND ( info.STATUS = 'closed' OR info.STATUS = 'refund' ) \n" +
|
"AND ( info.STATUS = 'closed' OR info.STATUS = 'refund' ) \n" +
|
||||||
"GROUP BY\n" +
|
"GROUP BY\n" +
|
||||||
"info.product_id,\n" +
|
"info.product_id,\n" +
|
||||||
"pro.shop_id,\n" +
|
"info.product_sku_id;",nativeQuery = true)
|
||||||
"pro.id,\n" +
|
|
||||||
"info.product_name,\n" +
|
|
||||||
"pro.is_stock,\n" +
|
|
||||||
"info.product_sku_name,\n" +
|
|
||||||
"unit.NAME;",nativeQuery = true)
|
|
||||||
List<StockCountDTO> countStockById(Integer orderId);
|
List<StockCountDTO> countStockById(Integer orderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
public interface TbPayService {
|
public interface TbPayService {
|
||||||
void scanPay(ScanPayDTO scanPayDTO);
|
void scanPay(ScanPayDTO scanPayDTO);
|
||||||
|
|
||||||
TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId);
|
TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId, Double discount, Integer vipUserId);
|
||||||
|
|
||||||
TbOrderInfo cashPay(PayDTO payDTO);
|
TbOrderInfo cashPay(PayDTO payDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ public interface TbVersionService {
|
|||||||
*/
|
*/
|
||||||
void update(TbVersion resources);
|
void update(TbVersion resources);
|
||||||
|
|
||||||
|
void updateSel(TbVersion resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
* @param ids /
|
* @param ids /
|
||||||
|
|||||||
@@ -21,13 +21,14 @@ import cn.ysk.cashier.repository.shop.TbMerchantThirdApplyRepository;
|
|||||||
import cn.ysk.cashier.service.TbPayService;
|
import cn.ysk.cashier.service.TbPayService;
|
||||||
import cn.ysk.cashier.utils.RabbitMsgUtils;
|
import cn.ysk.cashier.utils.RabbitMsgUtils;
|
||||||
import cn.ysk.cashier.utils.SnowFlakeUtil;
|
import cn.ysk.cashier.utils.SnowFlakeUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -297,7 +298,7 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
private final TbShopUserFlowMapper shopUserFlowMapper;
|
private final TbShopUserFlowMapper shopUserFlowMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId) {
|
public TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId, Double discount, Integer vipUserId) {
|
||||||
|
|
||||||
TbOrderInfo orderInfo = orderInfoMapper.selectById(orderId);
|
TbOrderInfo orderInfo = orderInfoMapper.selectById(orderId);
|
||||||
|
|
||||||
@@ -309,6 +310,9 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
throw new BadRequestException("订单非未支付状态");
|
throw new BadRequestException("订单非未支付状态");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vipUserId != null) {
|
||||||
|
orderInfo.setUserId(String.valueOf(vipUserId));
|
||||||
|
}
|
||||||
|
|
||||||
// 扣减会员余额
|
// 扣减会员余额
|
||||||
TbShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbShopUser>()
|
TbShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbShopUser>()
|
||||||
@@ -319,22 +323,29 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
throw new BadRequestException("用户不存在或已被禁用");
|
throw new BadRequestException("用户不存在或已被禁用");
|
||||||
}
|
}
|
||||||
|
|
||||||
long flag = shopUserMapper.decrBalance(Integer.valueOf(orderInfo.getUserId()), orderInfo.getOrderAmount());
|
BigDecimal payMount = discount == null ? orderInfo.getOrderAmount() : orderInfo.getOrderAmount().multiply(BigDecimal.valueOf(discount)).setScale(2, RoundingMode.UP);
|
||||||
|
|
||||||
|
long flag = shopUserMapper.decrBalance(Integer.valueOf(orderInfo.getUserId()), payMount);
|
||||||
if (flag < 1) {
|
if (flag < 1) {
|
||||||
throw new BadRequestException("余额不足或扣除余额失败");
|
throw new BadRequestException("余额不足或扣除余额失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
TbShopUserFlow userFlow = new TbShopUserFlow();
|
TbShopUserFlow userFlow = new TbShopUserFlow();
|
||||||
userFlow.setAmount(orderInfo.getOrderAmount());
|
userFlow.setAmount(payMount);
|
||||||
userFlow.setBalance(shopUser.getAmount());
|
userFlow.setBalance(shopUser.getAmount());
|
||||||
userFlow.setShopUserId(shopUser.getId());
|
userFlow.setShopUserId(shopUser.getId());
|
||||||
userFlow.setBizCode("vipCardCash");
|
userFlow.setBizCode("vipCardCash");
|
||||||
userFlow.setBizName("代客下单会员余额支付");
|
userFlow.setBizName("余额支付");
|
||||||
userFlow.setCreateTime(DateUtil.date());
|
userFlow.setCreateTime(DateUtil.date());
|
||||||
userFlow.setType("-");
|
userFlow.setType("-");
|
||||||
shopUserFlowMapper.insert(userFlow);
|
shopUserFlowMapper.insert(userFlow);
|
||||||
|
|
||||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
orderInfo.setPayAmount(payMount);
|
||||||
|
if (discount != null && discount != 1) {
|
||||||
|
orderInfo.setDiscountAmount(orderInfo.getOrderAmount().subtract(orderInfo.getPayAmount()));
|
||||||
|
orderInfo.setDiscountRatio(BigDecimal.valueOf(discount));
|
||||||
|
}
|
||||||
|
|
||||||
orderInfo.setPayType("cash");
|
orderInfo.setPayType("cash");
|
||||||
orderInfo.setStatus("closed");
|
orderInfo.setStatus("closed");
|
||||||
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
||||||
@@ -373,7 +384,12 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
// return Result.fail(CodeEnum.PAYTYPENOEXIST);
|
// return Result.fail(CodeEnum.PAYTYPENOEXIST);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
orderInfo.setPayAmount(payDTO.getDiscount() == null ? orderInfo.getOrderAmount() : orderInfo.getOrderAmount()
|
||||||
|
.multiply(BigDecimal.valueOf(payDTO.getDiscount())).setScale(2, RoundingMode.UP));
|
||||||
|
if (payDTO.getDiscount() != null && payDTO.getDiscount() != 1) {
|
||||||
|
orderInfo.setDiscountAmount(orderInfo.getOrderAmount().subtract(orderInfo.getPayAmount()));
|
||||||
|
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
||||||
|
}
|
||||||
orderInfo.setPayType("cash");
|
orderInfo.setPayType("cash");
|
||||||
orderInfo.setStatus("closed");
|
orderInfo.setStatus("closed");
|
||||||
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ import cn.ysk.cashier.mapper.TbVersionMapper;
|
|||||||
import cn.ysk.cashier.pojo.TbVersion;
|
import cn.ysk.cashier.pojo.TbVersion;
|
||||||
import cn.ysk.cashier.repository.TbVersionRepository;
|
import cn.ysk.cashier.repository.TbVersionRepository;
|
||||||
import cn.ysk.cashier.service.TbVersionService;
|
import cn.ysk.cashier.service.TbVersionService;
|
||||||
import cn.ysk.cashier.utils.PageUtil;
|
import cn.ysk.cashier.utils.*;
|
||||||
import cn.ysk.cashier.utils.QueryHelp;
|
|
||||||
import cn.ysk.cashier.utils.RedisUtils;
|
|
||||||
import cn.ysk.cashier.utils.ValidationUtil;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
@@ -61,17 +58,17 @@ public class TbVersionServiceImpl implements TbVersionService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public TbVersionDto create(TbVersion resources) {
|
public TbVersionDto create(TbVersion resources) {
|
||||||
int exist = tbVersionRepository.isExist(resources.getSource(), resources.getType(), resources.getVersion());
|
int exist = tbVersionRepository.isExist(resources.getSource(), resources.getVersion());
|
||||||
if (exist > 0) {
|
if (exist > 0) {
|
||||||
throw new BadRequestException("该版本已存在。");
|
throw new BadRequestException("该版本已存在。");
|
||||||
}
|
}
|
||||||
resources.setCreatedAt(Instant.now().toEpochMilli());
|
resources.setCreatedAt(Instant.now().toEpochMilli());
|
||||||
TbVersionDto dto = tbVersionMapper.toDto(tbVersionRepository.save(resources));
|
TbVersionDto dto = tbVersionMapper.toDto(tbVersionRepository.save(resources));
|
||||||
if (dto.getIsUp() == 1) {
|
// if (dto.getIsUp() == 1) {
|
||||||
//产品标识:型号:版本
|
// //产品标识:型号:版本
|
||||||
//LDBL_APP_VERSION:ios:version 存在即需要强制更新
|
// //VERSION:PC::version 存在即需要强制更新
|
||||||
redisUtils.set(dto.getSource() + "_VERSION:" + dto.getType() + ":" + dto.getVersion(), dto.getMessage());
|
// redisUtils.set(CacheKey.VERSION + dto.getSource() + ":" + dto.getVersion(), dto);
|
||||||
}
|
// }
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,17 +77,23 @@ public class TbVersionServiceImpl implements TbVersionService {
|
|||||||
public void update(TbVersion resources) {
|
public void update(TbVersion resources) {
|
||||||
TbVersion tbVersion = tbVersionRepository.findById(resources.getId()).orElseGet(TbVersion::new);
|
TbVersion tbVersion = tbVersionRepository.findById(resources.getId()).orElseGet(TbVersion::new);
|
||||||
ValidationUtil.isNull(tbVersion.getId(), "TbVersion", "id", resources.getId());
|
ValidationUtil.isNull(tbVersion.getId(), "TbVersion", "id", resources.getId());
|
||||||
redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
// redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
||||||
tbVersion.copy(resources);
|
tbVersion.copy(resources);
|
||||||
tbVersion.setUpdatedAt(Instant.now().toEpochMilli());
|
tbVersion.setUpdatedAt(Instant.now().toEpochMilli());
|
||||||
tbVersionRepository.save(tbVersion);
|
tbVersionRepository.save(tbVersion);
|
||||||
if (resources.getIsUp() == 1) {
|
// if (resources.getIsUp() == 1) {
|
||||||
//产品标识:型号:版本
|
// //产品标识:型号:版本
|
||||||
//LDBL_APP_VERSION:ios:version 存在即需要强制更新
|
// //LDBL_APP_VERSION:ios:version 存在即需要强制更新
|
||||||
redisUtils.set(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion(), tbVersion.getMessage());
|
// redisUtils.set(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion(), tbVersion.getMessage());
|
||||||
} else {
|
// } else {
|
||||||
redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
// redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateSel(TbVersion resources) {
|
||||||
|
tbVersionRepository.updateSelBySource(resources.getSource(),resources.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -99,9 +102,9 @@ public class TbVersionServiceImpl implements TbVersionService {
|
|||||||
TbVersion tbVersion = tbVersionRepository.findById(id).orElseGet(TbVersion::new);
|
TbVersion tbVersion = tbVersionRepository.findById(id).orElseGet(TbVersion::new);
|
||||||
ValidationUtil.isNull(tbVersion.getId(), "TbVersion", "id", id);
|
ValidationUtil.isNull(tbVersion.getId(), "TbVersion", "id", id);
|
||||||
tbVersionRepository.deleteById(id);
|
tbVersionRepository.deleteById(id);
|
||||||
if (tbVersion.getIsUp() == 1) {
|
// if (tbVersion.getIsUp() == 1) {
|
||||||
redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
// redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TbProduct> tbProductPage = productMapper.selectPage(page1, queryWrapper);
|
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TbProduct> tbProductPage = productMapper.selectPage(page1, queryWrapper);
|
||||||
tbProductPage.getRecords().stream().parallel().forEach(item -> {
|
tbProductPage.getRecords().forEach(item -> {
|
||||||
TbProductSkuResult skuResult = productSkuResultRepository.findById(item.getId()).orElse(null);
|
TbProductSkuResult skuResult = productSkuResultRepository.findById(item.getId()).orElse(null);
|
||||||
List<TbProductSku> tbProductSkus = producSkutMapper.selectList(new LambdaQueryWrapper<TbProductSku>().eq(TbProductSku::getIsDel, 0)
|
List<TbProductSku> tbProductSkus = producSkutMapper.selectList(new LambdaQueryWrapper<TbProductSku>().eq(TbProductSku::getIsDel, 0)
|
||||||
.eq(TbProductSku::getIsPauseSale, 0)
|
.eq(TbProductSku::getIsPauseSale, 0)
|
||||||
@@ -811,4 +811,8 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
current.remove(current.size() - 1); // 回溯
|
current.remove(current.size() - 1); // 回溯
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package cn.ysk.cashier.service.impl.productimpl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.dto.product.StockCountDTO;
|
import cn.ysk.cashier.dto.product.StockCountDTO;
|
||||||
import cn.ysk.cashier.dto.rabbit.StockRecordMsg;
|
import cn.ysk.cashier.mybatis.mapper.TbProducSkutMapper;
|
||||||
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
||||||
import cn.ysk.cashier.pojo.product.TbProductStockDetail;
|
import cn.ysk.cashier.pojo.product.TbProductStockDetail;
|
||||||
import cn.ysk.cashier.repository.order.StockCountRepository;
|
import cn.ysk.cashier.repository.order.StockCountRepository;
|
||||||
@@ -60,6 +60,7 @@ public class TbProductStockDetailServiceImpl implements TbProductStockDetailServ
|
|||||||
private final StockCountRepository stockCountRepository;
|
private final StockCountRepository stockCountRepository;
|
||||||
private final EntityManager entityManager;
|
private final EntityManager entityManager;
|
||||||
private final TbOrderInfoRepository tbOrderInfoRepository;
|
private final TbOrderInfoRepository tbOrderInfoRepository;
|
||||||
|
private final TbProducSkutMapper skutMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -203,7 +204,7 @@ public class TbProductStockDetailServiceImpl implements TbProductStockDetailServ
|
|||||||
productStockDetail.setSubType(-1);
|
productStockDetail.setSubType(-1);
|
||||||
tbProductStockDetailRepository.save(productStockDetail);
|
tbProductStockDetailRepository.save(productStockDetail);
|
||||||
}
|
}
|
||||||
|
skutMapper.incrRealSalesNumber(s.getSkuId().intValue(),s.getStockCount());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,6 +330,11 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
.eq(TbCashierCart::getMasterId, "");
|
.eq(TbCashierCart::getMasterId, "");
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (addCartDTO.getCartId() != null) {
|
||||||
|
query.eq(TbCashierCart::getId, addCartDTO.getCartId());
|
||||||
|
}
|
||||||
|
|
||||||
TbCashierCart tbCashierCart = cashierCartMapper.selectOne(query);
|
TbCashierCart tbCashierCart = cashierCartMapper.selectOne(query);
|
||||||
// 首次加入
|
// 首次加入
|
||||||
if (tbCashierCart == null) {
|
if (tbCashierCart == null) {
|
||||||
@@ -901,19 +906,23 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
// 后付费,不增加当前台桌取餐号
|
// 后付费,不增加当前台桌取餐号
|
||||||
if (createOrderDTO.isPostPay()) {
|
if (createOrderDTO.isPostPay()) {
|
||||||
// addGlobalCode(day, "pc", String.valueOf(createOrderDTO.getShopId()));
|
addGlobalCode(day, "pc", String.valueOf(createOrderDTO.getShopId()));
|
||||||
String key = "SHOP:CODE:USER:pc" + ":" + createOrderDTO.getShopId() + ":" + day + ":" + orderInfo.getTableId();
|
// String key = "SHOP:CODE:USER:pc" + ":" + createOrderDTO.getShopId() + ":" + day + ":" + orderInfo.getTableId();
|
||||||
redisTemplate.delete(key);
|
// redisTemplate.delete(key);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (!createOrderDTO.isPostPay() || addMaterId){
|
||||||
String key = "SHOP:CODE:USER:pc" + ":" + createOrderDTO.getShopId() + ":" + day + ":" + orderInfo.getTableId();
|
String key = "SHOP:CODE:USER:pc" + ":" + createOrderDTO.getShopId() + ":" + day + ":" + orderInfo.getTableId();
|
||||||
redisTemplate.delete(key);
|
redisTemplate.delete(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 推送耗材信息
|
// 推送耗材信息
|
||||||
pushConsMsg(orderInfo, cashierCarts);
|
pushConsMsg(orderInfo, cashierCarts);
|
||||||
|
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
|
||||||
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
|
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()));
|
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()));
|
||||||
|
|
||||||
@@ -1020,6 +1029,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
|
|
||||||
rabbitMsgUtils.printTicket(String.valueOf(orderId));
|
rabbitMsgUtils.printTicket(String.valueOf(orderId));
|
||||||
}
|
}
|
||||||
|
|
||||||
return orderInfoMapper.selectById(orderId);
|
return orderInfoMapper.selectById(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1078,7 +1088,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
TbOrderInfo orderInfo = null;
|
TbOrderInfo orderInfo = null;
|
||||||
switch (payDTO.getPayType()) {
|
switch (payDTO.getPayType()) {
|
||||||
case "vipPay":
|
case "vipPay":
|
||||||
orderInfo = tbPayServiceImpl.vipPay(payDTO.getShopId(), payDTO.getOrderId());
|
orderInfo = tbPayServiceImpl.vipPay(payDTO.getShopId(), payDTO.getOrderId(), payDTO.getDiscount(), payDTO.getVipUserId());
|
||||||
break;
|
break;
|
||||||
case "cash":
|
case "cash":
|
||||||
orderInfo = tbPayServiceImpl.cashPay(payDTO);
|
orderInfo = tbPayServiceImpl.cashPay(payDTO);
|
||||||
@@ -1096,9 +1106,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
|
|
||||||
// 打印消息
|
// 打印消息
|
||||||
rabbitMsgUtils.sendOrderCollectMsg(jsonObject);
|
rabbitMsgUtils.sendOrderCollectMsg(jsonObject);
|
||||||
if (StrUtil.isBlank(orderInfo.getUseType()) || orderInfo.getUseType().equals("afterPay")) {
|
|
||||||
rabbitMsgUtils.printTicket(String.valueOf(orderInfo.getId()));
|
rabbitMsgUtils.printTicket(String.valueOf(orderInfo.getId()));
|
||||||
}
|
|
||||||
|
|
||||||
// 发送库存记录mq消息
|
// 发送库存记录mq消息
|
||||||
JSONObject mqData = new JSONObject();
|
JSONObject mqData = new JSONObject();
|
||||||
|
|||||||
@@ -73,10 +73,15 @@ public class TbShopUserServiceImpl implements TbShopUserService {
|
|||||||
shopUserInfoVo.setTotalScore(0);
|
shopUserInfoVo.setTotalScore(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Integer orderNumber=tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getId().toString(),criteria.getShopId());
|
|
||||||
shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber)?0:orderNumber);
|
|
||||||
shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId()));
|
|
||||||
|
|
||||||
|
if (shopUserInfoVo.getUserId() == null) {
|
||||||
|
shopUserInfoVo.setUserId(0);
|
||||||
|
shopUserInfoVo.setOrderNumber(0);
|
||||||
|
} else {
|
||||||
|
Integer orderNumber = tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getUserId().toString(), criteria.getShopId());
|
||||||
|
shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber) ? 0 : orderNumber);
|
||||||
|
}
|
||||||
|
shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return PageUtil.toPlusPage(iPage.getRecords(), Integer.valueOf(iPage.getTotal() + ""));
|
return PageUtil.toPlusPage(iPage.getRecords(), Integer.valueOf(iPage.getTotal() + ""));
|
||||||
@@ -209,7 +214,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TbShopUser tbShopUser = tbShopUserRepository.getById(Integer.valueOf(map.get("id") + ""));
|
TbShopUser tbShopUser = tbShopUserRepository.getById(Integer.valueOf(map.get("id") + ""));
|
||||||
if (ObjectUtil.isNull(tbShopUser)) {
|
if (ObjectUtil.isNull(tbShopUser)) {
|
||||||
throw new BadRequestException("不存在的会员信息");
|
throw new BadRequestException("不存在的会员信息");
|
||||||
@@ -224,7 +228,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String type = map.get("type").toString();
|
String type = map.get("type").toString();
|
||||||
TbShopUserFlow flow = new TbShopUserFlow();
|
TbShopUserFlow flow = new TbShopUserFlow();
|
||||||
|
|
||||||
@@ -234,8 +237,8 @@ public class TbShopUserServiceImpl implements TbShopUserService {
|
|||||||
flow.setBizCode("inMoney".equals(type) ? "inMoneyIn" : "consumeIn");
|
flow.setBizCode("inMoney".equals(type) ? "inMoneyIn" : "consumeIn");
|
||||||
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
|
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
|
||||||
} else if ("out".equals(operationType)) {
|
} else if ("out".equals(operationType)) {
|
||||||
flow.setBizName("inMoney".equals(type)?"充值退款":"消费");
|
flow.setBizName("inMoneyOut".equals(type) ? "充值退款" : "消费");
|
||||||
flow.setBizCode("inMoney".equals(type)?"inMoneyOut":"consumeOut");
|
flow.setBizCode("inMoneyOut".equals(type) ? "inMoneyOut" : "consumeOut");
|
||||||
flow.setType("-");
|
flow.setType("-");
|
||||||
tbShopUser.setAmount(tbShopUser.getAmount().subtract(amount));
|
tbShopUser.setAmount(tbShopUser.getAmount().subtract(amount));
|
||||||
} else {
|
} else {
|
||||||
@@ -254,8 +257,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
|
|||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.math.BigDecimal;
|
|||||||
@Data
|
@Data
|
||||||
public class ShopUserInfoVo implements Serializable {
|
public class ShopUserInfoVo implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
private Integer userId;
|
||||||
private String headImg;
|
private String headImg;
|
||||||
private String nickName;
|
private String nickName;
|
||||||
private Object sex;
|
private Object sex;
|
||||||
|
|||||||
@@ -1,73 +1,65 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration scan="false" debug="false">
|
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||||
|
<contextName>elAdmin</contextName>
|
||||||
<!-- 日志存放路径, 读取application.yml 需要使用springProperty获取 -->
|
<property name="log.charset" value="utf-8" />
|
||||||
<springProperty scope="context" name="currentLoggerFilePath" source="logging.file.path"/>
|
<property name="log.pattern" value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %msg%n" />
|
||||||
|
<!--写入文件格式-->
|
||||||
<!-- 主日志级别配置 -->
|
<property name="p_file" value="%d | [%thread] %-5level %c [%L] - %msg %n"/>
|
||||||
<springProperty scope="context" name="currentRootLevel" source="logging.level.root"/>
|
<!--输出到控制台-->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<!-- 项目配置, 如修改包名,请搜索并全部替换掉 -->
|
<encoder>
|
||||||
<springProperty scope="context" name="currentProjectLevel" source="logging.level.com.jeequan.jeepay"/>
|
<pattern>${log.pattern}</pattern>
|
||||||
|
<charset>${log.charset}</charset>
|
||||||
<!-- 日志文件名称 logback属性 -->
|
</encoder>
|
||||||
<property name="currentLoggerFileName" value="pay" />
|
</appender>
|
||||||
<!-- 日志格式, 参考:https://logback.qos.ch/manual/layouts.html -->
|
<!--按天生成日志-->
|
||||||
<property name="currentLoggerPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n" />
|
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${user.dir}/logback.log</file>
|
||||||
<!-- appender: 控制台日志 -->
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<!--生成日志文件名称-->
|
||||||
<encoder charset="UTF-8" >
|
<FileNamePattern>${user.dir}/logs/cashierAdmin/%d{yyyy-MM-dd}.log.gz</FileNamePattern>
|
||||||
<pattern>${currentLoggerPattern}</pattern>
|
<!--日志文件保留天数-->
|
||||||
|
<MaxHistory>15</MaxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<pattern>${p_file}</pattern>
|
||||||
|
<charset>${log.charset}</charset>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- appender:主日志文件 -->
|
<!--普通日志输出到控制台-->
|
||||||
<appender name="ALL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<root level="info">
|
||||||
<!-- 日志文件路径及文件名 -->
|
<appender-ref ref="console" />
|
||||||
<file>${currentLoggerFilePath}/${currentLoggerFileName}.all.log</file>
|
<appender-ref ref="logFile"/>
|
||||||
<!-- 内容编码及格式 -->
|
|
||||||
<encoder charset="UTF-8" ><pattern>${currentLoggerPattern}</pattern></encoder>
|
|
||||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 每天日志归档路径以及格式 -->
|
|
||||||
<fileNamePattern>${currentLoggerFilePath}/${currentLoggerFileName}.all.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<maxHistory>5</maxHistory> <!--日志文件保留天数-->
|
|
||||||
</rollingPolicy>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- appender:错误信息日志文件 -->
|
|
||||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<!-- 日志文件路径及文件名 -->
|
|
||||||
<file>${currentLoggerFilePath}/${currentLoggerFileName}.error.log</file>
|
|
||||||
<!-- 内容编码及格式 -->
|
|
||||||
<encoder charset="UTF-8" ><pattern>${currentLoggerPattern}</pattern></encoder>
|
|
||||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 每天日志归档路径以及格式 -->
|
|
||||||
<fileNamePattern>${currentLoggerFilePath}/${currentLoggerFileName}.error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<maxHistory>20</maxHistory> <!--日志文件保留天数-->
|
|
||||||
</rollingPolicy>
|
|
||||||
<!-- 此日志文件只记录ERROR级别的 -->
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 主日志级别配置 -->
|
|
||||||
<root level="${currentRootLevel}">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
<appender-ref ref="ALL_FILE" />
|
|
||||||
<appender-ref ref="ERROR_FILE" />
|
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
<!-- 项目日志级别配置 -->
|
<!--监控sql日志输出,如需监控 Sql 打印,请设置为 INFO -->
|
||||||
<logger name="cn.ysk.cashier" level="${currentProjectLevel}"/>
|
<logger name="jdbc.sqlonly" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
<logger name="org.hibernate.SQL" level="debug">
|
||||||
|
|
||||||
<logger name="org.apache.hc.client5.http.wire" level="info"/>
|
</logger>
|
||||||
|
|
||||||
<logger name="org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager" level="info" />
|
<logger name="jdbc.resultset" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 如想看到表格数据,将OFF改为INFO -->
|
||||||
|
<logger name="jdbc.resultsettable" level="OFF" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="jdbc.connection" level="OFF" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="jdbc.sqltiming" level="OFF" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="jdbc.audit" level="OFF" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -77,7 +77,7 @@ public class QiniuController {
|
|||||||
return new ResponseEntity<>(qiNiuService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(qiNiuService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Log("上传文件")
|
@Log("上传版本文件")
|
||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
@AnonymousPostMapping
|
@AnonymousPostMapping
|
||||||
public ResponseEntity<Object> uploadQiNiu(@RequestParam MultipartFile file){
|
public ResponseEntity<Object> uploadQiNiu(@RequestParam MultipartFile file){
|
||||||
@@ -89,6 +89,15 @@ public class QiniuController {
|
|||||||
return new ResponseEntity<>(map,HttpStatus.OK);
|
return new ResponseEntity<>(map,HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("上传PC版本文件")
|
||||||
|
@AnonymousPostMapping("uploadVersionFile")
|
||||||
|
public ResponseEntity<Object> uploadVersionFile(@RequestParam MultipartFile file,@RequestParam String name){
|
||||||
|
String url = qiNiuService.uploadVersionFile(file,qiNiuService.findCloud(),name);
|
||||||
|
Map<String,Object> map = new HashMap<>(1);
|
||||||
|
map.put("data",url);
|
||||||
|
return new ResponseEntity<>(map,HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("上传文件")
|
// @Log("上传文件")
|
||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ public interface QiNiuService {
|
|||||||
*/
|
*/
|
||||||
List<QiniuContent> queryAll(QiniuQueryCriteria criteria);
|
List<QiniuContent> queryAll(QiniuQueryCriteria criteria);
|
||||||
|
|
||||||
|
String uploadVersionFile(MultipartFile file, CloudStorageConfig qiniuConfig,String fileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
* @param file 文件
|
* @param file 文件
|
||||||
|
|||||||
@@ -115,6 +115,22 @@ public class QiNiuServiceImpl implements QiNiuService {
|
|||||||
return qiniuContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
|
return qiniuContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String uploadVersionFile(MultipartFile file, CloudStorageConfig qiniuConfig,String fileName) {
|
||||||
|
if(qiniuConfig== null){
|
||||||
|
throw new BadRequestException("请先添加相应配置,再操作");
|
||||||
|
}
|
||||||
|
// 构造一个带指定Zone对象的配置类
|
||||||
|
try {
|
||||||
|
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
||||||
|
|
||||||
|
return OSSFactory.build(qiniuConfig).uploadFileName(file.getBytes(), extension,fileName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BadRequestException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public QiniuContent upload(MultipartFile file, CloudStorageConfig qiniuConfig) {
|
public QiniuContent upload(MultipartFile file, CloudStorageConfig qiniuConfig) {
|
||||||
|
|||||||
@@ -43,6 +43,25 @@ public abstract class AbstractCloudStorageService {
|
|||||||
return path + "." + suffix;
|
return path + "." + suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
* @param prefix 前缀
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @param suffix 后缀
|
||||||
|
* @return 返回上传路径
|
||||||
|
*/
|
||||||
|
public String getPath(String prefix,String suffix, String fileName) {
|
||||||
|
//文件路径
|
||||||
|
// String path = DateUtils.getDays() + "/" + fileName;
|
||||||
|
String path = "version/" + fileName;
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(prefix)){
|
||||||
|
path = prefix + "/" + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return path + "." + suffix;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传
|
* 文件上传
|
||||||
* @param data 文件字节数组
|
* @param data 文件字节数组
|
||||||
@@ -58,6 +77,7 @@ public abstract class AbstractCloudStorageService {
|
|||||||
* @return 返回http地址
|
* @return 返回http地址
|
||||||
*/
|
*/
|
||||||
public abstract String uploadSuffix(byte[] data, String suffix) throws Exception;
|
public abstract String uploadSuffix(byte[] data, String suffix) throws Exception;
|
||||||
|
public abstract String uploadFileName(byte[] data, String suffix,String fileName) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传
|
* 文件上传
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
|
|||||||
return upload(data, getPath(config.getPrefix(), suffix));
|
return upload(data, getPath(config.getPrefix(), suffix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String uploadFileName(byte[] data, String suffix,String fileName) throws Exception {
|
||||||
|
return upload(data, getPath(config.getPrefix(), suffix,fileName));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
||||||
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ public class HuaweiCloudStorageService extends AbstractCloudStorageService {
|
|||||||
return config.getUrl() + "/" + path;
|
return config.getUrl() + "/" + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String uploadFileName(byte[] data, String suffix,String fileName) throws Exception {
|
||||||
|
return upload(data, getPath(config.getPrefix(), suffix,fileName));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
||||||
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
||||||
|
|||||||
@@ -82,4 +82,9 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService {
|
|||||||
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
||||||
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String uploadFileName(byte[] data, String suffix,String fileName) throws Exception {
|
||||||
|
return upload(data, getPath(config.getPrefix(), suffix,fileName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -75,4 +75,9 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService {
|
|||||||
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
public String uploadSuffix(InputStream inputStream, String suffix) throws Exception {
|
||||||
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
return upload(inputStream, getPath(config.getPrefix(), suffix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String uploadFileName(byte[] data, String suffix,String fileName) throws Exception {
|
||||||
|
return upload(data, getPath(config.getPrefix(), suffix,fileName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user