提交 70cf8533 作者: 余乾开

Merge branch 'develop'

......@@ -103,20 +103,11 @@ jobs:
git config user.name "Chuck"
git config user.email "Chuck@users.noreply.github.com"
git remote set-url origin "$GITLAB_URL"
git commit -am "Generated Image New Tag"
git commit -am "Update Image Tag"
git push origin develop
- name: Send Error Notification by WeChat
if: ${{ failure() }}
run: |
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9be1b073-1760-442d-8e3d-faa0fd32ea16' -H 'Content-Type: application/json' -d '
{
"msgtype": "markdown",
"markdown": {
"content": "### GitHub构建并推送镜像失败 \n
> - 提交人: ${{github.actor}} \n
> - 提交信息: ${{github.event.head_commit.message}} \n
> - 提交到仓库: ${{github.repository}} \n
> - 提交到分支: ${{github.ref}} \n 请修复错误后重新提交...
"
}'
#- name: Commit files
# run: |
# git config --local user.email "Chuck@users.noreply.github.com"
# git config --local user.name "Chuck"
# git commit -am "Image Update"
......@@ -108,21 +108,11 @@ jobs:
git config user.name "Chuck"
git config user.email "Chuck@users.noreply.github.com"
git remote set-url origin "$GITLAB_URL"
git add .
git commit -m "Generated Image New Tag"
git commit -am "Update Image Tag"
git push origin master
- name: Send Error Notification by WeChat
if: ${{ failure() }}
run: |
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9be1b073-1760-442d-8e3d-faa0fd32ea16' -H 'Content-Type: application/json' -d '
{
"msgtype": "markdown",
"markdown": {
"content": "### GitHub构建并推送镜像失败 \n
> - 提交人: ${{github.actor}} \n
> - 提交信息: ${{github.event.head_commit.message}} \n
> - 提交到仓库: ${{github.repository}} \n
> - 提交到分支: ${{github.ref}} \n 请修复错误后重新提交...
"
}'
#- name: Commit files
# run: |
# git config --local user.email "Chuck@users.noreply.github.com"
# git config --local user.name "Chuck"
# git commit -am "Image Update"
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 0617f51e1eeecaa013d138ccfee8d9a085e3c6e7
newTag: 757f0a2dc9e893e41007e7f05972b846146bb4f9
package com.mmc.pms.auth.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author small
* @Date 2023/7/4 10:55
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyInfoDTO {
private static final long serialVersionUID = 3247519744829926132L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "单位类型,0科比特,1加盟公司", example = "0")
private Integer companyType;
@ApiModelProperty(value = "单位名称", example = "科比特")
private String companyName;
@ApiModelProperty(value = "单位全称", example = "浙江科比特创新科技有限公司")
private String fullName;
@ApiModelProperty(value = "省份名称", example = "广东省")
private String province;
@ApiModelProperty(value = "城市名称", example = "深圳市")
private String city;
@ApiModelProperty(value = "县区名称", example = "南山区")
private String district;
@ApiModelProperty(value = "详细地址", example = "西丽街道万科云城国际创新谷6栋")
private String address;
@ApiModelProperty(value = "联系人", example = "lx")
private String companyUserName;
@ApiModelProperty(value = "联系电话", example = "13925255742")
private String phoneNum;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.mmc.pms.auth.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* @Author small
* @Date 2023/7/4 10:04
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyInfoVO {
private static final long serialVersionUID = 3247519744829926132L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "单位类型,0科比特,1加盟公司", example = "0")
private Integer companyType;
@ApiModelProperty(value = "单位名称", example = "科比特")
private String companyName;
@ApiModelProperty(value = "单位全称", example = "浙江科比特创新科技有限公司")
private String fullName;
@ApiModelProperty(value = "省份名称", example = "广东省")
private String province;
@ApiModelProperty(value = "城市名称", example = "深圳市")
private String city;
@ApiModelProperty(value = "县区名称", example = "南山区")
private String district;
@ApiModelProperty(value = "详细地址", example = "西丽街道万科云城国际创新谷6栋")
private String address;
@ApiModelProperty(value = "联系人", example = "lx")
private String companyUserName;
@ApiModelProperty(value = "联系电话", example = "13925255742")
private String phoneNum;
@ApiModelProperty(value = "备注")
private String remark;
}
......@@ -26,5 +26,6 @@ public class LoginSuccessDTO implements Serializable {
private String phoneNum;
private String userName;
private String nickName;
private CompanyInfoVO companyInfoVO;
// private RoleInfoDTO roleInfo;
}
......@@ -381,10 +381,10 @@ public enum ResultEnum implements BaseErrorInfoInterface {
DIRECTORY_NAME_HAS_BEEN_EXIST("40168", "目录名称已存在"),
FAILED_TO_ADD_DATA("40169", "数据新增失败,请稍后重试"),
FAILED_TO_EDIT_DATA("40170", "数据修改失败,请稍后重试"),
SKU_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40171", "sku不存在或已删除,请刷新后重试!"),
PRODUCT_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40171", "产品不存在或已删除,请刷新后重试!"),
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40172", "规格不存在或已删除,请刷新后重试!"),
SKU_ALREADY_EXIST_IN_THIS_INDUSTRY("40173", "该所属行业下已经存在sku,请检查后重试!"),
SPEC_EXIST_UNDER_THE_SKU("40174", "该sku下有规格存在,无法删除!"),
SPEC_EXIST_UNDER_THE_SKU("40174", "该产品下有规格存在,无法删除!"),
SPEC_NOT_CONFIG_PRICE("40175", "存在规格没有配置价格,请联系客服获取报价!"),
SHOP_CAR_SIZE_MORE_2("40176", "行业购物车下单数量仅限一个"),
CONTRACT_TEMPLATE_NOT_EXIST_OR_DELETED("40177", "合同模板不存在或已删除!"),
......
......@@ -100,9 +100,11 @@ public class BackstageCategoriesController {
@GetMapping("queryRelevantBusiness")
public ResultBody queryRelevantBusiness(
@ApiParam(value = "分类id", required = true) @RequestParam(value = "id") Integer id,
@ApiParam(value = "业务类型", required = true) @Min(value = 0) @RequestParam(value = "type")
Integer type) {
return categoriesService.queryRelevantBusiness(id, type);
@ApiParam(value = "业务类型: 0、商城商品列表 1、租赁商品列表 2、服务列表 3、课程列表", required = true) @Min(value = 0)
@RequestParam(value = "type") Integer type,
@RequestParam Integer pageNo,
@RequestParam Integer pageSize) {
return ResultBody.success(categoriesService.queryRelevantBusiness(id, type,pageNo,pageSize));
}
@ApiOperation(value = "分类删除")
......
......@@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
......@@ -27,15 +28,17 @@ import java.util.List;
@RestController
@RequestMapping("/goods")
@Api(tags = {"后台-商品管理-相关接口"})
public class BackstageGoodsManageController {
public class BackstageGoodsManageController extends BaseController {
@Resource private GoodsInfoService goodsInfoService;
@ApiOperation(value = "新增(租赁/销售)商品")
@PostMapping("addGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addGoods(
@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.addGoods(goodsAddVO);
@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO,
HttpServletRequest request) {
return goodsInfoService.addGoods(
goodsAddVO, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "修改(租赁/销售)商品")
......@@ -134,4 +137,12 @@ public class BackstageGoodsManageController {
@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListIndstGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "商品列表-排序")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("exchangeGoodsInfo")
public ResultBody exchangeGoodsInfo(@ApiParam(value = "第一个参数id", required = true) @RequestParam(value = "firstId") Integer firstId,
@ApiParam(value = "第二个参数id", required = true) @RequestParam(value = "secondId") Integer secondId) {
return goodsInfoService.exchangeGoodsInfo(firstId, secondId);
}
}
......@@ -15,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author LW
......@@ -27,7 +28,7 @@ import java.math.BigDecimal;
public class BackstageProductSpecController {
@Autowired private ProductSkuService productSkuService;
@ApiOperation(value = "新增产品sku")
@ApiOperation(value = "新增产品")
@PostMapping("addProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addProductSku(
......@@ -35,14 +36,14 @@ public class BackstageProductSpecController {
return productSkuService.addProductSku(param);
}
@ApiOperation(value = "产品sku详情")
@ApiOperation(value = "产品详情")
@GetMapping("getProductSkuDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSkuDTO.class)})
public ResultBody getProductSkuDetail(@ApiParam("id") @RequestParam(value = "id") Integer id) {
return productSkuService.getProductSkuDetail(id);
}
@ApiOperation(value = "编辑产品sku")
@ApiOperation(value = "编辑产品")
@PostMapping("editProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editProductSku(
......@@ -57,7 +58,7 @@ public class BackstageProductSpecController {
return productSkuService.productDirectoryList();
}
@ApiOperation(value = "产品sku分页列表")
@ApiOperation(value = "产品分页列表")
@PostMapping("listPageProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSkuDTO.class)})
public ResultBody listPageProductSku(@ApiParam("条件参数") @RequestBody ProductSkuQO productSkuQO) {
......@@ -101,14 +102,14 @@ public class BackstageProductSpecController {
@ApiOperation(value = "产品规格管理-价格配置")
@PostMapping("productSpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody productSpecCPQ(@RequestBody ProductSpecCPQVO productSpecCPQVO) {
public ResultBody productSpecCPQ(@RequestBody List<ProductSpecCPQVO> productSpecCPQVO) {
return productSkuService.productSpecCPQ(productSpecCPQVO);
}
@ApiOperation(value = "价格配置信息的修改")
@PostMapping("updateProductSpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updateProductSpecCPQ(@RequestBody ProductSpecCPQVO productSpecCPQVO) {
public ResultBody updateProductSpecCPQ(@RequestBody List<ProductSpecCPQVO> productSpecCPQVO) {
return productSkuService.updateProductSpecCPQ(productSpecCPQVO);
}
......
......@@ -3,6 +3,7 @@ package com.mmc.pms.controller;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
......@@ -64,10 +65,11 @@ public class BackstageTaskServiceController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@GetMapping("queryWorkService")
public ResultBody<ServiceDTO> queryWorkService(
@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) {
return backstageTaskService.queryById(id);
@ApiParam("作业服务id") @RequestParam(value = "id") Integer id,HttpServletRequest request) {
return backstageTaskService.queryById(id,request);
}
@ApiOperation(value = "查询服务管理列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@PostMapping("queryServiceManagerList")
......@@ -75,7 +77,7 @@ public class BackstageTaskServiceController extends BaseController {
@Validated(Page.class) @RequestBody ServiceQO param, HttpServletRequest request) {
return ResultBody.success(
backstageTaskService.queryServiceManagerList(
param, this.getUserLoginInfoFromRedis(request).getUserAccountId()));
param, this.getUserLoginInfoFromRedis(request).getUserAccountId(),this.getUserLoginInfoFromRedis(request).getCompanyInfoVO()));
}
@ApiOperation(value = "远程查询作业服务")
......@@ -93,4 +95,22 @@ public class BackstageTaskServiceController extends BaseController {
@ApiParam("分类id") @RequestBody List<Integer> categoriesId) {
return backstageTaskService.getWorkServiceCountByCategoriesId(categoriesId);
}
@ApiOperation(value = "查询作业服务数量——用于后台调用")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("queryWorkServiceCount")
public ResultBody queryWorkServiceCount(
@ApiParam("单位id") @RequestParam(value = "companyId") Integer companyId,HttpServletRequest request) {
return backstageTaskService.queryByIdCount(companyId);
}
@ApiOperation(value = "排序交换")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) })
@PostMapping("exchange")
public ResultBody exchangeBannerInfo(@Validated(Others.class) @RequestBody List<ServiceVO> list) {
return backstageTaskService.exchange(list);
}
}
......@@ -43,4 +43,12 @@ public interface BackstageTaskServiceDao {
Integer batchUpAndDownWorkService(@Param("param") UpAndDownServiceVO param);
Integer getWorkServiceCountByCategoriesId(@Param("categoriesIds") List<Integer> categoriesIds);
Integer queryByIdCount(Integer companyId);
void exchange(ServiceDO serviceDO);
void exchangeSort(Integer id,Integer sort);
List<ServiceDO> queryWorkInfoByCategoryId(Integer pageNo , Integer pageSize,Integer id);
}
......@@ -68,8 +68,6 @@ public interface GoodsInfoDao {
List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids);
void insertMallProdSkuInfo(MallProdInfoDO mallProdSkuInfoDO);
void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO);
void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
......@@ -91,7 +89,7 @@ public interface GoodsInfoDao {
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer pageNo,Integer pageSize,Integer id,int type);
List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId);
......@@ -114,4 +112,8 @@ public interface GoodsInfoDao {
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId);
int updateGoodsInfoSort(Integer id, Integer sort);
int countServiceByCategoryId(Integer id);
}
......@@ -11,37 +11,37 @@ import java.util.List;
*/
@Mapper
public interface MiniProgramProductMallDao {
GoodsInfoDO getGoodsInfoByGoodsId(Integer goodsId);
GoodsInfoDO getGoodsInfoByGoodsId(Integer goodsId);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer goodsId);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer goodsId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsId);
List<GoodsQaDO> listGoodsQaInfoByGoodsId(Integer goodsId);
List<GoodsQaDO> listGoodsQaInfoByGoodsId(Integer goodsId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsId);
List<MallProdInfoDO> getMallProdInfoByGoodsId(Integer goodsId);
List<MallProdInfoDO> getMallProdInfoByGoodsId(Integer goodsId);
List<MallProdSkuInfoSpecDO> listMallProdSkuInfoSpec(Integer goodsId);
List<MallProdSkuInfoSpecDO> listMallProdSkuInfoSpec(Integer goodsId);
List<ProductSpecDO> listProductSpecInfo(List<Integer> collect);
List<ProductSpecDO> listProductSpecInfo(List<Integer> collect);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer goodsInfoId);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer goodsInfoId);
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
int countListGoodsByQO(GoodsInfoQO param);
int countListGoodsByQO(GoodsInfoQO param);
List<GoodsInfoDO> listGoodsByQO(GoodsInfoQO param);
List<GoodsInfoDO> listGoodsByQO(GoodsInfoQO param);
List<GoodsTypeDO> listIndustryIdBySort();
List<GoodsTypeDO> listIndustryIdBySort();
List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId);
List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId);
List<InventorySpecDO> listInventorySpec(List<Integer> collect);
List<InventorySpecDO> listInventorySpec(List<Integer> collect);
ProductSpecDO getProductSpecDetail(Integer productSpecId);
ProductSpecDO getProductSpecDetail(Integer productSpecId);
ProductSkuDO getProductSkuDetail(Integer productSkuId);
ProductDO getProductSkuDetail(Integer productSkuId);
}
......@@ -26,17 +26,17 @@ public interface ProductDao {
int countSkuName(ProductSkuVO param);
int insertProductSku(ProductSkuDO productSkuDO);
int insertProductSku(ProductDO productDO);
int countSkuIsExist(Integer id);
int countProductIsExist(Integer id);
ProductSkuDO getProductSkuDetail(Integer id);
ProductDO getProductDetail(Integer id);
int updateProductSku(ProductSkuDO productSkuDO);
int updateProductSku(ProductDO productDO);
int countListPageProductSku(ProductSkuQO productSkuQO);
List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO);
List<ProductDO> listPageProductSku(ProductSkuQO productSkuQO);
int countSpecName(ProductSpecVO param);
......@@ -53,7 +53,7 @@ public interface ProductDao {
List<ProductSpecDO> listPageProductSpec(
@Param(value = "pageNo") Integer pageNo,
@Param(value = "pageSize") Integer pageSize,
@Param(value = "productSkuId") Integer productSkuId,
@Param(value = "productId") Integer productId,
@Param(value = "keyword") String keyword);
int batchInsertSpecPrice(List<ProductSpecPriceDO> list);
......@@ -68,7 +68,7 @@ public interface ProductDao {
List<ProductSpecDO> listProductSpec(Integer id);
List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId);
List<ProductDO> listProductSkuDO(List<Integer> productId);
List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds);
......@@ -78,8 +78,6 @@ public interface ProductDao {
int countProductSpecByBrandId(Integer id);
int countSpecByProdSkuId(Integer id);
void removeProductSku(Integer id);
void removeProductSpec(Integer id);
......@@ -88,7 +86,7 @@ public interface ProductDao {
List<InventorySpecDO> listInventorySpec(Integer id);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
List<BigDecimal> feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
......@@ -103,7 +101,7 @@ public interface ProductDao {
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds);
List<ProductSpecDO> getProductSpecList(List<Integer> productIds);
List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId);
......@@ -119,5 +117,10 @@ public interface ProductDao {
List<DirectoryDO> productDirectoryList();
List<ProductSpecPriceDO> listAllProductSpecPriceByType(@Param("prodSkuSpecIds") Set<Integer> prodSkuSpecIds);
List<ProductSpecPriceDO> listAllProductSpecPriceByType(
@Param("prodSkuSpecIds") Set<Integer> prodSkuSpecIds);
int countSpecByProdSkuId(Integer id);
BigDecimal getMarketplacePrice(PriceAcquisition priceAcquisition);
}
......@@ -37,12 +37,14 @@ public interface WebDeviceDao {
int countListWareInfoPage(
@Param("categoryIds") List<Integer> categoryIds,
@Param("userIds") List<Integer> userIds,
@Param("type") Integer type);
@Param("type") Integer type,
@Param("goodsName")String goodsName);
List<GoodsInfo> listWareInfoPage(
@Param("param") WareInfoQO param,
@Param("userIds") List<Integer> userIds,
@Param("type") Integer type);
@Param("type") Integer type,
@Param("goodsName")String goodsName);
WareInfoDO getWareInfoById(Integer id);
......
......@@ -55,12 +55,10 @@ public class MallIndustrySkuInfoDO implements Serializable {
return GoodsSpecDTO.builder()
.id(this.id)
.goodsSpecName(this.industrySkuSpecName)
.categoryId(this.categoriesId)
.chooseType(this.chooseType)
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.industrySkuId)
.typeName(this.typeName)
.skuName(this.industrySkuName)
.must(must)
.build();
......
......@@ -21,7 +21,7 @@ public class MallProdInfoDO implements Serializable {
private static final long serialVersionUID = 3667714765929443857L;
private Integer id;
private Integer goodsInfoId;
private Integer prodSkuId;
private Integer productId;
private String prodSkuSpecName;
private Integer categoriesId;
private Integer chooseType;
......@@ -52,13 +52,11 @@ public class MallProdInfoDO implements Serializable {
public GoodsSpecDTO buildGoodsSpecDTO() {
return GoodsSpecDTO.builder()
.id(this.id)
.skuId(this.productId)
.goodsSpecName(this.prodSkuSpecName)
.categoryId(this.categoriesId)
.chooseType(this.chooseType)
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.prodSkuId)
.typeName(this.typeName)
.must(must)
.skuName(this.productSkuName)
.brandInfoId(brandInfoId)
......
......@@ -17,52 +17,39 @@ import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductSkuDO implements Serializable {
private static final long serialVersionUID = -2830786012593215477L;
private Integer id;
private String productName;
private Integer categoriesId;
private String model;
private Date createTime;
private Date updateTime;
private Integer brandInfoId;
private Integer deleted;
private Integer customize;
private Integer directoryId;
/**
* 辅助字段 begin
*/
private String categoryName;
private String directoryName;
private String brandName;
/**
* 辅助字段 end
*/
public ProductSkuDO(ProductSkuVO param) {
this.id = param.getId();
this.categoriesId = param.getCategoryId();
this.model = param.getModel();
this.productName = param.getProductName();
this.brandInfoId = param.getProductBrandId();
this.directoryId = param.getDirectoryId();
}
public ProductSkuDTO buildProductSkuDTO() {
return ProductSkuDTO.builder()
.id(this.id)
.productName(this.productName)
.model(this.model)
.productBrand(this.brandName)
.createTime(this.createTime)
.categoriesId(categoriesId)
.productBrandId(brandInfoId)
.directoryId(directoryId)
.categoryName(this.categoryName)
.directoryName(directoryName)
.build();
}
public class ProductDO implements Serializable {
private static final long serialVersionUID = -2830786012593215477L;
private Integer id;
private String productName;
private String model;
private Date createTime;
private Date updateTime;
private Integer brandInfoId;
private Integer deleted;
private Integer customize;
private Integer type;
/** 辅助字段 begin */
private String brandName;
/** 辅助字段 end */
public ProductDO(ProductSkuVO param) {
this.id = param.getId();
this.model = param.getModel();
this.productName = param.getProductName();
this.brandInfoId = param.getProductBrandId();
this.type = param.getType();
}
public ProductSkuDTO buildProductSkuDTO() {
return ProductSkuDTO.builder()
.id(this.id)
.productName(this.productName)
.model(this.model)
.productBrand(this.brandName)
.createTime(this.createTime)
.productBrandId(brandInfoId)
.type(this.type)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.sale.dto.MallProductSpecDTO;
import com.mmc.pms.model.sale.dto.ProductSpecDTO;
import com.mmc.pms.model.sale.dto.ProductSpecVO;
import com.mmc.pms.model.sale.dto.MallProductSpecDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -19,46 +19,46 @@ import java.util.Date;
@AllArgsConstructor
@Accessors(chain = true)
public class ProductSpecDO implements Serializable {
private static final long serialVersionUID = -5476701567447257133L;
private Integer id;
private Integer productSkuId;
private String specName;
private String specImage;
private String partNo;
private String versionDesc;
private Date createTime;
private Date updateTime;
private Integer deleted;
private static final long serialVersionUID = -5476701567447257133L;
private Integer id;
private Integer productId;
private String specName;
private String specImage;
private String partNo;
private String versionDesc;
private Date createTime;
private Date updateTime;
private Integer deleted;
public ProductSpecDO(ProductSpecVO param) {
this.id = param.getId();
this.productSkuId = param.getProductSkuId();
this.specName = param.getSpecName();
this.specImage = param.getSpecImage();
this.partNo = param.getPartNo();
this.versionDesc = param.getVersionDesc();
}
public ProductSpecDO(ProductSpecVO param) {
this.id = param.getId();
this.productId = param.getProductSkuId();
this.specName = param.getSpecName();
this.specImage = param.getSpecImage();
this.partNo = param.getPartNo();
this.versionDesc = param.getVersionDesc();
}
public ProductSpecDTO buildProductSpecDTO() {
return ProductSpecDTO.builder()
.id(this.id)
.productSkuId(this.productSkuId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.createTime(this.createTime)
.build();
}
public ProductSpecDTO buildProductSpecDTO() {
return ProductSpecDTO.builder()
.id(this.id)
.productSkuId(this.productId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.createTime(this.createTime)
.build();
}
public MallProductSpecDTO buildMallProductSpecDTO() {
return MallProductSpecDTO.builder()
.productSpec(this.id)
.productSkuId(this.productSkuId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.build();
}
public MallProductSpecDTO buildMallProductSpecDTO() {
return MallProductSpecDTO.builder()
.productSpec(this.id)
.productSkuId(this.productId)
.specName(this.specName)
.specImage(this.specImage)
.partNo(this.partNo)
.versionDesc(this.versionDesc)
.build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.categories.vo.RelevanceServiceInfoVO;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.work.vo.ServiceVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -7,6 +9,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
......@@ -61,6 +64,14 @@ public class ServiceDO implements Serializable {
@ApiModelProperty(value = "逻辑删除字段")
private Integer isDeleted;
@ApiModelProperty(value = "单位id")
private Integer companyId;
@ApiModelProperty(value = "顺序")
@NotNull(message = "sort不能为空", groups = { Others.class})
private Integer sort;
public ServiceDO(ServiceVO param, Integer accountId) {
this(param);
this.accountId = accountId;
......@@ -76,10 +87,9 @@ public class ServiceDO implements Serializable {
this.shareCard = param.getShareCard();
this.video = param.getVideo();
this.serviceIntroduction = param.getServiceIntroduction();
this.companyId=param.getCompanyId();
}
public ServiceDO(Integer id, Integer accountId) {
this.id = id;
this.accountId = accountId;
public RelevanceServiceInfoVO buildRelevanceServiceInfoVO(){
return RelevanceServiceInfoVO.builder().id(id).name(serviceName).shelf(displayState).videoUrl(video).build();
}
}
......@@ -17,4 +17,7 @@ import java.util.List;
public interface ImsAppApi {
@GetMapping("/release/curriculum/feignCurriculumInfoList")
List<CurriculumInfoVO> feignCurriculumInfoList(@RequestParam Integer categoriesId);
@GetMapping("/release/curriculum/feignCountCurriculumInfo")
int feignCountCurriculumInfo(@RequestParam Integer categoriesId);
}
......@@ -3,8 +3,11 @@ package com.mmc.pms.feign;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mmc.pms.auth.dto.BUserAccountQO;
import com.mmc.pms.auth.dto.CompanyInfoDTO;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import com.mmc.pms.feign.hystrix.UserAppApiHystrix;
import com.mmc.pms.model.qo.CompanyInfoQO;
import com.mmc.pms.model.qo.UserAccountQO;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections4.CollectionUtils;
......@@ -67,4 +70,17 @@ public interface UserAppApi {
*/
@PostMapping("/userapp/user-account/feignListAppUserAccount")
List<UserAccountSimpleDTO> feignListAppUserAccount(@ApiParam(value = "账号查询QO", required = true) @RequestBody UserAccountQO userAccountQO, @RequestHeader("token") String token);
/**
* 获取单位数据
* @param id
* @param token
* @return
*/
@GetMapping("/userapp/company/getCompanyInfoById")
String getCompanyInfoById(@ApiParam(value = "单位", required = true) @RequestParam Integer id, @RequestHeader("token") String token);
@PostMapping("/userapp/company/listCompanyPageBack")
List<CompanyInfoVO> listCompanyPage(@ApiParam(value = "单位查询QO", required = true) @RequestBody CompanyInfoQO companyInfoQO, @RequestHeader("token") String token);
}
......@@ -18,4 +18,10 @@ public class ImsApiHystrix implements ImsAppApi {
log.error("熔断:feignCurriculumInfoList:{}", categoriesId);
return null;
}
@Override
public int feignCountCurriculumInfo(Integer categoriesId) {
log.error("熔断:feignCountCurriculumInfo:{}", categoriesId);
return 0;
}
}
package com.mmc.pms.feign.hystrix;
import com.mmc.pms.auth.dto.BUserAccountQO;
import com.mmc.pms.auth.dto.CompanyInfoDTO;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import com.mmc.pms.feign.UserAppApi;
import com.mmc.pms.model.qo.CompanyInfoQO;
import com.mmc.pms.model.qo.UserAccountQO;
import lombok.extern.slf4j.Slf4j;
......@@ -37,4 +40,16 @@ public class UserAppApiHystrix implements UserAppApi {
log.error("熔断:feignListAppUserAccount:{}", userAccountQO);
return null;
}
@Override
public String getCompanyInfoById(Integer id, String token) {
log.error("熔断:feignListAppUserAccount:{}", id);
return null;
}
@Override
public List<CompanyInfoVO> listCompanyPage(CompanyInfoQO companyInfoQO, String token) {
log.error("熔断:feignListAppUserAccount:{}", companyInfoQO);
return null;
}
}
......@@ -71,4 +71,8 @@ public class CurriculumInfoVO implements Serializable {
@ApiModelProperty(value = "课程详情")
private String detailContent;
public RelevanceCurriculumVO buildRelevanceCurriculumVO(){
return RelevanceCurriculumVO.builder().id(id).curriculumUrl(surfaceUrl).curriculumName(curriculumName).build();
}
}
......@@ -2,6 +2,7 @@ package com.mmc.pms.model.categories.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -15,6 +16,7 @@ import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class RelevanceCurriculumVO implements Serializable {
@ApiModelProperty(value = "id")
......@@ -22,7 +24,10 @@ public class RelevanceCurriculumVO implements Serializable {
@ApiModelProperty(value = "课程名称")
private String curriculumName;
// 课程图片
// 状态
@ApiModelProperty(value = "课程图片")
private String curriculumUrl;
@ApiModelProperty(value = "状态")
private String status;
}
......@@ -2,6 +2,7 @@ package com.mmc.pms.model.categories.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -15,11 +16,10 @@ import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class RelevanceServiceInfoVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "服务编号")
private String number;
@ApiModelProperty(value = "服务名称")
private String name;
@ApiModelProperty(value = "视频")
......
package com.mmc.pms.model.group;
/**
* @Author small
* @Date 2023/7/5 16:55
* @Version 1.0
*/
public @interface Others {
}
......@@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author 23214
*/
......@@ -12,9 +14,6 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
public class PriceAcquisition {
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "规格id")
private Integer specsId;
......@@ -22,6 +21,6 @@ public class PriceAcquisition {
private Integer day;
@ApiModelProperty(value = "渠道等级id")
private Integer channelLevelId;
private List<Integer> channelLevelId;
}
\ No newline at end of file
package com.mmc.pms.model.qo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author small
* @Date 2023/7/4 13:37
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyInfoQO {
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
}
......@@ -13,30 +13,36 @@ import java.io.Serializable;
/**
* @Author LW
* @date 2022/9/26 11:13
* 概要:
*
* @date 2022/9/26 11:13 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductSkuQO implements Serializable {
private static final long serialVersionUID = 7548828456935084794L;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品类型")
private Integer categoryId;
@ApiModelProperty(value = "产品目录")
private Integer directoryId;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
private static final long serialVersionUID = 7548828456935084794L;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "归属商品 0:商城商品 1:租赁商品")
private Integer type;
@ApiModelProperty(value = "页码", required = true)
@NotNull(
message = "页码不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(
message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
......@@ -65,4 +65,10 @@ public class ServiceQO implements Serializable {
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
@ApiModelProperty(value = "部门id", required = true)
private Integer companyId;
@ApiModelProperty(value = "单位类型,0科比特,1加盟公司", required = true)
private Integer companyType;
}
......@@ -23,6 +23,9 @@ public class WareInfoQO implements Serializable {
@ApiModelProperty(name = "districtId", value = "地域id", example = "440000")
private Integer provinceId;
@ApiModelProperty(name = "goodsName", value = "商品名称", example = "6")
private String goodsName;
@ApiModelProperty(name = "categoryId", value = "分类id")
private List<Integer> categoryId;
......
......@@ -27,12 +27,6 @@ public class GoodsSpecDTO implements Serializable {
@ApiModelProperty(value = "规格名称")
private String goodsSpecName;
@ApiModelProperty(value = "产品或行业类型")
private Integer categoryId;
@ApiModelProperty(value = "产品或行业类型名称")
private String typeName;
@ApiModelProperty(value = "产品或行业skuId")
private Integer skuId;
......
......@@ -18,38 +18,29 @@ import java.util.List;
@AllArgsConstructor
@Builder
public class ProductSkuDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品类型id")
private Integer categoriesId;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "产品类型名称")
private String categoryName;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "产品品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "产品品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "归属商品 0:商城商品 1:租赁商品")
private Integer type;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
@ApiModelProperty(value = "目录名称")
private String directoryName;
@ApiModelProperty(value = "产品规格信息对象")
private List<ProductSpecDTO> productSpecList;
@ApiModelProperty(value = "产品规格信息对象")
private List<ProductSpecDTO> productSpecList;
}
......@@ -17,26 +17,29 @@ import java.io.Serializable;
@NoArgsConstructor
@AllArgsConstructor
public class ProductSkuVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
@NotNull(message = "修改时id不能为空", groups = {Update.class})
private Integer id;
@NotNull(message = "产品名称不能为空", groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品名称")
private String productName;
@NotNull(message = "产品类型id不能为空", groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品类型id")
private Integer categoryId;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id")
@NotNull(
message = "修改时id不能为空",
groups = {Update.class})
private Integer id;
@NotNull(
message = "产品名称不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品名称")
private String productName;
@NotNull(
message = "归属商品不能为空",
groups = {Create.class})
@ApiModelProperty(value = "归属商品")
private Integer type;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌id")
private Integer productBrandId;
}
......@@ -25,7 +25,7 @@ public class ProductSpecVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "productSkuId")
@ApiModelProperty(value = "产品id")
@NotNull(message = "修改时productSkuId不能为空", groups = {Create.class})
private Integer productSkuId;
......
......@@ -28,9 +28,9 @@ public class GoodsProdSpecVO implements Serializable {
@ApiModelProperty(value = "产品类型id")
private Integer categoryId;
@ApiModelProperty(value = "产品:自定义时此字段可不用填写")
@ApiModelProperty(value = "产品:新增自定义时此字段可不用填写")
private Integer skuId;
@ApiModelProperty(value = "规格来源 0:获取 1:自定义")
private Integer flag;
......
......@@ -18,6 +18,4 @@ public class SpecPriceVO implements Serializable {
private Integer id;
private Integer cooperationTag;
private BigDecimal price;
private Integer productSpecId;
private Integer leaseTerm;
}
......@@ -2,6 +2,7 @@ package com.mmc.pms.model.work.dto;
import com.mmc.pms.entity.InspComtDO;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.work.vo.ServiceVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -9,6 +10,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
......@@ -73,6 +75,15 @@ public class ServiceDTO implements Serializable {
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "单位id")
private Integer companyId;
@ApiModelProperty(value = "单位名称")
private String companyName;
@ApiModelProperty(value = "顺序")
private Integer sort;
public ServiceDTO(ServiceVO param, Integer accountId) {
this.id = param.getId();
this.serviceName = param.getServiceName();
......@@ -116,6 +127,25 @@ public class ServiceDTO implements Serializable {
this.accountId = serviceDO.getAccountId();
this.createTime = serviceDO.getCreateTime();
this.updateTime = serviceDO.getUpdateTime();
this.companyId=serviceDO.getCompanyId();
this.sort=serviceDO.getSort();
}
public ServiceDTO(ServiceDO serviceDO,String companyName) {
this.id = serviceDO.getId();
this.serviceName = serviceDO.getServiceName();
this.applicationId = serviceDO.getApplicationId();
this.industryId = serviceDO.getIndustryId();
this.displayState = serviceDO.getDisplayState();
this.coverPlan = serviceDO.getCoverPlan();
this.shareCard = serviceDO.getShareCard();
this.video = serviceDO.getVideo();
this.serviceIntroduction = serviceDO.getServiceIntroduction();
this.accountId = serviceDO.getAccountId();
this.createTime = serviceDO.getCreateTime();
this.updateTime = serviceDO.getUpdateTime();
this.companyId=serviceDO.getCompanyId();
this.companyName=companyName;
}
}
......@@ -45,12 +45,18 @@ public class WorkServiceDTO implements Serializable {
@ApiModelProperty(value = "服务介绍")
private String serviceIntroduction;
@ApiModelProperty(value = "公司名称")
@ApiModelProperty(value = "部门名称")
private String companyName;
@ApiModelProperty(value = "部门id")
private Integer companyId;
@ApiModelProperty(value = "评论列表")
private List<InspComtDO> inspComtList;
@ApiModelProperty(value = "评论数量")
private Integer inspComtAmount;
@ApiModelProperty(value = "排序")
private Integer sort;
}
package com.mmc.pms.model.work.vo;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -28,7 +29,7 @@ public class ServiceVO implements Serializable {
@NotNull(
message = "修改服务id不能为空",
groups = {Update.class})
groups = {Update.class, Others.class})
private Integer id;
@ApiModelProperty(value = "服务名称", example = "服务名称")
......@@ -67,4 +68,11 @@ public class ServiceVO implements Serializable {
@ApiModelProperty(value = "服务介绍")
private String serviceIntroduction;
@ApiModelProperty(value = "单位id")
private Integer companyId;
@ApiModelProperty(value = "顺序")
@NotNull(message = "sort不能为空", groups = { Others.class})
private Integer sort;
}
package com.mmc.pms.service;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
......@@ -22,9 +23,9 @@ public interface BackstageTaskService {
ResultBody deleteByIds(List<Integer> ids);
ResultBody<ServiceDTO> queryById(Integer id);
ResultBody<ServiceDTO> queryById(Integer id,HttpServletRequest request);
PageResult queryServiceManagerList(ServiceQO param, Integer userAccountId);
PageResult queryServiceManagerList(ServiceQO param, Integer userAccountId, CompanyInfoVO companyInfoDTO);
PageResult queryWorkServiceList(ServiceQO param, HttpServletRequest request);
......@@ -33,4 +34,8 @@ public interface BackstageTaskService {
ResultBody batchUpAndDownWorkService(UpAndDownServiceVO param);
Integer getWorkServiceCountByCategoriesId(List<Integer> ids);
ResultBody queryByIdCount(Integer id);
ResultBody exchange(List<ServiceVO> list);
}
......@@ -2,8 +2,6 @@ package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.DirectoryDO;
import com.mmc.pms.entity.DistrictDO;
import com.mmc.pms.model.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
......@@ -11,7 +9,6 @@ import com.mmc.pms.model.sale.vo.QueryClassifyVO;
import com.mmc.pms.page.PageResult;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
......@@ -37,7 +34,7 @@ public interface CategoriesService {
ResultBody getClassifyDetails(Integer id);
ResultBody queryRelevantBusiness(Integer id, Integer type);
PageResult queryRelevantBusiness(Integer id, Integer type,Integer pageNo,Integer pageSize);
ResultBody deleteRelevantBusiness(Integer id);
......
......@@ -21,7 +21,7 @@ import java.util.List;
*/
public interface GoodsInfoService {
ResultBody addGoods(GoodsAddVO goodsAddVO);
ResultBody addGoods(GoodsAddVO goodsAddVO, Integer userAccountId);
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO);
......@@ -46,4 +46,6 @@ public interface GoodsInfoService {
ResultBody batchOnShelfOrTakeDown(List<Integer> goodsIds, Integer status);
ResultBody batchRemoveWareInfo(List<Integer> ids);
ResultBody exchangeGoodsInfo(Integer firstId, Integer secondId);
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.service.WebAndMiniProgramCategoryService;
import org.springframework.stereotype.Service;
/**
* @Author LW
* @date 2023/6/7 13:51
* 概要:
*/
@Service
public class WebAndMiniProgramCategoryServiceImpl implements WebAndMiniProgramCategoryService {
}
......@@ -34,11 +34,11 @@ public interface ProductSkuService {
ResultBody listPageProductSpec(
Integer pageNo, Integer pageSize, Integer productSkuId, String keyword);
ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody productSpecCPQ(List<ProductSpecCPQVO> productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO);
ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody updateProductSpecCPQ(List<ProductSpecCPQVO> productSpecCPQVO);
ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.mmc.pms.auth.dto.CompanyInfoDTO;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.constant.DateConstant;
import com.mmc.pms.dao.BackstageTaskServiceDao;
......@@ -10,6 +15,7 @@ import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.InspComtDO;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.feign.UserAppApi;
import com.mmc.pms.model.qo.CompanyInfoQO;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.dto.WorkServiceDTO;
......@@ -25,6 +31,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
......@@ -54,7 +61,8 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
@Override
public ResultBody addWorkService(ServiceVO param, Integer userAccountId) {
ServiceDO serviceDO = new ServiceDO(param, userAccountId);
backstageTaskServiceDao.insert(serviceDO);
Integer insert = backstageTaskServiceDao.insert(serviceDO);
backstageTaskServiceDao.exchangeSort(serviceDO.getId(),serviceDO.getId());
return ResultBody.success();
}
......@@ -74,9 +82,16 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
}
@Override
public ResultBody<ServiceDTO> queryById(Integer id) {
public ResultBody<ServiceDTO> queryById(Integer id, HttpServletRequest request) {
ServiceDO serviceDO = backstageTaskServiceDao.queryById(id);
ServiceDTO serviceDTO = new ServiceDTO(serviceDO);
String token =
userAppApi.getCompanyInfoById(serviceDO.getCompanyId(), request.getHeader("token"));
JSONObject jsonObject = JSONObject.parseObject(token);
CompanyInfoDTO companyInfoDTO =
JSON.parseObject(
String.valueOf((JSONObject) jsonObject.get("result")), CompanyInfoDTO.class);
String companyName = companyInfoDTO.getCompanyName();
ServiceDTO serviceDTO = new ServiceDTO(serviceDO, companyName);
Map<Integer, String> categoriesNameMap =
getCategoriesNameByIds(
Arrays.asList(serviceDTO.getApplicationId(), serviceDTO.getIndustryId()));
......@@ -107,7 +122,10 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
}
@Override
public PageResult queryServiceManagerList(ServiceQO param, Integer userAccountId) {
public PageResult queryServiceManagerList(
ServiceQO param, Integer userAccountId, CompanyInfoVO companyInfoVO) {
param.setCompanyId(companyInfoVO.getId());
param.setCompanyType(companyInfoVO.getCompanyType());
int count = backstageTaskServiceDao.count(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
......@@ -140,6 +158,7 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
}
@Override
@Transactional
public PageResult queryWorkServiceList(ServiceQO param, HttpServletRequest request) {
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
......@@ -159,7 +178,7 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
List<ServiceDO> pageList =
backstageTaskServiceDao.queryPageByLimit(param, categoriesIds, userIds);
List<WorkServiceDTO> workServiceDTOList = getWorkServiceDTOS(pageList);
List<WorkServiceDTO> workServiceDTOList = getWorkServiceDTOS(pageList, request);
return PageResult.buildPage(pageNo, param.getPageSize(), count, workServiceDTOList);
}
......@@ -184,24 +203,53 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
return backstageTaskServiceDao.getWorkServiceCountByCategoriesId(ids);
}
private List<WorkServiceDTO> getWorkServiceDTOS(List<ServiceDO> pageList) {
// 用户暂时无关联公司数据,先用假数据展示
String companyName = "浙江科比特创新科技有限公司";
@Override
public ResultBody queryByIdCount(Integer companyId) {
return ResultBody.success(backstageTaskServiceDao.queryByIdCount(companyId));
}
@Transactional
@Override
public ResultBody exchange(List<ServiceVO> list) {
Integer sort = list.get(0).getSort();
ServiceDO serviceDO = new ServiceDO();
serviceDO.setId(list.get(0).getId());
serviceDO.setSort(list.get(1).getSort());
backstageTaskServiceDao.exchange(serviceDO);
ServiceDO serviceDO1 = new ServiceDO();
serviceDO1.setId(list.get(1).getId());
serviceDO1.setSort(sort);
backstageTaskServiceDao.exchange(serviceDO1);
return ResultBody.success();
}
private List<WorkServiceDTO> getWorkServiceDTOS(List<ServiceDO> pageList,HttpServletRequest request) {
List<CompanyInfoVO> companyInfoList = userAppApi.listCompanyPage(new CompanyInfoQO(1, 100000), request.getHeader("token"));
String companyName = "";
List<WorkServiceDTO> workServiceDTOList = new ArrayList<>();
for (ServiceDO item : pageList) {
for (CompanyInfoVO companyInfoVO : companyInfoList) {
if (item.getCompanyId().equals(companyInfoVO.getId())){
companyName=companyInfoVO.getCompanyName();
break;
}
}
List<InspComtDO> inspComtDOS = generateComments(item);
WorkServiceDTO workServiceDTO =
WorkServiceDTO.builder()
.id(item.getId())
.serviceName(item.getServiceName())
.companyName(companyName)
.coverPlan(item.getCoverPlan())
.serviceIntroduction(item.getServiceIntroduction())
.video(item.getVideo())
.shareCard(item.getShareCard())
.inspComtList(inspComtDOS)
.inspComtAmount(inspComtDOS.size())
.build();
WorkServiceDTO.builder()
.id(item.getId())
.serviceName(item.getServiceName())
.companyId(item.getCompanyId())
.companyName(companyName)
.sort(item.getSort())
.coverPlan(item.getCoverPlan())
.serviceIntroduction(item.getServiceIntroduction())
.video(item.getVideo())
.shareCard(item.getShareCard())
.inspComtList(inspComtDOS)
.inspComtAmount(inspComtDOS.size())
.build();
workServiceDTOList.add(workServiceDTO);
}
return workServiceDTOList;
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
......@@ -17,82 +17,78 @@ import java.util.stream.Collectors;
/**
* @Author LW
* @date 2023/3/14 13:27
* 概要:
*
* @date 2023/3/14 13:27 概要:
*/
@Service
public class BrandManageServiceImpl implements BrandManageService {
@Autowired
private BrandManageDao brandManageDao;
@Resource
private ProductDao productDao;
@Autowired private BrandManageDao brandManageDao;
@Resource private ProductDao productDao;
/**
* 添加品牌信息
*
* @param brandName 品牌名称
* @return {@link ResultBody}
*/
@Override
public ResultBody addBrandInfo(String brandName) {
// 根据品牌名称判断是否存在
int count = brandManageDao.countBrandInfoByName(null, brandName);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
BrandInfoDO brandInfoDO = new BrandInfoDO(brandName);
brandManageDao.insertBrandInfo(brandInfoDO);
return ResultBody.success();
/**
* 添加品牌信息
*
* @param brandName 品牌名称
* @return {@link ResultBody}
*/
@Override
public ResultBody addBrandInfo(String brandName) {
// 根据品牌名称判断是否存在
int count = brandManageDao.countBrandInfoByName(null, brandName);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
BrandInfoDO brandInfoDO = new BrandInfoDO(brandName);
brandManageDao.insertBrandInfo(brandInfoDO);
return ResultBody.success();
}
/**
* 品牌列表信息
*
* @return {@link ResultBody}
*/
@Override
public PageResult listBrandInfo(Integer pageNo, Integer pageSize) {
int count = brandManageDao.countBrandInfo();
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, 0);
}
int itemIndex = (pageNo - 1) * pageSize;
List<BrandInfoDO> brandInfo = brandManageDao.listBrandInfo(itemIndex, pageSize);
List<BrandInfoDTO> brandInfoList = brandInfo.stream()
.map(BrandInfoDO::buildBrandInfoDTO)
.collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, brandInfoList);
/**
* 品牌列表信息
*
* @return {@link ResultBody}
*/
@Override
public PageResult listBrandInfo(Integer pageNo, Integer pageSize) {
int count = brandManageDao.countBrandInfo();
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, 0);
}
int itemIndex = (pageNo - 1) * pageSize;
List<BrandInfoDO> brandInfo = brandManageDao.listBrandInfo(itemIndex, pageSize);
List<BrandInfoDTO> brandInfoList =
brandInfo.stream().map(BrandInfoDO::buildBrandInfoDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, brandInfoList);
}
/**
* 删除品牌信息
*
* @param id id
* @return {@link ResultBody}
*/
@Override
public ResultBody deleteBrandInfo(Integer id) {
// 判断该品牌是否绑定产品信息
int count = productDao.countProductSpecByBrandId(id);
if (count > 0) {
return ResultBody.error(ResultEnum.BRAND_DELETE_FAIL);
}
brandManageDao.removeBrandInfoById(id);
return ResultBody.success();
/**
* 删除品牌信息
*
* @param id id
* @return {@link ResultBody}
*/
@Override
public ResultBody deleteBrandInfo(Integer id) {
// 判断该品牌是否绑定产品信息
int count = productDao.countProductSpecByBrandId(id);
if (count > 0) {
return ResultBody.error(ResultEnum.BRAND_DELETE_FAIL);
}
brandManageDao.removeBrandInfoById(id);
return ResultBody.success();
}
@Override
public ResultBody editBrandInfo(Integer id, String brandName) {
// 根据品牌名称判断是否存在
int count = brandManageDao.countBrandInfoByName(id, brandName);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
BrandInfoDO brandInfoDO = new BrandInfoDO(brandName);
brandInfoDO.setId(id);
brandManageDao.updateBrandInfo(brandInfoDO);
return ResultBody.success();
@Override
public ResultBody editBrandInfo(Integer id, String brandName) {
// 根据品牌名称判断是否存在
int count = brandManageDao.countBrandInfoByName(id, brandName);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
BrandInfoDO brandInfoDO = new BrandInfoDO(brandName);
brandInfoDO.setId(id);
brandManageDao.updateBrandInfo(brandInfoDO);
return ResultBody.success();
}
}
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.BackstageTaskServiceDao;
import com.mmc.pms.dao.CategoriesDao;
import com.mmc.pms.dao.DirectoryDao;
import com.mmc.pms.dao.GoodsInfoDao;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.DirectoryDO;
import com.mmc.pms.entity.GoodsInfo;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.feign.ImsAppApi;
import com.mmc.pms.model.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.dto.CategoriesDTO;
......@@ -45,7 +47,8 @@ public class CategoriesServiceImpl implements CategoriesService {
@Resource private GoodsInfoDao goodsInfoDao;
@Autowired private DirectoryDao directoryDao;
@Autowired private BackstageTaskService backstageTaskService;
@Autowired private ImsAppApi appApi;
@Autowired private BackstageTaskServiceDao backstageTaskServiceDao;
@Autowired private ImsAppApi imsAppApi;
@Override
public ResultBody addOrEditDirectory(DirectoryInfoVO param) {
......@@ -191,23 +194,68 @@ public class CategoriesServiceImpl implements CategoriesService {
}
@Override
public ResultBody queryRelevantBusiness(Integer id, Integer type) {
public PageResult queryRelevantBusiness(Integer id, Integer type,Integer pageNo,Integer pageSize) {
RelevantBusinessVO relevantBusinessVO = new RelevantBusinessVO();
switch (type) {
case 0:
List<GoodsInfo> goodsInfo = goodsInfoDao.ListGoodsInfoByCategoryId(id);
if (CollectionUtils.isNotEmpty(goodsInfo)) {
int count = goodsInfoDao.countGoodsInfoByCategoryId(id);
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
List<GoodsInfo> mallGoodsInfo = goodsInfoDao.ListGoodsInfoByCategoryId((pageNo - 1) * pageSize, pageSize,id,0);
if (CollectionUtils.isNotEmpty(mallGoodsInfo)) {
relevantBusinessVO.setRelevanceGoodsInfoVOs(
goodsInfo.stream()
mallGoodsInfo.stream()
.map(GoodsInfo::buildRelevanceGoodsInfoVO)
.collect(Collectors.toList()));
return ResultBody.success(relevantBusinessVO);
return PageResult.buildPage(pageNo,pageSize,count,relevantBusinessVO);
}
break;
case 1:
int countOne = goodsInfoDao.countGoodsInfoByCategoryId(id);
if (countOne == 0) {
return PageResult.buildPage(pageNo, pageSize, countOne);
}
List<GoodsInfo> leaseTermGoodsInfo = goodsInfoDao.ListGoodsInfoByCategoryId((pageNo - 1) * pageSize, pageSize,id,1);
if (CollectionUtils.isNotEmpty(leaseTermGoodsInfo)) {
relevantBusinessVO.setRelevanceGoodsInfoVOs(
leaseTermGoodsInfo.stream()
.map(GoodsInfo::buildRelevanceGoodsInfoVO)
.collect(Collectors.toList()));
return PageResult.buildPage(pageNo,pageSize,countOne,relevantBusinessVO);
}
break;
case 2:
int countTwo = goodsInfoDao.countServiceByCategoryId(id);
if (countTwo == 0) {
return PageResult.buildPage(pageNo, pageSize, countTwo);
}
List<ServiceDO> serviceList = backstageTaskServiceDao.queryWorkInfoByCategoryId((pageNo - 1) * pageSize,pageSize,id);
if (CollectionUtils.isNotEmpty(serviceList)) {
relevantBusinessVO.setRelevanceServiceInfoVOs(
serviceList.stream().map(ServiceDO :: buildRelevanceServiceInfoVO)
.collect(Collectors.toList()));
return PageResult.buildPage(pageNo,pageSize,countTwo,relevantBusinessVO);
}
break;
case 3 :
int countThree = imsAppApi.feignCountCurriculumInfo(id);
if (countThree == 0){
return PageResult.buildPage(pageNo, pageSize, countThree);
}
List<CurriculumInfoVO> curriculumList = imsAppApi.feignCurriculumInfoList(id);
if(CollectionUtils.isNotEmpty(curriculumList)){
relevantBusinessVO.setRelevanceCurriculumVOs(curriculumList
.stream().skip((pageNo - 1) * pageSize).limit(pageSize)
.map(CurriculumInfoVO::buildRelevanceCurriculumVO)
.collect(Collectors.toList()));
return PageResult.buildPage(pageNo, pageSize, countThree,relevantBusinessVO);
}
break;
default:
return ResultBody.error("输入类型有误!");
throw new RuntimeException("输入类型有误!");
}
return ResultBody.success();
return PageResult.buildPage(pageNo,pageSize,0);
}
@Override
......@@ -271,7 +319,7 @@ public class CategoriesServiceImpl implements CategoriesService {
if (taskCount > 0) {
return ResultBody.error(ResultEnum.GROUP_DONT_DELETE);
}
List<CurriculumInfoVO> curriculumInfo = appApi.feignCurriculumInfoList(id);
List<CurriculumInfoVO> curriculumInfo = imsAppApi.feignCurriculumInfoList(id);
if (CollectionUtils.isNotEmpty(curriculumInfo)) {
return ResultBody.error(ResultEnum.GROUP_DONT_DELETE);
}
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.dao.InspComtDao;
import com.mmc.pms.entity.InspComtDO;
......@@ -10,9 +9,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 评论表 服务实现类
* </p>
*
* @author Pika
* @since 2023-06-09
......@@ -20,11 +17,10 @@ import java.util.List;
@Service
public class InspComtServiceImpl implements InspComtService {
@Autowired
private InspComtDao inspComtDao;
@Autowired private InspComtDao inspComtDao;
@Override
public List<InspComtDO> randomGetInspComtList(Integer size) {
return inspComtDao.randomGetInspComtList(size);
}
@Override
public List<InspComtDO> randomGetInspComtList(Integer size) {
return inspComtDao.randomGetInspComtList(size);
}
}
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
......@@ -100,12 +100,10 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
GoodsSpecDTO goodsSpecDTO = new GoodsSpecDTO();
goodsSpecDTO
.setId(d.getId())
.setSkuId(d.getProdSkuId())
.setSkuId(d.getProductId())
.setGoodsSpecName(d.getProdSkuSpecName())
.setSkuName(d.getProductSkuName())
.setBrandInfoId(d.getBrandInfoId())
.setCategoryId(d.getCategoriesId())
.setTypeName(d.getTypeName())
.setChooseType(d.getChooseType())
.setSkuUnitId(d.getSkuUnitId())
.setUnitName(d.getUnitName())
......@@ -190,7 +188,7 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
return productSpecVO;
})
.collect(Collectors.toList());
ProductSkuDO productSkuDetail =
ProductDO productSkuDetail =
goodsInfoDao.getProductSkuDetail(industryProductInventoryDO.getProductSkuId());
GoodsProductSkuVO goodsProductSkuVO = new GoodsProductSkuVO();
BeanUtils.copyProperties(productSkuDetail, goodsProductSkuVO);
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
......@@ -14,6 +14,7 @@ import com.mmc.pms.service.ProductSkuService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
......@@ -37,7 +38,7 @@ public class ProductServiceImpl implements ProductSkuService {
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
ProductSkuDO productSkuDO = new ProductSkuDO(param);
ProductDO productSkuDO = new ProductDO(param);
productSkuDO.setCustomize(0);
// 新增产品sku
int status = productDao.insertProductSku(productSkuDO);
......@@ -50,11 +51,11 @@ public class ProductServiceImpl implements ProductSkuService {
@Override
public ResultBody getProductSkuDetail(Integer id) {
// 校验此sku是否还存在或已删除
int count = productDao.countSkuIsExist(id);
int count = productDao.countProductIsExist(id);
if (count <= 0) {
return ResultBody.error(ResultEnum.SKU_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
return ResultBody.error(ResultEnum.PRODUCT_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
}
ProductSkuDO productSkuDO = productDao.getProductSkuDetail(id);
ProductDO productSkuDO = productDao.getProductDetail(id);
return ResultBody.success(productSkuDO.buildProductSkuDTO());
}
......@@ -65,7 +66,7 @@ public class ProductServiceImpl implements ProductSkuService {
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
ProductSkuDO productSkuDO = new ProductSkuDO(param);
ProductDO productSkuDO = new ProductDO(param);
int status = productDao.updateProductSku(productSkuDO);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_EDIT_DATA);
......@@ -82,14 +83,14 @@ public class ProductServiceImpl implements ProductSkuService {
}
Integer pageNo = productSkuQO.getPageNo();
productSkuQO.buildCurrentPage();
List<ProductSkuDO> productSkuList = productDao.listPageProductSku(productSkuQO);
List<ProductDO> productSkuList = productDao.listPageProductSku(productSkuQO);
List<Integer> productSkuIds =
productSkuList.stream().map(ProductSkuDO::getId).collect(Collectors.toList());
productSkuList.stream().map(ProductDO::getId).collect(Collectors.toList());
List<ProductSpecDO> productSpecList = productDao.getProductSpecList(productSkuIds);
Map<Integer, List<ProductSpecDO>> productSpecMap =
productSpecList.stream().collect(Collectors.groupingBy(ProductSpecDO::getProductSkuId));
productSpecList.stream().collect(Collectors.groupingBy(ProductSpecDO::getProductId));
List<ProductSkuDTO> list =
productSkuList.stream().map(ProductSkuDO::buildProductSkuDTO).collect(Collectors.toList());
productSkuList.stream().map(ProductDO::buildProductSkuDTO).collect(Collectors.toList());
list.stream()
.peek(
d -> {
......@@ -176,14 +177,21 @@ public class ProductServiceImpl implements ProductSkuService {
}
@Override
public ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
// 判断该规格是否存在
int count = productDao.countSpecIsExist(productSpecCPQVO.getProductSpecId());
if (count <= 0) {
return ResultBody.error(ResultEnum.SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
@Transactional(rollbackFor = Exception.class)
public ResultBody productSpecCPQ(List<ProductSpecCPQVO> productSpecCPQVO) {
for (ProductSpecCPQVO d : productSpecCPQVO) {
// 判断该规格是否存在
int count = productDao.countSpecIsExist(d.getProductSpecId());
if (count <= 0) {
return ResultBody.error(ResultEnum.SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
}
if (d.getType().equals(1) && d.getLeaseTerm() == null) {
return ResultBody.error("租赁期限不能为空!");
}
// 插入规格销售或租赁价格
insertSpecPrice(d);
}
// 批量插入规格销售或租赁价格
return insertSpecPrice(productSpecCPQVO);
return ResultBody.success();
}
@Override
......@@ -206,19 +214,21 @@ public class ProductServiceImpl implements ProductSkuService {
}
@Override
public ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
// 先删除原来该规格下的所有价格配置信息
productDao.removeProductSpecCPQ(productSpecCPQVO);
// 批量插入规格销售或租赁价格
return insertSpecPrice(productSpecCPQVO);
@Transactional(rollbackFor = Exception.class)
public ResultBody updateProductSpecCPQ(List<ProductSpecCPQVO> params) {
for (ProductSpecCPQVO productSpecCPQVO : params) {
// 先删除原来该规格下的所有价格配置信息
productDao.removeProductSpecCPQ(productSpecCPQVO);
// 调用批量插入规格销售或租赁价格
this.productSpecCPQ(params);
}
return ResultBody.success();
}
@NotNull
@Transactional(rollbackFor = Exception.class)
public ResultBody insertSpecPrice(ProductSpecCPQVO productSpecCPQVO) {
List<ProductSpecPriceDO> list = getProductSpecPriceDOS(productSpecCPQVO);
if (productSpecCPQVO.getType().equals(1) && productSpecCPQVO.getLeaseTerm() == null) {
return ResultBody.error("租赁期限不能为空!");
}
// 批量插入规格销售价格
if (productSpecCPQVO.getType().equals(0)) {
productDao.batchInsertSpecPrice(list);
......@@ -231,9 +241,6 @@ public class ProductServiceImpl implements ProductSkuService {
@Override
public ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
if (productSpecCPQVO.getType().equals(1) && productSpecCPQVO.getLeaseTerm() == null) {
return ResultBody.error("租赁期限不能为空!");
}
List<ProductSpecPriceDO> productSpecPriceList =
productDao.getProductSpecPrice(productSpecCPQVO);
List<ProductSpecPriceDTO> list =
......@@ -306,20 +313,48 @@ public class ProductServiceImpl implements ProductSkuService {
@Override
public BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition) {
Map<Integer, Integer> dayMap = new HashMap<>();
dayMap.put(0, 7);
dayMap.put(8, 15);
dayMap.put(16, 30);
dayMap.put(31, Integer.MAX_VALUE);
Integer dayRange =
dayMap.entrySet().stream()
.filter(entry -> priceAcquisition.getDay() <= entry.getKey())
.findFirst()
.map(Map.Entry::getValue)
.orElseThrow(() -> new RuntimeException("租赁期限错误错误!"));
List<Integer> channelLevelId = priceAcquisition.getChannelLevelId();
if (channelLevelId == null){
return new BigDecimal(0);
}
// 设置时间区间
int dayRange = getDayRange(priceAcquisition.getDay());
priceAcquisition.setDay(dayRange);
return productDao.feignGetUnitPriceByTag(priceAcquisition);
// 获取市场价
BigDecimal marketplacePrice = productDao.getMarketplacePrice(priceAcquisition);
if (marketplacePrice == null) {
return new BigDecimal(0);
}
// 获取渠道价格
List<BigDecimal> price = productDao.feignGetUnitPriceByTag(priceAcquisition);
if (price.size()==0) {
return marketplacePrice;
}else {
List<BigDecimal> sortedPrice = price.stream()
.sorted(Comparator.naturalOrder())
.collect(Collectors.toList());
BigDecimal bigDecimal = sortedPrice.get(0);
if (bigDecimal.compareTo(marketplacePrice) < 0){
return bigDecimal;
}else if (bigDecimal.compareTo(marketplacePrice) > 0){
return marketplacePrice;
}else {
return marketplacePrice;
}
}
}
public int getDayRange(int day) {
if (between(day, 0 ,7)) return 0;
if (between(day, 8, 15)) return 1;
if (between(day, 16,30)) return 2;
if (day > 30) return 3;
throw new RuntimeException("租期有误!");
}
private boolean between(int num, int start, int end){
return num >= start && num <= end;
}
@Override
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import com.mmc.pms.common.ResultBody;
......@@ -179,14 +179,14 @@ public class WebDeviceServiceImpl implements WebDeviceService {
userIds = Collections.singletonList(-1);
}
}
int count = webDeviceDao.countListWareInfoPage(param.getCategoryId(), userIds, param.getType());
int count = webDeviceDao.countListWareInfoPage(param.getCategoryId(), userIds, param.getType(),param.getGoodsName());
if (count == 0) {
return ResultBody.success(
PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
}
int pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType());
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType(),param.getGoodsName());
List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
......
package com.mmc.pms.service.Impl;
package com.mmc.pms.service.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.WebProductMallDao;
......@@ -8,7 +8,6 @@ import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.WebProductMallService;
......
......@@ -7,8 +7,7 @@ spring:
password: MMC@2022&MYSQL
redis:
database: 1
host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
password: MMC@2022&REDIS
host: 127.0.0.1
port: 6379
#连接池
lettuce:
......
......@@ -63,13 +63,6 @@
insert into mall_industry_sku_info_spec(mall_industry_sku_info_id, industry_spec_id, goods_info_id)
values (#{mallIndustrySkuInfoId}, #{industrySpecId}, #{goodsInfoId})
</insert>
<insert id="insertMallProdSkuInfo" parameterType="com.mmc.pms.entity.MallProdInfoDO" useGeneratedKeys="true"
keyProperty="id">
insert into mall_prod_info (goods_info_id, product_id, prod_spec_name, categories_id, choose_type,
sku_unit_id, is_must, flag)
values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categoriesId}, #{chooseType}, #{skuUnitId}, #{must},
#{flag})
</insert>
<insert id="insertMallProdSkuInfoSpec">
insert into mall_prod_info_spec (goods_info_id, mall_prod_info_id, product_spec_id)
values (#{goodsInfoId}, #{mallProdSkuInfoId}, #{productSpecId})
......@@ -79,6 +72,7 @@
update goods_info
set goods_name = #{goodsName},
eco_label = #{ecoLabel},
directory_id = #{directoryId},
category_by_one = #{categoryByOne},
category_by_two = #{categoryByTwo},
shelf_status = #{shelfStatus}
......@@ -114,7 +108,7 @@
<foreach collection="list" item="d" separator=";" index="index">
update mall_prod_info
<set>
product_id = #{d.prodSkuId},
product_id = #{d.productId},
categories_id = #{d.categoriesId},
prod_spec_name = #{d.prodSkuSpecName},
choose_type = #{d.chooseType},
......@@ -163,7 +157,7 @@
</update>
<update id="updateMallProdSkuInfo">
update mall_prod_info
set product_id = #{prodSkuId},
set product_id = #{productId},
categories_id = #{categoriesId},
prod_spec_name = #{prodSkuSpecName},
choose_type = #{chooseType},
......@@ -171,6 +165,9 @@
is_must = #{must}
where id = #{id}
</update>
<update id="updateGoodsInfoSort">
update goods_info set sort = #{sort} where id = #{id}
</update>
<delete id="deleteGoodsServiceByGoodsId">
delete
from goods_service
......@@ -208,25 +205,21 @@
<select id="getMallProSkuInfo" resultType="com.mmc.pms.entity.MallProdInfoDO">
SELECT mi.id,
mi.goods_info_id,
mi.product_id prodSkuId,
mi.product_id productId,
mi.prod_spec_name prodSkuSpecName,
mi.categories_id categoriesId,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.is_must must,
mi.flag flag,
mi.create_time createTime,
c.name typeName,
su.id skuUnitId,
su.unit_name unitName,
ps.product_name productSkuName
FROM mall_prod_info mi
INNER JOIN categories c ON c.id = mi.categories_id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
and flag = 0
</select>
<select id="getMallIndustrySkuInfo" resultType="com.mmc.pms.entity.MallIndustrySkuInfoDO">
SELECT mi.id,
......@@ -256,6 +249,7 @@
gi.category_by_two,
gi.shelf_status,
gi.create_time,
gi.sort,
gv.id goodsVideoId,
gv.video_url videoUrl
FROM goods_info gi
......@@ -466,7 +460,8 @@
FROM goods_info gi
INNER JOIN goods_img im ON gi.id = im.goods_info_id
AND im.img_type = 0
WHERE gi.category_by_one = #{id}
WHERE gi.category_by_one = #{id} and gi.goods_type = #{type} and gi.is_deleted = 0
limit #{pageNo},#{pageSize}
</select>
<resultMap id="resultMallProdSkuInfoSpecMap" type="com.mmc.pms.entity.MallProdSkuInfoSpecDO">
<id property="id" column="id"/>
......@@ -576,7 +571,7 @@
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time asc
gi.shelf_status DESC , gi.sort DESC
limit #{pageNo},#{pageSize}
</select>
......@@ -601,24 +596,24 @@
<select id="getAllMallProSkuInfo" resultType="com.mmc.pms.entity.MallProdInfoDO">
SELECT mi.id,
mi.goods_info_id,
mi.product_id prodSkuId,
mi.product_id productId,
mi.prod_spec_name prodSkuSpecName,
mi.categories_id categoriesId,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.is_must must,
mi.flag flag,
mi.create_time createTime,
c.name typeName,
su.id skuUnitId,
su.unit_name unitName,
ps.product_name productSkuName
FROM mall_prod_info mi
INNER JOIN categories c ON c.id = mi.categories_id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
WHERE mi.goods_info_id = #{goodsInfoId}
AND mi.is_deleted = 0
ORDER BY mi.create_time asc
</select>
<select id="countServiceByCategoryId" resultType="java.lang.Integer">
select count(*) from service where (application_id = #{id} or industry_id = #{id})
</select>
</mapper>
......@@ -346,7 +346,7 @@
where id = #{id}
</select>
<select id="getProductSkuDetail" resultType="com.mmc.pms.entity.ProductSkuDO">
<select id="getProductSkuDetail" resultType="com.mmc.pms.entity.ProductDO">
SELECT ps.id,
ps.product_name productName,
ps.model,
......
......@@ -169,6 +169,9 @@
#{user}
</foreach>
</if>
<if test="goodsName != null and goodsName != ''">
and gi.goods_name like CONCAT('%',#{goodsName},'%')
</if>
</where>
</select>
......@@ -193,8 +196,11 @@
#{user}
</foreach>
</if>
<if test="goodsName != null and goodsName != ''">
and gi.goods_name like CONCAT('%',#{goodsName},'%')
</if>
</where>
order by gi.create_time asc
order by gi.sort desc
limit #{param.pageNo},#{param.pageSize}
</select>
<select id="getWareInfoById" resultMap="wareInfoResultMap" parameterType="java.lang.Integer">
......
......@@ -18,6 +18,8 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
<result property="accountId" column="account_id" jdbcType="INTEGER"/>
<result property="companyId" column="company_id" jdbcType="INTEGER"/>
<result property="sort" column="sort" jdbcType="INTEGER"/>
</resultMap>
<!--查询所有-->
......@@ -51,8 +53,9 @@
service_introduction,
create_time,
update_time,
account_id
from service
account_id,
company_id
from service
where id = #{id}
and is_deleted = 0
</select>
......@@ -61,7 +64,7 @@
<select id="queryAllByLimit" resultMap="ServiceMap" parameterType="com.mmc.pms.model.qo.ServiceQO">
select
id, service_name, application_id, industry_id, display_state, cover_plan, share_card, video,
service_introduction, create_time, update_time, account_id
service_introduction, create_time, update_time, account_id,company_id,sort
from service
<where>
is_deleted = 0
......@@ -77,8 +80,11 @@
<if test="displayState != null">
and display_state = #{displayState}
</if>
<if test="companyType==1 and companyId!=null">
and company_id = #{companyId}
</if>
</where>
order by create_time desc
order by sort desc
limit #{pageNo}, #{pageSize}
</select>
......@@ -100,15 +106,18 @@
<if test="displayState != null">
and display_state = #{displayState}
</if>
<if test="companyType==1 and companyId!=null">
and company_id = #{companyId}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.mmc.pms.entity.ServiceDO">
insert into service(service_name, application_id, industry_id, display_state, cover_plan, share_card, video,
service_introduction, account_id)
service_introduction, account_id,company_id)
values (#{serviceName}, #{applicationId}, #{industryId}, #{displayState}, #{coverPlan}, #{shareCard},
#{video}, #{serviceIntroduction}, #{accountId})
#{video}, #{serviceIntroduction}, #{accountId},#{companyId})
</insert>
<!--通过主键修改数据-->
......@@ -148,6 +157,9 @@
<if test="accountId != null">
account_id = #{accountId},
</if>
<if test="companyId != null">
company_id = #{companyId},
</if>
</set>
where id = #{id}
</update>
......@@ -200,7 +212,7 @@
<select id="queryPageByLimit" resultType="com.mmc.pms.entity.ServiceDO">
select
id, service_name, application_id, industry_id, display_state, cover_plan, share_card, video,
service_introduction, create_time, update_time, account_id
service_introduction, create_time, update_time, account_id,company_id,sort
from service
<where>
is_deleted = 0 and display_state = 0
......@@ -232,9 +244,10 @@
and display_state = #{param.displayState}
</if>
</where>
order by create_time desc
order by sort desc
limit #{param.pageNo}, #{param.pageSize}
</select>
<select id="QueryWorkServiceListById" resultType="com.mmc.pms.model.work.dto.ServiceDTO">
select id,
service_name,
......@@ -283,4 +296,35 @@
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<select id="queryByIdCount" resultType="java.lang.Integer">
select count(1) from service where company_id=#{companyId} and is_deleted=0
</select>
<select id="queryWorkInfoByCategoryId" resultType="com.mmc.pms.entity.ServiceDO">
select id,service_name,display_state,video
from service
where (application_id = #{id} or industry_id = #{id})
limit #{pageNo},#{pageSize}
</select>
<update id="exchange" parameterType="com.mmc.pms.entity.ServiceDO">
update service
<set>
<if test=" sort != null ">
sort = #{sort}
</if>
</set>
where id = #{id}
</update>
<update id="exchangeSort" parameterType="com.mmc.pms.entity.ServiceDO">
update service
<set>
<if test=" sort != null ">
sort = #{sort}
</if>
</set>
where id = #{id}
</update>
</mapper>
......@@ -17,4 +17,4 @@ data-filter:
- /pms/backstage/work/feignQueryWorkServiceListById
- /pms/webDevice/getSecondDistrictInfo
- /pms/webDevice/ad
- /pms/actuator/health/readiness
\ No newline at end of file
- /pms/actuator/health/readiness
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论