master:生产需求功能完善;
parent
54b4fa0e32
commit
7f28afd984
|
|
@ -101,17 +101,18 @@ public class StoreProductController extends XktBaseController {
|
|||
@ApiOperation(value = "新增档口商品", httpMethod = "POST", response = R.class)
|
||||
@PostMapping
|
||||
public R<Integer> create(@Validated @RequestBody StoreProdVO storeProdVO) throws IOException {
|
||||
return R.ok(storeProdService.insertStoreProduct(BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
|
||||
return R.ok(storeProdService.create(BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "修改档口商品", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "修改档口商品", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{storeProdId}")
|
||||
public R<Integer> edit(@PathVariable Long storeProdId, @Validated @RequestBody StoreProdVO storeProdVO) throws IOException {
|
||||
return R.ok(storeProdService.updateStoreProduct(storeProdId, BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
|
||||
public R<Integer> update(@PathVariable Long storeProdId, @Validated @RequestBody StoreProdVO storeProdVO) throws IOException {
|
||||
return R.ok(storeProdService.update(storeProdId, BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@Log(title = "修改档口商品状态", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation(value = "修改档口商品状态", httpMethod = "PUT", response = R.class)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ public class StoreProductDemandController extends XktBaseController {
|
|||
|
||||
final IStoreProductDemandService storeProdDemandService;
|
||||
|
||||
@ApiOperation(value = "获取所有需求单状态", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/status/num/{storeId}")
|
||||
public R<StoreProdDemandStatusCountResVO> getStatusNum(@PathVariable Long storeId) {
|
||||
return R.ok(BeanUtil.toBean(storeProdDemandService.getStatusNum(storeId), StoreProdDemandStatusCountResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "商品入库校验是否存在需求单", httpMethod = "POST", response = R.class)
|
||||
@Log(title = "商品入库校验是否存在需求单", businessType = BusinessType.INSERT)
|
||||
|
|
@ -84,6 +90,14 @@ public class StoreProductDemandController extends XktBaseController {
|
|||
return R.ok(storeProdDemandService.deleteByStoreProdDemandIds(BeanUtil.toBean(deleteVO, StoreProdDemandDeleteDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "全部完成", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "全部完成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/finish-all")
|
||||
public R<Integer> finishAll(@Validated @RequestBody StoreProdDemandFinishAllVO allFinishVO) {
|
||||
return R.ok(storeProdDemandService.finishAll(BeanUtil.toBean(allFinishVO, StoreProdDemandFinishAllDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "导出生产需求", httpMethod = "POST", response = R.class)
|
||||
@Log(title = "导出生产需求", businessType = BusinessType.EXPORT)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeColor.StoreColorVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdCreateVO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品名称")
|
||||
private String prodName;
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品分类ID", required = true)
|
||||
@NotNull(message = "商品分类ID不能为空!")
|
||||
private Long prodCateId;
|
||||
@ApiModelProperty(value = "商品分类名称", required = true)
|
||||
@NotBlank(message = "商品分类名称不能为空!")
|
||||
private String prodCateName;
|
||||
@ApiModelProperty(value = "工厂货号")
|
||||
@Size(min = 0, max = 15, message = "工厂货号不能超过60个字!")
|
||||
private String factoryArtNum;
|
||||
@ApiModelProperty(value = "商品货号", required = true)
|
||||
@Size(min = 0, max = 15, message = "商品货号不能超过60个字!")
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品标题", required = true)
|
||||
@Size(min = 0, max = 60, message = "商品标题不能超过60个字!")
|
||||
@NotBlank(message = "商品标题不能为空!")
|
||||
private String prodTitle;
|
||||
@ApiModelProperty(value = "商品重量")
|
||||
private BigDecimal prodWeight;
|
||||
@ApiModelProperty(value = "生产价格")
|
||||
private Integer producePrice;
|
||||
@ApiModelProperty(value = "大小码加价")
|
||||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "发货时效")
|
||||
private Integer deliveryTime;
|
||||
@ApiModelProperty(value = "上架方式:1 立即上架 2 定时上架", required = true)
|
||||
@NotNull(message = "上架方式不能为空!")
|
||||
private Integer listingWay;
|
||||
@ApiModelProperty(value = "商品状态:1.未发布 2. 在售 3. 尾货 4.已下架 5. 已删除", required = true)
|
||||
@NotNull(message = "商品状态不能为空!")
|
||||
private Integer prodStatus;
|
||||
@ApiModelProperty(value = "定时发货时间(精确到小时)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH")
|
||||
private Date listingWaySchedule;
|
||||
@ApiModelProperty(value = "档口文件列表", required = true)
|
||||
@NotNull(message = "档口文件不能为空!")
|
||||
@Valid
|
||||
private List<StoreProdFileVO> fileList;
|
||||
@NotNull(message = "档口类目属性不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口类目属性", required = true)
|
||||
private StoreProdCateAttrVO cateAttr;
|
||||
@NotNull(message = "档口所有颜色列表不能为空!")
|
||||
@ApiModelProperty(value = "档口所有颜色列表", required = true)
|
||||
@Valid
|
||||
private List<StoreColorVO> allColorList;
|
||||
@NotNull(message = "档口尺码列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口尺码列表", required = true)
|
||||
private List<SPCSizeVO> sizeList;
|
||||
@Valid
|
||||
@NotNull(message = "商品颜色价格列表不能为空!")
|
||||
@ApiModelProperty(value = "档口颜色价格列表", required = true)
|
||||
private List<SPCColorPriceVO> colorPriceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcVO svc;
|
||||
@NotBlank(message = "详情内容不能为空!")
|
||||
@ApiModelProperty(value = "详情内容", required = true)
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "档口生产工艺")
|
||||
private StoreProdProcessVO process;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class SPCColorPriceVO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class StoreProdFileVO {
|
||||
@NotBlank(message = "文件名称不能为空!")
|
||||
@ApiModelProperty(value = "文件名称", required = true)
|
||||
private String fileName;
|
||||
@NotBlank(message = "文件路径不能为空!")
|
||||
@ApiModelProperty(value = "文件路径", required = true)
|
||||
private String fileUrl;
|
||||
@NotNull(message = "文件大小不能为空!")
|
||||
@ApiModelProperty(value = "文件大小", required = true)
|
||||
private BigDecimal fileSize;
|
||||
@NotNull(message = "文件类型不能为空!")
|
||||
@ApiModelProperty(value = "文件类型", required = true)
|
||||
private Integer fileType;
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
@NotNull(message = "排序不能为空!")
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdCateAttrVO {
|
||||
@NotBlank(message = "帮面材质不可为空!")
|
||||
@ApiModelProperty(value = "帮面材质", required = true)
|
||||
private String upperMaterial;
|
||||
@NotBlank(message = "内里材质不可为空!")
|
||||
@ApiModelProperty(value = "内里材质", required = true)
|
||||
private String liningMaterial;
|
||||
@NotBlank(message = "鞋垫材质不可为空!")
|
||||
@ApiModelProperty(value = "鞋垫材质", required = true)
|
||||
private String insoleMaterial;
|
||||
@ApiModelProperty(value = "上市季节年份")
|
||||
private String releaseYearSeason;
|
||||
@ApiModelProperty(value = "后跟高")
|
||||
private String heelHeight;
|
||||
@ApiModelProperty(value = "跟底款式")
|
||||
private String heelType;
|
||||
@ApiModelProperty(value = "鞋头款式")
|
||||
private String toeStyle;
|
||||
@ApiModelProperty(value = "适合季节")
|
||||
private String suitableSeason;
|
||||
@ApiModelProperty(value = "开口深度")
|
||||
private String collarDepth;
|
||||
@ApiModelProperty(value = "鞋底材质")
|
||||
private String outsoleMaterial;
|
||||
@ApiModelProperty(value = "风格")
|
||||
private String style;
|
||||
@ApiModelProperty(value = "款式")
|
||||
private String design;
|
||||
@ApiModelProperty(value = "皮质特征")
|
||||
private String leatherFeatures;
|
||||
@ApiModelProperty(value = "制作工艺")
|
||||
private String manufacturingProcess;
|
||||
@ApiModelProperty(value = "图案")
|
||||
private String pattern;
|
||||
@ApiModelProperty(value = "闭合方式")
|
||||
private String closureType;
|
||||
@ApiModelProperty(value = "适用场景")
|
||||
private String occasion;
|
||||
@ApiModelProperty(value = "适用年龄")
|
||||
private String suitableAge;
|
||||
@ApiModelProperty(value = "厚薄")
|
||||
private String thickness;
|
||||
@ApiModelProperty(value = "流行元素")
|
||||
private String fashionElements;
|
||||
@ApiModelProperty(value = "适用对象")
|
||||
private String suitablePerson;
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class SPCSizeVO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
@NotNull(message = "是否是标准尺码不能为空!")
|
||||
@ApiModelProperty(value = "是否是标准尺码", required = true)
|
||||
private Integer standard;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdSvcVO {
|
||||
@ApiModelProperty(value = "大小码及定制款可退")
|
||||
private String customRefund;
|
||||
@ApiModelProperty(value = "30天包退")
|
||||
private String thirtyDayRefund;
|
||||
@ApiModelProperty(value = "一件起批")
|
||||
private String oneBatchSale;
|
||||
@ApiModelProperty(value = "退款72小时到账")
|
||||
private String refundWithinThreeDay;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdProcessVO {
|
||||
@ApiModelProperty(value = "鞋型")
|
||||
private String shoeType;
|
||||
@ApiModelProperty(value = "楦号")
|
||||
private String shoeSize;
|
||||
@ApiModelProperty(value = "主皮")
|
||||
private String mainSkin;
|
||||
@ApiModelProperty(value = "主皮用量")
|
||||
private String mainSkinUsage;
|
||||
@ApiModelProperty(value = "配皮")
|
||||
private String matchSkin;
|
||||
@ApiModelProperty(value = "配皮用量")
|
||||
private String matchSkinUsage;
|
||||
@ApiModelProperty(value = "领口")
|
||||
private String neckline;
|
||||
@ApiModelProperty(value = "膛底")
|
||||
private String insole;
|
||||
@ApiModelProperty(value = "扣件/拉头")
|
||||
private String fastener;
|
||||
@ApiModelProperty(value = "辅料")
|
||||
private String shoeAccessories;
|
||||
@ApiModelProperty(value = "包头")
|
||||
private String toeCap;
|
||||
@ApiModelProperty(value = "包边")
|
||||
private String edgeBinding;
|
||||
@ApiModelProperty(value = "中大底")
|
||||
private String midOutsole;
|
||||
@ApiModelProperty(value = "防水台")
|
||||
private String platformSole;
|
||||
@ApiModelProperty(value = "中底厂家编码")
|
||||
private String midsoleFactoryCode;
|
||||
@ApiModelProperty(value = "外底厂家编码")
|
||||
private String outsoleFactoryCode;
|
||||
@ApiModelProperty(value = "跟厂编码")
|
||||
private String heelFactoryCode;
|
||||
@ApiModelProperty(value = "配料")
|
||||
private String components;
|
||||
@ApiModelProperty(value = "第二底料")
|
||||
private String secondSoleMaterial;
|
||||
@ApiModelProperty(value = "第二配料")
|
||||
private String secondUpperMaterial;
|
||||
@ApiModelProperty(value = "自定义")
|
||||
private String customAttr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,255 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeColor.StoreColorVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdUpdateVO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品名称")
|
||||
private String prodName;
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品分类ID", required = true)
|
||||
@NotNull(message = "商品分类ID不能为空!")
|
||||
private Long prodCateId;
|
||||
@ApiModelProperty(value = "商品分类名称", required = true)
|
||||
@NotBlank(message = "商品分类名称不能为空!")
|
||||
private String prodCateName;
|
||||
@ApiModelProperty(value = "工厂货号")
|
||||
@Size(min = 0, max = 15, message = "工厂货号不能超过60个字!")
|
||||
private String factoryArtNum;
|
||||
@ApiModelProperty(value = "商品货号", required = true)
|
||||
@Size(min = 0, max = 15, message = "商品货号不能超过60个字!")
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品标题", required = true)
|
||||
@Size(min = 0, max = 60, message = "商品标题不能超过60个字!")
|
||||
@NotBlank(message = "商品标题不能为空!")
|
||||
private String prodTitle;
|
||||
@ApiModelProperty(value = "商品重量")
|
||||
private BigDecimal prodWeight;
|
||||
@ApiModelProperty(value = "生产价格")
|
||||
private Integer producePrice;
|
||||
@ApiModelProperty(value = "大小码加价")
|
||||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "发货时效")
|
||||
private Integer deliveryTime;
|
||||
@ApiModelProperty(value = "上架方式:1 立即上架 2 定时上架", required = true)
|
||||
@NotNull(message = "上架方式不能为空!")
|
||||
private Integer listingWay;
|
||||
@ApiModelProperty(value = "商品状态:1.未发布 2. 在售 3. 尾货 4.已下架 5. 已删除", required = true)
|
||||
@NotNull(message = "商品状态不能为空!")
|
||||
private Integer prodStatus;
|
||||
@ApiModelProperty(value = "定时发货时间(精确到小时)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH")
|
||||
private Date listingWaySchedule;
|
||||
@ApiModelProperty(value = "档口文件列表", required = true)
|
||||
@NotNull(message = "档口文件不能为空!")
|
||||
@Valid
|
||||
private List<StoreProdFileVO> fileList;
|
||||
@NotNull(message = "档口类目属性不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口类目属性", required = true)
|
||||
private StoreProdCateAttrVO cateAttr;
|
||||
@NotNull(message = "档口所有颜色列表不能为空!")
|
||||
@ApiModelProperty(value = "档口所有颜色列表", required = true)
|
||||
@Valid
|
||||
private List<StoreColorVO> allColorList;
|
||||
@NotNull(message = "档口尺码列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口尺码列表", required = true)
|
||||
private List<SPCSizeVO> sizeList;
|
||||
@Valid
|
||||
@NotNull(message = "商品颜色价格列表不能为空!")
|
||||
@ApiModelProperty(value = "档口颜色价格列表", required = true)
|
||||
private List<SPCColorPriceVO> colorPriceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcVO svc;
|
||||
@NotBlank(message = "详情内容不能为空!")
|
||||
@ApiModelProperty(value = "详情内容", required = true)
|
||||
// @Xss
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "档口生产工艺")
|
||||
private StoreProdProcessVO process;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class SPCColorPriceVO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class StoreProdFileVO {
|
||||
@NotBlank(message = "文件名称不能为空!")
|
||||
@ApiModelProperty(value = "文件名称", required = true)
|
||||
private String fileName;
|
||||
@NotBlank(message = "文件路径不能为空!")
|
||||
@ApiModelProperty(value = "文件路径", required = true)
|
||||
private String fileUrl;
|
||||
@NotNull(message = "文件大小不能为空!")
|
||||
@ApiModelProperty(value = "文件大小", required = true)
|
||||
private BigDecimal fileSize;
|
||||
@NotNull(message = "文件类型不能为空!")
|
||||
@ApiModelProperty(value = "文件类型", required = true)
|
||||
private Integer fileType;
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
@NotNull(message = "排序不能为空!")
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdCateAttrVO {
|
||||
@NotBlank(message = "帮面材质不可为空!")
|
||||
@ApiModelProperty(value = "帮面材质", required = true)
|
||||
private String upperMaterial;
|
||||
@NotBlank(message = "内里材质不可为空!")
|
||||
@ApiModelProperty(value = "内里材质", required = true)
|
||||
private String liningMaterial;
|
||||
@NotBlank(message = "鞋垫材质不可为空!")
|
||||
@ApiModelProperty(value = "鞋垫材质", required = true)
|
||||
private String insoleMaterial;
|
||||
@ApiModelProperty(value = "上市季节年份")
|
||||
private String releaseYearSeason;
|
||||
@ApiModelProperty(value = "后跟高")
|
||||
private String heelHeight;
|
||||
@ApiModelProperty(value = "跟底款式")
|
||||
private String heelType;
|
||||
@ApiModelProperty(value = "鞋头款式")
|
||||
private String toeStyle;
|
||||
@ApiModelProperty(value = "适合季节")
|
||||
private String suitableSeason;
|
||||
@ApiModelProperty(value = "开口深度")
|
||||
private String collarDepth;
|
||||
@ApiModelProperty(value = "鞋底材质")
|
||||
private String outsoleMaterial;
|
||||
@ApiModelProperty(value = "风格")
|
||||
private String style;
|
||||
@ApiModelProperty(value = "款式")
|
||||
private String design;
|
||||
@ApiModelProperty(value = "皮质特征")
|
||||
private String leatherFeatures;
|
||||
@ApiModelProperty(value = "制作工艺")
|
||||
private String manufacturingProcess;
|
||||
@ApiModelProperty(value = "图案")
|
||||
private String pattern;
|
||||
@ApiModelProperty(value = "闭合方式")
|
||||
private String closureType;
|
||||
@ApiModelProperty(value = "适用场景")
|
||||
private String occasion;
|
||||
@ApiModelProperty(value = "适用年龄")
|
||||
private String suitableAge;
|
||||
@ApiModelProperty(value = "厚薄")
|
||||
private String thickness;
|
||||
@ApiModelProperty(value = "流行元素")
|
||||
private String fashionElements;
|
||||
@ApiModelProperty(value = "适用对象")
|
||||
private String suitablePerson;
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class SPCSizeVO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
@NotNull(message = "是否是标准尺码不能为空!")
|
||||
@ApiModelProperty(value = "是否是标准尺码", required = true)
|
||||
private Integer standard;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdSvcVO {
|
||||
@ApiModelProperty(value = "大小码及定制款可退")
|
||||
private String customRefund;
|
||||
@ApiModelProperty(value = "30天包退")
|
||||
private String thirtyDayRefund;
|
||||
@ApiModelProperty(value = "一件起批")
|
||||
private String oneBatchSale;
|
||||
@ApiModelProperty(value = "退款72小时到账")
|
||||
private String refundWithinThreeDay;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdProcessVO {
|
||||
@ApiModelProperty(value = "鞋型")
|
||||
private String shoeType;
|
||||
@ApiModelProperty(value = "楦号")
|
||||
private String shoeSize;
|
||||
@ApiModelProperty(value = "主皮")
|
||||
private String mainSkin;
|
||||
@ApiModelProperty(value = "主皮用量")
|
||||
private String mainSkinUsage;
|
||||
@ApiModelProperty(value = "配皮")
|
||||
private String matchSkin;
|
||||
@ApiModelProperty(value = "配皮用量")
|
||||
private String matchSkinUsage;
|
||||
@ApiModelProperty(value = "领口")
|
||||
private String neckline;
|
||||
@ApiModelProperty(value = "膛底")
|
||||
private String insole;
|
||||
@ApiModelProperty(value = "扣件/拉头")
|
||||
private String fastener;
|
||||
@ApiModelProperty(value = "辅料")
|
||||
private String shoeAccessories;
|
||||
@ApiModelProperty(value = "包头")
|
||||
private String toeCap;
|
||||
@ApiModelProperty(value = "包边")
|
||||
private String edgeBinding;
|
||||
@ApiModelProperty(value = "中大底")
|
||||
private String midOutsole;
|
||||
@ApiModelProperty(value = "防水台")
|
||||
private String platformSole;
|
||||
@ApiModelProperty(value = "中底厂家编码")
|
||||
private String midsoleFactoryCode;
|
||||
@ApiModelProperty(value = "外底厂家编码")
|
||||
private String outsoleFactoryCode;
|
||||
@ApiModelProperty(value = "跟厂编码")
|
||||
private String heelFactoryCode;
|
||||
@ApiModelProperty(value = "配料")
|
||||
private String components;
|
||||
@ApiModelProperty(value = "第二底料")
|
||||
private String secondSoleMaterial;
|
||||
@ApiModelProperty(value = "第二配料")
|
||||
private String secondUpperMaterial;
|
||||
@ApiModelProperty(value = "自定义")
|
||||
private String customAttr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ package com.ruoyi.web.controller.xkt.vo.storeProd;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeColor.StoreColorVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -68,34 +67,48 @@ public class StoreProdVO {
|
|||
@ApiModelProperty(value = "档口文件列表", required = true)
|
||||
@NotNull(message = "档口文件不能为空!")
|
||||
@Valid
|
||||
private List<StoreProdFileVO> fileList;
|
||||
private List<StoreProdCreateVO.StoreProdFileVO> fileList;
|
||||
@NotNull(message = "档口类目属性不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口类目属性", required = true)
|
||||
private StoreProdCateAttrVO cateAttr;
|
||||
private StoreProdCreateVO.StoreProdCateAttrVO cateAttr;
|
||||
@NotNull(message = "档口所有颜色列表不能为空!")
|
||||
@ApiModelProperty(value = "档口所有颜色列表", required = true)
|
||||
private List<StoreColorVO> allColorList;
|
||||
@NotNull(message = "商品颜色列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "商品颜色列表", required = true)
|
||||
private List<StoreProdColorVO> colorList;
|
||||
private List<StoreColorVO> allColorList;
|
||||
@NotNull(message = "档口尺码列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口尺码列表", required = true)
|
||||
private List<StoreProdColorSizeVO> sizeList;
|
||||
@NotNull(message = "档口颜色价格列表不能为空!")
|
||||
private List<StoreProdCreateVO.SPCSizeVO> sizeList;
|
||||
@Valid
|
||||
@NotNull(message = "商品颜色价格列表不能为空!")
|
||||
@ApiModelProperty(value = "档口颜色价格列表", required = true)
|
||||
private List<StoreProdColorPriceVO> priceList;
|
||||
private List<StoreProdCreateVO.SPCColorPriceVO> colorPriceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcVO svc;
|
||||
private StoreProdCreateVO.StoreProdSvcVO svc;
|
||||
@NotBlank(message = "详情内容不能为空!")
|
||||
@ApiModelProperty(value = "详情内容", required = true)
|
||||
// @Xss
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "档口生产工艺")
|
||||
private StoreProdProcessVO process;
|
||||
private StoreProdCreateVO.StoreProdProcessVO process;
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class SPCColorPriceVO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
|
|
@ -166,29 +179,11 @@ public class StoreProdVO {
|
|||
private String suitablePerson;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class StoreProdColorVO {
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class StoreProdColorSizeVO {
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
public static class SPCSizeVO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
|
|
@ -197,19 +192,6 @@ public class StoreProdVO {
|
|||
private Integer standard;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class StoreProdColorPriceVO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreProdSvcVO {
|
||||
@ApiModelProperty(value = "大小码及定制款可退")
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ public class StoreProdDemandExportVO {
|
|||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空")
|
||||
private Long storeId;
|
||||
@NotNull(message = "档口需求明细ID不能为空")
|
||||
@ApiModelProperty(value = "档口需求明细ID", required = true)
|
||||
@ApiModelProperty(value = "档口需求明细ID")
|
||||
private List<Long> storeProdDemandDetailIdList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProductDemand;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
public class StoreProdDemandFinishAllVO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空")
|
||||
private Long storeId;
|
||||
@NotNull(message = "档口需求明细ID不能为空")
|
||||
@ApiModelProperty(value = "档口需求明细ID", required = true)
|
||||
private List<Long> storeProdDemandDetailIdList;
|
||||
@NotNull(message = "档口需求ID列表不能为空")
|
||||
@ApiModelProperty(value = "档口需求ID列表", required = true)
|
||||
private List<Long> storeProdDemandIdList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProductDemand;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdDemandStatusCountResVO {
|
||||
|
||||
@ApiModelProperty(value = "待生产数量")
|
||||
private Integer unProductionNum;
|
||||
@ApiModelProperty(value = "生产中数量")
|
||||
private Integer inProductionNum;
|
||||
@ApiModelProperty(value = "生产完成数量")
|
||||
private Integer productionCompleteNum;
|
||||
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreCustomer extends XktBaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ruoyi.xkt.dto.storeProduct;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
||||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdFileDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdCreateDTO {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -11,10 +11,15 @@ import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
|||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdFileDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -29,19 +34,27 @@ import java.util.List;
|
|||
@Accessors(chain = true)
|
||||
public class StoreProdDTO {
|
||||
|
||||
@ApiModelProperty("档口商品名称")
|
||||
@ApiModelProperty(value = "档口商品名称")
|
||||
private String prodName;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品分类ID")
|
||||
@ApiModelProperty(value = "商品分类ID", required = true)
|
||||
@NotNull(message = "商品分类ID不能为空!")
|
||||
private Long prodCateId;
|
||||
@ApiModelProperty(value = "商品分类名称")
|
||||
@ApiModelProperty(value = "商品分类名称", required = true)
|
||||
@NotBlank(message = "商品分类名称不能为空!")
|
||||
private String prodCateName;
|
||||
@ApiModelProperty(value = "工厂货号")
|
||||
@Size(min = 0, max = 15, message = "工厂货号不能超过60个字!")
|
||||
private String factoryArtNum;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
@ApiModelProperty(value = "商品货号", required = true)
|
||||
@Size(min = 0, max = 15, message = "商品货号不能超过60个字!")
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品标题")
|
||||
@ApiModelProperty(value = "商品标题", required = true)
|
||||
@Size(min = 0, max = 60, message = "商品标题不能超过60个字!")
|
||||
@NotBlank(message = "商品标题不能为空!")
|
||||
private String prodTitle;
|
||||
@ApiModelProperty(value = "商品重量")
|
||||
private BigDecimal prodWeight;
|
||||
|
|
@ -51,31 +64,74 @@ public class StoreProdDTO {
|
|||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "发货时效")
|
||||
private Integer deliveryTime;
|
||||
@ApiModelProperty(value = "上架方式")
|
||||
@ApiModelProperty(value = "上架方式:1 立即上架 2 定时上架", required = true)
|
||||
@NotNull(message = "上架方式不能为空!")
|
||||
private Integer listingWay;
|
||||
@ApiModelProperty(value = "商品状态")
|
||||
@ApiModelProperty(value = "商品状态:1.未发布 2. 在售 3. 尾货 4.已下架 5. 已删除", required = true)
|
||||
@NotNull(message = "商品状态不能为空!")
|
||||
private Integer prodStatus;
|
||||
@ApiModelProperty(value = "详情内容")
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "定时发货时间(精确到小时)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH")
|
||||
private Date listingWaySchedule;
|
||||
@ApiModelProperty(value = "档口文件列表")
|
||||
@ApiModelProperty(value = "档口文件列表", required = true)
|
||||
@NotNull(message = "档口文件不能为空!")
|
||||
@Valid
|
||||
private List<StoreProdFileDTO> fileList;
|
||||
@ApiModelProperty(value = "档口类目属性列表")
|
||||
@NotNull(message = "档口类目属性不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口类目属性", required = true)
|
||||
private StoreProdCateAttrDTO cateAttr;
|
||||
@NotNull(message = "档口所有颜色列表不能为空!")
|
||||
@ApiModelProperty(value = "档口所有颜色列表")
|
||||
@ApiModelProperty(value = "档口所有颜色列表", required = true)
|
||||
@Valid
|
||||
private List<StoreColorDTO> allColorList;
|
||||
@ApiModelProperty(value = "商品颜色列表")
|
||||
private List<StoreProdColorDTO> colorList;
|
||||
@ApiModelProperty(value = "档口商品尺码列表")
|
||||
private List<StoreProdColorSizeDTO> sizeList;
|
||||
@ApiModelProperty(value = "档口价格列表")
|
||||
private List<StoreProdColorPriceSimpleDTO> priceList;
|
||||
@NotNull(message = "档口尺码列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口尺码列表", required = true)
|
||||
private List<SPCSizeDTO> sizeList;
|
||||
@Valid
|
||||
@NotNull(message = "商品颜色价格列表不能为空!")
|
||||
@ApiModelProperty(value = "档口颜色价格列表", required = true)
|
||||
private List<SPCColorPriceDTO> colorPriceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcDTO svc;
|
||||
@NotBlank(message = "详情内容不能为空!")
|
||||
@ApiModelProperty(value = "详情内容", required = true)
|
||||
// @Xss
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "档口生产工艺")
|
||||
private StoreProdProcessDTO process;
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class SPCColorPriceDTO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class SPCSizeDTO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
@NotNull(message = "是否是标准尺码不能为空!")
|
||||
@ApiModelProperty(value = "是否是标准尺码", required = true)
|
||||
private Integer standard;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,132 @@
|
|||
package com.ruoyi.xkt.dto.storeProduct;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
||||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdFileDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdUpdateDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品名称")
|
||||
private String prodName;
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品分类ID", required = true)
|
||||
@NotNull(message = "商品分类ID不能为空!")
|
||||
private Long prodCateId;
|
||||
@ApiModelProperty(value = "商品分类名称", required = true)
|
||||
@NotBlank(message = "商品分类名称不能为空!")
|
||||
private String prodCateName;
|
||||
@ApiModelProperty(value = "工厂货号")
|
||||
@Size(min = 0, max = 15, message = "工厂货号不能超过60个字!")
|
||||
private String factoryArtNum;
|
||||
@ApiModelProperty(value = "商品货号", required = true)
|
||||
@Size(min = 0, max = 15, message = "商品货号不能超过60个字!")
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品标题", required = true)
|
||||
@Size(min = 0, max = 60, message = "商品标题不能超过60个字!")
|
||||
@NotBlank(message = "商品标题不能为空!")
|
||||
private String prodTitle;
|
||||
@ApiModelProperty(value = "商品重量")
|
||||
private BigDecimal prodWeight;
|
||||
@ApiModelProperty(value = "生产价格")
|
||||
private Integer producePrice;
|
||||
@ApiModelProperty(value = "大小码加价")
|
||||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "发货时效")
|
||||
private Integer deliveryTime;
|
||||
@ApiModelProperty(value = "上架方式:1 立即上架 2 定时上架", required = true)
|
||||
@NotNull(message = "上架方式不能为空!")
|
||||
private Integer listingWay;
|
||||
@ApiModelProperty(value = "商品状态:1.未发布 2. 在售 3. 尾货 4.已下架 5. 已删除", required = true)
|
||||
@NotNull(message = "商品状态不能为空!")
|
||||
private Integer prodStatus;
|
||||
@ApiModelProperty(value = "定时发货时间(精确到小时)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH")
|
||||
private Date listingWaySchedule;
|
||||
@ApiModelProperty(value = "档口文件列表", required = true)
|
||||
@NotNull(message = "档口文件不能为空!")
|
||||
@Valid
|
||||
private List<StoreProdFileDTO> fileList;
|
||||
@NotNull(message = "档口类目属性不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口类目属性", required = true)
|
||||
private StoreProdCateAttrDTO cateAttr;
|
||||
@NotNull(message = "档口所有颜色列表不能为空!")
|
||||
@ApiModelProperty(value = "档口所有颜色列表", required = true)
|
||||
@Valid
|
||||
private List<StoreColorDTO> allColorList;
|
||||
@NotNull(message = "档口尺码列表不能为空!")
|
||||
@Valid
|
||||
@ApiModelProperty(value = "档口尺码列表", required = true)
|
||||
private List<SPCSizeDTO> sizeList;
|
||||
@Valid
|
||||
@NotNull(message = "商品颜色价格列表不能为空!")
|
||||
@ApiModelProperty(value = "档口颜色价格列表", required = true)
|
||||
private List<SPCColorPriceDTO> colorPriceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcDTO svc;
|
||||
@NotBlank(message = "详情内容不能为空!")
|
||||
@ApiModelProperty(value = "详情内容", required = true)
|
||||
// @Xss
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "档口生产工艺")
|
||||
private StoreProdProcessDTO process;
|
||||
|
||||
|
||||
@Data
|
||||
@Valid
|
||||
public static class SPCColorPriceDTO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
@ApiModelProperty(value = "档口商品定价", required = true)
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "排序不能为空!")
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class SPCSizeDTO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
@NotNull(message = "是否是标准尺码不能为空!")
|
||||
@ApiModelProperty(value = "是否是标准尺码", required = true)
|
||||
private Integer standard;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.xkt.dto.storeProductDemand;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
public class StoreProdDemandFinishAllDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口需求明细ID")
|
||||
private List<Long> storeProdDemandDetailIdList;
|
||||
@ApiModelProperty(value = "档口需求ID列表")
|
||||
private List<Long> storeProdDemandIdList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.dto.storeProductDemand;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdDemandStatusCountResDTO {
|
||||
|
||||
@ApiModelProperty(value = "待生产数量")
|
||||
private Integer unProductionNum;
|
||||
@ApiModelProperty(value = "生产中数量")
|
||||
private Integer inProductionNum;
|
||||
@ApiModelProperty(value = "生产完成数量")
|
||||
private Integer productionCompleteNum;
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,6 @@ package com.ruoyi.xkt.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreCustomer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口客户Mapper接口
|
||||
*
|
||||
|
|
@ -12,51 +10,5 @@ import java.util.List;
|
|||
* @date 2025-03-26
|
||||
*/
|
||||
public interface StoreCustomerMapper extends BaseMapper<StoreCustomer> {
|
||||
/**
|
||||
* 查询档口客户
|
||||
*
|
||||
* @param id 档口客户主键
|
||||
* @return 档口客户
|
||||
*/
|
||||
public StoreCustomer selectStoreCustomerByStoreCusId(Long id);
|
||||
|
||||
/**
|
||||
* 查询档口客户列表
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 档口客户集合
|
||||
*/
|
||||
public List<StoreCustomer> selectStoreCustomerList(StoreCustomer storeCustomer);
|
||||
|
||||
/**
|
||||
* 新增档口客户
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreCustomer(StoreCustomer storeCustomer);
|
||||
|
||||
/**
|
||||
* 修改档口客户
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreCustomer(StoreCustomer storeCustomer);
|
||||
|
||||
/**
|
||||
* 删除档口客户
|
||||
*
|
||||
* @param id 档口客户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreCustomerByStoreCusId(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除档口客户
|
||||
*
|
||||
* @param storeCusIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreCustomerByStoreCusIds(Long[] storeCusIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface StoreProductColorPriceMapper extends BaseMapper<StoreProductColorPrice> {
|
||||
|
||||
void updateDelFlagByStoreProdId(Long storeProdId);
|
||||
|
||||
List<StoreProdColorPriceSimpleDTO> selectListByStoreProdId(Long storeProdId);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreProductDemand;
|
||||
import com.ruoyi.xkt.dto.storeProductDemand.StoreProdDemandStatusCountResDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -31,4 +32,11 @@ public interface StoreProductDemandMapper extends BaseMapper<StoreProductDemand>
|
|||
*/
|
||||
void deleteDemandList(@Param("deleteDemandIdList") List<Long> deleteDemandIdList);
|
||||
|
||||
/**
|
||||
* 查询各状态数量
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @return StoreProdDemandStatusCountResDTO
|
||||
*/
|
||||
StoreProdDemandStatusCountResDTO getStatusNum(@Param("storeId") Long storeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.domain.StoreCustomer;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusFuzzyResDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageDTO;
|
||||
|
|
@ -22,23 +21,7 @@ public interface IStoreCustomerService {
|
|||
* @param storeCusId 档口客户主键
|
||||
* @return 档口客户
|
||||
*/
|
||||
public StoreCusDTO selectByStoreCusId(Long storeCusId);
|
||||
|
||||
/**
|
||||
* 查询档口客户列表
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 档口客户集合
|
||||
*/
|
||||
public List<StoreCustomer> selectStoreCustomerList(StoreCustomer storeCustomer);
|
||||
|
||||
/**
|
||||
* 新增档口客户
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreCustomer(StoreCustomer storeCustomer);
|
||||
StoreCusDTO selectByStoreCusId(Long storeCusId);
|
||||
|
||||
/**
|
||||
* 修改档口客户
|
||||
|
|
@ -46,28 +29,29 @@ public interface IStoreCustomerService {
|
|||
* @param storeCusDTO 档口客户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreCus(StoreCusDTO storeCusDTO);
|
||||
int updateStoreCus(StoreCusDTO storeCusDTO);
|
||||
|
||||
/**
|
||||
* 批量删除档口客户
|
||||
* 新增档口客户
|
||||
*
|
||||
* @param storeCusIds 需要删除的档口客户主键集合
|
||||
* @return 结果
|
||||
* @param storeCusDTO 新增入参
|
||||
* @return
|
||||
*/
|
||||
public int deleteStoreCustomerByStoreCusIds(Long[] storeCusIds);
|
||||
|
||||
/**
|
||||
* 删除档口客户信息
|
||||
*
|
||||
* @param storeCusId 档口客户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreCustomerByStoreCusId(Long storeCusId);
|
||||
|
||||
int create(StoreCusDTO storeCusDTO);
|
||||
|
||||
/**
|
||||
* 删除档口客户
|
||||
*
|
||||
* @param storeCusId 档口客户ID
|
||||
*/
|
||||
void deleteStoreCus(Long storeCusId);
|
||||
|
||||
/**
|
||||
* 查询档口客户分页
|
||||
*
|
||||
* @param storeCusPageDTO
|
||||
* @return
|
||||
*/
|
||||
Page<StoreCusPageResDTO> selectPage(StoreCusPageDTO storeCusPageDTO);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public interface IStoreProductDemandService {
|
|||
* @return 返回一个包含校验结果的DTO对象,包括是否存在以及相关的验证信息
|
||||
*/
|
||||
StoreProdDemandVerifyResDTO verifyDemandExist(StoreProdDemandVerifyDTO demandVerifyDTO);
|
||||
|
||||
/**
|
||||
* 导出生产需求单
|
||||
*
|
||||
|
|
@ -76,4 +77,19 @@ public interface IStoreProductDemandService {
|
|||
*/
|
||||
List<StoreProdDemandDownloadDTO> export(StoreProdDemandExportDTO exportDTO);
|
||||
|
||||
/**
|
||||
* 获取需求单各个状态对应的数量
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @return StoreProdDemandStatusCountResDTO
|
||||
*/
|
||||
StoreProdDemandStatusCountResDTO getStatusNum(Long storeId);
|
||||
|
||||
/**
|
||||
* 全部完成
|
||||
*
|
||||
* @param finishAllDTO 全部完成
|
||||
* @return Integer
|
||||
*/
|
||||
Integer finishAll(StoreProdDemandFinishAllDTO finishAllDTO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public interface IStoreProductService {
|
|||
* @param storeProdDTO 档口商品
|
||||
* @return 结果
|
||||
*/
|
||||
int insertStoreProduct(StoreProdDTO storeProdDTO) throws IOException;
|
||||
int create(StoreProdDTO storeProdDTO) throws IOException;
|
||||
|
||||
/**
|
||||
* 修改档口商品
|
||||
|
|
@ -56,7 +56,7 @@ public interface IStoreProductService {
|
|||
* @param storeProdDTO 档口商品
|
||||
* @return 结果
|
||||
*/
|
||||
int updateStoreProduct(Long storeProdId, StoreProdDTO storeProdDTO) throws IOException;
|
||||
int update(Long storeProdId, StoreProdDTO storeProdDTO) throws IOException;
|
||||
|
||||
/**
|
||||
* 更新档口商品状态
|
||||
|
|
@ -158,4 +158,5 @@ public interface IStoreProductService {
|
|||
* @return List<StoreProdFuzzyLatest20ResDTO>
|
||||
*/
|
||||
List<StoreProdFuzzyLatest30ResDTO> fuzzyQueryLatest30List(Long storeId, String prodArtNum);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.ruoyi.common.constant.Constants;
|
|||
import com.ruoyi.common.constant.HttpStatus;
|
||||
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.StoreCustomer;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
|
||||
|
|
@ -116,7 +115,7 @@ public class StoreCustomerServiceImpl implements IStoreCustomerService {
|
|||
.eq(StoreCustomer::getId, storeCusDTO.getStoreCusId()).eq(StoreCustomer::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("档口客户不存在!"));
|
||||
BeanUtil.copyProperties(storeCusDTO, storeCus);
|
||||
return storeCusMapper.updateStoreCustomer(storeCus);
|
||||
return storeCusMapper.updateById(storeCus);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -135,55 +134,4 @@ public class StoreCustomerServiceImpl implements IStoreCustomerService {
|
|||
return BeanUtil.toBean(storeCus, StoreCusDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询档口客户列表
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 档口客户
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreCustomer> selectStoreCustomerList(StoreCustomer storeCustomer) {
|
||||
return storeCusMapper.selectStoreCustomerList(storeCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口客户
|
||||
*
|
||||
* @param storeCustomer 档口客户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertStoreCustomer(StoreCustomer storeCustomer) {
|
||||
storeCustomer.setCreateTime(DateUtils.getNowDate());
|
||||
return storeCusMapper.insertStoreCustomer(storeCustomer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除档口客户
|
||||
*
|
||||
* @param storeCusIds 需要删除的档口客户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteStoreCustomerByStoreCusIds(Long[] storeCusIds) {
|
||||
return storeCusMapper.deleteStoreCustomerByStoreCusIds(storeCusIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档口客户信息
|
||||
*
|
||||
* @param storeCusId 档口客户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteStoreCustomerByStoreCusId(Long storeCusId) {
|
||||
return storeCusMapper.deleteStoreCustomerByStoreCusId(storeCusId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,18 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
|
|||
final StoreProductStorageDemandDeductMapper storageDemandDeductMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 获取需求单各个状态对应的数量
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @return StoreProdDemandStatusCountResDTO
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreProdDemandStatusCountResDTO getStatusNum(Long storeId) {
|
||||
return this.storeProdDemandMapper.getStatusNum(storeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定门店及商品的库存和生产数量
|
||||
* 此方法用于查询特定门店中特定商品的库存和生产数量信息,帮助进行库存管理和生产计划制定
|
||||
|
|
@ -381,9 +393,12 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreProdDemandDownloadDTO> export(StoreProdDemandExportDTO exportDTO) {
|
||||
List<StoreProductDemandDetail> demandDetailList = this.storeProdDemandDetailMapper.selectList(new LambdaQueryWrapper<StoreProductDemandDetail>()
|
||||
.eq(StoreProductDemandDetail::getStoreId, exportDTO.getStoreId()).eq(StoreProductDemandDetail::getDelFlag, Constants.UNDELETED)
|
||||
.in(StoreProductDemandDetail::getId, exportDTO.getStoreProdDemandDetailIdList()));
|
||||
LambdaQueryWrapper<StoreProductDemandDetail> queryWrapper = new LambdaQueryWrapper<StoreProductDemandDetail>()
|
||||
.eq(StoreProductDemandDetail::getStoreId, exportDTO.getStoreId()).eq(StoreProductDemandDetail::getDelFlag, Constants.UNDELETED);
|
||||
if (CollectionUtils.isNotEmpty(exportDTO.getStoreProdDemandDetailIdList())) {
|
||||
queryWrapper.in(StoreProductDemandDetail::getId, exportDTO.getStoreProdDemandDetailIdList());
|
||||
}
|
||||
List<StoreProductDemandDetail> demandDetailList = this.storeProdDemandDetailMapper.selectList(queryWrapper);
|
||||
List<StoreProdDemandDownloadDTO> downLoadList = demandDetailList.stream().sorted(Comparator.comparing(StoreProductDemandDetail::getProdArtNum))
|
||||
.map(x -> new StoreProdDemandDownloadDTO()
|
||||
.setProdArtNum(x.getProdArtNum()).setColorName(x.getColorName()).setSize30Quantity(x.getSize30()).setSize31Quantity(x.getSize31())
|
||||
|
|
@ -552,8 +567,8 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
|
|||
// 更新数量为最新数量
|
||||
.setQuantity(quantity);
|
||||
});
|
||||
this.storeProdDemandDetailMapper.updateById(demandDetailList);
|
||||
// 有需求明细的抵扣关系,则将已完成的入库单数量变更为当前需求单数量 并将需求明细状态置为已完成
|
||||
this.storeProdDemandDetailMapper.updateById(demandDetailList);
|
||||
List<StoreProductDemandDetail> listAfterUpdate = this.storeProdDemandDetailMapper.selectList(new LambdaQueryWrapper<StoreProductDemandDetail>()
|
||||
.in(StoreProductDemandDetail::getStoreProdDemandId, demandDetailList.stream().map(StoreProductDemandDetail::getStoreProdDemandId).collect(Collectors.toList()))
|
||||
.eq(StoreProductDemandDetail::getDelFlag, Constants.UNDELETED));
|
||||
|
|
@ -571,6 +586,47 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 全部完成
|
||||
*
|
||||
* @param finishAllDTO 全部完成
|
||||
* @return Integer
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer finishAll(StoreProdDemandFinishAllDTO finishAllDTO) {
|
||||
List<StoreProductDemandDetail> demandDetailList = this.storeProdDemandDetailMapper.selectList(new LambdaQueryWrapper<StoreProductDemandDetail>()
|
||||
.eq(StoreProductDemandDetail::getDelFlag, Constants.UNDELETED).eq(StoreProductDemandDetail::getStoreId, finishAllDTO.getStoreId())
|
||||
.in(StoreProductDemandDetail::getId, finishAllDTO.getStoreProdDemandDetailIdList()));
|
||||
if (CollectionUtils.isEmpty(demandDetailList)) {
|
||||
throw new ServiceException("没有找到任何需求单!", HttpStatus.ERROR);
|
||||
}
|
||||
// 调整状态为已完成
|
||||
demandDetailList.forEach(demandDetail -> demandDetail.setDetailStatus(DemandStatus.PRODUCTION_COMPLETE.getValue()));
|
||||
int count = this.storeProdDemandDetailMapper.updateById(demandDetailList).size();
|
||||
// 查询需求单所有的明细列表,判断状态是否都已完成
|
||||
List<StoreProductDemandDetail> allDemandDetailList = this.storeProdDemandDetailMapper.selectList(new LambdaQueryWrapper<StoreProductDemandDetail>()
|
||||
.eq(StoreProductDemandDetail::getDelFlag, Constants.UNDELETED).eq(StoreProductDemandDetail::getStoreId, finishAllDTO.getStoreId())
|
||||
.in(StoreProductDemandDetail::getStoreProdDemandId, finishAllDTO.getStoreProdDemandIdList()));
|
||||
List<Long> finishDemandIdList = new ArrayList<>();
|
||||
// 判断有哪些是都已完成的
|
||||
allDemandDetailList.stream().collect(Collectors.groupingBy(StoreProductDemandDetail::getStoreProdDemandId))
|
||||
.forEach((demandId, detailList) -> {
|
||||
// 所有明细均已完成
|
||||
if (detailList.stream().allMatch(x -> Objects.equals(x.getDetailStatus(), DemandStatus.PRODUCTION_COMPLETE.getValue()))) {
|
||||
finishDemandIdList.add(demandId);
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isEmpty(finishDemandIdList)) {
|
||||
return count;
|
||||
}
|
||||
List<StoreProductDemand> demandList = this.storeProdDemandMapper.selectList(new LambdaQueryWrapper<StoreProductDemand>()
|
||||
.in(StoreProductDemand::getId, finishDemandIdList).eq(StoreProductDemand::getDelFlag, Constants.UNDELETED));
|
||||
demandList.forEach(demand -> demand.setDemandStatus(DemandStatus.PRODUCTION_COMPLETE.getValue()));
|
||||
this.storeProdDemandMapper.updateById(demandList);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据商品详情信息添加错误消息
|
||||
|
|
|
|||
|
|
@ -196,8 +196,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertStoreProduct(StoreProdDTO storeProdDTO) throws IOException {
|
||||
|
||||
public int create(StoreProdDTO createDTO) throws IOException {
|
||||
|
||||
// TODO 富文本标签过滤
|
||||
// TODO 富文本标签过滤
|
||||
|
|
@ -208,29 +207,25 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// TODO 富文本标签过滤
|
||||
|
||||
// 用户是否为档口管理者或子账户
|
||||
if (!SecurityUtils.isAdmin() && !SecurityUtils.isStoreManagerOrSub(storeProdDTO.getStoreId())) {
|
||||
if (!SecurityUtils.isAdmin() && !SecurityUtils.isStoreManagerOrSub(createDTO.getStoreId())) {
|
||||
throw new ServiceException("当前用户非档口管理者或子账号,无权限操作!", HttpStatus.ERROR);
|
||||
}
|
||||
// 组装StoreProduct数据
|
||||
StoreProduct storeProd = BeanUtil.toBean(storeProdDTO, StoreProduct.class).setVoucherDate(DateUtils.getNowDate())
|
||||
StoreProduct storeProd = BeanUtil.toBean(createDTO, StoreProduct.class).setVoucherDate(DateUtils.getNowDate())
|
||||
.setRecommendWeight(0L).setSaleWeight(0L).setPopularityWeight(0L);
|
||||
int count = this.storeProdMapper.insert(storeProd);
|
||||
// 处理档口所有颜色
|
||||
Map<String, StoreColor> storeColorMap = this.handleStoreColor(storeProdDTO);
|
||||
// 处理编辑档口商品颜色
|
||||
this.handleStoreProdColorList(storeColorMap, storeProd, storeProdDTO.getColorList(), storeProd.getId(), storeProd.getStoreId(), Boolean.TRUE);
|
||||
// 处理编辑档口商品颜色尺码
|
||||
this.handleStoreProdColorSizeList(storeColorMap, storeProdDTO.getSizeList(), storeProd.getId(), Boolean.TRUE);
|
||||
// 处理StoreProduct其它属性
|
||||
this.handleStoreProdProperties(storeColorMap, storeProd, storeProdDTO);
|
||||
// 新增档口商品颜色相关
|
||||
this.createProdColor(createDTO, storeProd);
|
||||
// 新增档口商品其它属性
|
||||
this.createOtherProperties(createDTO, storeProd);
|
||||
// 立即发布 将商品同步到 ES 商品文档,并将商品主图同步到 以图搜款服务中
|
||||
if (Objects.equals(storeProd.getListingWay(), ListingType.RIGHT_NOW.getValue())) {
|
||||
// redis中的档口
|
||||
Store store = this.redisCache.getCacheObject(CacheConstants.STORE_KEY + storeProd.getStoreId());
|
||||
// 向ES索引: product_info 创建文档
|
||||
this.createESDoc(storeProd, storeProdDTO, store.getStoreName());
|
||||
this.createESDoc(storeProd, createDTO, store.getStoreName());
|
||||
// 搜图服务同步
|
||||
sync2ImgSearchServer(storeProd.getId(), storeProdDTO.getFileList());
|
||||
sync2ImgSearchServer(storeProd.getId(), createDTO.getFileList());
|
||||
// 新增档口商品动态、关注档口通知公告
|
||||
this.createNotice(storeProd, store.getStoreName());
|
||||
}
|
||||
|
|
@ -241,12 +236,12 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
/**
|
||||
* 修改档口商品
|
||||
*
|
||||
* @param storeProdDTO 档口商品
|
||||
* @param updateDTO 档口商品
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateStoreProduct(final Long storeProdId, StoreProdDTO storeProdDTO) throws IOException {
|
||||
public int update(final Long storeProdId, StoreProdDTO updateDTO) throws IOException {
|
||||
|
||||
|
||||
// TODO 富文本标签过滤
|
||||
|
|
@ -262,37 +257,31 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
.eq(StoreProduct::getId, storeProdId).eq(StoreProduct::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("档口商品不存在!", HttpStatus.ERROR));
|
||||
// 更新档口商品信息
|
||||
BeanUtil.copyProperties(storeProdDTO, storeProd);
|
||||
BeanUtil.copyProperties(updateDTO, storeProd);
|
||||
int count = this.storeProdMapper.updateById(storeProd);
|
||||
// 档口文件(商品主图、主图视频、下载的商品详情)的del_flag置为2
|
||||
this.storeProdFileMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 档口类目属性列表的 del_flag置为2
|
||||
this.storeProdCateAttrMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 档口颜色价格列表的del_flag置为2
|
||||
this.storeProdColorPriceMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 档口详情内容的del_flag置为2
|
||||
this.storeProdDetailMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 档口服务承诺的del_flag置为2
|
||||
this.storeProdSvcMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 档口工艺信息的del_flag置为2
|
||||
this.storeProdProcMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 处理档口所有颜色
|
||||
Map<String, StoreColor> storeColorMap = this.handleStoreColor(storeProdDTO);
|
||||
// 更新档口商品颜色价格及尺码等
|
||||
this.updateColorRelation(updateDTO, storeProdId, storeProd.getStoreId());
|
||||
// 处理更新逻辑
|
||||
this.handleStoreProdProperties(storeColorMap, storeProd, storeProdDTO);
|
||||
// 处理编辑档口商品颜色
|
||||
this.handleStoreProdColorList(storeColorMap, storeProd, storeProdDTO.getColorList(), storeProdId, storeProd.getStoreId(), Boolean.FALSE);
|
||||
// 处理编辑档口商品颜色尺码
|
||||
this.handleStoreProdColorSizeList(storeColorMap, storeProdDTO.getSizeList(), storeProdId, Boolean.FALSE);
|
||||
this.updateOtherProperties(updateDTO, storeProd);
|
||||
// 只有在售和尾货状态,更新ES 信息 及 图搜
|
||||
if (Objects.equals(storeProd.getProdStatus(), EProductStatus.ON_SALE.getValue())
|
||||
|| Objects.equals(storeProd.getProdStatus(), EProductStatus.TAIL_GOODS.getValue())) {
|
||||
// 从redis中获取store
|
||||
Store store = this.redisCache.getCacheObject(CacheConstants.STORE_KEY + storeProd.getStoreId());
|
||||
// 更新索引: product_info 的文档
|
||||
this.updateESDoc(storeProd, storeProdDTO, store.getStoreName());
|
||||
this.updateESDoc(storeProd, updateDTO, store.getStoreName());
|
||||
// 搜图服务同步
|
||||
sync2ImgSearchServer(storeProd.getId(), storeProdDTO.getFileList());
|
||||
sync2ImgSearchServer(storeProd.getId(), updateDTO.getFileList());
|
||||
// 更新档口商品动态、关注档口、收藏商品通知公告
|
||||
this.updateNotice(storeProd, store.getStoreName());
|
||||
}
|
||||
|
|
@ -300,157 +289,182 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 处理档口所有的颜色
|
||||
* 更新商品其它属性
|
||||
*
|
||||
* @param storeProdDTO 入参
|
||||
* @return Map<String, StoreColor>
|
||||
* @param updateDTO 更新入参
|
||||
* @param storeProd 档口商品
|
||||
*/
|
||||
private Map<String, StoreColor> handleStoreColor(StoreProdDTO storeProdDTO) {
|
||||
// 处理档口所有颜色列表
|
||||
List<StoreColor> storeColorList = this.storeColorMapper.selectList(new LambdaQueryWrapper<StoreColor>()
|
||||
.eq(StoreColor::getStoreId, storeProdDTO.getStoreId()).eq(StoreColor::getDelFlag, Constants.UNDELETED));
|
||||
List<Long> dbStoreColorIdList = storeColorList.stream().map(StoreColor::getId).collect(Collectors.toList());
|
||||
// 新增的颜色列表
|
||||
List<StoreColor> addColorList = storeProdDTO.getAllColorList().stream().filter(x -> !dbStoreColorIdList.contains(x.getStoreColorId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreColor.class).setStoreId(storeProdDTO.getStoreId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(addColorList)) {
|
||||
this.storeColorMapper.insert(addColorList);
|
||||
private void updateOtherProperties(StoreProdDTO updateDTO, StoreProduct storeProd) {
|
||||
// 上传的文件列表
|
||||
final List<StoreProdFileDTO> fileDTOList = updateDTO.getFileList();
|
||||
// 将文件插入到SysFile表中
|
||||
List<SysFile> fileList = BeanUtil.copyToList(fileDTOList, SysFile.class);
|
||||
this.fileMapper.insert(fileList);
|
||||
// 将文件名称和文件ID映射到Map中
|
||||
Map<String, Long> fileMap = fileList.stream().collect(Collectors.toMap(SysFile::getFileName, SysFile::getId));
|
||||
// 档口文件(商品主图、主图视频、下载的商品详情)
|
||||
List<StoreProductFile> prodFileList = fileDTOList.stream().map(x -> BeanUtil.toBean(x, StoreProductFile.class)
|
||||
.setFileId(fileMap.get(x.getFileName())).setStoreProdId(storeProd.getId()).setStoreId(updateDTO.getStoreId()))
|
||||
.collect(Collectors.toList());
|
||||
this.storeProdFileMapper.insert(prodFileList);
|
||||
// 档口类目属性
|
||||
this.storeProdCateAttrMapper.insert(BeanUtil.toBean(updateDTO.getCateAttr(), StoreProductCategoryAttribute.class)
|
||||
.setStoreProdId(storeProd.getId()).setStoreId(storeProd.getStoreId()));
|
||||
// 档口详情内容
|
||||
StoreProductDetail storeProdDetail = new StoreProductDetail().setDetail(updateDTO.getDetail()).setStoreProdId(storeProd.getId());
|
||||
this.storeProdDetailMapper.insert(storeProdDetail);
|
||||
// 档口服务承诺
|
||||
if (ObjectUtils.isNotEmpty(updateDTO.getSvc())) {
|
||||
this.storeProdSvcMapper.insert(BeanUtil.toBean(updateDTO.getSvc(), StoreProductService.class).setStoreProdId(storeProd.getId()));
|
||||
}
|
||||
// 所有的档口颜色
|
||||
CollectionUtils.addAll(addColorList, storeColorList);
|
||||
return addColorList.stream().collect(Collectors.toMap(StoreColor::getColorName, Function.identity()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理店铺商品颜色尺码列表
|
||||
*
|
||||
* @param storeColorMap
|
||||
* @param sizeDTOList 店铺商品颜色尺码DTO列表
|
||||
* @param storeProdId 店铺商品ID
|
||||
* @param isInsert 是否是插入操作
|
||||
*/
|
||||
private void handleStoreProdColorSizeList(Map<String, StoreColor> storeColorMap, List<StoreProdColorSizeDTO> sizeDTOList, Long storeProdId, Boolean isInsert) {
|
||||
sizeDTOList.forEach(x -> x.setStoreColorId(storeColorMap.get(x.getColorName()).getId()));
|
||||
if (isInsert) {
|
||||
// 如果是插入操作,直接插入新的颜色尺码信息
|
||||
List<StoreProductColorSize> toAddList = sizeDTOList.stream().sorted(Comparator.comparing(StoreProdColorSizeDTO::getStoreColorId))
|
||||
.filter(x -> ObjectUtils.isEmpty(x.getStoreProdColorSizeId())).map(x -> BeanUtil
|
||||
.toBean(x, StoreProductColorSize.class).setStoreProdId(storeProdId))
|
||||
.collect(Collectors.toList());
|
||||
this.storeProdColorSizeMapper.insert(toAddList);
|
||||
} else {
|
||||
// 查询当前商品最新的颜色,并与现在做对比
|
||||
List<StoreProductColor> dbColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getDelFlag, Constants.UNDELETED));
|
||||
List<Long> dbColorIdList = dbColorList.stream().map(StoreProductColor::getId).collect(Collectors.toList());
|
||||
List<Long> newColorIdList = sizeDTOList.stream().map(StoreProdColorSizeDTO::getStoreColorId).collect(Collectors.toList());
|
||||
// 判断这两个list 内容是否完全一致(不考虑顺序,只考虑内容)
|
||||
boolean colorEqual = CollectionUtils.isEqualCollection(dbColorIdList, newColorIdList);
|
||||
|
||||
// 如果不是插入操作,首先获取数据库中的颜色尺码信息
|
||||
List<StoreProductColorSize> colorSizeList = Optional.ofNullable(this.storeProdColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.eq(StoreProductColorSize::getStoreProdId, storeProdId).eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("该档口下没有商品及颜色", HttpStatus.ERROR));
|
||||
// 标准尺码是否一致
|
||||
List<Integer> dbStandardList = colorSizeList.stream().filter(x -> Objects.equals(x.getStandard(), ProductSizeStatus.STANDARD.getValue()))
|
||||
.map(StoreProductColorSize::getSize).distinct().collect(Collectors.toList());
|
||||
List<Integer> newStandardList = sizeDTOList.stream().filter(x -> Objects.equals(x.getStandard(), ProductSizeStatus.STANDARD.getValue()))
|
||||
.map(StoreProdColorSizeDTO::getSize).collect(Collectors.toList());
|
||||
boolean standardEqual = CollectionUtils.isEqualCollection(dbStandardList, newStandardList);
|
||||
// 如果两项都没变动,则不做任何调整
|
||||
if (colorEqual && standardEqual) {
|
||||
return;
|
||||
}
|
||||
boolean colorUpdate = Boolean.FALSE;
|
||||
// 颜色不相等
|
||||
if (!colorEqual) {
|
||||
// 新增的颜色
|
||||
List<Long> addColorIdList = newColorIdList.stream().filter(x -> !dbColorIdList.contains(x)).collect(Collectors.toList());
|
||||
List<StoreProductColorSize> toUpdateList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(addColorIdList)) {
|
||||
Map<Integer, Integer> sizeMap = sizeDTOList.stream().collect(Collectors.toMap(StoreProdColorSizeDTO::getSize, StoreProdColorSizeDTO::getStandard));
|
||||
sizeMap.forEach((size, standard) -> addColorIdList.forEach(storeColorId -> toUpdateList
|
||||
.add(new StoreProductColorSize().setSize(size).setStoreColorId(storeColorId).setStoreProdId(storeProdId).setStandard(standard))));
|
||||
}
|
||||
// 删除的颜色
|
||||
List<Long> deleteColorIdList = dbColorIdList.stream().filter(x -> !newColorIdList.contains(x)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(deleteColorIdList)) {
|
||||
toUpdateList.addAll(colorSizeList.stream().filter(x -> deleteColorIdList.contains(x.getStoreColorId())).peek(x -> x.setDelFlag(DELETED)).collect(Collectors.toList()));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(toUpdateList)) {
|
||||
this.storeProdColorSizeMapper.insertOrUpdate(toUpdateList);
|
||||
}
|
||||
colorUpdate = Boolean.TRUE;
|
||||
}
|
||||
if (!standardEqual) {
|
||||
// 如果更新过颜色,则重新从数据库获取数据
|
||||
if (colorUpdate) {
|
||||
colorSizeList = Optional.ofNullable(this.storeProdColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.eq(StoreProductColorSize::getStoreProdId, storeProdId).eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("该档口下没有商品及颜色", HttpStatus.ERROR));
|
||||
}
|
||||
// 新增的标准尺码
|
||||
List<Integer> createStandardList = newStandardList.stream().filter(item -> !dbStandardList.contains(item)).collect(Collectors.toList());
|
||||
List<StoreProductColorSize> toUpdateList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(createStandardList)) {
|
||||
toUpdateList.addAll(colorSizeList.stream().filter(item -> createStandardList.contains(item.getSize())).peek(x -> x.setStandard(ProductSizeStatus.STANDARD.getValue())).collect(Collectors.toList()));
|
||||
}
|
||||
// 删除的标准尺码
|
||||
List<Integer> deleteStandardList = dbStandardList.stream().filter(item -> !newStandardList.contains(item)).collect(Collectors.toList());
|
||||
// 将这些标准尺码的standard置为0
|
||||
if (CollectionUtils.isNotEmpty(deleteStandardList)) {
|
||||
toUpdateList.addAll(colorSizeList.stream().filter(x -> deleteStandardList.contains(x.getSize())).peek(x -> x.setStandard(ProductSizeStatus.UN_STANDARD.getValue())).collect(Collectors.toList()));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(toUpdateList)) {
|
||||
this.storeProdColorSizeMapper.insertOrUpdate(toUpdateList);
|
||||
}
|
||||
}
|
||||
// 档口生产工艺信息
|
||||
if (ObjectUtils.isNotEmpty(updateDTO.getProcess())) {
|
||||
this.storeProdProcMapper.insert(BeanUtil.toBean(updateDTO.getProcess(), StoreProductProcess.class).setStoreProdId(storeProd.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理店铺商品颜色列表
|
||||
* 更新档口商品其它属性
|
||||
*
|
||||
* @param storeColorMap
|
||||
* @param storeProd 档口商品
|
||||
* @param colorDTOList 商品颜色DTO列表
|
||||
* @param storeProdId 店铺商品ID
|
||||
* @param storeId 店铺ID
|
||||
* @param isInsert 是否是插入操作
|
||||
* @param updateDTO 更新入参
|
||||
* @param storeProdId 档口商品ID
|
||||
* @param storeId 档口ID
|
||||
*/
|
||||
private void handleStoreProdColorList(Map<String, StoreColor> storeColorMap, StoreProduct storeProd, List<StoreProdColorDTO> colorDTOList, Long storeProdId, Long storeId, Boolean isInsert) {
|
||||
// 档口商品颜色map,给入参赋值
|
||||
colorDTOList.forEach(x -> x.setStoreColorId(storeColorMap.get(x.getColorName()).getId()));
|
||||
if (isInsert) {
|
||||
// 过滤出需要添加的商品颜色,并转换为StoreProductColor对象
|
||||
List<StoreProductColor> toAddList = colorDTOList.stream().filter(x -> ObjectUtils.isEmpty(x.getStoreProdColorId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreProductColor.class).setStoreProdId(storeProdId).setStoreId(storeId)).collect(Collectors.toList());
|
||||
// 如果是插入操作,直接添加新的商品颜色
|
||||
this.storeProdColorMapper.insert(toAddList);
|
||||
// 给设置了所有商品优惠的客户 新增优惠
|
||||
this.createStoreCusDiscount(toAddList, storeProd);
|
||||
} else {
|
||||
List<StoreProductColor> dbColorList = Optional.ofNullable(this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getDelFlag, Constants.UNDELETED)
|
||||
.eq(StoreProductColor::getStoreId, storeId)))
|
||||
.orElseThrow(() -> new ServiceException("该档口下没有商品及颜色", HttpStatus.ERROR));
|
||||
final List<Long> dbStoreColorIdList = dbColorList.stream().map(StoreProductColor::getStoreColorId).collect(Collectors.toList());
|
||||
final List<Long> newStoreColorIdList = colorDTOList.stream().map(StoreProdColorDTO::getStoreColorId).collect(Collectors.toList());
|
||||
// 新增的颜色
|
||||
List<StoreProductColor> newColorList = colorDTOList.stream().filter(x -> !dbStoreColorIdList.contains(x.getStoreColorId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreProductColor.class).setStoreProdId(storeProdId).setStoreId(storeId)).collect(Collectors.toList());
|
||||
// 给设置了所有商品优惠的客户 新增优惠
|
||||
this.createStoreCusDiscount(newColorList, storeProd);
|
||||
// 删除的颜色
|
||||
List<StoreProductColor> deleteColorList = dbColorList.stream().filter(x -> !newStoreColorIdList.contains(x.getStoreColorId()))
|
||||
.peek(x -> x.setDelFlag(Constants.DELETED)).collect(Collectors.toList());
|
||||
// 将deleteColorList添加到newColorList中 并且是null-safe
|
||||
CollectionUtils.addAll(newColorList, deleteColorList);
|
||||
if (CollectionUtils.isNotEmpty(newColorList)) {
|
||||
this.storeProdColorMapper.insertOrUpdate(newColorList);
|
||||
}
|
||||
private void updateColorRelation(StoreProdDTO updateDTO, Long storeProdId, Long storeId) {
|
||||
// 处理档口所有颜色
|
||||
Map<String, Long> storeColorMap = updateDTO.getAllColorList().stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreColorId()))
|
||||
.collect(Collectors.toMap(StoreColorDTO::getColorName, StoreColorDTO::getStoreColorId));
|
||||
List<StoreColor> newColorList = updateDTO.getAllColorList().stream().filter(x -> ObjectUtils.isEmpty(x.getStoreColorId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreColor.class).setStoreId(updateDTO.getStoreId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(newColorList)) {
|
||||
this.storeColorMapper.insert(newColorList);
|
||||
storeColorMap.putAll(newColorList.stream().collect(Collectors.toMap(StoreColor::getColorName, StoreColor::getId)));
|
||||
}
|
||||
// 所有颜色列表
|
||||
List<StoreProductColor> prodColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getDelFlag, Constants.UNDELETED));
|
||||
List<Long> existColorIdList = prodColorList.stream().map(StoreProductColor::getStoreColorId).collect(Collectors.toList());
|
||||
prodColorList.forEach(color -> {
|
||||
// 判断有哪些是删除的颜色
|
||||
if (!storeColorMap.containsValue(color.getStoreColorId())) {
|
||||
color.setDelFlag(Constants.DELETED);
|
||||
}
|
||||
});
|
||||
// 非新增颜色价格map
|
||||
Map<Long, BigDecimal> existColorPriceMap = updateDTO.getColorPriceList().stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreColorId()))
|
||||
.collect(Collectors.toMap(StoreProdDTO.SPCColorPriceDTO::getStoreColorId, StoreProdDTO.SPCColorPriceDTO::getPrice));
|
||||
// 所有已存在的颜色价格列表
|
||||
List<StoreProductColorPrice> storeColorPriceList = this.storeProdColorPriceMapper.selectList(new LambdaQueryWrapper<StoreProductColorPrice>()
|
||||
.eq(StoreProductColorPrice::getStoreProdId, storeProdId).eq(StoreProductColorPrice::getDelFlag, Constants.UNDELETED));
|
||||
storeColorPriceList.forEach(x -> {
|
||||
// 判断有哪些是删除的颜色
|
||||
if (!storeColorMap.containsValue(x.getStoreColorId())) {
|
||||
x.setDelFlag(Constants.DELETED);
|
||||
} else {
|
||||
// 更新颜色价格
|
||||
x.setPrice(existColorPriceMap.get(x.getStoreColorId()));
|
||||
}
|
||||
});
|
||||
// 标准尺码map
|
||||
Map<Integer, Integer> standardSizeMap = updateDTO.getSizeList().stream().collect(Collectors
|
||||
.toMap(StoreProdDTO.SPCSizeDTO::getSize, StoreProdDTO.SPCSizeDTO::getStandard));
|
||||
// 所有已存在的颜色价格尺码列表
|
||||
List<StoreProductColorSize> storeColorSizeList = this.storeProdColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.eq(StoreProductColorSize::getStoreProdId, storeProdId).eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED));
|
||||
storeColorSizeList.forEach(x -> {
|
||||
// 哪些是删除颜色
|
||||
if (!storeColorMap.containsValue(x.getStoreColorId())) {
|
||||
x.setDelFlag(Constants.DELETED);
|
||||
} else {
|
||||
// 更新标准尺码
|
||||
x.setStandard(standardSizeMap.get(x.getSize()));
|
||||
}
|
||||
});
|
||||
// 新增的颜色价格等
|
||||
List<StoreProdDTO.SPCColorPriceDTO> newColorPriceList = updateDTO.getColorPriceList().stream()
|
||||
.filter(x -> !existColorIdList.contains(x.getStoreColorId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(newColorPriceList)) {
|
||||
newColorPriceList.forEach(newColorPrice -> {
|
||||
Long storeColorId = storeColorMap.get(newColorPrice.getColorName());
|
||||
prodColorList.add(new StoreProductColor().setStoreProdId(storeProdId).setStoreColorId(storeColorMap.get(newColorPrice.getColorName()))
|
||||
.setColorName(newColorPrice.getColorName()).setOrderNum(newColorPrice.getOrderNum()).setStoreId(storeId));
|
||||
storeColorPriceList.add(new StoreProductColorPrice().setStoreColorId(storeColorId).setPrice(newColorPrice.getPrice()).setStoreProdId(storeProdId));
|
||||
updateDTO.getSizeList().forEach(size -> storeColorSizeList.add(new StoreProductColorSize().setStoreColorId(storeColorId).setSize(size.getSize())
|
||||
.setStoreProdId(storeProdId).setStandard(size.getStandard())));
|
||||
});
|
||||
}
|
||||
this.storeProdColorMapper.insertOrUpdate(prodColorList);
|
||||
this.storeProdColorPriceMapper.insertOrUpdate(storeColorPriceList);
|
||||
this.storeProdColorSizeMapper.insertOrUpdate(storeColorSizeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品其它属性
|
||||
*
|
||||
* @param createDTO 新增入参
|
||||
* @param storeProd 档口商品
|
||||
*/
|
||||
private void createOtherProperties(StoreProdDTO createDTO, StoreProduct storeProd) {
|
||||
// 上传的文件列表
|
||||
final List<StoreProdFileDTO> fileDTOList = createDTO.getFileList();
|
||||
// 将文件插入到SysFile表中
|
||||
List<SysFile> fileList = BeanUtil.copyToList(fileDTOList, SysFile.class);
|
||||
this.fileMapper.insert(fileList);
|
||||
// 将文件名称和文件ID映射到Map中
|
||||
Map<String, Long> fileMap = fileList.stream().collect(Collectors.toMap(SysFile::getFileName, SysFile::getId));
|
||||
// 档口文件(商品主图、主图视频、下载的商品详情)
|
||||
List<StoreProductFile> prodFileList = fileDTOList.stream().map(x -> BeanUtil.toBean(x, StoreProductFile.class)
|
||||
.setFileId(fileMap.get(x.getFileName())).setStoreProdId(storeProd.getId()).setStoreId(createDTO.getStoreId()))
|
||||
.collect(Collectors.toList());
|
||||
this.storeProdFileMapper.insert(prodFileList);
|
||||
// 档口类目属性
|
||||
this.storeProdCateAttrMapper.insert(BeanUtil.toBean(createDTO.getCateAttr(), StoreProductCategoryAttribute.class)
|
||||
.setStoreProdId(storeProd.getId()).setStoreId(storeProd.getStoreId()));
|
||||
// 档口详情内容
|
||||
StoreProductDetail storeProdDetail = new StoreProductDetail().setDetail(createDTO.getDetail()).setStoreProdId(storeProd.getId());
|
||||
this.storeProdDetailMapper.insert(storeProdDetail);
|
||||
// 档口服务承诺
|
||||
if (ObjectUtils.isNotEmpty(createDTO.getSvc())) {
|
||||
this.storeProdSvcMapper.insert(BeanUtil.toBean(createDTO.getSvc(), StoreProductService.class).setStoreProdId(storeProd.getId()));
|
||||
}
|
||||
// 档口生产工艺信息
|
||||
if (ObjectUtils.isNotEmpty(createDTO.getProcess())) {
|
||||
this.storeProdProcMapper.insert(BeanUtil.toBean(createDTO.getProcess(), StoreProductProcess.class).setStoreProdId(storeProd.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品颜色等
|
||||
*
|
||||
* @param createDTO 入参
|
||||
* @param storeProd 档口商品
|
||||
*/
|
||||
private void createProdColor(StoreProdDTO createDTO, StoreProduct storeProd) {
|
||||
// 处理档口所有颜色
|
||||
Map<String, Long> storeColorMap = createDTO.getAllColorList().stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreColorId()))
|
||||
.collect(Collectors.toMap(StoreColorDTO::getColorName, StoreColorDTO::getStoreColorId));
|
||||
List<StoreColor> newColorList = createDTO.getAllColorList().stream().filter(x -> ObjectUtils.isEmpty(x.getStoreColorId()))
|
||||
.map(x -> BeanUtil.toBean(x, StoreColor.class).setStoreId(createDTO.getStoreId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(newColorList)) {
|
||||
this.storeColorMapper.insert(newColorList);
|
||||
storeColorMap.putAll(newColorList.stream().collect(Collectors.toMap(StoreColor::getColorName, StoreColor::getId)));
|
||||
}
|
||||
// 新增 档口颜色与尺码
|
||||
List<StoreProductColorPrice> prodColorPriceList = new ArrayList<>();
|
||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||
createDTO.getColorPriceList().forEach(colorPrice -> {
|
||||
prodColorList.add(new StoreProductColor().setStoreProdId(storeProd.getId()).setStoreColorId(storeColorMap.get(colorPrice.getColorName()))
|
||||
.setColorName(colorPrice.getColorName()).setOrderNum(colorPrice.getOrderNum()).setStoreId(storeProd.getStoreId()));
|
||||
prodColorPriceList.add(new StoreProductColorPrice().setStoreProdId(storeProd.getId()).setPrice(colorPrice.getPrice())
|
||||
.setStoreColorId(storeColorMap.get(colorPrice.getColorName())));
|
||||
prodColorSizeList.addAll(createDTO.getSizeList().stream().map(x -> new StoreProductColorSize().setSize(x.getSize()).setStoreProdId(storeProd.getId())
|
||||
.setStandard(x.getStandard()).setStoreColorId(storeColorMap.get(colorPrice.getColorName())))
|
||||
.collect(Collectors.toList()));
|
||||
});
|
||||
this.storeProdColorPriceMapper.insert(prodColorPriceList);
|
||||
this.storeProdColorSizeMapper.insert(prodColorSizeList);
|
||||
this.storeProdColorMapper.insert(prodColorList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -829,11 +843,10 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
/**
|
||||
* 处理档口商品属性
|
||||
*
|
||||
* @param storeColorMap 档口颜色map
|
||||
* @param storeProd 档口商品实体
|
||||
* @param storeProdDTO 档口商品数据传输对象
|
||||
* @param storeProd 档口商品实体
|
||||
* @param storeProdDTO 档口商品数据传输对象
|
||||
*/
|
||||
private void handleStoreProdProperties(Map<String, StoreColor> storeColorMap, StoreProduct storeProd, StoreProdDTO storeProdDTO) {
|
||||
private void handleStoreProdProperties(StoreProduct storeProd, StoreProdDTO storeProdDTO) {
|
||||
// 上传的文件列表
|
||||
final List<StoreProdFileDTO> fileDTOList = storeProdDTO.getFileList();
|
||||
// 将文件插入到SysFile表中
|
||||
|
|
@ -850,10 +863,10 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
this.storeProdCateAttrMapper.insert(BeanUtil.toBean(storeProdDTO.getCateAttr(), StoreProductCategoryAttribute.class)
|
||||
.setStoreProdId(storeProd.getId()).setStoreId(storeProd.getStoreId()));
|
||||
// 档口颜色价格列表
|
||||
List<StoreProductColorPrice> priceList = storeProdDTO.getPriceList().stream().map(x -> BeanUtil.toBean(x, StoreProductColorPrice.class)
|
||||
.setStoreProdId(storeProd.getId()).setStoreColorId(storeColorMap.get(x.getColorName()).getId()))
|
||||
.collect(Collectors.toList());
|
||||
this.storeProdColorPriceMapper.insert(priceList);
|
||||
// List<StoreProductColorPrice> priceList = storeProdDTO.getPriceList().stream().map(x -> BeanUtil.toBean(x, StoreProductColorPrice.class)
|
||||
// .setStoreProdId(storeProd.getId()).setStoreColorId(storeColorMap.get(x.getColorName()).getId()))
|
||||
// .collect(Collectors.toList());
|
||||
// this.storeProdColorPriceMapper.insert(priceList);
|
||||
// 档口详情内容
|
||||
StoreProductDetail storeProdDetail = new StoreProductDetail().setDetail(storeProdDTO.getDetail()).setStoreProdId(storeProd.getId());
|
||||
this.storeProdDetailMapper.insert(storeProdDetail);
|
||||
|
|
@ -892,13 +905,13 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
/**
|
||||
* 向ES索引更新文档
|
||||
*
|
||||
* @param storeProd 档口商品
|
||||
* @param storeProdDTO 档口商品更新入参
|
||||
* @param storeName 档口名称
|
||||
* @param storeProd 档口商品
|
||||
* @param updateDTO 档口商品更新入参
|
||||
* @param storeName 档口名称
|
||||
* @throws IOException
|
||||
*/
|
||||
private void updateESDoc(StoreProduct storeProd, StoreProdDTO storeProdDTO, String storeName) throws IOException {
|
||||
ESProductDTO esProductDTO = this.getESDTO(storeProd, storeProdDTO, storeName);
|
||||
private void updateESDoc(StoreProduct storeProd, StoreProdDTO updateDTO, String storeName) throws IOException {
|
||||
ESProductDTO esProductDTO = this.getESDTO(storeProd, updateDTO, storeName);
|
||||
try {
|
||||
UpdateResponse<ESProductDTO> updateResponse = esClientWrapper.getEsClient().update(u -> u
|
||||
.index(Constants.ES_IDX_PRODUCT_INFO).doc(esProductDTO).id(storeProd.getId().toString()), ESProductDTO.class);
|
||||
|
|
@ -913,29 +926,29 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
/**
|
||||
* 组装ES 入参 DTO
|
||||
*
|
||||
* @param storeProd 档口商品
|
||||
* @param storeProdDTO 档口商品更新入参
|
||||
* @param storeName 档口名称
|
||||
* @param storeProd 档口商品
|
||||
* @param updateDTO 档口商品更新入参
|
||||
* @param storeName 档口名称
|
||||
* @return
|
||||
*/
|
||||
private ESProductDTO getESDTO(StoreProduct storeProd, StoreProdDTO storeProdDTO, String storeName) {
|
||||
private ESProductDTO getESDTO(StoreProduct storeProd, StoreProdDTO updateDTO, String storeName) {
|
||||
// 获取第一张主图
|
||||
String firstMainPic = storeProdDTO.getFileList().stream().filter(x -> Objects.equals(x.getFileType(), FileType.MAIN_PIC.getValue()))
|
||||
String firstMainPic = updateDTO.getFileList().stream().filter(x -> Objects.equals(x.getFileType(), FileType.MAIN_PIC.getValue()))
|
||||
.min(Comparator.comparing(StoreProdFileDTO::getOrderNum)).map(StoreProdFileDTO::getFileUrl)
|
||||
.orElseThrow(() -> new ServiceException("商品主图不存在!", HttpStatus.ERROR));
|
||||
// 是否有主图视频
|
||||
boolean hasVideo = storeProdDTO.getFileList().stream().anyMatch(x -> Objects.equals(x.getFileType(), FileType.MAIN_PIC_VIDEO.getValue()));
|
||||
boolean hasVideo = updateDTO.getFileList().stream().anyMatch(x -> Objects.equals(x.getFileType(), FileType.MAIN_PIC_VIDEO.getValue()));
|
||||
// 获取上一级分类的分类ID 及 分类名称
|
||||
ProdCateDTO parCate = this.prodCateMapper.getParentCate(storeProdDTO.getProdCateId());
|
||||
ProdCateDTO parCate = this.prodCateMapper.getParentCate(updateDTO.getProdCateId());
|
||||
// 获取当前商品的最低价格
|
||||
BigDecimal minPrice = storeProdDTO.getPriceList().stream().min(Comparator.comparing(StoreProdColorPriceSimpleDTO::getPrice))
|
||||
.map(StoreProdColorPriceSimpleDTO::getPrice).orElseThrow(() -> new ServiceException("商品价格不存在!", HttpStatus.ERROR));
|
||||
BigDecimal minPrice = updateDTO.getColorPriceList().stream().min(Comparator.comparing(StoreProdDTO.SPCColorPriceDTO::getPrice))
|
||||
.map(StoreProdDTO.SPCColorPriceDTO::getPrice).orElseThrow(() -> new ServiceException("商品价格不存在!", HttpStatus.ERROR));
|
||||
// 获取使用季节
|
||||
String season = storeProdDTO.getCateAttr().getSuitableSeason();
|
||||
String season = updateDTO.getCateAttr().getSuitableSeason();
|
||||
// 获取风格
|
||||
String style = storeProdDTO.getCateAttr().getStyle();
|
||||
String style = updateDTO.getCateAttr().getStyle();
|
||||
return BeanUtil.toBean(storeProd, ESProductDTO.class).setHasVideo(hasVideo)
|
||||
.setProdCateName(storeProdDTO.getProdCateName()).setSaleWeight("0").setRecommendWeight("0").setPopularityWeight("0")
|
||||
.setProdCateName(updateDTO.getProdCateName()).setSaleWeight("0").setRecommendWeight("0").setPopularityWeight("0")
|
||||
.setCreateTime(DateUtils.getTime()).setStoreName(storeName).setMainPicUrl(firstMainPic)
|
||||
.setParCateId(parCate.getProdCateId().toString()).setParCateName(parCate.getName()).setProdPrice(minPrice.toString())
|
||||
.setSeason(season).setStyle(style).setTags(Collections.singletonList(style));
|
||||
|
|
|
|||
|
|
@ -3,93 +3,5 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.StoreCustomerMapper">
|
||||
|
||||
<resultMap type="StoreCustomer" id="StoreCustomerResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="storeId" column="store_id" />
|
||||
<result property="cusName" column="cus_name" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="version" column="version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStoreCustomerVo">
|
||||
select id, store_id, cus_name, phone, remark, version, del_flag, create_by, create_time, update_by, update_time from store_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectStoreCustomerList" parameterType="StoreCustomer" resultMap="StoreCustomerResult">
|
||||
<include refid="selectStoreCustomerVo"/>
|
||||
<where>
|
||||
<if test="storeId != null "> and store_id = #{storeId}</if>
|
||||
<if test="cusName != null and cusName != ''"> and cus_name like concat('%', #{cusName}, '%')</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStoreCustomerByStoreCusId" parameterType="Long" resultMap="StoreCustomerResult">
|
||||
<include refid="selectStoreCustomerVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertStoreCustomer" parameterType="StoreCustomer" useGeneratedKeys="true" keyProperty="storeCusId">
|
||||
insert into store_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="cusName != null">cus_name,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="cusName != null">#{cusName},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreCustomer" parameterType="StoreCustomer">
|
||||
update store_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="cusName != null">cus_name = #{cusName},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStoreCustomerByStoreCusId" parameterType="Long">
|
||||
delete from store_customer where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStoreCustomerByStoreCusIds" parameterType="String">
|
||||
delete from store_customer where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -4,10 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.StoreProductColorPriceMapper">
|
||||
|
||||
<update id="updateDelFlagByStoreProdId" parameterType="Long">
|
||||
UPDATE store_product_color_price SET del_flag = 2 WHERE store_prod_id = #{storeProdId}
|
||||
</update>
|
||||
|
||||
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO">
|
||||
SELECT
|
||||
store_color_id AS storeColorId,
|
||||
|
|
|
|||
|
|
@ -4,85 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.StoreProductDemandMapper">
|
||||
|
||||
<resultMap type="StoreProductDemand" id="StoreProductDemandResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="demandStatus" column="demand_status" />
|
||||
<result property="version" column="version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStoreProductDemandVo">
|
||||
select id, code, demand_status, version, del_flag, create_by, create_time, update_by, update_time from store_product_demand
|
||||
</sql>
|
||||
|
||||
<select id="selectStoreProductDemandList" parameterType="StoreProductDemand" resultMap="StoreProductDemandResult">
|
||||
<include refid="selectStoreProductDemandVo"/>
|
||||
<where>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="demandStatus != null "> and demand_status = #{demandStatus}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStoreProductDemandByStoreProdDemandId" parameterType="Long" resultMap="StoreProductDemandResult">
|
||||
<include refid="selectStoreProductDemandVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertStoreProductDemand" parameterType="StoreProductDemand" useGeneratedKeys="true" keyProperty="storeProdDemandId">
|
||||
insert into store_product_demand
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="demandStatus != null">demand_status,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="demandStatus != null">#{demandStatus},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreProductDemand" parameterType="StoreProductDemand">
|
||||
update store_product_demand
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="demandStatus != null">demand_status = #{demandStatus},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStoreProductDemandByStoreProdDemandId" parameterType="Long">
|
||||
delete from store_product_demand where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStoreProductDemandByStoreProdDemandIds" parameterType="String">
|
||||
delete from store_product_demand where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateStatusByIds">
|
||||
UPDATE
|
||||
|
|
@ -104,6 +25,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getStatusNum" resultType="com.ruoyi.xkt.dto.storeProductDemand.StoreProdDemandStatusCountResDTO">
|
||||
SELECT
|
||||
COALESCE(SUM(CASE WHEN spd.demand_status = 1 THEN 1 ELSE 0 END),0) AS unProductionNum,
|
||||
COALESCE(SUM(CASE WHEN spd.demand_status = 2 THEN 1 ELSE 0 END),0) AS inProductionNum,
|
||||
COALESCE(SUM(CASE WHEN spd.demand_status = 3 THEN 1 ELSE 0 END),0) AS productionCompleteNum
|
||||
FROM
|
||||
store_product_demand spd
|
||||
WHERE
|
||||
spd.del_flag = 0 AND spd.store_id = #{storeId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -72,14 +72,14 @@
|
|||
SELECT us.user_id, 3 AS targetNoticeType
|
||||
FROM user_subscriptions us
|
||||
WHERE us.del_flag = 0
|
||||
AND us.store_id = ?
|
||||
AND us.store_id = #{storeId}
|
||||
|
||||
UNION
|
||||
|
||||
SELECT uf.user_id , 4 AS targetNoticeType
|
||||
FROM user_favorites uf
|
||||
WHERE uf.del_flag = 0
|
||||
AND uf.store_prod_id = ?
|
||||
AND uf.store_prod_id = #{storeProdId}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue