master:入库单新增、列表等功能添加;
parent
f6418632f1
commit
a98ad764e9
|
|
@ -102,8 +102,8 @@ public class StoreCustomerController extends XktBaseController {
|
|||
@PreAuthorize("@ss.hasPermi('system:customer:list')")
|
||||
@ApiOperation(value = "查询档口客户列表", httpMethod = "GET", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public Page selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
|
||||
return storeCusService.selectPage(BeanUtil.toBean(pageVO, StoreCusPageDTO.class));
|
||||
public R<Page> selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
|
||||
return R.ok(storeCusService.selectPage(BeanUtil.toBean(pageVO, StoreCusPageDTO.class)));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,22 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount.StoreCusProdDiscountVO;
|
||||
import com.ruoyi.xkt.domain.StoreCustomerProductDiscount;
|
||||
import com.ruoyi.xkt.dto.storeCusProdDiscount.StoreCusProdDiscountDTO;
|
||||
import com.ruoyi.xkt.service.IStoreCustomerProductDiscountService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -21,11 +28,31 @@ import java.util.List;
|
|||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Api(tags = "档口客户优惠")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rest/v1/cus-discounts")
|
||||
public class StoreCustomerProductDiscountController extends XktBaseController {
|
||||
@Autowired
|
||||
private IStoreCustomerProductDiscountService storeCustomerProductDiscountService;
|
||||
|
||||
final IStoreCustomerProductDiscountService storeCusProdDiscountSvc;
|
||||
|
||||
/**
|
||||
* 销售出库时,新增或修改档口客户优惠
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
@ApiOperation(value = "销售出库时,新增或修改档口客户优惠", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "销售出库时,新增或修改档口客户优惠", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Integer> edit(@Validated @RequestBody StoreCusProdDiscountVO cusProdDisVO) {
|
||||
return R.ok(storeCusProdDiscountSvc.updateStoreCusProdDiscount(BeanUtil.toBean(cusProdDisVO, StoreCusProdDiscountDTO.class)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口客户优惠列表
|
||||
|
|
@ -34,7 +61,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
startPage();
|
||||
List<StoreCustomerProductDiscount> list = storeCustomerProductDiscountService.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
List<StoreCustomerProductDiscount> list = storeCusProdDiscountSvc.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -45,7 +72,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
@Log(title = "档口客户优惠", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
List<StoreCustomerProductDiscount> list = storeCustomerProductDiscountService.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
List<StoreCustomerProductDiscount> list = storeCusProdDiscountSvc.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
ExcelUtil<StoreCustomerProductDiscount> util = new ExcelUtil<StoreCustomerProductDiscount>(StoreCustomerProductDiscount.class);
|
||||
util.exportExcel(response, list, "档口客户优惠数据");
|
||||
}
|
||||
|
|
@ -56,7 +83,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
@PreAuthorize("@ss.hasPermi('system:discount:query')")
|
||||
@GetMapping(value = "/{storeCusProdDiscId}")
|
||||
public R getInfo(@PathVariable("storeCusProdDiscId") Long storeCusProdDiscId) {
|
||||
return success(storeCustomerProductDiscountService.selectStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId));
|
||||
return success(storeCusProdDiscountSvc.selectStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,18 +93,10 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
@Log(title = "档口客户优惠", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R add(@RequestBody StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
return success(storeCustomerProductDiscountService.insertStoreCustomerProductDiscount(storeCustomerProductDiscount));
|
||||
return success(storeCusProdDiscountSvc.insertStoreCustomerProductDiscount(storeCustomerProductDiscount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口客户优惠
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
@Log(title = "档口客户优惠", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R edit(@RequestBody StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
return success(storeCustomerProductDiscountService.updateStoreCustomerProductDiscount(storeCustomerProductDiscount));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除档口客户优惠
|
||||
|
|
@ -86,6 +105,6 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
@Log(title = "档口客户优惠", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeCusProdDiscIds}")
|
||||
public R remove(@PathVariable Long[] storeCusProdDiscIds) {
|
||||
return success(storeCustomerProductDiscountService.deleteStoreCustomerProductDiscountByStoreCusProdDiscIds(storeCusProdDiscIds));
|
||||
return success(storeCusProdDiscountSvc.deleteStoreCustomerProductDiscountByStoreCusProdDiscIds(storeCusProdDiscIds));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.ruoyi.web.controller.xkt.vo.storeProd.*;
|
|||
import com.ruoyi.xkt.domain.StoreProduct;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdPageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdPageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdStatusDTO;
|
||||
import com.ruoyi.xkt.service.IStoreProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -55,8 +56,8 @@ public class StoreProductController extends XktBaseController {
|
|||
@PreAuthorize("@ss.hasPermi('system:product:list')")
|
||||
@ApiOperation(value = "查询档口商品列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public Page page(@Validated @RequestBody StoreProdPageVO pageVO) {
|
||||
return storeProdService.page(BeanUtil.toBean(pageVO, StoreProdPageDTO.class));
|
||||
public R<Page<StoreProdPageResDTO>> page(@Validated @RequestBody StoreProdPageVO pageVO) {
|
||||
return R.ok(storeProdService.page(BeanUtil.toBean(pageVO, StoreProdPageDTO.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ public class StoreProductDemandController extends XktBaseController {
|
|||
@Autowired
|
||||
private IStoreProductDemandService storeProductDemandService;
|
||||
|
||||
|
||||
// TODO 入库单判断需求单是否存在
|
||||
// TODO 入库单判断需求单是否存在
|
||||
// TODO 入库单判断需求单是否存在
|
||||
// TODO 入库单判断需求单是否存在
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口商品需求单列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ public class StoreProductStockController extends XktBaseController {
|
|||
// TODO 销售出库时扣件库存
|
||||
|
||||
|
||||
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口商品库存列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,15 +1,30 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProd.StoreProdPageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdStorage.StoreProdStoragePageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdStorage.StoreProdStorageResVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdStorage.StoreProdStorageVO;
|
||||
import com.ruoyi.xkt.domain.StoreProductStorage;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdPageDTO;
|
||||
import com.ruoyi.xkt.service.IStoreProductStorageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -21,11 +36,78 @@ import java.util.List;
|
|||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Api(tags = "档口商品入库")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rest/v1/prod-storages")
|
||||
public class StoreProductStorageController extends XktBaseController {
|
||||
@Autowired
|
||||
private IStoreProductStorageService storeProductStorageService;
|
||||
|
||||
final IStoreProductStorageService storeProdStorageService;
|
||||
|
||||
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
// TODO 新增入款单库存会变化
|
||||
|
||||
|
||||
// TODO 撤销入款单库存会变化
|
||||
// TODO 撤销入款单库存会变化
|
||||
// TODO 撤销入款单库存会变化
|
||||
|
||||
|
||||
// TODO 需求抵扣明细没做
|
||||
// TODO 需求抵扣明细没做
|
||||
// TODO 需求抵扣明细没做
|
||||
// TODO 需求抵扣明细没做
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增档口商品入库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:add')")
|
||||
@ApiOperation(value = "新增档口商品入库", httpMethod = "POST", response = R.class)
|
||||
@Log(title = "新增档口商品入库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Integer> add(@Validated @RequestBody StoreProdStorageVO storeProdStorageVO) {
|
||||
return R.ok(storeProdStorageService.create(BeanUtil.toBean(storeProdStorageVO, StoreProdStorageDTO.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询档口商品入库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:product:list')")
|
||||
@ApiOperation(value = "查询档口商品入库列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<StoreProdStoragePageResDTO>> page(@Validated @RequestBody StoreProdStoragePageVO pageVO) {
|
||||
return R.ok(storeProdStorageService.page(BeanUtil.toBean(pageVO, StoreProdStoragePageDTO.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档口商品入库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:query')")
|
||||
@ApiOperation(value = "获取档口商品入库详细信息", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/{storeProdStorId}")
|
||||
public R<StoreProdStorageResVO> getInfo(@PathVariable("storeProdStorId") Long storeProdStorId) {
|
||||
return R.ok(BeanUtil.toBean(storeProdStorageService.selectByStoreProdStorId(storeProdStorId), StoreProdStorageResVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销档口商品入库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:remove')")
|
||||
@ApiOperation(value = "撤销档口商品入库", httpMethod = "DELETE", response = R.class)
|
||||
@Log(title = "撤销档口商品入库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeProdStorId}")
|
||||
public R remove(@PathVariable Long storeProdStorId) {
|
||||
return R.ok(storeProdStorageService.deleteByStoreProdStorId(storeProdStorId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口商品入库列表
|
||||
|
|
@ -34,7 +116,7 @@ public class StoreProductStorageController extends XktBaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(StoreProductStorage storeProductStorage) {
|
||||
startPage();
|
||||
List<StoreProductStorage> list = storeProductStorageService.selectStoreProductStorageList(storeProductStorage);
|
||||
List<StoreProductStorage> list = storeProdStorageService.selectStoreProductStorageList(storeProductStorage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -45,29 +127,14 @@ public class StoreProductStorageController extends XktBaseController {
|
|||
@Log(title = "档口商品入库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, StoreProductStorage storeProductStorage) {
|
||||
List<StoreProductStorage> list = storeProductStorageService.selectStoreProductStorageList(storeProductStorage);
|
||||
List<StoreProductStorage> list = storeProdStorageService.selectStoreProductStorageList(storeProductStorage);
|
||||
ExcelUtil<StoreProductStorage> util = new ExcelUtil<StoreProductStorage>(StoreProductStorage.class);
|
||||
util.exportExcel(response, list, "档口商品入库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档口商品入库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:query')")
|
||||
@GetMapping(value = "/{storeProdStorId}")
|
||||
public R getInfo(@PathVariable("storeProdStorId") Long storeProdStorId) {
|
||||
return success(storeProductStorageService.selectStoreProductStorageByStoreProdStorId(storeProdStorId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品入库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:add')")
|
||||
@Log(title = "档口商品入库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R add(@RequestBody StoreProductStorage storeProductStorage) {
|
||||
return success(storeProductStorageService.insertStoreProductStorage(storeProductStorage));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改档口商品入库
|
||||
|
|
@ -76,16 +143,9 @@ public class StoreProductStorageController extends XktBaseController {
|
|||
@Log(title = "档口商品入库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R edit(@RequestBody StoreProductStorage storeProductStorage) {
|
||||
return success(storeProductStorageService.updateStoreProductStorage(storeProductStorage));
|
||||
return success(storeProdStorageService.updateStoreProductStorage(storeProductStorage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档口商品入库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:storage:remove')")
|
||||
@Log(title = "档口商品入库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeProdStorIds}")
|
||||
public R remove(@PathVariable Long[] storeProdStorIds) {
|
||||
return success(storeProductStorageService.deleteStoreProductStorageByStoreProdStorIds(storeProdStorIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口客户优惠")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusProdDiscountVO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
@NotBlank(message = "客户名称不能为空!")
|
||||
@ApiModelProperty(name = "客户名称")
|
||||
private String storeCusName;
|
||||
@ApiModelProperty(name = "客户联系电话")
|
||||
private String phone;
|
||||
@NotNull(message = "优惠金额不能为空!")
|
||||
@ApiModelProperty(name = "优惠金额")
|
||||
private BigDecimal discount;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.web.controller.xkt.vo.BasePageVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("档口商品入库分页查询入参")
|
||||
@Data
|
||||
public class StoreProdStoragePageVO extends BasePageVO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@ApiModelProperty(name = "销售开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date createTimeStart;
|
||||
@ApiModelProperty(name = "销售结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date createTimeEnd;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品入库详情")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Accessors(chain = true)
|
||||
public class StoreProdStorageResVO {
|
||||
|
||||
@ApiModelProperty(name = "storeProdStorId")
|
||||
@JsonProperty("storeProdStorId")
|
||||
private Long id;
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "单据编号")
|
||||
private String code;
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@ApiModelProperty(name = "数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(name = "生产成本金额")
|
||||
private BigDecimal produceAmount;
|
||||
@ApiModelProperty(name = "操作人名称")
|
||||
private String operatorName;
|
||||
@ApiModelProperty(name = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(name = "商品入库明细列表")
|
||||
private List<StorageDetailVO> detailList;
|
||||
|
||||
@Data
|
||||
public static class StorageDetailVO {
|
||||
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(name = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(name = "尺码30")
|
||||
private Integer size30;
|
||||
@ApiModelProperty(name = "尺码31")
|
||||
private Integer size31;
|
||||
@ApiModelProperty(name = "尺码32")
|
||||
private Integer size32;
|
||||
@ApiModelProperty(name = "尺码33")
|
||||
private Integer size33;
|
||||
@ApiModelProperty(name = "尺码34")
|
||||
private Integer size34;
|
||||
@ApiModelProperty(name = "尺码35")
|
||||
private Integer size35;
|
||||
@ApiModelProperty(name = "尺码36")
|
||||
private Integer size36;
|
||||
@ApiModelProperty(name = "尺码37")
|
||||
private Integer size37;
|
||||
@ApiModelProperty(name = "尺码38")
|
||||
private Integer size38;
|
||||
@ApiModelProperty(name = "尺码39")
|
||||
private Integer size39;
|
||||
@ApiModelProperty(name = "尺码40")
|
||||
private Integer size40;
|
||||
@ApiModelProperty(name = "尺码41")
|
||||
private Integer size41;
|
||||
@ApiModelProperty(name = "尺码42")
|
||||
private Integer size42;
|
||||
@ApiModelProperty(name = "尺码43")
|
||||
private Integer size43;
|
||||
@ApiModelProperty(name = "总数量")
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Max;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品入库")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdStorageVO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@NotBlank(message = "入库类型不能为空!")
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@Valid
|
||||
@NotNull(message = "商品入库明细列表不能为空!")
|
||||
@ApiModelProperty(name = "商品入库明细列表")
|
||||
private List<StorageDetailVO> detailList;
|
||||
|
||||
@Data
|
||||
public static class StorageDetailVO {
|
||||
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@NotNull(message = "档口商品颜色ID不能为空!")
|
||||
@ApiModelProperty(name = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(name = "颜色名称")
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品ID不能为空!")
|
||||
@ApiModelProperty(name = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码30")
|
||||
private Integer size30;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码31")
|
||||
private Integer size31;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码32")
|
||||
private Integer size32;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码33")
|
||||
private Integer size33;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码34")
|
||||
private Integer size34;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码35")
|
||||
private Integer size35;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码36")
|
||||
private Integer size36;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码37")
|
||||
private Integer size37;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码38")
|
||||
private Integer size38;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码39")
|
||||
private Integer size39;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码40")
|
||||
private Integer size40;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码41")
|
||||
private Integer size41;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码42")
|
||||
private Integer size42;
|
||||
@Min(value = 0, message = "商品数量不能小于0双!")
|
||||
@Max(value = 9999, message = "商品数量不能超过9999双!")
|
||||
@ApiModelProperty(name = "尺码43")
|
||||
private Integer size43;
|
||||
@ApiModelProperty(name = "总数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(name = "生产价格")
|
||||
private BigDecimal producePrice;
|
||||
@ApiModelProperty(name = "总的生产价格")
|
||||
private BigDecimal produceAmount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -75,18 +75,6 @@ public class XktBaseController {
|
|||
*/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
protected TableDataInfo getDataTable(List<?> list) {
|
||||
/*PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setPageNum(pageDomain.getPageNum());
|
||||
rspData.setPageSize(pageDomain.getPageSize());
|
||||
long total = new PageInfo(list).getTotal();
|
||||
rspData.setTotal(total);
|
||||
rspData.setPages((long) Math.ceil((double) total / pageDomain.getPageSize()));
|
||||
return rspData;*/
|
||||
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
|
|
@ -95,7 +83,6 @@ public class XktBaseController {
|
|||
System.err.println(pageInfo);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Excel;
|
|||
import com.ruoyi.common.core.domain.XktBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreCustomerProductDiscount extends XktBaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -26,7 +28,11 @@ public class StoreCustomerProductDiscount extends XktBaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 档口ID
|
||||
*/
|
||||
@Excel(name = "档口ID")
|
||||
private Long storeId;
|
||||
/**
|
||||
* 档口商品ID
|
||||
*/
|
||||
|
|
@ -38,6 +44,10 @@ public class StoreCustomerProductDiscount extends XktBaseEntity {
|
|||
*/
|
||||
@Excel(name = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
/**
|
||||
* 档口客户名称
|
||||
*/
|
||||
private String storeCusName;
|
||||
|
||||
/**
|
||||
* 档口商品颜色ID
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Excel;
|
|||
import com.ruoyi.common.core.domain.XktBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -18,7 +19,9 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreProductStorage extends XktBaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
@ -26,47 +29,48 @@ public class StoreProductStorage extends XktBaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 档口ID
|
||||
*/
|
||||
private Long storeId;
|
||||
/**
|
||||
* 入库CODE
|
||||
*/
|
||||
@Excel(name = "入库CODE")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 入库类型
|
||||
* 入库类型 生产入库 PROD_STORAGE 其它入库 OTHER_STORAGE 维修入库 REPAIR_STORAGE
|
||||
*/
|
||||
@Excel(name = "入库类型")
|
||||
private Long storageType;
|
||||
|
||||
private String storageType;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Excel(name = "数量")
|
||||
private Integer totalNum;
|
||||
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 生产成本金额
|
||||
*/
|
||||
@Excel(name = "生产成本金额")
|
||||
private BigDecimal totalProducePrice;
|
||||
|
||||
private BigDecimal produceAmount;
|
||||
/**
|
||||
* 入库状态
|
||||
* 操作人ID
|
||||
*/
|
||||
@Excel(name = "入库状态")
|
||||
private String storageStatus;
|
||||
|
||||
private Long operatorId;
|
||||
/**
|
||||
* 操作人名称
|
||||
*/
|
||||
private String operatorName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("storeId", getStoreId())
|
||||
.append("code", getCode())
|
||||
.append("storageType", getStorageType())
|
||||
.append("totalNum", getTotalNum())
|
||||
.append("totalProducePrice", getTotalProducePrice())
|
||||
.append("storageStatus", getStorageStatus())
|
||||
.append("quantity", getQuantity())
|
||||
.append("produceAmount", getProduceAmount())
|
||||
.append("version", getVersion())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.ruoyi.xkt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.XktBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -18,7 +20,9 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreProductStorageDetail extends XktBaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
@ -26,127 +30,130 @@ public class StoreProductStorageDetail extends XktBaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品货号
|
||||
*/
|
||||
@Excel(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
/**
|
||||
* 档口商品入库ID
|
||||
*/
|
||||
@Excel(name = "档口商品入库ID")
|
||||
private Long storeProdStorId;
|
||||
|
||||
/**
|
||||
* 档口商品颜色ID
|
||||
*/
|
||||
@Excel(name = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
|
||||
/**
|
||||
* 颜色名称
|
||||
*/
|
||||
@Excel(name = "颜色名称")
|
||||
private String colorName;
|
||||
/**
|
||||
* 档口商品ID
|
||||
*/
|
||||
@Excel(name = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
|
||||
/**
|
||||
* 尺码30
|
||||
*/
|
||||
@Excel(name = "尺码30")
|
||||
@TableField("size_30")
|
||||
private Integer size30;
|
||||
|
||||
/**
|
||||
* 尺码31
|
||||
*/
|
||||
@Excel(name = "尺码31")
|
||||
@TableField("size_31")
|
||||
private Integer size31;
|
||||
|
||||
/**
|
||||
* 尺码32
|
||||
*/
|
||||
@Excel(name = "尺码32")
|
||||
@TableField("size_32")
|
||||
private Integer size32;
|
||||
|
||||
/**
|
||||
* 尺码33
|
||||
*/
|
||||
@Excel(name = "尺码33")
|
||||
@TableField("size_33")
|
||||
private Integer size33;
|
||||
|
||||
/**
|
||||
* 尺码34
|
||||
*/
|
||||
@Excel(name = "尺码34")
|
||||
@TableField("size_34")
|
||||
private Integer size34;
|
||||
|
||||
/**
|
||||
* 尺码35
|
||||
*/
|
||||
@Excel(name = "尺码35")
|
||||
@TableField("size_35")
|
||||
private Integer size35;
|
||||
|
||||
/**
|
||||
* 尺码36
|
||||
*/
|
||||
@Excel(name = "尺码36")
|
||||
@TableField("size_36")
|
||||
private Integer size36;
|
||||
|
||||
/**
|
||||
* 尺码37
|
||||
*/
|
||||
@Excel(name = "尺码37")
|
||||
@TableField("size_37")
|
||||
private Integer size37;
|
||||
|
||||
/**
|
||||
* 尺码38
|
||||
*/
|
||||
@Excel(name = "尺码38")
|
||||
@TableField("size_38")
|
||||
private Integer size38;
|
||||
|
||||
/**
|
||||
* 尺码39
|
||||
*/
|
||||
@Excel(name = "尺码39")
|
||||
@TableField("size_39")
|
||||
private Integer size39;
|
||||
|
||||
/**
|
||||
* 尺码40
|
||||
*/
|
||||
@Excel(name = "尺码40")
|
||||
@TableField("size_40")
|
||||
private Integer size40;
|
||||
|
||||
/**
|
||||
* 尺码41
|
||||
*/
|
||||
@Excel(name = "尺码41")
|
||||
@TableField("size_41")
|
||||
private Integer size41;
|
||||
|
||||
/**
|
||||
* 尺码42
|
||||
*/
|
||||
@Excel(name = "尺码42")
|
||||
@TableField("size_42")
|
||||
private Integer size42;
|
||||
|
||||
/**
|
||||
* 尺码43
|
||||
*/
|
||||
@Excel(name = "尺码43")
|
||||
@TableField("size_43")
|
||||
private Integer size43;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
@Excel(name = "总数量")
|
||||
private Integer totalNum;
|
||||
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 生产价格
|
||||
*/
|
||||
@Excel(name = "生产价格")
|
||||
private BigDecimal producePrice;
|
||||
|
||||
/**
|
||||
* 总的生产价格
|
||||
*/
|
||||
@Excel(name = "总的生产价格")
|
||||
private BigDecimal totalProducePrice;
|
||||
|
||||
private BigDecimal produceAmount;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
@ -169,9 +176,9 @@ public class StoreProductStorageDetail extends XktBaseEntity {
|
|||
.append("size41", getSize41())
|
||||
.append("size42", getSize42())
|
||||
.append("size43", getSize43())
|
||||
.append("totalNum", getTotalNum())
|
||||
.append("quantity", getQuantity())
|
||||
.append("producePrice", getProducePrice())
|
||||
.append("totalProducePrice", getTotalProducePrice())
|
||||
.append("produceAmount", getProduceAmount())
|
||||
.append("version", getVersion())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.ruoyi.xkt.dto.storeCusProdDiscount;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口客户优惠")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusProdDiscountDTO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
@ApiModelProperty(name = "客户名称")
|
||||
private String storeCusName;
|
||||
@ApiModelProperty(name = "客户联系电话")
|
||||
private String phone;
|
||||
@ApiModelProperty(name = "优惠金额")
|
||||
private BigDecimal discount;
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.xkt.dto.storeCustomer;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -19,10 +20,11 @@ import java.util.Date;
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusPageResDTO {
|
||||
|
||||
@ApiModelProperty(name = "档口客户ID", notes = "新增为空,编辑必传")
|
||||
@JsonProperty("storeCusId")
|
||||
private Long id;
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "档口客户ID", notes = "新增为空,编辑必传")
|
||||
private Long storeCusId;
|
||||
@NotBlank(message = "客户名称不能为空!")
|
||||
@ApiModelProperty(name = "客户名称")
|
||||
private String cusName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ruoyi.xkt.dto.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品入库")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdStorageDTO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@NotBlank(message = "入库类型不能为空!")
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@Valid
|
||||
@NotNull(message = "商品入库明细列表不能为空!")
|
||||
@ApiModelProperty(name = "商品入库明细列表")
|
||||
private List<StorageDetailDTO> detailList;
|
||||
|
||||
@Data
|
||||
public static class StorageDetailDTO {
|
||||
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@NotNull(message = "档口商品颜色ID不能为空!")
|
||||
@ApiModelProperty(name = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(name = "颜色名称")
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品ID不能为空!")
|
||||
@ApiModelProperty(name = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(name = "尺码30")
|
||||
private Integer size30;
|
||||
@ApiModelProperty(name = "尺码31")
|
||||
private Integer size31;
|
||||
@ApiModelProperty(name = "尺码32")
|
||||
private Integer size32;
|
||||
@ApiModelProperty(name = "尺码33")
|
||||
private Integer size33;
|
||||
@ApiModelProperty(name = "尺码34")
|
||||
private Integer size34;
|
||||
@ApiModelProperty(name = "尺码35")
|
||||
private Integer size35;
|
||||
@ApiModelProperty(name = "尺码36")
|
||||
private Integer size36;
|
||||
@ApiModelProperty(name = "尺码37")
|
||||
private Integer size37;
|
||||
@ApiModelProperty(name = "尺码38")
|
||||
private Integer size38;
|
||||
@ApiModelProperty(name = "尺码39")
|
||||
private Integer size39;
|
||||
@ApiModelProperty(name = "尺码40")
|
||||
private Integer size40;
|
||||
@ApiModelProperty(name = "尺码41")
|
||||
private Integer size41;
|
||||
@ApiModelProperty(name = "尺码42")
|
||||
private Integer size42;
|
||||
@ApiModelProperty(name = "尺码43")
|
||||
private Integer size43;
|
||||
@ApiModelProperty(name = "总数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(name = "生产价格")
|
||||
private BigDecimal producePrice;
|
||||
@ApiModelProperty(name = "总的生产价格")
|
||||
private BigDecimal produceAmount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.ruoyi.xkt.dto.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.xkt.dto.BasePageDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("档口商品入库分页查询入参")
|
||||
@Data
|
||||
public class StoreProdStoragePageDTO extends BasePageDTO {
|
||||
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@ApiModelProperty(name = "销售开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date createTimeStart;
|
||||
@ApiModelProperty(name = "销售结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date createTimeEnd;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.xkt.dto.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品入库分页返回数据")
|
||||
@Data
|
||||
public class StoreProdStoragePageResDTO {
|
||||
|
||||
@ApiModelProperty(name = "storeProdStorId")
|
||||
private Long storeProdStorId;
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "单据编号")
|
||||
private String code;
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@ApiModelProperty(name = "数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(name = "生产成本金额")
|
||||
private BigDecimal produceAmount;
|
||||
@ApiModelProperty(name = "操作人名称")
|
||||
private String operatorName;
|
||||
@ApiModelProperty(name = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.xkt.dto.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品入库详情")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Accessors(chain = true)
|
||||
public class StoreProdStorageResDTO {
|
||||
|
||||
@ApiModelProperty(name = "storeProdStorId")
|
||||
@JsonProperty("storeProdStorId")
|
||||
private Long id;
|
||||
@ApiModelProperty(name = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(name = "单据编号")
|
||||
private String code;
|
||||
@ApiModelProperty(name = "入库类型")
|
||||
private String storageType;
|
||||
@ApiModelProperty(name = "数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(name = "生产成本金额")
|
||||
private BigDecimal produceAmount;
|
||||
@ApiModelProperty(name = "操作人名称")
|
||||
private String operatorName;
|
||||
@ApiModelProperty(name = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(name = "商品入库明细列表")
|
||||
private List<StorageDetailDTO> detailList;
|
||||
|
||||
@Data
|
||||
public static class StorageDetailDTO {
|
||||
|
||||
@ApiModelProperty(name = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(name = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(name = "尺码30")
|
||||
private Integer size30;
|
||||
@ApiModelProperty(name = "尺码31")
|
||||
private Integer size31;
|
||||
@ApiModelProperty(name = "尺码32")
|
||||
private Integer size32;
|
||||
@ApiModelProperty(name = "尺码33")
|
||||
private Integer size33;
|
||||
@ApiModelProperty(name = "尺码34")
|
||||
private Integer size34;
|
||||
@ApiModelProperty(name = "尺码35")
|
||||
private Integer size35;
|
||||
@ApiModelProperty(name = "尺码36")
|
||||
private Integer size36;
|
||||
@ApiModelProperty(name = "尺码37")
|
||||
private Integer size37;
|
||||
@ApiModelProperty(name = "尺码38")
|
||||
private Integer size38;
|
||||
@ApiModelProperty(name = "尺码39")
|
||||
private Integer size39;
|
||||
@ApiModelProperty(name = "尺码40")
|
||||
private Integer size40;
|
||||
@ApiModelProperty(name = "尺码41")
|
||||
private Integer size41;
|
||||
@ApiModelProperty(name = "尺码42")
|
||||
private Integer size42;
|
||||
@ApiModelProperty(name = "尺码43")
|
||||
private Integer size43;
|
||||
@ApiModelProperty(name = "总数量")
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreProductStorage;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -59,4 +61,12 @@ public interface StoreProductStorageMapper extends BaseMapper<StoreProductStorag
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductStorageByStoreProdStorIds(Long[] storeProdStorIds);
|
||||
|
||||
/**
|
||||
* 查询出库单分页
|
||||
* @param storagePageDTO 查询入参
|
||||
* @return List<StoreProdStoragePageResDTO>
|
||||
*/
|
||||
List<StoreProdStoragePageResDTO> selectStoragePage(StoreProdStoragePageDTO storagePageDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.domain.StoreCustomerProductDiscount;
|
||||
import com.ruoyi.xkt.dto.storeCusProdDiscount.StoreCusProdDiscountDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -38,10 +39,10 @@ public interface IStoreCustomerProductDiscountService {
|
|||
/**
|
||||
* 修改档口客户优惠
|
||||
*
|
||||
* @param storeCustomerProductDiscount 档口客户优惠
|
||||
* @param cusProdDisDTO 档口客户优惠
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreCustomerProductDiscount(StoreCustomerProductDiscount storeCustomerProductDiscount);
|
||||
public Integer updateStoreCusProdDiscount(StoreCusProdDiscountDTO cusProdDisDTO);
|
||||
|
||||
/**
|
||||
* 批量删除档口客户优惠
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public interface IStoreProductService {
|
|||
*/
|
||||
public List<StoreProduct> selectStoreProductList(StoreProduct storeProduct);
|
||||
|
||||
public Page<StoreProdPageDTO> page(StoreProdPageDTO pageDTO);
|
||||
public Page<StoreProdPageResDTO> page(StoreProdPageDTO pageDTO);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.domain.StoreProductStorage;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -17,7 +22,7 @@ public interface IStoreProductStorageService {
|
|||
* @param storeProdStorId 档口商品入库主键
|
||||
* @return 档口商品入库
|
||||
*/
|
||||
public StoreProductStorage selectStoreProductStorageByStoreProdStorId(Long storeProdStorId);
|
||||
public StoreProdStorageResDTO selectByStoreProdStorId(Long storeProdStorId);
|
||||
|
||||
/**
|
||||
* 查询档口商品入库列表
|
||||
|
|
@ -30,10 +35,10 @@ public interface IStoreProductStorageService {
|
|||
/**
|
||||
* 新增档口商品入库
|
||||
*
|
||||
* @param storeProductStorage 档口商品入库
|
||||
* @param storeProdStorageDTO 档口商品入库
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreProductStorage(StoreProductStorage storeProductStorage);
|
||||
public int create(StoreProdStorageDTO storeProdStorageDTO);
|
||||
|
||||
/**
|
||||
* 修改档口商品入库
|
||||
|
|
@ -44,12 +49,12 @@ public interface IStoreProductStorageService {
|
|||
public int updateStoreProductStorage(StoreProductStorage storeProductStorage);
|
||||
|
||||
/**
|
||||
* 批量删除档口商品入库
|
||||
* 撤销档口商品入库
|
||||
*
|
||||
* @param storeProdStorIds 需要删除的档口商品入库主键集合
|
||||
* @param storeProdStorId 需要删除的档口商品入库主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductStorageByStoreProdStorIds(Long[] storeProdStorIds);
|
||||
public int deleteByStoreProdStorId(Long storeProdStorId);
|
||||
|
||||
/**
|
||||
* 删除档口商品入库信息
|
||||
|
|
@ -58,4 +63,12 @@ public interface IStoreProductStorageService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductStorageByStoreProdStorId(Long storeProdStorId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param storagePageDTO 查询入参
|
||||
* @return Page
|
||||
*/
|
||||
Page<StoreProdStoragePageResDTO> page(StoreProdStoragePageDTO storagePageDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.domain.Store;
|
||||
import com.ruoyi.xkt.domain.UserSubscriptions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单据编号Service接口
|
||||
*
|
||||
|
|
@ -15,8 +10,9 @@ public interface IVoucherSequenceService {
|
|||
|
||||
/**
|
||||
* 获取档口单据编号
|
||||
* @param storeId 档口ID
|
||||
* @param type 单据类型
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @param type 单据类型 STORE_SALE STORAGE DEMAND STORE_ORDER
|
||||
* @param voucherDate 单据日期 默认为当天
|
||||
* @return String
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,14 +1,29 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.xkt.domain.StoreCustomer;
|
||||
import com.ruoyi.xkt.domain.StoreCustomerProductDiscount;
|
||||
import com.ruoyi.xkt.domain.StoreProductColor;
|
||||
import com.ruoyi.xkt.dto.storeCusProdDiscount.StoreCusProdDiscountDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreCustomerMapper;
|
||||
import com.ruoyi.xkt.mapper.StoreCustomerProductDiscountMapper;
|
||||
import com.ruoyi.xkt.mapper.StoreProductColorMapper;
|
||||
import com.ruoyi.xkt.service.IStoreCustomerProductDiscountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 档口客户优惠Service业务层处理
|
||||
|
|
@ -17,9 +32,58 @@ import java.util.List;
|
|||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerProductDiscountService {
|
||||
@Autowired
|
||||
private StoreCustomerProductDiscountMapper storeCustomerProductDiscountMapper;
|
||||
|
||||
final StoreCustomerProductDiscountMapper cusProdDiscountMapper;
|
||||
final StoreCustomerMapper storeCusMapper;
|
||||
final StoreProductColorMapper storeProdColorMapper;
|
||||
|
||||
/**
|
||||
* 修改档口客户优惠
|
||||
*
|
||||
* @param cusProdDisDTO 档口客户优惠
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer updateStoreCusProdDiscount(StoreCusProdDiscountDTO cusProdDisDTO) {
|
||||
List<StoreCustomer> storeCusList = this.storeCusMapper.selectList(new LambdaQueryWrapper<StoreCustomer>()
|
||||
.eq(StoreCustomer::getStoreId, cusProdDisDTO.getStoreId()).eq(StoreCustomer::getDelFlag, "0")
|
||||
.eq(StoreCustomer::getCusName, cusProdDisDTO.getStoreCusName()));
|
||||
if (ObjectUtils.isNotEmpty(storeCusList) && storeCusList.size() > 1) {
|
||||
throw new ServiceException("客户名称重复,请修改客户名称!", HttpStatus.CONFLICT);
|
||||
}
|
||||
StoreCustomer storeCus = CollectionUtils.isNotEmpty(storeCusList) ? storeCusList.get(0) : this.createStoreCustomer(cusProdDisDTO);
|
||||
// 获取当前档口客户已有的优惠
|
||||
List<StoreCustomerProductDiscount> cusProdDisList = Optional.ofNullable(cusProdDiscountMapper.selectList(new LambdaQueryWrapper<StoreCustomerProductDiscount>()
|
||||
.eq(StoreCustomerProductDiscount::getStoreCusName, cusProdDisDTO.getStoreCusName()).eq(StoreCustomerProductDiscount::getDelFlag, "0")
|
||||
.eq(StoreCustomerProductDiscount::getStoreId, cusProdDisDTO.getStoreId()))).orElse(new ArrayList<>());
|
||||
// 已存在优惠但优惠额度低于当前优惠,则更新该部分优惠
|
||||
List<StoreCustomerProductDiscount> updateList = cusProdDisList.stream()
|
||||
// 找到所有优惠低于当前优惠额度的列表
|
||||
.filter(x -> cusProdDisDTO.getDiscount().compareTo(ObjectUtils.defaultIfNull(x.getDiscount(), BigDecimal.ZERO)) > 0)
|
||||
// 更新最新的优惠
|
||||
.peek(x -> x.setDiscount(cusProdDisDTO.getDiscount())).collect(Collectors.toList());
|
||||
// 已有优惠的id
|
||||
List<Long> existDiscountProdColorIdList = cusProdDisList.stream().map(StoreCustomerProductDiscount::getStoreProdColorId).collect(Collectors.toList());
|
||||
// 档口所有的商品
|
||||
List<StoreProductColor> storeProdColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreId, cusProdDisDTO.getStoreId()).eq(StoreProductColor::getDelFlag, "0"));
|
||||
// 绑定其它商品的优惠
|
||||
List<StoreCustomerProductDiscount> addDiscountList = storeProdColorList.stream().filter(x -> !existDiscountProdColorIdList.contains(x.getId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreCustomerProductDiscount.class).setDiscount(cusProdDisDTO.getDiscount()).setStoreProdColorId(x.getId())
|
||||
.setStoreId(cusProdDisDTO.getStoreId()).setStoreCusId(storeCus.getId()).setStoreCusName(cusProdDisDTO.getStoreCusName()))
|
||||
.collect(Collectors.toList());
|
||||
// 档口所有商品优惠
|
||||
if (CollectionUtils.isNotEmpty(addDiscountList)) {
|
||||
updateList.addAll(addDiscountList);
|
||||
}
|
||||
// 更新及新增当前客户优惠
|
||||
return this.cusProdDiscountMapper.insertOrUpdate(updateList).size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口客户优惠
|
||||
|
|
@ -30,7 +94,7 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreCustomerProductDiscount selectStoreCustomerProductDiscountByStoreCusProdDiscId(Long storeCusProdDiscId) {
|
||||
return storeCustomerProductDiscountMapper.selectStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId);
|
||||
return cusProdDiscountMapper.selectStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +106,7 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreCustomerProductDiscount> selectStoreCustomerProductDiscountList(StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
return storeCustomerProductDiscountMapper.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
return cusProdDiscountMapper.selectStoreCustomerProductDiscountList(storeCustomerProductDiscount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -55,20 +119,7 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
@Transactional
|
||||
public int insertStoreCustomerProductDiscount(StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
storeCustomerProductDiscount.setCreateTime(DateUtils.getNowDate());
|
||||
return storeCustomerProductDiscountMapper.insertStoreCustomerProductDiscount(storeCustomerProductDiscount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口客户优惠
|
||||
*
|
||||
* @param storeCustomerProductDiscount 档口客户优惠
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateStoreCustomerProductDiscount(StoreCustomerProductDiscount storeCustomerProductDiscount) {
|
||||
storeCustomerProductDiscount.setUpdateTime(DateUtils.getNowDate());
|
||||
return storeCustomerProductDiscountMapper.updateStoreCustomerProductDiscount(storeCustomerProductDiscount);
|
||||
return cusProdDiscountMapper.insertStoreCustomerProductDiscount(storeCustomerProductDiscount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -80,7 +131,7 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
@Override
|
||||
@Transactional
|
||||
public int deleteStoreCustomerProductDiscountByStoreCusProdDiscIds(Long[] storeCusProdDiscIds) {
|
||||
return storeCustomerProductDiscountMapper.deleteStoreCustomerProductDiscountByStoreCusProdDiscIds(storeCusProdDiscIds);
|
||||
return cusProdDiscountMapper.deleteStoreCustomerProductDiscountByStoreCusProdDiscIds(storeCusProdDiscIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -92,6 +143,21 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
@Override
|
||||
@Transactional
|
||||
public int deleteStoreCustomerProductDiscountByStoreCusProdDiscId(Long storeCusProdDiscId) {
|
||||
return storeCustomerProductDiscountMapper.deleteStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId);
|
||||
return cusProdDiscountMapper.deleteStoreCustomerProductDiscountByStoreCusProdDiscId(storeCusProdDiscId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口客户
|
||||
* @param cusProdDisDTO 新增档口客户入参
|
||||
* @return StoreCustomer
|
||||
*/
|
||||
private StoreCustomer createStoreCustomer(StoreCusProdDiscountDTO cusProdDisDTO) {
|
||||
StoreCustomer storeCus = new StoreCustomer();
|
||||
storeCus.setCusName(cusProdDisDTO.getStoreCusName());
|
||||
storeCus.setPhone(cusProdDisDTO.getPhone());
|
||||
storeCus.setStoreId(cusProdDisDTO.getStoreId());
|
||||
this.storeCusMapper.insert(storeCus);
|
||||
return storeCus;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Page<StoreProdPageDTO> page(StoreProdPageDTO pageDTO) {
|
||||
public Page<StoreProdPageResDTO> page(StoreProdPageDTO pageDTO) {
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
// 调用Mapper方法查询商店产品分页信息
|
||||
List<StoreProdPageResDTO> prodList = storeProdColorMapper.selectStoreProdColorPage(pageDTO);
|
||||
|
|
@ -150,7 +150,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 为每个产品设置主图URL和标准尺码列表
|
||||
prodList.forEach(x -> x.setMainPicUrl(mainPicMap.get(x.getStoreProdId())).setStandardSizeList(standardSizeMap.get(x.getStoreProdId())));
|
||||
// 使用公共方法转换 PageInfo 到 Page
|
||||
return Page.convert(new PageInfo<>(prodList), BeanUtil.copyToList(prodList, StoreProdPageDTO.class));
|
||||
return Page.convert(new PageInfo<>(prodList), BeanUtil.copyToList(prodList, StoreProdPageResDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,14 +1,37 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.xkt.domain.StoreProductStorage;
|
||||
import com.ruoyi.xkt.domain.StoreProductStorageDetail;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdStorage.StoreProdStorageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeSale.StoreSalePageResDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreProductStorageDetailMapper;
|
||||
import com.ruoyi.xkt.mapper.StoreProductStorageMapper;
|
||||
import com.ruoyi.xkt.service.IStoreProductStorageService;
|
||||
import com.ruoyi.xkt.service.IVoucherSequenceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 档口商品入库Service业务层处理
|
||||
|
|
@ -17,9 +40,57 @@ import java.util.List;
|
|||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class StoreProductStorageServiceImpl implements IStoreProductStorageService {
|
||||
@Autowired
|
||||
private StoreProductStorageMapper storeProductStorageMapper;
|
||||
|
||||
final StoreProductStorageMapper storageMapper;
|
||||
final StoreProductStorageDetailMapper storageDetailMapper;
|
||||
final IVoucherSequenceService sequenceService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 查询入参
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Page<StoreProdStoragePageResDTO> page(StoreProdStoragePageDTO pageDTO) {
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
List<StoreProdStoragePageResDTO> list = this.storageMapper.selectStoragePage(pageDTO);
|
||||
return Page.convert(new PageInfo<>(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品入库
|
||||
*
|
||||
* @param storeProdStorageDTO 档口商品入库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int create(StoreProdStorageDTO storeProdStorageDTO) {
|
||||
// 生成code
|
||||
String code = this.sequenceService.generateCode(storeProdStorageDTO.getStoreId(), "STORAGE", DateUtils.getDate());
|
||||
// 总的数量
|
||||
Integer totalNum = storeProdStorageDTO.getDetailList().stream().map(x -> ObjectUtils.defaultIfNull(x.getQuantity(), 0)).reduce(0, Integer::sum);
|
||||
// 总的金额
|
||||
BigDecimal produceAmount = storeProdStorageDTO.getDetailList().stream().map(x -> ObjectUtils.defaultIfNull(x.getProduceAmount(), BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// 当前登录用户
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// 新增档口商品入库
|
||||
StoreProductStorage storeProdStorage = BeanUtil.toBean(storeProdStorageDTO, StoreProductStorage.class)
|
||||
.setCode(code).setQuantity(totalNum).setProduceAmount(produceAmount).setOperatorId(loginUser.getUserId()).setOperatorName(loginUser.getUsername());
|
||||
int count = this.storageMapper.insert(storeProdStorage);
|
||||
// 新增档口商品入库明细
|
||||
List<StoreProductStorageDetail> detailList = storeProdStorageDTO.getDetailList().stream().map(x -> BeanUtil.toBean(x, StoreProductStorageDetail.class)
|
||||
.setStoreProdStorId(storeProdStorage.getId())).collect(Collectors.toList());
|
||||
this.storageDetailMapper.insert(detailList);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询档口商品入库
|
||||
|
|
@ -29,8 +100,16 @@ public class StoreProductStorageServiceImpl implements IStoreProductStorageServi
|
|||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreProductStorage selectStoreProductStorageByStoreProdStorId(Long storeProdStorId) {
|
||||
return storeProductStorageMapper.selectStoreProductStorageByStoreProdStorId(storeProdStorId);
|
||||
public StoreProdStorageResDTO selectByStoreProdStorId(Long storeProdStorId) {
|
||||
// 档口商品入库
|
||||
StoreProductStorage storage = Optional.ofNullable(this.storageMapper.selectOne(new LambdaQueryWrapper<StoreProductStorage>()
|
||||
.eq(StoreProductStorage::getId, storeProdStorId).eq(StoreProductStorage::getDelFlag, "0")))
|
||||
.orElseThrow(() -> new ServiceException("档口商品入库不存在!", HttpStatus.ERROR));
|
||||
// 档口商品入库明细
|
||||
List<StoreProductStorageDetail> storageDetailList = storageDetailMapper.selectList(new LambdaQueryWrapper<StoreProductStorageDetail>()
|
||||
.eq(StoreProductStorageDetail::getStoreProdStorId, storeProdStorId).eq(StoreProductStorageDetail::getDelFlag, "0"));
|
||||
return BeanUtil.toBean(storage, StoreProdStorageResDTO.class)
|
||||
.setDetailList(storageDetailList.stream().map(x -> BeanUtil.toBean(x, StoreProdStorageResDTO.StorageDetailDTO.class)).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,22 +121,42 @@ public class StoreProductStorageServiceImpl implements IStoreProductStorageServi
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreProductStorage> selectStoreProductStorageList(StoreProductStorage storeProductStorage) {
|
||||
return storeProductStorageMapper.selectStoreProductStorageList(storeProductStorage);
|
||||
return storageMapper.selectStoreProductStorageList(storeProductStorage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品入库
|
||||
* 撤销档口商品入库
|
||||
*
|
||||
* @param storeProductStorage 档口商品入库
|
||||
* @param storeProdStorId 需要撤销档口商品入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertStoreProductStorage(StoreProductStorage storeProductStorage) {
|
||||
storeProductStorage.setCreateTime(DateUtils.getNowDate());
|
||||
return storeProductStorageMapper.insertStoreProductStorage(storeProductStorage);
|
||||
public int deleteByStoreProdStorId(Long storeProdStorId) {
|
||||
// 档口商品入库
|
||||
StoreProductStorage storage = Optional.ofNullable(this.storageMapper.selectOne(new LambdaQueryWrapper<StoreProductStorage>()
|
||||
.eq(StoreProductStorage::getId, storeProdStorId).eq(StoreProductStorage::getDelFlag, "0")))
|
||||
.orElseThrow(() -> new ServiceException("档口商品入库不存在!", HttpStatus.ERROR));
|
||||
storage.setDelFlag("2");
|
||||
int count = this.storageMapper.updateById(storage);
|
||||
// 档口商品入库明细
|
||||
List<StoreProductStorageDetail> storageDetailList = storageDetailMapper.selectList(new LambdaQueryWrapper<StoreProductStorageDetail>()
|
||||
.eq(StoreProductStorageDetail::getStoreProdStorId, storeProdStorId).eq(StoreProductStorageDetail::getDelFlag, "0"));
|
||||
storageDetailList.forEach(x -> x.setDelFlag("2"));
|
||||
this.storageDetailMapper.updateById(storageDetailList);
|
||||
|
||||
// TODO 更新档口商品库存
|
||||
// TODO 更新档口商品库存
|
||||
// TODO 更新档口商品库存
|
||||
// TODO 更新档口商品库存
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改档口商品入库
|
||||
*
|
||||
|
|
@ -68,19 +167,10 @@ public class StoreProductStorageServiceImpl implements IStoreProductStorageServi
|
|||
@Transactional
|
||||
public int updateStoreProductStorage(StoreProductStorage storeProductStorage) {
|
||||
storeProductStorage.setUpdateTime(DateUtils.getNowDate());
|
||||
return storeProductStorageMapper.updateStoreProductStorage(storeProductStorage);
|
||||
return storageMapper.updateStoreProductStorage(storeProductStorage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除档口商品入库
|
||||
*
|
||||
* @param storeProdStorIds 需要删除的档口商品入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStoreProductStorageByStoreProdStorIds(Long[] storeProdStorIds) {
|
||||
return storeProductStorageMapper.deleteStoreProductStorageByStoreProdStorIds(storeProdStorIds);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除档口商品入库信息
|
||||
|
|
@ -89,7 +179,10 @@ public class StoreProductStorageServiceImpl implements IStoreProductStorageServi
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteStoreProductStorageByStoreProdStorId(Long storeProdStorId) {
|
||||
return storeProductStorageMapper.deleteStoreProductStorageByStoreProdStorId(storeProdStorId);
|
||||
return storageMapper.deleteStoreProductStorageByStoreProdStorId(storeProdStorId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,4 +98,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectStoragePage" parameterType="com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageDTO" resultType="com.ruoyi.xkt.dto.storeProdStorage.StoreProdStoragePageResDTO">
|
||||
SELECT
|
||||
sps.id AS storeProdStorId, sps.store_id, sps.`code`, sps.storage_type, sps.produce_amount, sps.quantity, sps.create_time, sps.operator_name
|
||||
FROM
|
||||
store_product_storage sps
|
||||
<if test="prodArtNum != null and prodArtNum != ''"> join store_product_storage_detail spsd on sps.id = spsd.store_prod_stor_id </if>
|
||||
WHERE
|
||||
sps.del_flag = 0 AND sps.store_id = #{storeId}
|
||||
<if test="prodArtNum != null and prodArtNum != ''"> and spsd.prod_art_num like concat('%', #{prodArtNum}, '%')</if>
|
||||
<if test="storageType != null and storageType != ''"> and sps.storage_type = #{storageType} </if>
|
||||
<if test="createTimeStart != null"> and sps.voucher_date >= #{createTimeStart}</if>
|
||||
<if test="createTimeEnd != null"> and sps.voucher_date <= #{createTimeEnd}</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue