Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
SongZhang 2024-09-24 18:14:50 +08:00
commit 5e9d45520f
9 changed files with 27 additions and 10 deletions

View File

@ -29,6 +29,7 @@ public class AppApiMethodAspect {
"cn.ysk.cashier.controller.* " +
"|| cn.ysk.cashier.controller.*.* " +
"|| cn.ysk.cashier.mnt.rest.* " +
"|| cn.ysk.cashier.cons.rest.* " +
"|| cn.ysk.cashier.system.rest.* " +
"|| cn.ysk.cashier.config.security.rest.*" +
").*(..))")

View File

@ -7,6 +7,7 @@ import cn.ysk.cashier.cons.service.dto.ProskuInfo;
import cn.ysk.cashier.cons.service.dto.TbProskuConDtoV2;
import cn.ysk.cashier.cons.service.dto.TbProskuConQueryCriteria;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.utils.JSONUtil;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@ -60,7 +61,7 @@ public class TbProskuConController {
@PostMapping("V2")
@Log("新增商品耗材绑定关系")
@ApiOperation("新增商品耗材绑定关系")
public ResponseEntity<Object> upV2(@Validated @RequestBody TbProskuConDtoV2 resources) throws Exception {
public ResponseEntity<Object> upV2(@RequestBody TbProskuConDtoV2 resources) throws Exception {
try {
tbProskuConService.upV2(resources);
return new ResponseEntity<>(HttpStatus.CREATED);

View File

@ -38,6 +38,7 @@ public class TbProskuConDto implements Serializable {
private String status;
private BigDecimal lasterInStock;
private BigDecimal surplusStock;
/** 创建时间 */
private Timestamp createTime;

View File

@ -2,13 +2,11 @@ package cn.ysk.cashier.cons.service.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class TbProskuConDtoV2 {
@NotNull
private Integer productId;
List<TbProskuConDto> cons;
private List<TbProskuConDto> cons;
}

View File

@ -189,6 +189,9 @@ public class TbProskuConServiceImpl implements TbProskuConService {
//判断
for (TbProskuConDto resource : resources.getCons()) {
if (resource.getConInfoId() == null) {
continue;
}
TbConsInfo tbConsInfo = tbConsInfoRepository.findById(resource.getConInfoId()).orElseGet(TbConsInfo::new);
if (ObjectUtil.isNull(tbConsInfo) || ObjectUtil.isNull(tbConsInfo.getId())) {
throw new BadRequestException("对应的耗材信息不存在");
@ -200,7 +203,7 @@ public class TbProskuConServiceImpl implements TbProskuConService {
}
}
TbProskuCon tbConsInfo1 = new TbProskuCon();
BeanUtil.copyProperties(tbConsInfo1,resource, CopyOptions.create().setIgnoreNullValue(true));
BeanUtil.copyProperties(resource,tbConsInfo1, CopyOptions.create().setIgnoreNullValue(true));
newCons.add(tbConsInfo1);
}
if (!CollectionUtils.isEmpty(newCons)) {

View File

@ -241,7 +241,7 @@ public class SummaryServiceImpl implements SummaryService {
List<CountDateVO> numList = new ArrayList<>();
for (Object[] o : objects) {
CountDateVO countDateVO = new CountDateVO();
BigInteger integers = (BigInteger) o[1];
BigInteger integers = (BigInteger) o[0];
countDateVO.setCount(new BigDecimal(integers.toString()));
Date date = (Date) o[2];
countDateVO.setTradeDay(date.toString());

View File

@ -255,15 +255,22 @@ public class TbProductServiceImpl implements TbProductService {
BigDecimal maxPrice = tbProductSkus.stream().map(TbProductSku::getSalePrice).max(BigDecimal::compareTo).get();
productNewVo.setLowPrice("" +productNewVo.getLowPrice() + "~¥" + maxPrice);
}
if(product.getTypeEnum().equals("sku")){
//规格填充
productNewVo.setSkuList(convert(tbProductSkus));
}
ViewConSku viewConSku = new ViewConSku();
viewConSku.setShopId(Integer.valueOf(product.getShopId()));
viewConSku.setProductId(product.getId());
Example<ViewConSku> query = Example.of(viewConSku);
List<ViewConSku> skuCons = viewConSkuRepository.findAll(query);
if(product.getTypeEnum().equals("sku")){
//规格填充
productNewVo.setSkuList(convert(tbProductSkus));
//耗材弹窗选项
if (!CollectionUtils.isEmpty(skuCons)) {
Integer productSkuId = skuCons.get(0).getProductSkuId();
if (productSkuId != 0) {//添加至商品
productNewVo.setIsSaveSku(2);
}
}
}
productNewVo.setConInfos(CollectionUtils.isEmpty(skuCons)?Arrays.asList():skuCons);
products.add(productNewVo);
}

View File

@ -127,6 +127,10 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
@Override
@Transactional(rollbackFor = Exception.class)
public TbShopInfoDto create(TbShopInfoDto resources) {
if(StringUtils.isBlank(resources.getShopName())){
throw new BadRequestException("店铺名称不可为空");
}
resources.setShopName(resources.getShopName().trim());
if ("release".equals(resources.getProfiles())){
if (resources.getRegisterCode() == null){
throw new BadRequestException("未绑定激活码");

View File

@ -44,6 +44,8 @@ public class TbProductNewVo {
//退款是否退回库存
private Integer isRefundStock = 1;
private Integer isSaveSku = 1;
//库存警戒线
private Integer warnLine = 0;