From 5c81622bc9c1f5b3d75ee02a63105c4c0a7ebb81 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Thu, 5 Mar 2026 08:38:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=85=8D=E9=80=81=E5=91=98?= =?UTF-8?q?=E4=BD=A3=E9=87=91=E8=AE=BE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/manage/AuthController.java | 20 ++ .../controller/manage/UserController.java | 4 +- .../controller/ProductCategoryController.java | 14 +- .../mall/controller/ProductController.java | 32 +-- .../controller/ShopTakeawayController.java | 9 +- .../controller/WorkerRelaPriceController.java | 65 +++++++ .../dao/mapper/WorkerRelaPriceMapper.java | 18 ++ .../java/cc/hiver/mall/entity/Product.java | 18 ++ .../mall/entity/ProductGroupBuyPrice.java | 16 -- .../cc/hiver/mall/entity/WorkerRelaPrice.java | 53 +++++ .../cc/hiver/mall/pojo/vo/ProductPageVO.java | 18 ++ .../java/cc/hiver/mall/pojo/vo/ProductVo.java | 18 ++ .../mybatis/WorkerRelaPriceService.java | 15 ++ .../mybatis/ProductCategoryServiceImpl.java | 4 +- .../mybatis/WorkerRelaPriceServiceImpl.java | 35 ++++ .../main/resources/mapper/ProductMapper.xml | 184 +++++++++++------- .../mapper/WorkerRelaPriceMapper.xml | 48 +++++ 17 files changed, 453 insertions(+), 118 deletions(-) create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerRelaPriceController.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/WorkerRelaPriceMapper.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/WorkerRelaPrice.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/WorkerRelaPriceService.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/WorkerRelaPriceServiceImpl.java create mode 100644 hiver-modules/hiver-mall/src/main/resources/mapper/WorkerRelaPriceMapper.xml diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java index b032ae5d..0fe45fb8 100644 --- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java +++ b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java @@ -48,6 +48,8 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -420,6 +422,24 @@ public class AuthController { shop.setShopLecard(registerShopVo.getShopLecard()); shop.setAliAccount(registerShopVo.getAliAccount()); shop.setAliName(registerShopVo.getAliName()); + shop.setRegion(registerShopVo.getRegion()); + shop.setRegionId(registerShopVo.getRegionId()); + + // 1. 获取当前日期 (LocalDate 只包含年月日,不包含时分秒) + final LocalDate today = LocalDate.now(); + + // 2. 定义格式器:yyyy-MM-dd + final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + // 3. 将当前日期格式化为字符串 (例如:2026-03-02) + final String formattedDate = today.format(formatter); + shop.setStartTime(formattedDate); + // 4. 计算加 10 年后的日期 + LocalDate tenYearsLater = today.plusYears(10); + // 5. 将加 10 年后的日期格式化为字符串 + String formattedFutureDate = tenYearsLater.format(formatter); + + shop.setEndTime(formattedFutureDate); // 店铺店铺名称,店铺地址,与用户(默认店主)的关联 // 设置注册用户为店主 shop.setShopOwnerId(user.getId()); diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java index 0f409efb..c4d2d739 100644 --- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java +++ b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java @@ -406,7 +406,7 @@ public class UserController { return ResultUtil.error("该邮箱已绑定其他账户"); } - if (CharSequenceUtil.isNotBlank(u.getDepartmentId())) { + /*if (CharSequenceUtil.isNotBlank(u.getDepartmentId())) { final Department d = departmentService.get(u.getDepartmentId()); if (d != null) { u.setDepartmentTitle(d.getTitle()); @@ -414,7 +414,7 @@ public class UserController { } else { u.setDepartmentId(null); u.setDepartmentTitle(""); - } + }*/ u.setPassword(old.getPassword()); // 是否有维护成本权限 1:是;0否 diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java index 56daf7b6..3612df97 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java @@ -57,8 +57,12 @@ public class ProductCategoryController { @ApiOperation(value = "根据id修改货品类别") public Result updateSpuById(ProductCategory productCategory) { // shopId从缓存中设置 - final String shopId = securityUtil.getShopId(); - productCategory.setShopId(shopId); + if (StringUtils.isEmpty(productCategory.getShopId())) { + final String shopId = securityUtil.getShopId(); + productCategory.setShopId(shopId); + } else { + productCategory.setShopId(productCategory.getShopId()); + } boolean result = productCategoryService.updateById(productCategory); if (result) { return ResultUtil.success("修改成功"); @@ -82,10 +86,12 @@ public class ProductCategoryController { @RequestMapping(value = "/list", method = RequestMethod.GET) @ApiOperation(value = "查询货品类别列表") - public Result list() { + public Result list(String shopId) { // QueryWrapper queryWrapper = new QueryWrapper<>(); // shopId从缓存中设置 - final String shopId = securityUtil.getShopId(); + if(shopId == null || shopId.isEmpty()){ + shopId = securityUtil.getShopId(); + } // final String shopId = "1759768115375378438"; // queryWrapper.eq("shop_id", shopId); List list = productCategoryService.getCategoryListByShopId(shopId); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java index 752699ab..abb04491 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java @@ -10,7 +10,6 @@ import cc.hiver.core.common.vo.Result; import cc.hiver.mall.entity.Product; import cc.hiver.mall.entity.ProductGroupBuyPrice; import cc.hiver.mall.pojo.query.ProductPageQuery; -import cc.hiver.mall.pojo.vo.ProductCategoryVo; import cc.hiver.mall.pojo.vo.ProductLastBuyVo; import cc.hiver.mall.pojo.vo.ProductPageVO; import cc.hiver.mall.pojo.vo.ProductVo; @@ -31,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; @Slf4j @RestController @@ -60,15 +58,15 @@ public class ProductController { // 20240824 增加修改的商品货号不能重复 // 根据货号查询商品是否存在 // shopId从缓存中设置 - final String shopId = securityUtil.getShopId(); - final CopyOnWriteArrayList oldProductListBySn = productService.getByProductSn(productVo.getProductSn(), shopId,""); - if (oldProductListBySn != null && !oldProductListBySn.isEmpty()) { + //final String shopId = securityUtil.getShopId(); + //final CopyOnWriteArrayList oldProductListBySn = productService.getByProductSn(productVo.getProductSn(), shopId,""); + /*if (oldProductListBySn != null && !oldProductListBySn.isEmpty()) { return ResultUtil.error("您已有货号"+productVo.getProductSn()+"的商品,请更换货号"); - } + }*/ final Product product = new Product(); BeanUtils.copyBeanProp(product, productVo); // 新增商品专属分类信息 - final ProductCategoryVo productCategoryVo = productVo.getProductCategoryVo(); + /*final ProductCategoryVo productCategoryVo = productVo.getProductCategoryVo(); productCategoryVo.setShopId("spfl"); final String attrId = productCategoryService.batchSaveCategoryAndAttribute(productCategoryVo); // 更新店铺尺码库 @@ -78,8 +76,8 @@ public class ProductController { product.setAttrId(attrId); } else { return ResultUtil.error("添加分类信息失败"); - } - product.setShopId(shopId); + }*/ + //product.setShopId(shopId); // 新增的默认为已上架 product.setDelFlag(CommonConstant.DEL_FLAG_TRUE); // 处理前台的错误传参 @@ -98,6 +96,9 @@ public class ProductController { // 如果有拼团信息,那么新增拼团信息 final List productGroupBuyPrices = productVo.getProductGroupBuyPrices(); + for (ProductGroupBuyPrice productGroupBuyPrice : productGroupBuyPrices) { + productGroupBuyPrice.setProductId(product.getId()); + } if (productGroupBuyPrices != null && !productGroupBuyPrices.isEmpty()) { productGroupBuyPriceService.saveBatch(productGroupBuyPrices); } @@ -114,17 +115,17 @@ public class ProductController { // 20240824 增加修改的商品货号不能重复 // 根据货号查询商品是否存在 // shopId从缓存中设置 - final String shopId = securityUtil.getShopId(); + /*final String shopId = securityUtil.getShopId(); final CopyOnWriteArrayList oldProductListBySn = productService.getByProductSn(productVo.getProductSn(), shopId,""); if (oldProductListBySn != null && !oldProductListBySn.isEmpty()) { // 如果旧商品id不等于前台传递的商品id,则返回信息 if (!productVo.getId().equals(oldProductListBySn.get(0).getId())) { return ResultUtil.error("您已有货号"+productVo.getProductSn()+"的商品,请更换货号"); } - } + }*/ final Product product = new Product(); BeanUtils.copyBeanProp(product, productVo); - // 删除商品专属分类信息 + /* // 删除商品专属分类信息 productCategoryService.deleteCategoryOfProduct1(productVo.getAttrId()); // 新增商品专属分类信息 final ProductCategoryVo productCategoryVo = productVo.getProductCategoryVo(); @@ -137,7 +138,7 @@ public class ProductController { product.setAttrId(attrId); } else { return ResultUtil.error("添加分类信息失败"); - } + }*/ // 处理前台的错误传参 if("[]".equals(product.getCustomerCategoryRule()) || "null".equals(product.getCustomerCategoryRule())){ product.setCustomerCategoryRule(""); @@ -156,7 +157,11 @@ public class ProductController { } // 如果有拼团信息,那么新增拼团信息 final List productGroupBuyPrices = productVo.getProductGroupBuyPrices(); + for (ProductGroupBuyPrice productGroupBuyPrice : productGroupBuyPrices) { + productGroupBuyPrice.setProductId(product.getId()); + } if (productGroupBuyPrices != null && !productGroupBuyPrices.isEmpty()) { + productGroupBuyPriceService.deleteByProductId(productVo.getId()); productGroupBuyPriceService.saveBatch(productGroupBuyPrices); } if (result) { @@ -361,6 +366,7 @@ public class ProductController { @ApiOperation("根据id查询商品信息") public Result getById(@PathVariable String id,String customerId) { final Product byId = productService.getByIdOrBrcode(id, customerId); + byId.setProductGroupBuyPrices(productGroupBuyPriceService.selectByProductId(id)); if (byId != null) { return new ResultUtil().setData(byId); } else { diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopTakeawayController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopTakeawayController.java index 2577583a..050ae74b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopTakeawayController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopTakeawayController.java @@ -17,9 +17,7 @@ package cc.hiver.mall.controller; import cc.hiver.core.common.utils.ResultUtil; import cc.hiver.core.common.vo.Result; -import cc.hiver.mall.entity.Sale; import cc.hiver.mall.entity.ShopTakeaway; -import cc.hiver.mall.pojo.query.SalePageQuery; import cc.hiver.mall.pojo.query.ShopTakeawayQuery; import cc.hiver.mall.service.ShopTakeawayService; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -32,7 +30,6 @@ import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.List; /** * 店铺外卖业务配置控制器 @@ -61,13 +58,13 @@ public class ShopTakeawayController { @ResponseBody public Result save(ShopTakeaway shopTakeaway) { // 1. 获取当前时间 - LocalDateTime now = LocalDateTime.now(); + final LocalDateTime now = LocalDateTime.now(); // 2. 定义格式化器 (例如:yyyy-MM-dd HH:mm:ss) - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); // 3. 转换为字符串 - String timeStr = now.format(formatter); + final String timeStr = now.format(formatter); shopTakeaway.setJoinTime(timeStr); final ShopTakeaway result = shopTakeawayService.insert(shopTakeaway); return new ResultUtil().setData(result); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerRelaPriceController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerRelaPriceController.java new file mode 100644 index 00000000..556edcbe --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerRelaPriceController.java @@ -0,0 +1,65 @@ +/* +Copyright [2022] [https://hiver.cc] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + */ +package cc.hiver.mall.controller; + +import cc.hiver.core.common.utils.ResultUtil; +import cc.hiver.core.common.vo.Result; +import cc.hiver.mall.entity.WorkerRelaPrice; +import cc.hiver.mall.service.mybatis.WorkerRelaPriceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 店铺外卖业务配置控制器 + * + * @author cc + */ +@Slf4j +@RestController +@Api(tags = "配送员佣金设定") +@RequestMapping("/hiver/app/workerRelaPrice") +public class WorkerRelaPriceController { + + @Autowired + private WorkerRelaPriceService workerRelaPriceService; + + @RequestMapping(value = "/getByWorkerId", method = RequestMethod.GET) + @ApiOperation("根据配送员id获取") + public Result> getByProductId(@RequestParam String workerId) { + final List workerRelaPriceList = workerRelaPriceService.selectByWorkerId(workerId); + return new ResultUtil>().setData(workerRelaPriceList); + } + + @PostMapping(value = "/batchAdd") + @ApiOperation("批量新增") + public Result batchAdd(@RequestBody List workerRelaPrice) { + if(workerRelaPrice != null && !workerRelaPrice.isEmpty()){ + workerRelaPriceService.deleteByWorkerId(workerRelaPrice.get(0).getWorkerId()); + } + // 批量新增 + final boolean b = workerRelaPriceService.saveBatch(workerRelaPrice); + if (b) { + return ResultUtil.success("保存成功!"); + } else { + return ResultUtil.error("保存失败!"); + } + } +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/WorkerRelaPriceMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/WorkerRelaPriceMapper.java new file mode 100644 index 00000000..f1e639ae --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/WorkerRelaPriceMapper.java @@ -0,0 +1,18 @@ +package cc.hiver.mall.dao.mapper; + +import cc.hiver.mall.entity.WorkerRelaPrice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkerRelaPriceMapper extends BaseMapper { + + int insert(WorkerRelaPrice record); + + List selectByWorkerId(String workerId); + + void deleteByWorkerId(String workerId); + +} \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java index b155ba59..e4ce90f8 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java @@ -44,6 +44,9 @@ public class Product implements Serializable { @ApiModelProperty(value = "商品是否上架 0-否 1-是") private Integer delFlag; + @ApiModelProperty(value = "商品排序") + private Integer orderFiled; + @ApiModelProperty(value = "更新者") @LastModifiedBy @TableField(fill = FieldFill.UPDATE) @@ -74,6 +77,15 @@ public class Product implements Serializable { @ApiModelProperty(value = "商品属性列表") private String attributeList; + @ApiModelProperty(value = "商品规格列表") + private String attributeListPrice; + + @ApiModelProperty(value = "是否为推荐 0不是 1是") + private Integer isPush; + + @ApiModelProperty(value = "是否为必点 0不是 1是") + private Integer isMust; + @ApiModelProperty(value = "供应商") private String supplierId; @@ -110,6 +122,12 @@ public class Product implements Serializable { @ApiModelProperty(value = "尾货预警日期") private Date salesWeek; + @ApiModelProperty(value = "开始售卖时间") + private Date sellBeginTime; + + @ApiModelProperty(value = "结束售卖时间") + private Date sellEndTime; + @ApiModelProperty(value = "打印条码(自己制作的)") private String printBarcode; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductGroupBuyPrice.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductGroupBuyPrice.java index 5763c76d..148520d0 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductGroupBuyPrice.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductGroupBuyPrice.java @@ -1,22 +1,6 @@ -/* -Copyright [2022] [https://hiver.cc] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - */ package cc.hiver.mall.entity; import cc.hiver.core.base.HiverBaseEntity; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/WorkerRelaPrice.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/WorkerRelaPrice.java new file mode 100644 index 00000000..dc6597f9 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/WorkerRelaPrice.java @@ -0,0 +1,53 @@ +package cc.hiver.mall.entity; + +import cc.hiver.core.base.HiverBaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Entity; +import javax.persistence.Table; +import java.math.BigDecimal; + +/** + * 配送员价格配置实体类 + * + * @author cc + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@Table(name = "t_worker_rela_price") +@TableName("t_worker_rela_price") +@ApiModel(value = "配送员价格配置") +public class WorkerRelaPrice extends HiverBaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "配送员id") + private String workerId; + + @ApiModelProperty(value = "取货区域id") + private String getAreaId; + + @ApiModelProperty(value = "取货区域名称") + private String getAreaName; + + @ApiModelProperty(value = "送货区域id") + private String putAreaId; + + @ApiModelProperty(value = "送货区域名称") + private String putAreaName; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "配送佣金") + private BigDecimal orderBkge; + + @ApiModelProperty(value = "配送类型") + private Integer orderType; +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java index c8288eac..f66658e9 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductPageVO.java @@ -42,6 +42,9 @@ public class ProductPageVO { @ApiModelProperty(value = "商品是否上架 0-否 1-是") private Integer delFlag; + @ApiModelProperty(value = "商品排序") + private Integer orderFiled; + @ApiModelProperty(value = "商品名称") private String productName; @@ -60,6 +63,15 @@ public class ProductPageVO { @ApiModelProperty(value = "商品属性列表") private String attributeList; + @ApiModelProperty(value = "商品规格列表") + private String attributeListPrice; + + @ApiModelProperty(value = "是否为推荐 0不是 1是") + private Integer isPush; + + @ApiModelProperty(value = "是否为必点 0不是 1是") + private Integer isMust; + @ApiModelProperty(value = "供应商") private String supplierId; @@ -99,6 +111,12 @@ public class ProductPageVO { @ApiModelProperty(value = "销售周期") private Date salesWeek; + @ApiModelProperty(value = "开始售卖时间") + private Date sellBeginTime; + + @ApiModelProperty(value = "结束售卖时间") + private Date sellEndTime; + @ApiModelProperty(value = "打印条码(自己制作的)") private String printBarcode; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java index c5ab6322..2fd100d2 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductVo.java @@ -20,6 +20,9 @@ public class ProductVo extends HiverBaseEntity { @ApiModelProperty(value = "商品是否上架 0-否 1-是") private Integer delFlag; + @ApiModelProperty(value = "商品排序") + private Integer orderFiled; + @ApiModelProperty(value = "商品名称") private String productName; @@ -38,6 +41,15 @@ public class ProductVo extends HiverBaseEntity { @ApiModelProperty(value = "商品属性列表") private String attributeList; + @ApiModelProperty(value = "商品规格列表") + private String attributeListPrice; + + @ApiModelProperty(value = "是否为推荐 0不是 1是") + private Integer isPush; + + @ApiModelProperty(value = "是否为必点 0不是 1是") + private Integer isMust; + @ApiModelProperty(value = "供应商") private String supplierId; @@ -74,6 +86,12 @@ public class ProductVo extends HiverBaseEntity { @ApiModelProperty(value = "尾货预警日期") private Date salesWeek; + @ApiModelProperty(value = "开始售卖时间") + private Date sellBeginTime; + + @ApiModelProperty(value = "结束售卖时间") + private Date sellEndTime; + @ApiModelProperty(value = "打印条码(自己制作的)") private String printBarcode; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/WorkerRelaPriceService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/WorkerRelaPriceService.java new file mode 100644 index 00000000..6d6b395c --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/WorkerRelaPriceService.java @@ -0,0 +1,15 @@ +package cc.hiver.mall.service.mybatis; + +import cc.hiver.mall.entity.WorkerRelaPrice; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface WorkerRelaPriceService extends IService { + + WorkerRelaPrice insert(WorkerRelaPrice record); + + List selectByWorkerId(String workerId); + + void deleteByWorkerId(String workerId); +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java index 1233a960..798b269e 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java @@ -431,7 +431,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl productAttributeOfAddVos = new CopyOnWriteArrayList<>(); + /*final CopyOnWriteArrayList productAttributeOfAddVos = new CopyOnWriteArrayList<>(); // 新增颜色 final ProductAttributeOfAddVo productAttributeOfAddVo = new ProductAttributeOfAddVo(); productAttributeOfAddVo.setAttributeName("颜色"); @@ -455,7 +455,7 @@ public class ProductCategoryServiceImpl extends ServiceImpl implements WorkerRelaPriceService { + + @Autowired + private WorkerRelaPriceMapper workerRelaPriceMapper; + + @Override + public WorkerRelaPrice insert(WorkerRelaPrice record) { + workerRelaPriceMapper.insert(record); + return record; + } + + @Override + public List selectByWorkerId(String workerId) { + return workerRelaPriceMapper.selectByWorkerId(workerId); + } + + @Override + public void deleteByWorkerId(String workerId) { + workerRelaPriceMapper.deleteByWorkerId(workerId); + } +} diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml index a27783f5..80b8bfba 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml @@ -30,6 +30,12 @@ + + + + + + @@ -95,7 +101,7 @@ id, create_by, create_time, del_flag, update_by, update_time, product_name, unit, shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,commission, wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode, - tail_warn,in_storage_status,customer_category_rule + tail_warn,in_storage_status,customer_category_rule, attribute_list_price, is_push, is_must, order_filed, sell_begin_time, sell_end_time @@ -407,6 +451,24 @@ customer_category_rule = #{record.customerCategoryRule,jdbcType=VARCHAR}, + + attribute_list_price = #{record.attributeListPrice,jdbcType=VARCHAR}, + + + is_push = #{record.isPush,jdbcType=INTEGER}, + + + is_must = #{record.isMust,jdbcType=INTEGER}, + + + order_filed = #{record.orderFiled,jdbcType=INTEGER} + + + sell_begin_time = #{record.sellBeginTime,jdbcType=TIMESTAMP}, + + + sell_end_time = #{record.sellEndTime,jdbcType=TIMESTAMP} + @@ -440,7 +502,13 @@ print_barcode = #{record.printBarcode,jdbcType=VARCHAR}, tail_warn = #{record.tailWarn,jdbcType=INTEGER}, in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER}, - customer_category_rule = #{record.customerCategoryRule,jdbcType=VARCHAR} + customer_category_rule = #{record.customerCategoryRule,jdbcType=VARCHAR}, + attribute_list_price = #{record.attributeListPrice,jdbcType=VARCHAR}, + is_push = #{record.isPush,jdbcType=INTEGER}, + is_must = #{record.isMust,jdbcType=INTEGER}, + order_filed = #{record.orderFiled,jdbcType=INTEGER}, + sell_begin_time = #{record.sellBeginTime,jdbcType=TIMESTAMP}, + sell_end_time = #{record.sellEndTime,jdbcType=TIMESTAMP} @@ -526,6 +594,24 @@ customer_category_rule = #{customerCategoryRule,jdbcType=VARCHAR}, + + attribute_list_price = #{attributeListPrice,jdbcType=VARCHAR}, + + + is_push = #{isPush,jdbcType=INTEGER}, + + + is_must = #{isMust,jdbcType=INTEGER}, + + + order_filed = #{orderFiled,jdbcType=INTEGER} + + + sell_begin_time = #{sellBeginTime,jdbcType=TIMESTAMP}, + + + sell_end_time = #{sellEndTime,jdbcType=TIMESTAMP}, + where id = #{id,jdbcType=VARCHAR} @@ -556,7 +642,13 @@ print_barcode = #{printBarcode,jdbcType=VARCHAR}, tail_warn = #{tailWarn,jdbcType=INTEGER}, in_storage_status = #{inStorageStatus,jdbcType=INTEGER}, - customer_category_rule = #{customerCategoryRule,jdbcType=VARCHAR} + customer_category_rule = #{customerCategoryRule,jdbcType=VARCHAR}, + attribute_list_price = #{attributeListPrice,jdbcType=VARCHAR}, + is_push = #{isPush,jdbcType=INTEGER}, + is_must = #{isMust,jdbcType=INTEGER}, + order_filed = #{orderFiled,jdbcType=INTEGER}, + sell_begin_time = #{sellBeginTime,jdbcType=TIMESTAMP}, + sell_end_time = #{sellEndTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR} @@ -591,49 +683,14 @@ t.tail_warn, t.in_storage_status, t.customer_category_rule, - COALESCE(ss.stock_count + ss.minus_stock_count, 0) AS total_stock_count, - COALESCE(ss.stock_count, 0) AS stock_count, - COALESCE(ss.minus_stock_count, 0) AS minus_stock_count - - , COALESCE(sd.total_sold, 0) AS total_sold - + t.attribute_list_price, + t.is_push, + t.is_must, + t.order_filed, + t.sell_begin_time, + t.sell_end_time FROM t_product t - LEFT JOIN ( - SELECT - sum( CASE WHEN s.stock_count < 0 THEN 0 ELSE s.stock_count END ) AS stock_count, - sum( CASE WHEN s.stock_count > 0 THEN 0 ELSE s.stock_count END ) AS minus_stock_count, - shop_id, - product_id - FROM - t_stock s - GROUP BY - shop_id, - product_id - ) ss - ON ss.product_id = t.id - and ss.shop_id = t.shop_id - - LEFT JOIN ( - SELECT - sd.product_id, - SUM(sd.product_count) AS total_sold - FROM - t_sale_detail sd - INNER JOIN t_sale s ON sd.sale_id = s.id - WHERE - s.del_flag = '0' - AND s.status = '4' - and s.create_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate} - - GROUP BY - product_id - ) sd ON t.id = sd.product_id - - - AND t.del_flag != '2' AND t.shop_id = #{queryParams.shopId} @@ -647,25 +704,12 @@ AND t.category_id =#{queryParams.categoryId} - - - AND t.supplier_id =#{queryParams.supplierId} - - AND t.product_name like concat('%',#{queryParams.productName},'%') - - - AND t.product_sn like concat('%',#{queryParams.productSn},'%') - - - - AND t.supplier_name like concat('%',#{queryParams.supplierName},'%') - - and id in + and t.id in #{item} @@ -673,27 +717,17 @@ and ( t.product_name like concat('%',#{queryParams.searchStr},'%') - or t.product_sn like concat('%',#{queryParams.searchStr},'%') - or t.supplier_name like concat('%',#{queryParams.searchStr},'%') ) - ORDER BY - - LENGTH(product_sn), - CASE - WHEN product_sn LIKE CONCAT(#{queryParams.searchStr}, '%') THEN 1 - WHEN product_sn LIKE CONCAT('%',#{queryParams.searchStr}) THEN 2 - ELSE 3 - END, - - + ORDER BY t.order_filed asc, + + --> + t.in_storage_status asc, t.del_flag desc,t.create_time desc, id diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/WorkerRelaPriceMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/WorkerRelaPriceMapper.xml new file mode 100644 index 00000000..5fddafa8 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/WorkerRelaPriceMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + id, create_by, create_time, del_flag, update_by, update_time, worker_id, get_area_id, get_area_name, put_area_id, put_area_name, ramark, order_type, order_bkge + + + + insert into t_worker_rela_price (id, create_by, create_time, + del_flag, update_by, update_time, + worker_id, get_area_id, get_area_name, put_area_id, put_area_name, remark, order_type, order_bkge) + values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + #{workerId,jdbcType=VARCHAR}, #{getAreaId,jdbcType=VARCHAR}, #{getAreaName,jdbcType=VARCHAR}, + #{putAreaId,jdbcType=VARCHAR}, #{putAreaName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{orderType,jdbcType=INTEGER}, #{orderBkge,jdbcType=DECIMAL}) + + + + + + delete + from t_worker_rela_price + where worker_id = #{workerId,jdbcType=VARCHAR} + + \ No newline at end of file