新增规格逻辑修改,新增激活码到期时间,激活码时间校验
This commit is contained in:
parent
45d9319811
commit
55ca50ad1b
|
|
@ -63,6 +63,13 @@ public class TbShopPayTypeController {
|
|||
return new ResponseEntity<>(tbShopPayTypeService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Log("新增/merchant/system/paytype")
|
||||
@ApiOperation("新增/merchant/system/paytype")
|
||||
public ResponseEntity<Object> TbShopPayTypeInfo(@PathVariable Integer id){
|
||||
return new ResponseEntity<>(tbShopPayTypeService.findById(id),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改/merchant/system/paytype")
|
||||
@ApiOperation("修改/merchant/system/paytype")
|
||||
|
|
|
|||
|
|
@ -56,14 +56,13 @@ public class TbShopInfoController {
|
|||
@Log("查询/shop/list")
|
||||
@ApiOperation("查询/shop/list")
|
||||
@PreAuthorize("@el.check('tbShopInfo:list')")
|
||||
public ResponseEntity<Object> queryTbShopInfo(TbShopInfoQueryCriteria criteria, Pageable pageable){
|
||||
public ResponseEntity<Object> queryTbShopInfo(TbShopInfoQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbShopInfoService.queryAll(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{shopId}")
|
||||
@Log("查询/shop/list")
|
||||
@ApiOperation("查询/shop/list")
|
||||
@PreAuthorize("@el.check('tbShopInfo:info')")
|
||||
public Object queryInfo(@PathVariable("shopId") Integer shopId){
|
||||
return tbShopInfoService.findById(shopId);
|
||||
}
|
||||
|
|
@ -79,7 +78,6 @@ public class TbShopInfoController {
|
|||
@PutMapping
|
||||
@Log("修改/shop/list")
|
||||
@ApiOperation("修改/shop/list")
|
||||
@PreAuthorize("@el.check('tbShopInfo:edit')")
|
||||
public ResponseEntity<Object> updateTbShopInfo(@Validated @RequestBody TbShopInfo resources){
|
||||
tbShopInfoService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class TbProductDto implements Serializable {
|
|||
private BigDecimal lowPrice;
|
||||
|
||||
/** 单位Id */
|
||||
private String unitId;
|
||||
private Integer unitId;
|
||||
|
||||
/** 商品封面图 */
|
||||
private String coverImg;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class TbProduct implements Serializable {
|
|||
|
||||
@Column(name = "`unit_id`")
|
||||
@ApiModelProperty(value = "单位Id")
|
||||
private String unitId;
|
||||
private Integer unitId;
|
||||
|
||||
@Column(name = "`cover_img`")
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package cn.ysk.cashier.repository.product;
|
|||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -34,5 +35,6 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
|
|||
List<TbProduct> findByIds(List<Integer> productIds);
|
||||
|
||||
@Query(value = "update tb_product set status = -1 where id in :productIds",nativeQuery = true)
|
||||
Integer updateByStatus(List<Integer> productIds);
|
||||
@Modifying
|
||||
void updateByStatus(List<Integer> productIds);
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||
//记录单位id
|
||||
if (product.getUnitId() != null){
|
||||
if (!"".equals(product.getUnitId())){
|
||||
unitId.add(Integer.valueOf(product.getUnitId().trim()));
|
||||
unitId.add(product.getUnitId());
|
||||
}
|
||||
}
|
||||
//记录规格id
|
||||
|
|
@ -241,7 +241,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||
ListUtil.JSONArrayChangeString(resources.getGroupSnap());
|
||||
}
|
||||
if (resources.getUnitId() != null){
|
||||
product.setUnitId(String.valueOf(resources.getUnitId()));
|
||||
product.setUnitId(resources.getUnitId());
|
||||
}
|
||||
//套餐内容
|
||||
if (!resources.getGroupSnap().isEmpty()){
|
||||
|
|
@ -290,7 +290,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||
product.setStatus(1);
|
||||
product.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
product.setCategoryId(resources.getCategoryId().toString());
|
||||
|
||||
product.setImages(resources.getImages().toString());
|
||||
if (!resources.getGroupSnap().isEmpty()){
|
||||
ListUtil.JSONArrayChangeString(resources.getGroupSnap());
|
||||
}
|
||||
|
|
@ -311,6 +311,15 @@ public class TbProductServiceImpl implements TbProductService {
|
|||
tbProductSkuRepository.saveAll(skuList);
|
||||
|
||||
}
|
||||
//保存到sku_result
|
||||
if ("sku".equals(resources.getTypeEnum())){
|
||||
TbProductSkuResult productSkuResult = new TbProductSkuResult();
|
||||
productSkuResult.setCreatedAt(Instant.now().toEpochMilli());
|
||||
productSkuResult.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
productSkuResult.setTagSnap(resources.getSkuSnap());
|
||||
productSkuResult.setId(save.getId());
|
||||
tbProductSkuResultRepository.save(productSkuResult);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
|||
BeanUtils.copyProperties(resources,tbShopInfo);
|
||||
tbShopInfo.setCreatedAt(Instant.now().toEpochMilli());
|
||||
tbShopInfo.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
tbShopInfo.setOnSale(1);
|
||||
//激活码
|
||||
TbMerchantRegister tbMerchantRegister = new TbMerchantRegister();
|
||||
if (resources.getRegisterCode() != null){
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class TbProductVo {
|
|||
private BigDecimal lowPrice;
|
||||
|
||||
|
||||
private String unitId;
|
||||
private Integer unitId;
|
||||
|
||||
|
||||
private String coverImg;
|
||||
|
|
|
|||
Loading…
Reference in New Issue