master:更新档口的库存系统;
parent
2507940446
commit
c6f63454c8
|
|
@ -173,4 +173,11 @@ public class StoreController extends XktBaseController {
|
|||
return R.ok(BeanUtil.copyToList(storeService.indexTop10SaleCus(BeanUtil.toBean(saleCusTop10VO, StoreSaleCustomerTop10DTO.class)), StoreIndexCusSaleTop10ResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')")
|
||||
@ApiOperation(value = "更新档口库存系统", httpMethod = "PUT", response = R.class)
|
||||
@PutMapping(value = "/stock-sys")
|
||||
public R<Integer> updateStockSys(@Validated @RequestBody StoreUpdateStockSysVO stockSysVO) {
|
||||
return R.ok(storeService.updateStockSys(BeanUtil.toBean(stockSysVO, StoreUpdateStockSysDTO.class)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.store;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreUpdateStockSysVO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空")
|
||||
private Long storeId;
|
||||
@NotNull(message = "库存系统不能为空")
|
||||
@ApiModelProperty(value = "库存系统 2 天友 3 发货宝", required = true)
|
||||
private Integer stockSys;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.dto.store;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreUpdateStockSysDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "库存系统")
|
||||
private Integer stockSys;
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
package com.ruoyi.xkt.enums;
|
||||
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 推广营销风格类型
|
||||
* 库存系统枚举
|
||||
*
|
||||
* @author liujiang
|
||||
* @date 2025-04-02 23:42
|
||||
|
|
@ -32,7 +34,6 @@ public enum StockSysType {
|
|||
return e;
|
||||
}
|
||||
}
|
||||
// 默认库存
|
||||
return StockSysType.BU_JU;
|
||||
throw new ServiceException("库存系统枚举不存在!", HttpStatus.ERROR);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,4 +182,13 @@ public interface IStoreService {
|
|||
* @return
|
||||
*/
|
||||
Integer getStoreStatus(Long storeId);
|
||||
|
||||
/**
|
||||
* 更新档口库存系统
|
||||
*
|
||||
* @param stockSysDTO 更新入参
|
||||
* @return Integer
|
||||
*/
|
||||
Integer updateStockSys(StoreUpdateStockSysDTO stockSysDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.ruoyi.xkt.dto.store.*;
|
|||
import com.ruoyi.xkt.dto.storeCertificate.StoreCertDTO;
|
||||
import com.ruoyi.xkt.dto.storeCertificate.StoreCertResDTO;
|
||||
import com.ruoyi.xkt.enums.FileType;
|
||||
import com.ruoyi.xkt.enums.StockSysType;
|
||||
import com.ruoyi.xkt.enums.StoreStatus;
|
||||
import com.ruoyi.xkt.mapper.*;
|
||||
import com.ruoyi.xkt.service.IAssetService;
|
||||
|
|
@ -378,6 +379,17 @@ public class StoreServiceImpl implements IStoreService {
|
|||
return Optional.ofNullable(storeMapper.selectById(storeId)).map(Store::getStoreStatus).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer updateStockSys(StoreUpdateStockSysDTO stockSysDTO) {
|
||||
StockSysType.of(stockSysDTO.getStockSys());
|
||||
Store store = Optional.ofNullable(storeMapper.selectOne(new LambdaQueryWrapper<Store>()
|
||||
.eq(Store::getId, stockSysDTO.getStoreId()).eq(Store::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("档口不存在!", HttpStatus.ERROR));
|
||||
store.setStockSys(stockSysDTO.getStockSys());
|
||||
return this.storeMapper.updateById(store);
|
||||
}
|
||||
|
||||
/**
|
||||
* 档口首页今日销售额
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue