提交 14c92cfd 作者: zhenjie

Merge branch 'develop' of github.com:sharefly-iuav/pms into develop

apiVersion: v1
kind: Service
metadata:
name: mysql #此名字随便起
namespace: default #在固定的命名空间下
spec:
type: ExternalName
externalName: rm-wz9dd796t4j1giz6t.mysql.rds.aliyuncs.com
ports:
- port: 3306
### ExternalName类型的服务创建后,pod可以通过my-mysql-external.default.svc.cluster.local域名连接到外部服务,
#### 或者通过my-mysql-external。当需要指向其他外部服务时,只需要修改spec.externalName的值即可。
\ No newline at end of file
...@@ -17,4 +17,4 @@ patches: ...@@ -17,4 +17,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 0d859e2f696547afc10400b3f8d18beb47e8e6e3 newTag: 581f9d969edde40480c9dd33aa87cad6205992a1
apiVersion: apps/v1
kind: Deployment
metadata:
name: pms-deployment
spec:
replicas: 1
# template:
# spec:
# nodeName: master
...@@ -9,6 +9,7 @@ commonLabels: ...@@ -9,6 +9,7 @@ commonLabels:
commonAnnotations: commonAnnotations:
note: This is prod! note: This is prod!
patches: patches:
- path: ./increase_replicas.yaml
- path: ./configMap.yaml - path: ./configMap.yaml
- path: ./service-patch.yaml - path: ./service-patch.yaml
target: target:
......
...@@ -68,9 +68,14 @@ ...@@ -68,9 +68,14 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba.fastjson2</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson2</artifactId> <artifactId>fastjson</artifactId>
<version>2.0.24</version> <version>2.0.32</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
</dependency> </dependency>
<!--<dependency> <!--<dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
...@@ -102,7 +107,11 @@ ...@@ -102,7 +107,11 @@
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.2</version> <version>3.0.2</version>
</dependency> </dependency>
<!-- <dependency>
<groupId>com.taobao.arthas</groupId>
<artifactId>arthas-spring-boot-starter</artifactId>
<version>3.6.3</version>
</dependency>-->
<dependency> <dependency>
<groupId>com.deepoove</groupId> <groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId> <artifactId>poi-tl</artifactId>
......
package com.mmc.pms.common;
/**
* @Author small @Date 2023/5/25 9:58 @Version 1.0
*/
public enum FlyerAccountType {
YK(0, "游客"),
PT(1, "普通用户"),
GR(2, "个人飞手"),
JG(3, "飞手机构");
FlyerAccountType(Integer code, String status) {
this.code = code;
this.status = status;
}
private Integer code;
private String status;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.pms.common;
/**
* @Author small @Date 2023/5/25 9:52 @Version 1.0
*/
public interface Page {}
package com.mmc.pms.common; package com.mmc.pms.common;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.BrandInfoDTO;
import com.mmc.pms.service.BrandManageService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
* @date 2023/3/14 13:22
* 概要:
*/
@RestController
@RequestMapping("/brand")
@Api(tags = {"品牌管理-相关接口"})
public class BackstageBrandManageController {
@Autowired
private BrandManageService brandManageService;
@ApiOperation(value = "新增品牌")
@GetMapping("addBrandInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addBrandInfo(@ApiParam(value = "品牌名称") @RequestParam String brandName) {
return brandManageService.addBrandInfo(brandName);
}
@ApiOperation(value = "品牌列表")
@GetMapping("listBrandInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = BrandInfoDTO.class)})
public ResultBody listBrandInfo(@RequestParam Integer pageNo, @RequestParam Integer pageSize) {
return ResultBody.success(brandManageService.listBrandInfo(pageNo, pageSize));
}
// @ApiOperation(value = "删除品牌")
// @GetMapping("deleteBrandInfo")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// public ResultBody deleteBrandInfo(Integer id) {
// return brandManageService.deleteBrandInfo(id);
// }
@ApiOperation(value = "编辑品牌")
@GetMapping("editBrandInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editBrandInfo(Integer id, String brandName) {
return brandManageService.editBrandInfo(id, brandName);
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.dto.ClassifyInfoDTO;
import com.mmc.pms.model.vo.*;
import com.mmc.pms.service.CategoriesService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @Author lw @Date 2023/5/15 13:24 @Version 1.0
*/
@Api(tags = {"后台-分类管理-接口"})
@RestController
@RequestMapping("/classify")
public class BackstageCategoriesController {
@Autowired
private CategoriesService categoriesService;
@ApiOperation(value = "新增or修改目录")
@PostMapping("addOrEditDirectory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addOrEditDirectory(@RequestBody DirectoryInfoVO param) {
return categoriesService.addOrEditDirectory(param);
}
@ApiOperation(value = "目录列表")
@GetMapping("directoryList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = DirectoryInfoVO.class)})
public ResultBody directoryList(@RequestParam Integer pageNo, @RequestParam Integer pageSize) {
return ResultBody.success(categoriesService.directoryList(pageNo, pageSize));
}
@ApiOperation(value = "删除目录")
@GetMapping("removeDirectory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody removeDirectory(@ApiParam(value = "id") @RequestParam(value = "id") Integer id) {
return categoriesService.removeDirectory(id);
}
@ApiOperation(value = "分类新增")
@PostMapping("addClassification")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addClassification(@Validated(Create.class) @RequestBody ClassifyInfoVO classifyInfoVO) {
return categoriesService.addClassification(classifyInfoVO);
}
@ApiOperation(value = "分类修改")
@PostMapping("updateClassification")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updateClassification(@Validated(Update.class) @RequestBody ClassifyInfoVO classifyInfoVO) {
return categoriesService.updateClassification(classifyInfoVO);
}
@ApiOperation(value = "分类信息-排序")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("exchangeSortType")
public ResultBody exchangeSortType(@ApiParam(value = "第一个分类id", required = true) @RequestParam(value = "firstId") Integer firstId,
@ApiParam(value = "第二个分类id", required = true) @RequestParam(value = "secondId") Integer secondId) {
return categoriesService.exchangeSortType(firstId, secondId);
}
@ApiOperation(value = "分类信息-列表")
@PostMapping("getClassificationList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ClassifyInfoDTO.class)})
public ResultBody getClassificationList(@RequestBody QueryClassifyVO queryClassifyVO) {
return ResultBody.success(categoriesService.getClassificationList(queryClassifyVO));
}
@ApiOperation(value = "分类详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ClassifyDetailsDTO.class)})
@GetMapping("getClassifyDetails")
public ResultBody getClassifyDetails(@ApiParam(value = "分类id", required = true) @RequestParam(value = "id") Integer id) {
return categoriesService.getClassifyDetails(id);
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.vo.Create;
import com.mmc.pms.model.vo.GoodsAddVO;
import com.mmc.pms.model.vo.Update;
import com.mmc.pms.service.GoodsInfoService;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author LW
* @date 2023/3/14 13:22
* 概要:
*/
@RestController
@RequestMapping("/goods")
@Api(tags = {"商品管理-相关接口"})
public class BackstageGoodsManageController {
@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);
}
@ApiOperation(value = "修改(租赁/销售)商品")
@PostMapping("editGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editGoodsInfo(@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.editGoodsInfo(goodsAddVO);
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.Create;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import com.mmc.pms.model.vo.Update;
import com.mmc.pms.service.ProductSkuService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @Author LW
* @date 2022/9/22 10:28
* 概要:
*/
@RestController
@RequestMapping("/product/spec/")
@Api(tags = {"产品管理模块-相关接口"})
public class BackstageProductSpecController {
@Autowired
private ProductSkuService productSkuService;
@ApiOperation(value = "新增产品sku")
@PostMapping("addProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addProductSku(@Validated(Create.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) {
return productSkuService.addProductSku(param);
}
@ApiOperation(value = "产品sku详情")
@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")
@PostMapping("editProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editProductSku(@Validated(Update.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) {
return productSkuService.editProductSku(param);
}
@ApiOperation(value = "产品sku分页列表")
@PostMapping("listPageProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSkuDTO.class)})
public ResultBody listPageProductSku(@ApiParam("条件参数") @RequestBody ProductSkuQO productSkuQO) {
return productSkuService.listPageProductSku(productSkuQO);
}
// @ApiOperation(value = "产品sku管理---删除产品sku")
// @GetMapping("removeProductSku")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// public ResultBody removeProductSku(@ApiParam("id") @RequestParam(value = "id") Integer id) {
// return productSpecService.removeProductSku(id);
// }
//
@ApiOperation(value = "新增or修改产品规格")
@PostMapping("addOrEditProductSpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addOrEditProductSpec(@Validated({Create.class, Update.class}) @ApiParam("产品规格VO") @RequestBody ProductSpecVO param) {
return productSkuService.addOrEditProductSpec(param);
}
@ApiOperation(value = "产品规格编辑回显")
@GetMapping("getProductSpecDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecDTO.class)})
public ResultBody getProductSpecDetail(@ApiParam("id") @RequestParam(value = "id") Integer id) {
return productSkuService.getProductSpecDetail(id);
}
@ApiOperation(value = "产品规格分页列表")
@GetMapping("listPageProductSpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecDTO.class)})
public ResultBody listPageProductSpec(@ApiParam(value = "页码") @RequestParam(value = "pageNo") Integer pageNo,
@ApiParam(value = "每页显示数") @RequestParam(value = "pageSize") Integer pageSize,
@ApiParam(value = "产品skuId") @RequestParam(value = "productSkuId") Integer productSkuId) {
return productSkuService.listPageProductSpec(pageNo, pageSize, productSkuId);
}
@ApiOperation(value = "产品规格管理-价格配置")
@PostMapping("productSpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody productSpecCPQ(@RequestBody 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) {
return productSkuService.updateProductSpecCPQ(productSpecCPQVO);
}
@ApiOperation(value = "产品规格管理---获取价格配置信息")
@PostMapping("getProductSpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
public ResultBody getProductSpecCPQ(@RequestBody ProductSpecCPQVO productSpecCPQVO) {
return productSkuService.getProductSpecCPQ(productSpecCPQVO);
}
//
// @ApiOperation(value = "价格配置信息--恢复全局默认设置")
// @GetMapping("getDefaultSettings")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
// public ResultBody getDefaultSettings(@ApiParam(value = "规格id") @RequestParam(value = "productSpecId") Integer productSpecId) {
// return productSpecService.getDefaultSettings(productSpecId);
// }
//
// @ApiOperation(value = "产品规格管理---删除规格")
// @GetMapping("removeProductSpec")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = RemoveSkuDTO.class)})
// public ResultBody removeProductSpec(@ApiParam("id") @RequestParam(value = "id") Integer id) {
// return productSpecService.removeProductSpec(id);
// }
//
// @ApiOperation(value = "feign根据渠道等级获取单价信息")
// @GetMapping("feignGetUnitPriceByTag")
// @ApiIgnore
// @ApiResponses({@ApiResponse(code = 200, message = "OK",response = ProductSpecPriceDTO.class)})
// public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId")Integer specId,
// @RequestParam(value = "tagId")Integer tagId) {
// return productSpecService.feignGetUnitPriceByTag(specId,tagId);
// }
}
package com.mmc.pms.controller;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.*;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.json.JsonUtil;
import com.mmc.pms.redis.RedisConstant;
import com.mmc.pms.util.OssConstant;
import com.mmc.pms.util.PartUploadInfo;
import com.mmc.pms.util.TDateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/**
* @Author small @Date 2023/5/23 13:46 @Version 1.0
*/
@Api(tags = {"分片上传"})
@RestController
@RequestMapping("/partupload")
public class PartUploadController {
@Autowired private StringRedisTemplate stringRedisTemplate;
@ApiOperation(value = "初始化分片上传")
@GetMapping("/initPartUpload")
public ResultBody initPartUpload(@RequestParam String fileName, HttpServletRequest httpRequest) {
// 创建OSSClient实例。
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
StringBuffer objectName = new StringBuffer();
objectName.append(OssConstant.BUCKET);
objectName.append("/");
objectName.append(fileName);
objectName.append("-");
objectName.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
// 创建InitiateMultipartUploadRequest对象。
InitiateMultipartUploadRequest request =
new InitiateMultipartUploadRequest(OssConstant.BUCKET, objectName.toString());
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
// ObjectMetadata metadata = new ObjectMetadata();
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
// StorageClass.Standard.toString());
// request.setObjectMetadata(metadata);
// 初始化分片。
InitiateMultipartUploadResult upresult = ossClient.initiateMultipartUpload(request);
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
String uploadId = upresult.getUploadId();
// 记录缓存信息
PartUploadInfo pinfo = new PartUploadInfo();
pinfo.setBucketName(OssConstant.BUCKET);
pinfo.setObjectName(objectName.toString());
pinfo.setUploadId(uploadId);
stringRedisTemplate
.opsForValue()
.set(RedisConstant.createPartUploadKey(uploadId), JsonUtil.parseObjToJson(pinfo));
return ResultBody.success(uploadId);
}
@ApiOperation(value = "进行片段上传")
@PostMapping("/partUpload")
public ResultBody partUpload(
@RequestParam("partFile") MultipartFile partFile, @RequestParam("uploadId") String uploadId)
throws IOException {
PartUploadInfo pinfo =
JsonUtil.parseJsonToObj(
stringRedisTemplate.opsForValue().get(RedisConstant.createPartUploadKey(uploadId)),
PartUploadInfo.class);
// 创建OSSClient实例。
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
List<PartETag> partETags = new ArrayList<PartETag>();
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
final long partSize = 1 * 1024 * 1024L; // 1 MB。
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
final File sampleFile = new File("D:\\localpath\\examplefile.txt");
long fileLength = sampleFile.length();
int partCount = (int) (fileLength / partSize);
if (fileLength % partSize != 0) {
partCount++;
}
// 遍历分片上传。
for (int i = 0; i < partCount; i++) {
long startPos = i * partSize;
long curPartSize = (i + 1 == partCount) ? (fileLength - startPos) : partSize;
InputStream instream = new FileInputStream(sampleFile);
// 跳过已经上传的分片。
instream.skip(startPos);
UploadPartRequest uploadPartRequest = new UploadPartRequest();
uploadPartRequest.setBucketName(pinfo.getBucketName());
uploadPartRequest.setKey(pinfo.getObjectName());
uploadPartRequest.setUploadId(uploadId);
uploadPartRequest.setInputStream(instream);
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
uploadPartRequest.setPartSize(curPartSize);
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
uploadPartRequest.setPartNumber(i + 1);
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
UploadPartResult uploadPartResult = ossClient.uploadPart(uploadPartRequest);
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
partETags.add(uploadPartResult.getPartETag());
}
// 创建CompleteMultipartUploadRequest对象。
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
CompleteMultipartUploadRequest completeMultipartUploadRequest =
new CompleteMultipartUploadRequest(
pinfo.getBucketName(), pinfo.getObjectName(), uploadId, partETags);
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
// 完成上传。
CompleteMultipartUploadResult completeMultipartUploadResult =
ossClient.completeMultipartUpload(completeMultipartUploadRequest);
System.out.println(completeMultipartUploadResult.getETag());
// 关闭OSSClient。
ossClient.shutdown();
return ResultBody.success();
}
@ApiOperation(value = "上传到阿里云oss")
@PostMapping("/oss")
public ResultBody oss(
@RequestPart("uploadFile") MultipartFile uploadFile, HttpServletRequest httpRequest)
throws Exception {
// yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
String endpoint = "yourEndpoint";
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
String accessKeyId = "yourAccessKeyId";
String accessKeySecret = "yourAccessKeySecret";
// 填写Bucket名称,例如examplebucket。
String bucketName = "examplebucket";
// 填写Object完整路径,例如exampledir/exampleobject.txt。Object完整路径中不能包含Bucket名称。
String objectName = "exampledir/exampleobject.txt";
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
// 创建InitiateMultipartUploadRequest对象。
InitiateMultipartUploadRequest request =
new InitiateMultipartUploadRequest(bucketName, objectName);
// 如果需要在初始化分片时设置文件存储类型,请参考以下示例代码。
// ObjectMetadata metadata = new ObjectMetadata();
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS,
// StorageClass.Standard.toString());
// request.setObjectMetadata(metadata);
// 初始化分片。
InitiateMultipartUploadResult upresult = ossClient.initiateMultipartUpload(request);
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
String uploadId = upresult.getUploadId();
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
List<PartETag> partETags = new ArrayList<PartETag>();
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
final long partSize = 1 * 1024 * 1024L; // 1 MB。
// 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
final File sampleFile = new File("D:\\localpath\\examplefile.txt");
long fileLength = sampleFile.length();
int partCount = (int) (fileLength / partSize);
if (fileLength % partSize != 0) {
partCount++;
}
// 遍历分片上传。
for (int i = 0; i < partCount; i++) {
long startPos = i * partSize;
long curPartSize = (i + 1 == partCount) ? (fileLength - startPos) : partSize;
InputStream instream = new FileInputStream(sampleFile);
// 跳过已经上传的分片。
instream.skip(startPos);
UploadPartRequest uploadPartRequest = new UploadPartRequest();
uploadPartRequest.setBucketName(bucketName);
uploadPartRequest.setKey(objectName);
uploadPartRequest.setUploadId(uploadId);
uploadPartRequest.setInputStream(instream);
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
uploadPartRequest.setPartSize(curPartSize);
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
uploadPartRequest.setPartNumber(i + 1);
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
UploadPartResult uploadPartResult = ossClient.uploadPart(uploadPartRequest);
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
partETags.add(uploadPartResult.getPartETag());
}
// 创建CompleteMultipartUploadRequest对象。
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
CompleteMultipartUploadRequest completeMultipartUploadRequest =
new CompleteMultipartUploadRequest(bucketName, objectName, uploadId, partETags);
// 如果需要在完成文件上传的同时设置文件访问权限,请参考以下示例代码。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.PublicRead);
// 完成上传。
CompleteMultipartUploadResult completeMultipartUploadResult =
ossClient.completeMultipartUpload(completeMultipartUploadRequest);
System.out.println(completeMultipartUploadResult.getETag());
// 关闭OSSClient。
ossClient.shutdown();
return ResultBody.success();
}
}
package com.mmc.pms.controller;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.oss.ClientBuilderConfiguration;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.util.FileLoadUtil;
import com.mmc.pms.util.OssConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @Author small @Date 2023/5/23 10:12 @Version 1.0
*/
@Api(tags = {"上传文件"})
@RestController
@RequestMapping("/upload")
public class UploadController {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/");
@ApiOperation(value = "V1.0.1-上传一个图片或者文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "文件/图片/后缀无限制"),
})
@PostMapping("/oss")
public ResultBody oss(
@RequestParam("uploadFile") MultipartFile uploadFile, HttpServletRequest request) {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
InputStream inputStream = null;
try {
inputStream = uploadFile.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
String oldName = uploadFile.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, inputStream);
ossClient.shutdown();
String filePath = "https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName;
JSONObject jsObj = new JSONObject();
jsObj.put("filePath", filePath);
return ResultBody.success(jsObj);
}
@ApiOperation(value = "V1.0.1-上传多个文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "文件/图片"),
})
@PostMapping("/osses")
public ResultBody osses(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
List list = new LinkedList();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, inputStream);
// ossClient.shutdown();
// String filePath = "https://" + OssConstant.BUCKET + '.' +
// OssConstant.ENDPOINT + "/" +
// newName;
list.add("https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(list);
}
@ApiOperation(value = "V1.0.1-上传多个视频文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "视频不能超过1MB/mkv/avi/mov/mp4"),
})
@PostMapping("/videoOss")
public ResultBody videoOss(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
clientBuilderConfiguration.setRequestTimeoutEnabled(true);
clientBuilderConfiguration.setConnectionRequestTimeout(600000 * 20);
clientBuilderConfiguration.setConnectionTimeout(600000 * 20);
OSS ossClient =
new OSSClientBuilder()
.build(
OssConstant.ENDPOINT,
OssConstant.ACCESSKEYID,
OssConstant.ACCESSKEYSECRET,
clientBuilderConfiguration);
List list = new LinkedList();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 3) {
return ResultBody.error(ResultEnum.UPLOAD_VIDEO_ERROR);
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("视频名称:" + newName);
list.add("https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
}
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(list);
}
@ApiOperation(value = "V1.0.1-上传一个视频文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "视频不能超过1MB/mkv/avi/mov/mp4"),
})
@PostMapping("/videoOsses")
public ResultBody videoOsses(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
clientBuilderConfiguration.setRequestTimeoutEnabled(true);
clientBuilderConfiguration.setConnectionRequestTimeout(600000 * 20);
clientBuilderConfiguration.setConnectionTimeout(600000 * 20);
OSS ossClient =
new OSSClientBuilder()
.build(
OssConstant.ENDPOINT,
OssConstant.ACCESSKEYID,
OssConstant.ACCESSKEYSECRET,
clientBuilderConfiguration);
Map map = new HashMap();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 3) {
return ResultBody.error(ResultEnum.UPLOAD_VIDEO_ERROR);
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("视频名称:" + newName);
map.put(
"filePath",
"https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
map.put("fileName", oldName);
map.put("fileSize", file.getSize());
map.put("fileType", oldName.substring(oldName.lastIndexOf(".")).replace(".", ""));
}
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(map);
}
@ApiOperation(value = "V1.0.1-上传多张图片文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "图片"),
})
@PostMapping("/imgOss")
public ResultBody imgOss(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
List list = new LinkedList();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 1) {
return ResultBody.error(ResultEnum.UPLOAD_IMG_ERROR);
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("图片名称:" + newName);
list.add("https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
}
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(list);
}
@ApiOperation(value = "V1.0.1-上传一张图片文件到阿里云oss ")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "文件"),
})
@PostMapping("/singleImgOss")
public ResultBody singleImgOss(
@RequestParam("uploadFile") MultipartFile uploadFile, HttpServletRequest request)
throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
List list = new LinkedList();
if (uploadFile != null) {
if (uploadFile.getSize() / 1024 > 3096) {
return ResultBody.error("请上传小于3M的图片");
}
InputStream inputStream = null;
try {
inputStream = uploadFile.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 1) {
return ResultBody.error(ResultEnum.UPLOAD_IMG_ERROR);
}
String oldName = uploadFile.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("图片名称:" + newName);
list.add("https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(list);
}
@ApiOperation(value = "V1.0.1-上传一张图片文件到阿里云oss ")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = false,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "图片/返回图片名称及图片大小"),
})
@PostMapping("/imgOsses")
public ResultBody imgOsses(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
Map map = new HashMap();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 1) {
return ResultBody.error(ResultEnum.UPLOAD_IMG_ERROR);
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("图片名称:" + newName);
map.put(
"filePath",
"https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
map.put("fileName", oldName);
map.put("fileSize", file.getSize());
map.put("fileType", oldName.substring(oldName.lastIndexOf(".")).replace(".", ""));
}
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(map);
}
private byte[] readByte(final InputStream is) throws IOException {
try (BufferedInputStream bis = new BufferedInputStream(is);
ByteArrayOutputStream bas = new ByteArrayOutputStream(4096);
BufferedOutputStream bos = new BufferedOutputStream(bas)) {
byte[] bytes = new byte[4096];
int size;
while ((size = bis.read(bytes)) != -1) {
bos.write(bytes, 0, size);
}
return bas.toByteArray();
}
}
@ApiOperation(value = "V1.0.1-上传文档文件到阿里云oss")
@ApiImplicitParams({
@ApiImplicitParam(
paramType = "header",
name = "mmc-identity",
dataTypeClass = java.lang.String.class,
dataType = "String",
required = true,
value = "token"),
@ApiImplicitParam(
name = "uploadFile",
dataType = "MultipartFile",
dataTypeClass = org.springframework.web.multipart.MultipartFile.class,
required = true,
value = "文件 doc,ppt,pdf,xls结尾"),
})
@PostMapping("/docOss")
public ResultBody docOss(
@RequestParam("uploadFile") MultipartFile[] uploadFile, HttpServletRequest request)
throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
Map map = new HashMap();
if (uploadFile != null && uploadFile.length > 0) {
System.out.println("osses文件数量" + uploadFile.length);
for (int i = 0; i < uploadFile.length; i++) {
MultipartFile file = uploadFile[i];
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return ResultBody.error(e.getMessage());
}
try (final BufferedInputStream bis = new BufferedInputStream(inputStream)) {
// 校验
int typeNum = FileLoadUtil.checkFileType(FileLoadUtil.getType(bis));
if (typeNum != 2) {
return ResultBody.error(ResultEnum.UPLOAD_DOC_ERROR);
}
String oldName = file.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
ossClient.putObject(OssConstant.BUCKET, newName, bis);
System.out.println("文档名称:" + newName);
map.put(
"filePath",
"https://" + OssConstant.BUCKET + '.' + OssConstant.ENDPOINT + "/" + newName);
map.put("fileName", oldName);
map.put("fileSize", file.getSize());
map.put("fileType", oldName.substring(oldName.lastIndexOf(".")).replace(".", ""));
}
}
}
ossClient.shutdown(); // 关流
return ResultBody.success(map);
}
/**
* 上传文件
*
* @param uploadFile
* @return
*/
@ApiIgnore
@RequestMapping(value = "/local", method = RequestMethod.POST)
public ResultBody local(
@RequestParam(value = "uploadFile", required = false) MultipartFile[] uploadFile,
@RequestParam(value = "directory", required = false, defaultValue = "upload")
String directory,
HttpServletRequest request)
throws IOException {
return FileLoadUtil.bathCreateFile(directory, uploadFile);
}
/**
* 下载文件
*
* @param path
* @param response
* @throws IOException
*/
@ApiIgnore
@RequestMapping(value = "/download/{path}", method = RequestMethod.GET)
public void getDownloadFile(@PathVariable("path") String path, HttpServletResponse response)
throws IOException {
response.setContentType("application/x-001");
path = FileLoadUtil.explainLoadPath(path);
ServletOutputStream out = response.getOutputStream();
FileInputStream in = new FileInputStream(new File(path));
byte buffer[] = new byte[1024];
int length = 0;
while ((length = in.read(buffer)) != -1) {
out.write(buffer, 0, length);
}
in.close();
out.close();
}
@ApiIgnore
@RequestMapping(value = "/heart", method = RequestMethod.GET)
public ResultBody heart() {
return ResultBody.success("heart");
}
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.BrandInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* @Author LW
* @date 2023/3/14 13:27
* 概要:
*/
@Mapper
public interface BrandManageDao {
/**
* 插入品牌信息
*
* @param brandInfoDO 品牌信息
* @return int
*/
void insertBrandInfo(BrandInfoDO brandInfoDO);
/**
* 数品牌信息名字
* 品牌信息名字计数
*
* @param brandName 品牌名称
* @param id id
* @return int
*/
int countBrandInfoByName(Integer id, String brandName);
/**
* 通过id删除品牌信息
*
* @param id id
*/
void removeBrandInfoById(Integer id);
/**
* 品牌信息id列表
*
* @param ids id
* @return {@link List}<{@link BrandInfoDO}>
*/
List<BrandInfoDO> listBrandInfoByIds(@Param("ids") Set<Integer> ids);
/**
* 品牌列表信息
*
* @param itemIndex 项指数
* @param pageSize 页面大小
* @return {@link List}<{@link BrandInfoDO}>
*/
List<BrandInfoDO> listBrandInfo(Integer itemIndex, Integer pageSize);
/**
* 数品牌信息
*
* @return int
*/
int countBrandInfo();
/**
* 更新品牌信息
*
* @param brandInfoDO 品牌信息做
*/
void updateBrandInfo(BrandInfoDO brandInfoDO);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.Directory;
import com.mmc.pms.model.vo.ClassifyInfoVO;
import com.mmc.pms.model.vo.DirectoryInfoVO;
import com.mmc.pms.model.vo.QueryClassifyVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Mapper
* @createDate 2023-05-24 10:29:28
* @Entity com.mmc.pms.entity.Categories
*/
@Mapper
public interface CategoriesDao {
int countUpdateDirectoryName(DirectoryInfoVO param);
void insertDirectory(Directory directory);
void updateDirectory(Directory directory);
int countDirectoryList();
List<Directory> directoryList(int i, Integer pageSize);
int countDirectory(Integer id);
void removeDirectory(Integer id);
int countClassificationByName(ClassifyInfoVO classifyInfoVO);
int getCountCategoriesByPid(Integer pid, Integer type);
void insertClassification(Categories categories);
void updateClassification(ClassifyInfoVO classifyInfoVO);
Categories getGoodsGroupById(Integer id);
int updateTypeSort(Integer firstId, Integer sort);
List<Categories> selectAllClassification(QueryClassifyVO queryClassifyVO);
int countListClassification(QueryClassifyVO queryClassifyVO);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.vo.GoodsAddVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 23214
* @description 针对表【goods_info(商品基本信息)】的数据库操作Mapper
* @createDate 2023-05-27 14:08:45
* @Entity com.mmc.pms.entity.GoodsInfo
*/
@Mapper
public interface GoodsInfoDao {
int countGoodsInfoByName(GoodsAddVO goodsAddVO);
void insertGoodsInfo(GoodsInfo goodsInfo);
int countGoodsInfo();
void insertGoodsImgInfo(List<GoodsImgDO> list);
void insertVideoInfo(GoodsVideoDO goodsVideoDO);
void insertGoodsDetail(GoodsDetailDO goodsDetailDO);
void insertGoodsService(List<GoodsServiceDO> otherList);
int countGoodsInfoById(Integer id);
void updateGoodsInfo(GoodsInfo goodsInfo);
void updateGoodsDetail(GoodsDetailDO goodsDetailDO);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer id);
void deleteImgByIds(List<Integer> deleteIds);
void deleteGoodsVideoById(Integer id);
void deleteGoodsServiceByGoodsId(Integer id);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.MallProdSkuInfoDO;
import com.mmc.pms.entity.ProductSkuDO;
import com.mmc.pms.entity.ProductSpecDO;
import com.mmc.pms.entity.ProductSpecPriceDO;
import com.mmc.pms.model.dto.ProductSkuVO;
import com.mmc.pms.model.dto.ProductSpecVO;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @createDate 2023-05-25 14:55:56
* @Entity com.mmc.pms.entity.ProductSku
*/
@Mapper
public interface ProductSkuDao {
int countSkuName(ProductSkuVO param);
int insertProductSku(ProductSkuDO productSkuDO);
int countSkuIsExist(Integer id);
ProductSkuDO getProductSkuDetail(Integer id);
int updateProductSku(ProductSkuDO productSkuDO);
int countListPageProductSku(ProductSkuQO productSkuQO);
List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO);
int countSpecName(ProductSpecVO param);
int insertProductSpec(ProductSpecDO productSpecDO);
int updateProductSpec(ProductSpecDO productSpecDO);
int countSpecIsExist(Integer id);
ProductSpecDO getProductSpecDetail(Integer id);
int countListPageProductSpec(Integer productSkuId);
List<ProductSpecDO> listPageProductSpec(int i, Integer pageSize, Integer productSkuId);
int batchInsertSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list);
void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO);
void insertMallProdSkuInfo(MallProdSkuInfoDO mallProdSkuInfoDO);
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.BrandInfoDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author LW
* @date 2022/6/20 16:33
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BrandInfoDO implements Serializable {
private static final long serialVersionUID = 2832084701380349536L;
private Integer id;
private String brandName;
private Date createTime;
private Date updateTime;
private Integer delete;
public BrandInfoDO(String brandName) {
this.brandName = brandName;
}
public BrandInfoDTO buildBrandInfoDTO() {
return BrandInfoDTO.builder().id(id).brandName(brandName).createTime(createTime).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.dto.ClassifyInfoDTO;
import com.mmc.pms.model.vo.ClassifyInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author lw
* @TableName categories
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Categories implements Serializable {
private Integer id;
private Integer parentId;
private String name;
private String icon;
private String description;
private Integer sort;
private Integer type;
private Date createTime;
private Date updateTime;
private Integer deleted;
private Integer directoryId;
private String remark;
public Categories(ClassifyInfoVO classifyInfoVO) {
this.id = classifyInfoVO.getId();
this.parentId = classifyInfoVO.getPid();
this.name = classifyInfoVO.getClassifyName();
this.icon = classifyInfoVO.getIcon();
this.description = classifyInfoVO.getDescription();
this.type = classifyInfoVO.getType();
this.directoryId = classifyInfoVO.getDirectoryId();
this.remark = classifyInfoVO.getRemark();
}
public ClassifyInfoDTO buildClassifyInfoDTO() {
return ClassifyInfoDTO.builder().id(id).description(description)
.icon(icon).pid(parentId).classifyName(name)
.remark(remark).createTime(createTime)
.directoryId(directoryId).type(type).build();
}
public ClassifyDetailsDTO buildClassifyDetailsDTO() {
return ClassifyDetailsDTO.builder().id(id).description(description)
.icon(icon).classifyName(name)
.remark(remark).build();
}
}
\ No newline at end of file
package com.mmc.pms.entity;
import com.mmc.pms.model.vo.DirectoryInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* 目录管理表(Directory)实体类
*
* @author makejava
* @since 2023-05-24 14:58:31
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Directory implements Serializable {
private static final long serialVersionUID = 713939370607409336L;
/**
* 主键id
*/
private Integer id;
/**
* 目录名称
*/
private String directoryName;
/**
* 其他目录关联id
*/
private Integer relevance;
/**
* 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录)
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Integer deleted;
public Directory(DirectoryInfoVO param) {
this.id = param.getId();
this.directoryName = param.getDirectoryName();
this.relevance = param.getRelevance();
this.type = param.getType();
}
public DirectoryInfoVO buildDirectoryInfoVO() {
return DirectoryInfoVO.builder().id(id).directoryName(directoryName).relevance(relevance).type(type).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.vo.GoodsAddVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author 23214
* @TableName goods_info
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsInfo implements Serializable {
private Integer id;
private Integer pid;
private String goodsNo;
private String goodsName;
private Integer directoryId;
private Integer addGoodsUserId;
private Integer categoryByOne;
private Integer categoryByTwo;
private String ecoLabel;
private Integer shelfStatus;
private Integer showCode;
private Integer sort;
private Date createTime;
private Integer goodsType;
private Date updateTime;
private Integer deleted;
private static final long serialVersionUID = 1L;
public GoodsInfo(GoodsAddVO goodsAddVO) {
this.id = goodsAddVO.getId();
this.goodsName = goodsAddVO.getGoodsName();
this.shelfStatus = goodsAddVO.getShelfStatus();
this.categoryByOne = goodsAddVO.getCategoryByOne();
this.categoryByTwo = goodsAddVO.getCategoryByTwo();
this.directoryId = goodsAddVO.getDirectoryId();
this.ecoLabel = goodsAddVO.getTag();
this.goodsType = goodsAddVO.getGoodsType();
}
}
\ No newline at end of file
...@@ -71,6 +71,7 @@ public class GoodsInfoDO implements Serializable { ...@@ -71,6 +71,7 @@ public class GoodsInfoDO implements Serializable {
.imgUrl(this.mainImg) .imgUrl(this.mainImg)
.directoryId(this.sortTypeId) .directoryId(this.sortTypeId)
.directoryName(this.directoryName) .directoryName(this.directoryName)
.goodsDesc(this.goodsDesc)
.goodsOneLevelTypeName(this.goodsMasterType.getTypeName()) .goodsOneLevelTypeName(this.goodsMasterType.getTypeName())
.goodsTwoLevelTypeName(this.goodsSlaveType.getTypeName()) .goodsTwoLevelTypeName(this.goodsSlaveType.getTypeName())
.isCoupons(this.isCoupons) .isCoupons(this.isCoupons)
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.vo.GoodsGroupVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -17,28 +16,30 @@ import java.util.Date; ...@@ -17,28 +16,30 @@ import java.util.Date;
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
public class GoodsTypeDO implements Serializable { public class GoodsTypeDO implements Serializable {
private Integer id; private Integer id;
private Integer pid; private Integer pid;
private Integer sortTypeId; private Integer sortTypeId;
private String typeName; private String typeName;
private String description; private String description;
private Integer sort; private Integer sort;
private String icon; private String icon;
private String remark; private String remark;
private Integer deleted; private Integer deleted;
private Date updateTime; private Date updateTime;
private Date createTime; private Date createTime;
/** 辅助字段-start */ /**
private GoodsTypeDO slaveType; * 辅助字段-start
*/
private GoodsTypeDO slaveType;
/** 辅助字段-end */ /** 辅助字段-end */
public GoodsTypeDO(GoodsGroupVO goodsGroupVO) { // public GoodsTypeDO(ClassifyInfoVO goodsGroupVO) {
this.sortTypeId = goodsGroupVO.getSortTypeId(); // this.sortTypeId = goodsGroupVO.getSortTypeId();
this.typeName = goodsGroupVO.getGroupName(); // this.typeName = goodsGroupVO.getGroupName();
this.pid = goodsGroupVO.getPid(); // this.pid = goodsGroupVO.getPid();
this.description = goodsGroupVO.getDescription(); // this.description = goodsGroupVO.getDescription();
this.icon = goodsGroupVO.getIcon(); // this.icon = goodsGroupVO.getIcon();
this.remark = goodsGroupVO.getRemark(); // this.remark = goodsGroupVO.getRemark();
} // }
} }
...@@ -18,51 +18,56 @@ import java.util.Date; ...@@ -18,51 +18,56 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class MallProdSkuInfoDO implements Serializable { public class MallProdSkuInfoDO implements Serializable {
private static final long serialVersionUID = 3667714765929443857L; private static final long serialVersionUID = 3667714765929443857L;
private Integer id; private Integer id;
private Integer goodsInfoId; private Integer goodsInfoId;
private Integer prodSkuId; private Integer prodSkuId;
private String prodSkuSpecName; private String prodSkuSpecName;
private Integer goodsTypeId; private Integer categoryId;
private Integer chooseType; private Integer chooseType;
private Integer must; private Integer must;
private Integer skuUnitId; private Integer skuUnitId;
private Integer deleted; private Integer deleted;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer flag; private Integer flag;
private String productSpecIdList;
private String beforeUpdateSpec;
/**
* 辅助字段 start
*/
private String typeName;
/** 辅助字段 start */ private String unitName;
private String typeName; private String productSkuName;
private Integer brandInfoId;
private String unitName; /**
private String productSkuName; * 辅助字段 end
private Integer brandInfoId; */
public MallProdSkuInfoDO(GoodsSpecVO goodsSpecVO) {
this.categoryId = goodsSpecVO.getGoodsTypeId();
this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName();
this.chooseType = goodsSpecVO.getChooseType();
this.skuUnitId = goodsSpecVO.getSkuUnitId();
this.must = goodsSpecVO.getMust();
this.flag = goodsSpecVO.getFlag();
}
/** 辅助字段 end */ public GoodsSpecDTO buildGoodsSpecDTO() {
public MallProdSkuInfoDO(GoodsSpecVO goodsSpecVO) { return GoodsSpecDTO.builder()
this.goodsTypeId = goodsSpecVO.getGoodsTypeId(); .id(this.id)
this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName(); .goodsSpecName(this.prodSkuSpecName)
this.chooseType = goodsSpecVO.getChooseType(); .goodsTypeId(this.categoryId)
this.skuUnitId = goodsSpecVO.getSkuUnitId(); .chooseType(this.chooseType)
this.must = goodsSpecVO.getMust(); .skuUnitId(skuUnitId)
this.flag = goodsSpecVO.getFlag(); .unitName(this.unitName)
} .skuId(this.prodSkuId)
.typeName(this.typeName)
public GoodsSpecDTO buildGoodsSpecDTO() { .must(must)
return GoodsSpecDTO.builder() .skuName(this.productSkuName)
.id(this.id) .brandInfoId(brandInfoId)
.goodsSpecName(this.prodSkuSpecName) .flag(flag)
.goodsTypeId(this.goodsTypeId) .build();
.chooseType(this.chooseType) }
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.prodSkuId)
.typeName(this.typeName)
.must(must)
.skuName(this.productSkuName)
.brandInfoId(brandInfoId)
.flag(flag)
.build();
}
} }
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderInfoDTO;
import com.mmc.pms.model.vo.LeaseOrderVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:05 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderInfoDO implements Serializable {
private static final long serialVersionUID = 6544149196885009444L;
private Integer id;
private String orderNo;
private Integer wareInfoId;
private String wareNo;
private String wareTitle;
private String wareImg;
private Integer skuInfoId;
private String skuTitle;
private Integer repoAccountId;
private String uid;
private String buyerName;
private String buyerPhone;
private BigDecimal unitPrice;
private Integer wareNum;
private BigDecimal shouldPay;
private BigDecimal actualPay;
private Integer orderType;
private BigDecimal deposit;
private BigDecimal rentPrice;
private Date startDate;
private Date endDate;
private Integer payDay;
private String tranStatus;
private Integer exWare;
private String remark;
private String pfRemark;
private String shutReason;
private String payNo;
private Date payTime;
private Date sendWareTime;
private Integer rcdCompanyId;
private Date createTime;
private Date updateTime;
/**
* 辅助字段
*
* @return
*/
private OrderReceiptDO receipt;
public OrderInfoDTO buildOrderInfoDTO() {
return OrderInfoDTO.builder()
.id(this.id)
.orderNo(this.orderNo)
.wareInfoId(this.wareInfoId)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.repoAccountId(this.repoAccountId)
.uid(this.uid)
.buyerName(this.buyerName)
.buyerPhone(this.buyerPhone)
.unitPrice(this.unitPrice)
.wareNum(this.wareNum)
.shouldPay(this.shouldPay)
.actualPay(this.actualPay)
.orderType(this.orderType)
.deposit(this.deposit)
.rentPrice(this.rentPrice)
.startDate(this.startDate)
.endDate(this.endDate)
.payDay(this.payDay)
.tranStatus(this.tranStatus)
.createTime(this.createTime)
.payTime(this.payTime)
.payNo(this.payNo)
.wareImg(this.wareImg)
.pfRemark(this.pfRemark)
.shutReason(this.shutReason)
.remark(this.remark)
.receipt(this.receipt == null ? null : receipt.buildOrderReceiptDTO())
.exWare(this.exWare)
.sendWareTime(this.sendWareTime)
.build();
}
public OrderInfoDO(LeaseOrderVO lease) {
this.orderNo = lease.getOrderNo();
this.wareInfoId = lease.getWareInfoId();
this.wareNo = lease.getWareNo();
this.wareTitle = lease.getWareTitle();
this.wareImg = lease.getMainImg();
this.skuInfoId = lease.getSkuInfoId();
this.skuTitle = lease.getSkuTitle();
this.repoAccountId = lease.getRepoAccountId();
this.uid = lease.getUid();
this.buyerName = lease.getBuyerName();
this.buyerPhone = lease.getBuyerPhone();
this.unitPrice = lease.getUnitPrice();
this.wareNum = lease.getWareNum();
this.shouldPay = lease.getShouldPay();
this.actualPay = lease.getActualPay();
this.orderType = lease.getOrderType();
this.deposit = lease.getDeposit();
this.rentPrice = lease.getRentPrice();
this.startDate = lease.getStartDate();
this.endDate = lease.getEndDate();
this.payDay = lease.getPayDay();
this.exWare = lease.getExWare();
this.tranStatus = lease.getTranStatus();
this.remark = lease.getRemark();
this.createTime = lease.getCreateTime();
this.rcdCompanyId = lease.getRcdCompanyId();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderReceiptDTO;
import com.mmc.pms.model.vo.OrderReceiptVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:05 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderReceiptDO implements Serializable {
private static final long serialVersionUID = 7590192330910329668L;
private Integer id;
private Integer orderInfoId;
private Integer receiptMethod;
private String takeName;
private String takePhone;
private String region;
private String detailAddress;
private String repoName;
private String repoAddress;
private String bookPhone;
private String sendExCode;
private String sendExNo;
private String sendAddress;
private Integer renMethod;
private String renPhone;
private String renName;
private String renExCode;
private String renExNo;
private String renAddress;
private String exName;
private String renRepoName;
private String renRepoAddr;
private String renRepoPhone;
private Date createTime;
public OrderReceiptDO(OrderReceiptVO d) {
this.orderInfoId = d.getOrderInfoId();
this.receiptMethod = d.getReceiptMethod();
this.takeName = d.getTakeName();
this.takePhone = d.getTakePhone();
this.region = d.getRegion();
this.detailAddress = d.getDetailAddress();
this.repoName = d.getRepoName();
this.repoAddress = d.getRepoAddress();
this.bookPhone = d.getBookPhone();
}
public OrderReceiptDTO buildOrderReceiptDTO() {
return OrderReceiptDTO.builder()
.id(this.id)
.receiptMethod(this.receiptMethod)
.takeName(this.takeName)
.takePhone(this.takePhone)
.region(this.region)
.detailAddress(this.detailAddress)
.repoName(this.repoName)
.repoAddress(this.repoAddress)
.bookPhone(this.bookPhone)
.sendExCode(this.sendExCode)
.sendExNo(this.sendExNo)
.sendAddress(this.sendAddress)
.renMethod(this.renMethod)
.renPhone(this.renPhone)
.renName(this.renName)
.renExCode(this.renExCode)
.renExNo(this.renExNo)
.renAddress(this.renAddress)
.renRepoName(this.renRepoName)
.renRepoAddr(this.renRepoAddr)
.renRepoPhone(this.renRepoPhone)
.build();
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsProductSkuDTO; import com.mmc.pms.model.dto.ProductSkuDTO;
import com.mmc.pms.model.dto.GoodsProductSkuVO; import com.mmc.pms.model.dto.ProductSkuVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -18,46 +18,48 @@ import java.util.Date; ...@@ -18,46 +18,48 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class ProductSkuDO implements Serializable { public class ProductSkuDO implements Serializable {
private static final long serialVersionUID = -2830786012593215477L; private static final long serialVersionUID = -2830786012593215477L;
private Integer id; private Integer id;
private String productName; private String productName;
private Integer goodsTypeId; private Integer categoriesId;
private String model; private String model;
private String productBrand; private Date createTime;
private Date createTime; private Date updateTime;
private Date updateTime; private Integer brandInfoId;
private Integer brandInfoId; private Integer deleted;
private Integer deleted; private Integer customize;
private Integer sortTypeId; private Integer directoryId;
private Integer customize;
/**
/** 辅助字段 begin */ * 辅助字段 begin
private String typeName; */
private String categoryName;
private String sortName;
private String directoryName;
/** 辅助字段 end */
public ProductSkuDO(GoodsProductSkuVO param) { private String brandName;
this.id = param.getId();
this.goodsTypeId = param.getGoodsTypeId(); /**
this.model = param.getModel(); * 辅助字段 end
this.productName = param.getProductName(); */
this.brandInfoId = param.getProductBrandId(); public ProductSkuDO(ProductSkuVO param) {
this.sortTypeId = param.getDirectoryId(); this.id = param.getId();
} this.categoriesId = param.getCategoryId();
this.model = param.getModel();
public GoodsProductSkuDTO buildGoodsProductSkuDTO() { this.productName = param.getProductName();
return GoodsProductSkuDTO.builder() this.brandInfoId = param.getProductBrandId();
.id(this.id) this.directoryId = param.getDirectoryId();
.productName(this.productName) }
.goodsTypeId(this.goodsTypeId)
.model(this.model) public ProductSkuDTO buildProductSkuDTO() {
.productBrand(this.productBrand) return ProductSkuDTO.builder()
.productBrandId(brandInfoId) .id(this.id)
.createTime(this.createTime) .productName(this.productName)
.typeName(this.typeName) .model(this.model)
.directoryId(sortTypeId) .productBrand(this.brandName)
.directoryName(this.sortName) .createTime(this.createTime)
.build(); .categoryName(this.categoryName)
} .directoryName(directoryName)
.build();
}
} }
...@@ -19,46 +19,46 @@ import java.util.Date; ...@@ -19,46 +19,46 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class ProductSpecDO implements Serializable { public class ProductSpecDO implements Serializable {
private static final long serialVersionUID = -5476701567447257133L; private static final long serialVersionUID = -5476701567447257133L;
private Integer id; private Integer id;
private Integer productSkuId; private Integer productSkuId;
private String specName; private String specName;
private String specImage; private String specImage;
private String partNo; private String partNo;
private String versionDesc; private String versionDesc;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer deleted; private Integer deleted;
public ProductSpecDO(ProductSpecVO param) { public ProductSpecDO(ProductSpecVO param) {
this.id = param.getId(); this.id = param.getId();
this.productSkuId = param.getProductSkuId(); this.productSkuId = param.getProductSkuId();
this.specName = param.getSpecName(); this.specName = param.getSpecName();
this.specImage = param.getSpecImage(); this.specImage = param.getSpecImage();
this.partNo = param.getPartNo(); this.partNo = param.getPartNo();
this.versionDesc = param.getVersionDesc(); this.versionDesc = param.getVersionDesc();
} }
public ProductSpecDTO buildProductSpecDTO() { public ProductSpecDTO buildProductSpecDTO() {
return ProductSpecDTO.builder() return ProductSpecDTO.builder()
.id(this.id) .id(this.id)
.productSkuId(this.productSkuId) .productSkuId(this.productSkuId)
.specName(this.specName) .specName(this.specName)
.specImage(this.specImage) .specImage(this.specImage)
.partNo(this.partNo) .partNo(this.partNo)
.versionDesc(this.versionDesc) .versionDesc(this.versionDesc)
.createTime(this.createTime) .createTime(this.createTime)
.build(); .build();
} }
public MallProductSpecDTO buildMallProductSpecDTO() { public MallProductSpecDTO buildMallProductSpecDTO() {
return MallProductSpecDTO.builder() return MallProductSpecDTO.builder()
.productSpec(this.id) .productSpec(this.id)
.productSkuId(this.productSkuId) .productSkuId(this.productSkuId)
.specName(this.specName) .specName(this.specName)
.specImage(this.specImage) .specImage(this.specImage)
.partNo(this.partNo) .partNo(this.partNo)
.versionDesc(this.versionDesc) .versionDesc(this.versionDesc)
.build(); .build();
} }
} }
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ProductSpecPriceDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 产品规格价格配置表(ProductSpecPriceDO)实体类
*
* @author makejava
* @since 2023-05-25 17:51:18
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductSpecPriceDO implements Serializable {
private static final long serialVersionUID = 270307563560175486L;
private Integer id;
/**
* 产品规格id
*/
private Integer productSpecId;
/**
* 渠道等级id
*/
private Integer cooperationTag;
/**
* 价格
*/
private BigDecimal price;
private Integer type;
private Date createTime;
private Date updateTime;
private Integer leaseTerm;
public ProductSpecPriceDTO buildProductSpecPriceDTO() {
return ProductSpecPriceDTO.builder().id(this.id)
.cooperationTag(this.cooperationTag)
.price(this.price).createTime(this.createTime)
.leaseTerm(this.leaseTerm).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.RepoCashDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 9:48 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepoCashDO implements Serializable {
private static final long serialVersionUID = -7930603317037474755L;
private Integer id;
private Integer repoAccountId;
private String uid;
private String accountName;
private Integer orderInfoId;
private String orderNo;
private Integer skuInfoId;
private String skuTitle;
private Integer wareInfoId;
private String wareNo;
private String wareTitle;
private String payNo;
private Integer payMethod;
private BigDecimal amtPaid;
private BigDecimal cashAmt;
private Date payTime;
private String refundNo;
private String voucher;
private String remark;
private Integer createUser;
private Date createTime;
private Integer updateUser;
private Date updateTime;
public RepoCashDTO buildRepoCashDTO() {
return RepoCashDTO.builder()
.id(this.id)
.repoAccountId(this.repoAccountId)
.uid(this.uid)
.accountName(this.accountName)
.orderInfoId(this.orderInfoId)
.orderNo(this.orderNo)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.wareInfoId(this.wareInfoId)
.wareNo(this.wareNo)
.wareTitle(this.wareTitle)
.payNo(this.payNo)
.payMethod(this.payMethod)
.amtPaid(this.amtPaid)
.refundNo(this.refundNo)
.createUser(this.createUser)
.voucher(StringUtils.isBlank(this.voucher) ? null : Arrays.asList(this.voucher.split(",")))
.cashAmt(this.cashAmt)
.payTime(this.payTime)
.remark(this.remark)
.build();
}
}
package com.mmc.pms.json;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import java.io.*;
import java.util.List;
/**
* @Author small @Date 2023/5/23 13:50 @Version 1.0
*/
public class JsonUtil {
public static void main(String[] args) {
String array = "[1,24,23]";
List<Integer> list = JSONArray.parseArray(array, Integer.class);
System.out.println(list.get(2));
}
/**
* 把Java对象转换成json字符串
*
* @param object 待转化为JSON字符串的Java对象
* @return json 串 or null
*/
public static String parseObjToJson(Object object) {
String string = null;
try {
string = JSONObject.toJSONString(object);
} catch (Exception e) {
// LOGGER.error(e.getMessage());
}
return string;
}
/**
* 将Json字符串信息转换成对应的Java对象
*
* @param json json字符串对象
* @param c 对应的类型
*/
public static <T> T parseJsonToObj(String json, Class<T> c) {
try {
JSONObject jsonObject = JSON.parseObject(json);
return JSON.toJavaObject(jsonObject, c);
} catch (Exception e) {
// LOGGER.error(e.getMessage());
}
return null;
}
/**
* 读取json文件
*
* @param fileName
* @return
*/
public static String readJsonFile(String fileName) {
String jsonStr = "";
try {
File jsonFile = new File(fileName);
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
int ch = 0;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
jsonStr = sb.toString();
return jsonStr;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 将JSON数据格式化并保存到文件中
*
* @param jsonData 需要输出的json数
* @param filePath 输出的文件地址
* @return
*/
public static boolean createJsonFile(Object jsonData, String filePath) {
String content =
JSON.toJSONString(
jsonData,
SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteDateUseDateFormat);
// 标记文件生成是否成功
boolean flag = true;
// 生成json格式文件
try {
// 保证创建一个新文件
File file = new File(filePath);
if (!file.getParentFile().exists()) { // 如果父目录不存在,创建父目录
file.getParentFile().mkdirs();
}
if (file.exists()) { // 如果已存在,删除旧文件
file.delete();
}
file.createNewFile();
// 将格式化后的字符串写入文件
Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
write.write(content);
write.flush();
write.close();
} catch (Exception e) {
flag = false;
e.printStackTrace();
}
return flag;
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:55 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.BaseAccountDTO", description = "登录信息DTO")
public class BaseAccountDTO implements Serializable {
private static final long serialVersionUID = -2979712090903806216L;
private Integer id;
private String uid;
private String accountPhone;
private String accountNo;
private String accountName;
private String tokenPort;
@ApiModelProperty(value = "角色ID")
private Integer roleId;
@ApiModelProperty(value = "是否为管理角色:0否 1是")
private Integer admin; // 是否为管理角色
@ApiModelProperty(value = "是否为运营角色:0否 1是")
private Integer operate;
@ApiModelProperty(value = "是否PMC发货专员:0否 1是")
private Integer pmc;
@ApiModelProperty(value = "单位信息")
private CompanyCacheDTO companyInfo; // 单位信息
public BaseAccountDTO(UserAccountDTO user) {
this.id = user.getId();
this.accountNo = user.getAccountNo();
this.accountName = user.getUserName();
this.roleId = user.getRoleInfo() == null ? null : user.getRoleInfo().getId();
this.admin = user.getRoleInfo() == null ? null : user.getRoleInfo().getAdmin();
this.operate = user.getRoleInfo() == null ? null : user.getRoleInfo().getOperate();
this.pmc = user.getRoleInfo() == null ? null : user.getRoleInfo().getPmc();
}
public BaseAccountDTO(RepoAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(MallUserDTO account) {
this.id = account.getId();
this.accountName = account.getNickName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(FlyerAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
/**
* 是否为科比特超级管理员单位(是:无单位资源限制 否:只能看当前和下级单位的资源)
*
* @return
*/
public boolean isManage() {
if (this.getCompanyInfo() == null) {
return false;
}
if (this.getCompanyInfo().getManage() == null) {
return false;
}
return this.getCompanyInfo().getManage() == 1;
}
/**
* 判断是否已授权
*
* @return
*/
// public boolean authorized() {
// if (StringUtils.isBlank(this.accountName) || StringUtils.isBlank(this.accountPhone)) {
// return false;
// }
// return true;
// }
}
package com.mmc.pms.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author LW
* @date 2022/6/20 16:33
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BrandInfoDTO implements Serializable {
private static final long serialVersionUID = 2845503394350034900L;
private Integer id;
private String brandName;
private Date createTime;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
* @date 2022/3/22 15:50
* 概要:一级分类信息DTO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ClassifyDetailsDTO implements Serializable {
private static final long serialVersionUID = -1682216002629752311L;
@ApiModelProperty(value = "分类id")
private Integer id;
@ApiModelProperty(value = "分类名称")
private String classifyName;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "小程序底部备注")
private String remark;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author LW
* @date 2022/3/22 15:50
* 概要:一级分类信息DTO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ClassifyInfoDTO implements Serializable {
private static final long serialVersionUID = -1682216002629752311L;
@ApiModelProperty(value = "分类id")
private Integer id;
@ApiModelProperty(value = "所属目录id")
private Integer directoryId;
@ApiModelProperty(value = "分类名称")
private String classifyName;
@ApiModelProperty(value = "pid:一级分类的pid是0 二级分类pid是一级分类id")
private Integer pid;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "小程序底部备注")
private String remark;
@ApiModelProperty(value = "分类所属模块id(0:通用分类 1:作业服务分类 2:设备租赁分类 3:飞手培训分类 4:产品商城分类)")
private Integer type;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "二级分类信息")
private List<ClassifyInfoDTO> children;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:56 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyCacheDTO implements Serializable {
@ApiModelProperty(value = "单位ID")
private Integer id;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "是否为管理单位:0否 1是", hidden = true)
private Integer manage;
@ApiModelProperty(value = "当前单位ID+子级单位ID的集合", hidden = true)
private List<Integer> companys;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:56 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.sharefly.dto.CompanySimpleDTO", description = "单位信息DTO")
public class CompanySimpleDTO implements Serializable {
private static final long serialVersionUID = 2541404541696571857L;
@ApiModelProperty(value = "单位ID")
private Integer id;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "账号类型:0合伙人 1员工")
private Integer userType;
@ApiModelProperty(value = "是否为管理单位:0否 1是", hidden = true)
private Integer manage;
@ApiModelProperty(value = "当前单位ID+子级单位ID的集合", hidden = true)
private List<Integer> companys;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:47 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.ExpStationsDTO", description = "物流信息DTO")
public class ExpStationsDTO implements Serializable {
private static final long serialVersionUID = 8737447241343561076L;
@ApiModelProperty(value = "物流状态:查字典")
private String Action;
@ApiModelProperty(value = "描述")
private String AcceptStation;
@ApiModelProperty(value = "时间")
private String AcceptTime;
@ApiModelProperty(value = "所在城市")
private String Location;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.common.FlyerAccountType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @Author small @Date 2023/5/25 9:58 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.FlyerAccountDTO", description = "飞手端用户DTO")
public class FlyerAccountDTO implements Serializable {
private static final long serialVersionUID = -5663270547201316327L;
@ApiModelProperty(value = "飞手端用户id")
private Integer id;
@ApiModelProperty(value = "飞手端用户uid")
private String uid;
@ApiModelProperty(value = "飞手端用户名称")
private String accountName;
@ApiModelProperty(value = "联系电话")
private String phoneNum;
@ApiModelProperty(value = "飞手端用户类型,(个人飞手,机构)")
private Integer accountType;
@ApiModelProperty(value = "实名认证状态")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态")
private Integer entAuthStatus;
@ApiModelProperty(value = "工作状态")
private Integer workStatus;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "openId")
private String openId;
@ApiModelProperty(value = "unionId")
private String unionId;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "头像url")
private String headerImg;
@ApiModelProperty(value = "经度")
private Double lon;
@ApiModelProperty(value = "纬度")
private Double lat;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态,0未删除,1删除")
private Integer deleted;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "有无订单:0无,1有")
private Integer serviceStatus;
@ApiModelProperty(value = "距离订单距离-单位km")
private Double orderDist;
@ApiModelProperty(value = "服务中的订单名称")
private List<String> orderNames;
@ApiModelProperty(value = "飞手认证状态")
private Integer licStatus;
@ApiModelProperty(value = "机构信息")
private FlyerEntInfoDTO entInfo;
@ApiModelProperty(value = "抢单状态-0否-1是")
private Integer applyOrder;
@ApiModelProperty(value = "多端用户,USER_PORT(云享飞)-FLYER_PORT(云飞手)-REPO_PORT(云仓)")
private Set<String> ports;
@ApiModelProperty(value = "推荐人ID")
private Integer rcdFlyerAccountId;
@ApiModelProperty(value = "推荐人昵称")
private String rcdNickName;
@ApiModelProperty(value = "推荐人uid")
private String rcdUid;
@ApiModelProperty(value = "推荐人账号名称")
private String rcdAccountName;
@ApiModelProperty(value = "已推荐用户数")
private Integer rcdUserNumber;
@ApiModelProperty(value = "是否销售")
private Integer sale;
@ApiModelProperty(value = "是否白名单")
private Integer white;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty(value = "订单信息")
private FlyerOrderTaskDTO flyerOrderTask;
@ApiModelProperty(value = "场景认证信息")
private FlyerScenesAuthDTO flyerScenesAuth;
/**
* 是否为飞手机构用户
*
* @return
*/
public boolean checkFlyerEnt() {
return (FlyerAccountType.JG.getCode().toString().equals(this.accountType.toString()));
}
/**
* 是否为飞手个人用户
*
* @return
*/
public boolean checkFlyer() {
return (FlyerAccountType.GR.getCode().toString().equals(this.accountType.toString()));
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:00 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.FlyerEntInfoDTO", description = "飞手机构DTO")
public class FlyerEntInfoDTO implements Serializable {
private static final long serialVersionUID = -3064900348178903673L;
@ApiModelProperty(value = "机构id")
private Integer id;
@ApiModelProperty(value = "飞手端用户id")
private Integer flyerAccountId;
@ApiModelProperty(value = "机构名称")
private String entName;
@ApiModelProperty(value = "机构认证审批状态")
private Integer entCheckStatus;
@ApiModelProperty(value = "机构法人名称")
private String entLegalPerson;
@ApiModelProperty(value = "社会统一信用码")
private String uscCode;
@ApiModelProperty(value = "营业执照url")
private String unLicImg;
@ApiModelProperty(value = "开户银行")
private String bankName;
@ApiModelProperty(value = "账户名称")
private String accountHolder;
@ApiModelProperty(value = "银行账号")
private String bankAccount;
@ApiModelProperty(value = "法人身份证号")
private String idNumber;
@ApiModelProperty(value = "机构备注")
private String remark;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "飞手总数")
private Integer sumOfFlyer;
@ApiModelProperty(value = "认证飞手数")
private Integer countOfAuthFlyer;
@ApiModelProperty(value = "用户uid")
private String uid;
@ApiModelProperty(value = "用户手机号")
private String phoneNum;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "昵称")
private String nickName;
}
package com.mmc.pms.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:59 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FlyerOrderTaskDTO implements Serializable {
private static final long serialVersionUID = 4288411060058354326L;
private Integer id;
private Integer orderId;
private Integer flyerAccountId;
private Integer orderType;
private Integer virtualTeamId;
private String orderName;
private String orderNo;
public FlyerOrderTaskDTO(OrderTaskDTO d) {
this.orderId = d.getId();
this.orderName = d.getOrderName();
this.orderNo = d.getOrderNo();
}
}
package com.mmc.pms.model.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:59 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FlyerScenesAuthDTO implements Serializable {
private static final long serialVersionUID = 66032902942031710L;
@ApiModelProperty("飞手id")
private Integer id;
@ApiModelProperty(value = "商务礼仪认证")
private Integer protocolAuth;
@ApiModelProperty(value = "电力巡检认证状态,0未认证,1通过,2未通过")
private Integer electricAuth;
@ApiModelProperty(value = "航空测绘认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer aviationAuth;
@ApiModelProperty(value = "应急保障认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer emergencyAuth;
@ApiModelProperty(value = "value = 监察巡检认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer superviseAuth;
@ApiModelProperty(value = "通用认证状态,0未认证,1通过,2未通过")
private Integer universalAuth;
@ApiModelProperty(value = "油气巡检认证状态,0未认证,1通过,2未通过")
private Integer oilGasAuth;
@ApiModelProperty(value = "演示认证状态,0未认证,1通过,2未通过")
private Integer demoAuth;
@ApiModelProperty(value = "航空测绘外业状态,0未认证,1通过,2未通过")
private Integer aviationOutAuth;
@ApiModelProperty(value = "航空测绘内业状态,0未认证,1通过,2未通过")
private Integer aviationInAuth;
@ApiModelProperty(value = "指挥车认证状态,0未认证,1通过,2未通过")
private Integer commandAuth;
@ApiModelProperty(value = "天目将软件认证状态,0未认证,1通过,2未通过")
private Integer tmjAuth;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.entity.GoodsConfigExportDO;
import com.mmc.pms.entity.GoodsTypeDO;
import com.mmc.pms.entity.GoodsVideoDO;
import com.mmc.pms.model.vo.CategoryParamAndValueVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/16 13:41 @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsInfoDO implements Serializable {
private static final long serialVersionUID = -1329342381196659417L;
private Integer id;
private Integer pid;
private String goodsNo;
private String goodsName;
private Integer masterTypeId;
private Integer slaveTypeId;
private Integer shelfStatus;
private Integer skuNum;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer goodsAttr;
private String ecoLabel;
private Integer goodsCategoryId;
private Integer repoId;
private Integer shareFlyServiceId;
private Integer goodsType;
private Integer sort;
private Integer showCode;
private Integer standardProduct;
private String tag;
/** 辅助字段-start */
private String videoUrl;
private Integer goodsVideoId;
private String goodsDesc;
private GoodsVideoDO goodsVideoDO;
private String mainImg; // 主图
private GoodsTypeDO goodsMasterType;
private GoodsTypeDO goodsSlaveType;
private String remark; // 底部备注
private Integer sortTypeId;
private List<CategoryParamAndValueVO> paramAndValue;
private GoodsConfigExportDO goodsConfigExport; // 功能清单
private Integer buyNum; // 购买数量
private String directoryName;
private Integer isCoupons;
}
...@@ -47,4 +47,7 @@ public class GoodsInfoListDTO implements Serializable { ...@@ -47,4 +47,7 @@ public class GoodsInfoListDTO implements Serializable {
@ApiModelProperty(value = "是否有优惠券 0表示没有 有就返回数字") @ApiModelProperty(value = "是否有优惠券 0表示没有 有就返回数字")
private Integer isCoupons; private Integer isCoupons;
@ApiModelProperty(value = "描述")
private String goodsDesc;
} }
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:47 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.KdnExpDTO", description = "物流信息DTO")
public class KdnExpDTO implements Serializable {
private static final long serialVersionUID = 4129710329541565557L;
@ApiModelProperty(value = "物流状态:查字典")
private String StateEx;
@ApiModelProperty(value = "快递公司编码:查字典")
private String ShipperCode;
@ApiModelProperty(value = "物流单号")
private String LogisticCode;
@ApiModelProperty(value = "快递流转信息")
private List<ExpStationsDTO> Traces;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 9:58 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.mall.dto.MallUserDTO", description = "用户信息DTO")
public class MallUserDTO implements Serializable {
private static final long serialVersionUID = -2968237190830435082L;
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("uid")
private String uid;
@ApiModelProperty("个人认证名字")
private String userName;
@ApiModelProperty("联系电话")
private String phoneNum;
@ApiModelProperty("小程序openid")
private String openId;
@ApiModelProperty("微信unionid")
private String unionId;
@ApiModelProperty("微信昵称")
private String nickName;
@ApiModelProperty("头像")
private String headerImg;
@ApiModelProperty("经度")
private Double lon;
@ApiModelProperty("纬度")
private Double lat;
@ApiModelProperty("注册端口")
private String ports;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty("渠道等级状态")
private Integer channelAuthStatus;
@ApiModelProperty("渠道等级标签")
private Integer channelClass;
@ApiModelProperty("渠道等级名称")
private String tagName;
@ApiModelProperty("注册时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty(value = "实名认证状态(0未通过,1通过)")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态(0未通过,1通过)")
private Integer entAuthStatus;
@ApiModelProperty("企业名称")
private String entName;
@ApiModelProperty("法大大电子签章认证状态(0未通过,1通过)")
private Integer entVerifyStatus;
@ApiModelProperty("实名认证时间")
private Date realAuthTime;
@ApiModelProperty("企业认证时间")
private Date entAuthTime;
@ApiModelProperty("电子签章认证时间")
private Date entVerifyTime;
@ApiModelProperty(value = "上级推荐人id")
private Integer upReferralId;
@ApiModelProperty(value = "上级推荐人的uid(name)")
private String upReferralUidAndName;
@ApiModelProperty(value = "推荐伙伴数量")
private Integer lowerReferralCount;
@ApiModelProperty("相关运营id")
private Integer operateId;
@ApiModelProperty("相关运营Name")
private String operateName;
@ApiModelProperty("相关销售id")
private Integer saleId;
@ApiModelProperty("相关销售Name")
private String saleName;
@ApiModelProperty("小程序相关运营id")
private Integer mallOperator;
@ApiModelProperty("小程序相关运营名字")
private String mallOperatorName;
@ApiModelProperty("小程序相关运营uid")
private String mallOperatorUID;
@ApiModelProperty("小程序相关销售id")
private Integer mallSaleManager;
@ApiModelProperty("小程序相关销售uid")
private String mallSaleManagerUID;
@ApiModelProperty("小程序相关销售名字")
private String mallSaleManagerName;
@ApiModelProperty("上级渠道名称")
private String superiorChannelName;
@ApiModelProperty(value = "开户银行")
private String accountBank;
@ApiModelProperty(value = "开户姓名")
private String accountName;
@ApiModelProperty(value = "银行卡号")
private String bankCardNumber;
@ApiModelProperty(value = "支行")
private String branch;
}
package com.mmc.pms.model.dto;
import com.mmc.pms.entity.RepoCashDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:45 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderInfoDTO", description = "云仓订单DTO")
public class OrderInfoDTO implements Serializable {
private static final long serialVersionUID = 1572467108563651846L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商品ID")
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号")
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "商品图片")
private String wareImg;
@ApiModelProperty(value = "套餐(sku)ID")
private Integer skuInfoId;
@ApiModelProperty(value = "套餐(sku)名称")
private String skuTitle;
@ApiModelProperty(value = "购买用户ID")
private Integer repoAccountId;
@ApiModelProperty(value = "用户UID")
private String uid;
@ApiModelProperty(value = "买家name")
private String buyerName;
@ApiModelProperty(value = "买家电话")
private String buyerPhone;
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ApiModelProperty(value = "购买的商品数量")
private Integer wareNum;
@ApiModelProperty(value = "应付款金额")
private BigDecimal shouldPay;
@ApiModelProperty(value = "实收款金额")
private BigDecimal actualPay;
@ApiModelProperty(value = "订单类型:0租赁 100购买")
private Integer orderType;
@ApiModelProperty(value = "押金")
private BigDecimal deposit;
@ApiModelProperty(value = "租金总金额")
private BigDecimal rentPrice;
@ApiModelProperty(value = "租约开始日")
private Date startDate;
@ApiModelProperty(value = "租约结束日")
private Date endDate;
@ApiModelProperty(value = "付款天数")
private Integer payDay;
@ApiModelProperty(value = "交易状态:查订单状态字典")
private String tranStatus;
@ApiModelProperty(value = "减库方式 0:买家拍下减库存 1:卖家付款减库存")
private Integer exWare;
@ApiModelProperty(value = "用户备注")
private String remark;
@ApiModelProperty(value = "平台人员备注")
private String pfRemark;
@ApiModelProperty(value = "关闭原因")
private String shutReason;
@ApiModelProperty(value = "交易编号")
private String payNo;
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "发货时间")
private Date sendWareTime;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "物流信息/收货地址信息")
private OrderReceiptDTO receipt;
@ApiModelProperty(value = "退款单详情信息,无则为null")
private OrderRefundDTO orderRefund;
@ApiModelProperty(value = "发货-物流动态,无则为null")
private KdnExpDTO express;
@ApiModelProperty(value = "退货-物流动态,无则为null")
private KdnExpDTO refundExpress;
@ApiModelProperty(value = "质检详情,无则为null")
private List<OrderVcuDTO> vcus;
public RepoCashDO buildRepoCashDO() {
return RepoCashDO.builder()
.uid(this.uid)
.accountName(this.buyerName)
.orderInfoId(this.id)
.orderNo(this.orderNo)
.skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle)
.wareInfoId(this.wareInfoId)
.wareTitle(this.wareTitle)
.wareNo(this.wareNo)
.build();
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:45 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderReceiptDTO", description = "订单收货信息DTO")
public class OrderReceiptDTO implements Serializable {
private static final long serialVersionUID = -6212026509857770276L;
@ApiModelProperty(value = "地址ID")
private Integer id;
@ApiModelProperty(value = "收货方式:0邮寄 1门店地址")
private Integer receiptMethod;
@ApiModelProperty(value = "0-收货人姓名")
private String takeName;
@ApiModelProperty(value = "0-收货人电话")
private String takePhone;
@ApiModelProperty(value = "0-收货区域")
private String region;
@ApiModelProperty(value = "0-收获详细地址")
private String detailAddress;
@ApiModelProperty(value = "1-门店名称")
private String repoName;
@ApiModelProperty(value = "1-门店详细地址")
private String repoAddress;
@ApiModelProperty(value = "1-预留手机号")
private String bookPhone;
@ApiModelProperty(value = "发货-物流公司码")
private String sendExCode;
@ApiModelProperty(value = "发货-物流单号")
private String sendExNo;
@ApiModelProperty(value = "发货地址")
private String sendAddress;
@ApiModelProperty(value = "退还货方式:0邮寄 1门店地址")
private Integer renMethod;
@ApiModelProperty(value = "退还货-收货电话")
private String renPhone;
@ApiModelProperty(value = "退还货-收货人")
private String renName;
@ApiModelProperty(value = "退还货-物流公司码")
private String renExCode;
@ApiModelProperty(value = "退还货-物流单号")
private String renExNo;
@ApiModelProperty(value = "退还货-地址")
private String renAddress;
@ApiModelProperty(value = "退还货-门店名称")
private String renRepoName;
@ApiModelProperty(value = "退还货-门店地址")
private String renRepoAddr;
@ApiModelProperty(value = "退还货-门店联系电话")
private String renRepoPhone;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:46 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderRefundDTO", description = "退款单DTO")
public class OrderRefundDTO implements Serializable {
private static final long serialVersionUID = -6124933008580173589L;
@ApiModelProperty(value = "退款单ID")
private Integer id;
@ApiModelProperty(value = "订单ID")
private Integer orderInfoId;
@ApiModelProperty(value = "退款单号")
private String refundNo;
@ApiModelProperty(value = "退款单状态:查字典")
private Integer refundStatus;
@ApiModelProperty(value = "应退款金额")
private BigDecimal shouldRefund;
@ApiModelProperty(value = "实际退款金额")
private BigDecimal actualRefund;
@ApiModelProperty(value = "退款理由")
private String reason;
@ApiModelProperty(value = "创建时间/申请时间")
private Date createTime;
@ApiModelProperty(value = "退款-设备情况(图片&视频)")
private OrderVcuDTO orderVcu;
@ApiModelProperty(value = "订单信息")
private OrderInfoDTO orderInfo;
@ApiModelProperty(value = "退款协商历史")
private List<RefundLogDTO> rlogs;
@ApiModelProperty(value = "退款流水信息")
private RepoCashDTO refundCash;
@ApiModelProperty(value = "平台备注")
private String pfRemark;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:59 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderTaskDTO implements Serializable {
private static final long serialVersionUID = 6732943573766573605L;
@ApiModelProperty(value = "订单id")
private Integer id;
@ApiModelProperty(value = "主任务id")
private Integer parentId;
@ApiModelProperty(value = "用户id")
private Integer userAccountId;
@ApiModelProperty(value = "订单专属运营id")
private Integer userOperateId;
@ApiModelProperty(value = "用户订单uid")
private String uid;
@ApiModelProperty(value = "订单编号")
private String orderNo; // 单号
@ApiModelProperty(value = "订单名称")
private String orderName; // 名称
@ApiModelProperty(value = "账单金额")
private BigDecimal orderAmt; // 账单金额
@ApiModelProperty(value = "订单现金金额")
private BigDecimal orderCashAmt;
@ApiModelProperty(value = "订单信用金额")
private BigDecimal orderCreditAmt;
@ApiModelProperty(value = "任务状态")
private Integer orderStatus; // 任务状态
@ApiModelProperty(value = "评价状态")
private Integer evaluateStatus; // 评价状态
private String lastMsg1; // 消息
private String lastMag2;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "备注")
private String basicInfo; // 基本信息
@ApiModelProperty(value = "预计开始时间")
private String startTime; // 开始时间
@ApiModelProperty(value = "预计结束时间")
private String endTime; // 结束时间
@ApiModelProperty(value = "实际开始时间")
private String acStartTime; // 实际开始时间
@ApiModelProperty(value = "实际结束时间")
private String acEndTime; // 实际结束时间
@ApiModelProperty(value = "订单地址")
private String taskAddress;
private String image;
@ApiModelProperty(value = "服务id")
private Integer inspectionId;
@ApiModelProperty(value = "服务名称")
private String inspectionName;
@ApiModelProperty(value = "运营联系电话")
private String phoneNum;
@ApiModelProperty(value = "专属运营名称")
private String operateName;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "是否企业")
private Integer entUser;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "是否实名")
private Integer realAuthStatus;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "订单关闭原因")
private String shutReason;
@ApiModelProperty(value = "用户联系电话")
private String userPhoneNum;
@ApiModelProperty(value = "飞手Id")
private Integer flyerAccountId;
@ApiModelProperty(value = "平台工作人员设置的备注")
private String pfRemark;
@ApiModelProperty(value = "飞手端-推送-数据-0否-1是")
private Integer dummy;
@ApiModelProperty(value = "飞手UID")
private String flyerUid;
@ApiModelProperty(value = "飞手账号名")
private String flyerAccountName;
@ApiModelProperty(value = "抢单状态:0待接单,1抢单中")
private Integer applyStatus;
@ApiModelProperty(value = "预付款总金额")
private BigDecimal totalFreeze;
@ApiModelProperty(value = "结算总金额")
private BigDecimal totalPay;
@ApiModelProperty(value = "倒计时")
private Long countSconds;
@ApiModelProperty(value = "飞手基本信息")
private FlyerAccountDTO flyerAccount;
@ApiModelProperty(value = "飞手类型")
private Integer flyerType;
@ApiModelProperty(value = "飞手个数")
private Integer flyerNum;
@ApiModelProperty(value = "0:隐藏 1:显示")
private Integer display;
@ApiModelProperty(value = "飞手-结算-信息", hidden = true)
private TaskFlyerCostDTO taskFlyerCost;
@ApiModelProperty(value = "下期飞手入账时间")
private String nextFlyerIncomeDate;
@ApiModelProperty(value = "是否进行过催付款 0:未催 1:已催")
private Integer urge;
@ApiModelProperty(value = "订单类型")
private Integer orderType;
@ApiModelProperty(value = "确认需求备注")
private String cmdRemark;
@ApiModelProperty(value = "飞手可抢单开始时间")
private Date flyerStartTime;
@ApiModelProperty(value = "飞手可抢单结束时间")
private Date flyerEndTime;
@ApiModelProperty(value = "预估金额")
private BigDecimal estimatedAmount;
@ApiModelProperty(value = "申请id")
private Integer orderApplyId;
@ApiModelProperty(value = "用户下单附件预览效果")
private String userPreview;
@ApiModelProperty(value = "平台上传附件预览效果")
private String platformPreview;
@ApiModelProperty(value = "文案描述")
private String copywriting;
@ApiModelProperty(value = "子任务列表")
private List<OrderTaskDTO> children;
@ApiModelProperty(value = "子订单信息")
private List<OrderTaskSonDTO> son;
public void buildOperateUser(UserAccountDTO op) {
this.phoneNum = op.getPhoneNum();
this.operateName = op.getUserName();
this.userOperateId = op.getId();
}
public void buildWxUser(UserAccountDTO wx) {
this.userAccountId = wx.getId();
this.uid = wx.getUid();
this.nickName = wx.getNickName();
this.userName = wx.getUserName();
this.userPhoneNum = wx.getPhoneNum();
}
public FlyerOrderTaskDTO buildFlyerOrderTaskDTO() {
return FlyerOrderTaskDTO.builder()
.orderId(this.id)
.orderNo(this.orderNo)
.orderName(this.orderName)
.build();
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @Author small @Date 2023/5/25 10:13 @Version 1.0
*/
@Data
// @ApiModel(value = "OrderTaskSonDTO", description = "云享飞订单-子任务表")
@AllArgsConstructor
@NoArgsConstructor
public class OrderTaskSonDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@ApiModelProperty(value = "0为主任务")
private Integer parentId;
@ApiModelProperty(value = "客户ID")
private Integer userAccountId;
@ApiModelProperty(value = "运营人员ID(负责这个order的运营人员id")
private Integer userOperateId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "订单名称")
private String orderName;
@ApiModelProperty(value = "订单总金额")
private BigDecimal orderAmt;
@ApiModelProperty(value = "订单金额中的现金金额")
private BigDecimal cashAmt;
@ApiModelProperty(value = "订单金额中的信用金额")
private BigDecimal creditAmt;
@ApiModelProperty(value = "任务飞行地址")
private String taskAddress;
@ApiModelProperty(value = "基本信息")
private String basicInfo;
@ApiModelProperty(value = "服务开始时间")
private LocalDateTime startTime;
@ApiModelProperty(value = "服务结束时间")
private LocalDateTime endTime;
@ApiModelProperty(value = "实际服务开始时间")
private LocalDateTime acStartTime;
@ApiModelProperty(value = "实际服务结束时间")
private LocalDateTime acEndTime;
@ApiModelProperty(
value =
"0下单初始化(待分配运营)-> 100已分配运营(待需求确认)-> 200已经需求确认(待订单确认)-> 300已订单确认(待预支付)-> 400已预支付(调度中)-> 500飞手已接单(待抵达现场)-> 525飞手已抵达(待开始作业)-> 550已开始作业(作业中)-> 575飞手已完成作业(待平台确认作业完成)-> 600平台已确认作业完成(待验收结算)-> 700验收通过-> 900订单关闭")
private Integer orderStatus;
@ApiModelProperty(value = "评价状态:0未评价 1已评价")
private Integer evaluateStatus;
private LocalDateTime createTime;
private LocalDateTime updateTime;
@ApiModelProperty(value = "服务项ID")
private Integer inspectionId;
@ApiModelProperty(value = "服务名称")
private String inspectionName;
@ApiModelProperty(value = "最近一次操作信息")
private String lastMsg;
@ApiModelProperty(value = "任务地址经度")
private BigDecimal lon;
@ApiModelProperty(value = "任务地址纬度")
private BigDecimal lat;
@ApiModelProperty(value = "订单关闭原因")
private String shutReason;
@ApiModelProperty(value = "是否营销数据(假数据):0:否 1:是")
private Boolean isDummy;
@ApiModelProperty(value = "平台备注")
private String pfRemark;
@ApiModelProperty(value = "飞手类型(0个人飞手 1飞手机构)")
private Integer flyerType;
@ApiModelProperty(value = "任务飞手人数")
private Integer flyerNum;
@ApiModelProperty(value = "0:隐藏 1:显示(隐藏后飞手端不显示,不参与抢单)")
private Integer display;
@ApiModelProperty(value = "飞手评价:0未评价 1已评价")
private Integer flyerEval;
@ApiModelProperty(value = "是否进行过催单 0:未通知 1:已通知")
private Integer isUrge;
@ApiModelProperty(value = "订单类型:0普通订单,1推荐订单,2加急单")
private Integer orderType;
@ApiModelProperty(value = "需求确认备注")
private String cmdRemark;
@ApiModelProperty(value = "飞手抢单开始时间")
private LocalDateTime flyerStartTime;
@ApiModelProperty(value = "飞手抢单结束时间")
private LocalDateTime flyerEndTime;
@ApiModelProperty(value = "推荐机构")
private Integer rcdCompanyId;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:46 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.OrderVcuDTO", description = "订单凭证DTO")
public class OrderVcuDTO implements Serializable {
private static final long serialVersionUID = -7101242524092899210L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "订单ID")
private Integer orderInfoId;
@ApiModelProperty(value = "0:发货 1:收货 2:归还 3:平台收货")
private Integer vcuType;
@ApiModelProperty(value = "设备状况:0无问题 1有问题")
private Integer vcuSatus;
@ApiModelProperty(value = "描述-备注")
private String remark;
@ApiModelProperty(value = "图片集合")
private List<String> imgs;
@ApiModelProperty(value = "视频")
private String videoUrl;
}
package com.mmc.pms.model.dto; package com.mmc.pms.model.dto;
import com.mmc.pms.model.vo.GoodsProductSkuVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -15,17 +16,17 @@ import java.util.List; ...@@ -15,17 +16,17 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class ProductInventoryVO implements Serializable { public class ProductInventoryVO implements Serializable {
private static final long serialVersionUID = -2224789550998518979L; private static final long serialVersionUID = -2224789550998518979L;
@ApiModelProperty(value = "是否指定 不指定0 指定1") @ApiModelProperty(value = "是否指定 不指定0 指定1")
private Integer select; private Integer select;
@ApiModelProperty(value = "产品sku") @ApiModelProperty(value = "产品sku")
private GoodsProductSkuVO productSku; private GoodsProductSkuVO productSku;
@ApiModelProperty(value = "productSkuId") @ApiModelProperty(value = "productSkuId")
private Integer productSkuId; private Integer productSkuId;
@ApiModelProperty(value = "产品规格") @ApiModelProperty(value = "产品规格")
private List<ProductSpecVO> productSpecList; private List<ProductSpecVO> productSpecList;
} }
...@@ -8,7 +8,6 @@ import lombok.NoArgsConstructor; ...@@ -8,7 +8,6 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author small @Date 2023/5/16 16:29 @Version 1.0 * @Author small @Date 2023/5/16 16:29 @Version 1.0
...@@ -17,39 +16,36 @@ import java.util.List; ...@@ -17,39 +16,36 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GoodsProductSkuDTO implements Serializable { public class ProductSkuDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "产品名称") @ApiModelProperty(value = "产品名称")
private String productName; private String productName;
@ApiModelProperty(value = "产品类型id") @ApiModelProperty(value = "产品类型id")
private Integer goodsTypeId; private Integer categoriesId;
@ApiModelProperty(value = "产品类型名称") @ApiModelProperty(value = "产品类型名称")
private String typeName; private String categoryName;
@ApiModelProperty(value = "型号") @ApiModelProperty(value = "型号")
private String model; private String model;
@ApiModelProperty(value = "产品品牌") @ApiModelProperty(value = "产品品牌")
private String productBrand; private String productBrand;
@ApiModelProperty(value = "产品品牌id") @ApiModelProperty(value = "产品品牌id")
private Integer productBrandId; private Integer productBrandId;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "目录id") @ApiModelProperty(value = "目录id")
private Integer directoryId; private Integer directoryId;
@ApiModelProperty(value = "目录名称") @ApiModelProperty(value = "目录名称")
private String directoryName; private String directoryName;
@ApiModelProperty(value = "产品规格信息对象")
private List<ProductSpecDTO> productSpecList;
} }
...@@ -16,36 +16,27 @@ import java.io.Serializable; ...@@ -16,36 +16,27 @@ import java.io.Serializable;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class GoodsProductSkuVO implements Serializable { public class ProductSkuVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@NotNull( @NotNull(message = "修改时id不能为空", groups = {Update.class})
message = "修改时id不能为空", private Integer id;
groups = {Update.class})
private Integer id; @NotNull(message = "产品名称不能为空", groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品名称")
@NotNull( private String productName;
message = "产品名称不能为空",
groups = {Update.class, Create.class}) @NotNull(message = "产品类型id不能为空", groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品名称") @ApiModelProperty(value = "产品类型id")
private String productName; private Integer categoryId;
@NotNull( @ApiModelProperty(value = "型号")
message = "产品类型不能为空", private String model;
groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品类型") @ApiModelProperty(value = "品牌id")
private Integer goodsTypeId; private Integer productBrandId;
@ApiModelProperty(value = "型号") @ApiModelProperty(value = "目录id")
private String model; private Integer directoryId;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
} }
...@@ -9,7 +9,6 @@ import lombok.experimental.Accessors; ...@@ -9,7 +9,6 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author small @Date 2023/5/16 15:30 @Version 1.0 * @Author small @Date 2023/5/16 15:30 @Version 1.0
...@@ -20,29 +19,26 @@ import java.util.List; ...@@ -20,29 +19,26 @@ import java.util.List;
@Builder @Builder
@Accessors @Accessors
public class ProductSpecDTO implements Serializable { public class ProductSpecDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "productSkuId") @ApiModelProperty(value = "productSkuId")
private Integer productSkuId; private Integer productSkuId;
@ApiModelProperty(value = "规格名称") @ApiModelProperty(value = "规格名称")
private String specName; private String specName;
@ApiModelProperty(value = "规格图片") @ApiModelProperty(value = "规格图片")
private String specImage; private String specImage;
@ApiModelProperty(value = "料号") @ApiModelProperty(value = "料号")
private String partNo; private String partNo;
@ApiModelProperty(value = "版本描述") @ApiModelProperty(value = "版本描述")
private String versionDesc; private String versionDesc;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "价格配置")
private List<ProductSpecPriceDTO> priceList;
} }
...@@ -18,18 +18,18 @@ import java.util.Date; ...@@ -18,18 +18,18 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class ProductSpecPriceDTO implements Serializable { public class ProductSpecPriceDTO implements Serializable {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "规格id") @ApiModelProperty(value = "等级标签id")
private Integer productSpecId; private Integer cooperationTag;
@ApiModelProperty(value = "等级标签id") @ApiModelProperty(value = "价格")
private Integer tagInfoId; private BigDecimal price;
@ApiModelProperty(value = "价格") @ApiModelProperty(value = "创建时间")
private BigDecimal price; private Date createTime;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "租赁期限 (0:1-7天,1:8-15天,2:16-30天,3:30天以上)")
private Date createTime; private Integer leaseTerm;
} }
...@@ -20,41 +20,29 @@ import java.io.Serializable; ...@@ -20,41 +20,29 @@ import java.io.Serializable;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class ProductSpecVO implements Serializable { public class ProductSpecVO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@NotNull( private Integer id;
message = "修改时id不能为空",
groups = {Update.class}) @ApiModelProperty(value = "productSkuId")
private Integer id; @NotNull(message = "修改时productSkuId不能为空", groups = {Create.class})
private Integer productSkuId;
@ApiModelProperty(value = "productSkuId")
@NotNull( @NotNull(message = "规格名称不能为空", groups = {Update.class, Create.class})
message = "修改时productSkuId不能为空", @ApiModelProperty(value = "规格名称")
groups = {Create.class}) private String specName;
private Integer productSkuId;
@NotNull(message = "规格图片不能为空", groups = {Update.class, Create.class})
@NotNull( @ApiModelProperty(value = "规格图片")
message = "规格名称不能为空", private String specImage;
groups = {Update.class, Create.class})
@ApiModelProperty(value = "规格名称") @NotNull(message = "料号不能为空", groups = {Update.class, Create.class})
private String specName; @ApiModelProperty(value = "料号")
private String partNo;
@NotNull(
message = "规格图片不能为空", @ApiModelProperty(value = "版本描述")
groups = {Update.class, Create.class}) private String versionDesc;
@ApiModelProperty(value = "规格图片") @ApiModelProperty(value = "价格配置信息")
private String specImage; private ProductSpecCPQVO productSpecCPQVO;
@NotNull(
message = "料号不能为空",
groups = {Update.class, Create.class})
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "价格配置信息")
private ProductSpecCPQVO productSpecCPQVO;
} }
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.RefundLogDTO", description = "退款logDTO")
public class RefundLogDTO implements Serializable {
private static final long serialVersionUID = 6524395508534109389L;
@ApiModelProperty(value = "内容")
private String msg;
@ApiModelProperty(value = "账号")
private String opAccount;
@ApiModelProperty(value = "名称")
private String opName;
@ApiModelProperty(value = "创建/发送时间")
private Date createTime;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;
/**
* @Author small @Date 2023/5/25 9:57 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.RepoAccountDTO", description = "云仓账号信息DTO")
public class RepoAccountDTO implements Serializable {
private static final long serialVersionUID = 1433562781546856233L;
@ApiModelProperty(value = "用户id")
private Integer id;
@ApiModelProperty(value = "用户uid")
private String uid;
@ApiModelProperty(value = "账号名称")
private String accountName;
@ApiModelProperty(value = "账号类型")
private Integer accountType;
@ApiModelProperty(value = "联系电话")
private String phoneNum;
@ApiModelProperty(value = "实名认证状态")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态")
private Integer entAuthStatus;
@ApiModelProperty(value = "渠道认证状态")
private Integer channelAuthStatus;
@ApiModelProperty(value = "渠道等级")
private Integer channelClass;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "头像url")
private String headerImg;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态,0未删除,1删除")
private Integer deleted;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "企业认证时间")
private Date entAuthTime;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "现金余额")
private BigDecimal cashAmt;
private String unionId;
private String openId;
@ApiModelProperty(value = "多端用户,USER_PORT(云享飞)-FLYER_PORT(云飞手)-REPO_PORT(云仓)")
private Set<String> ports;
@ApiModelProperty(value = "用户推荐人数量")
private Integer rcdRepoTeamNum;
@ApiModelProperty(value = "推荐人Uid")
private String rcdUid;
@ApiModelProperty(value = "推荐人账户名称")
private String rcdAccountName;
@ApiModelProperty(value = "推荐人昵称")
private String rcdNickName;
@ApiModelProperty(value = "推荐人id")
private Integer rcdAccountId;
@ApiModelProperty(value = "是否销售")
private Integer sale;
@ApiModelProperty(value = "是否白名单")
private Integer white;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty(value = "推荐单位")
private String company;
@ApiModelProperty(value = "推荐单位ID", hidden = true)
private Integer rcdCompanyId;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:06 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.RepoAddressDTO", description = "云仓地址信息DTO")
public class RepoAddressDTO implements Serializable {
private static final long serialVersionUID = 610413683850745833L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "用户id")
private Integer repoAccountId;
@ApiModelProperty(value = "姓名")
private String realName;
@ApiModelProperty(value = "电话")
private String phoneNum;
@ApiModelProperty(value = "地区")
private String region;
@ApiModelProperty(value = "详细地址")
private String detailAddress;
@ApiModelProperty(value = "使用类型")
private Integer type;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/25 9:49 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.RepoBannerDTO", description = "现金流水DTO")
public class RepoCashDTO implements Serializable {
private static final long serialVersionUID = 4569221850373256579L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "用户ID", hidden = true)
private Integer repoAccountId;
@ApiModelProperty(value = "用户UID", hidden = true)
private String uid;
@ApiModelProperty(value = "用户名", hidden = true)
private String accountName;
@ApiModelProperty(value = "订单ID", hidden = true)
private Integer orderInfoId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "skuID", hidden = true)
private Integer skuInfoId;
@ApiModelProperty(value = "sku标题", hidden = true)
private String skuTitle;
@ApiModelProperty(value = "商品ID", hidden = true)
private Integer wareInfoId;
@ApiModelProperty(value = "商品编号", hidden = true)
private String wareNo;
@ApiModelProperty(value = "商品标题")
private String wareTitle;
@ApiModelProperty(value = "流水编号")
private String payNo;
@ApiModelProperty(value = "流水类型:查字典")
private Integer payMethod;
@ApiModelProperty(value = "变动金额")
private BigDecimal amtPaid;
@ApiModelProperty(value = "当前余额")
private BigDecimal cashAmt;
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "退款流水编号")
private String refundNo;
@ApiModelProperty(value = "凭证")
private List<String> voucher;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "操作人账号")
private String opNo;
@ApiModelProperty(value = "操作人姓名")
private String opName;
private Integer createUser;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:07 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.RepoInfoDTO", description = "仓库/门店DTO")
public class RepoInfoDTO implements Serializable {
private static final long serialVersionUID = 8002261035352227237L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "仓库名称")
private String repoName;
@ApiModelProperty(value = "仓库编号")
private String repoNo;
@ApiModelProperty(value = "仓库地址")
private String repoAddress;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "仓库营业时间")
private String repoBusinessHours;
@ApiModelProperty(value = "管理员Id")
private Integer userAccountId;
@ApiModelProperty(value = "管理员账号")
private String accountNo;
@ApiModelProperty(value = "管理员姓名")
private String userName;
@ApiModelProperty(value = "管理员手机号")
private String phoneNum;
@ApiModelProperty(value = "仓库库存")
private Integer repoInventory;
@ApiModelProperty(value = "是否删除")
private Integer deleted;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "设备个数")
private Integer deviceNum;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 9:57 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.RoleInfoDTO", description = "角色信息DTO")
public class RoleInfoDTO implements Serializable {
private static final long serialVersionUID = -4791023169682602298L;
@ApiModelProperty(value = "角色ID")
private Integer id;
@ApiModelProperty(value = "角色编号")
private String roleNo;
@ApiModelProperty(value = "角色名称")
private String roleName;
@ApiModelProperty(value = "是否为管理角色:0否 1是")
private Integer admin; // 是否为管理角色
@ApiModelProperty(value = "是否为运营角色:0否 1是")
private Integer operate;
@ApiModelProperty(value = "是否为系统角色:0否 1是")
private Integer system;
@ApiModelProperty(value = "是否为PMC发货角色:0否 1是")
private Integer pmc; // PMC发货角色
@ApiModelProperty(value = "是否可用:0否 1是")
private Integer roleStatus;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small @Date 2023/5/25 10:12 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.TaskFlyerCostDTO", description = "飞手工资DTO")
public class TaskFlyerCostDTO implements Serializable {
private static final long serialVersionUID = 4411028098471010440L;
@ApiModelProperty(value = "飞手工资id")
private Integer id;
@ApiModelProperty(value = "订单id")
private Integer orderTaskId;
@ApiModelProperty(value = "飞手日薪")
private BigDecimal flyerWag;
@ApiModelProperty(value = "飞手每日补贴")
private BigDecimal flyerSudy;
@ApiModelProperty(value = "每月工资结算日")
private Integer payDay;
@ApiModelProperty(value = "租房补贴")
private BigDecimal rentHouseSudy;
@ApiModelProperty(value = "交通补贴")
private BigDecimal trafficSudy;
@ApiModelProperty(value = "支付比例(例如0.95)")
private BigDecimal payPersent;
@ApiModelProperty(value = "设备信息")
private String deviceInfo;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "任务编号")
private String orderNo;
@ApiModelProperty(value = "任务名称")
private String orderName;
@ApiModelProperty(value = "飞手数量")
private Integer flyerNum;
@ApiModelProperty(value = "服务类型")
private String inspectionName;
@ApiModelProperty(value = "飞手类型(0个人飞手 1飞手机构)")
private Integer flyerType;
@ApiModelProperty(value = "任务工资信息列表")
private List<WagTermDetailDTO> details;
@ApiModelProperty(value = "任务开始日")
private Date startTime;
@ApiModelProperty(value = "任务结束日")
private Date endTime;
@ApiModelProperty(value = "高温补贴")
private BigDecimal hotSudy;
@ApiModelProperty(value = "预估金额")
private BigDecimal estimateWag;
@ApiModelProperty(value = "补助标签")
private String sudyTag;
public void defaultValue() {
if (this.flyerWag == null) {
this.flyerWag = BigDecimal.ZERO;
}
if (this.flyerSudy == null) {
this.flyerSudy = BigDecimal.ZERO;
}
if (this.rentHouseSudy == null) {
this.rentHouseSudy = BigDecimal.ZERO;
}
if (this.trafficSudy == null) {
this.trafficSudy = BigDecimal.ZERO;
}
if (this.payPersent == null) {
this.payPersent = BigDecimal.ZERO;
}
if (this.hotSudy == null) {
this.hotSudy = BigDecimal.ZERO;
}
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 9:56 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.UserAccountDTO", description = "用户信息DTO")
public class UserAccountDTO implements Serializable {
private static final long serialVersionUID = -3760693134872196985L;
@ApiModelProperty(value = "用户ID")
private Integer id;
@ApiModelProperty(value = "UID")
private String uid;
@ApiModelProperty(value = "账号")
private String accountNo;
@ApiModelProperty(value = "密码")
private String passWord;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "身份证号码")
private String idNumber;
@ApiModelProperty(value = "电话号码")
private String phoneNum;
@ApiModelProperty(value = "性别:0未知 1男 2女 ")
private Integer userSex;
@ApiModelProperty(value = "常住地址")
private String resAddres;
private Integer realAuthStatus;
@ApiModelProperty(value = "常住地址-经度")
private String longitude;
@ApiModelProperty(value = "常住地址-纬度")
private String latitude;
@ApiModelProperty(value = "是否企业用户:0否 1是")
private Integer entUser;
@ApiModelProperty(value = "是否渠道用户:0否 1是")
private Integer channelUser;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "账号类型:0神行太保平台账号 ; 100云享飞-客户端; 101云享飞-飞手端; 102云享飞-云仓端")
private Integer accountType;
@ApiModelProperty(value = "账号状态:0禁用 1可用")
private Integer accountStatus;
@ApiModelProperty(value = "角色信息")
private RoleInfoDTO roleInfo;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "身份证正面照")
private String frontIdImg;
@ApiModelProperty(value = "身份证反面照")
private String backIdImg;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "单位信息")
private CompanySimpleDTO companyInfo;
private Integer rcdCompanyId;
@ApiModelProperty(value = "渠道等级")
private String channelLevel;
@ApiModelProperty(value = "法大大企业认证状态")
private Integer entVerifyStatus;
public UserAccountDTO(Integer id, String uid, String nickName) {
this.id = id;
this.uid = uid;
this.nickName = nickName;
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:13 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.dto.WagTermDetailDTO", description = "任务工资信息DTO")
public class WagTermDetailDTO implements Serializable {
private static final long serialVersionUID = 6088946395006027466L;
@ApiModelProperty(value = "ID")
private Integer id;
@ApiModelProperty(value = "工资日期")
private Date costDate;
@ApiModelProperty(value = "工资(元/日)")
private BigDecimal wagPrice;
@ApiModelProperty(value = "补贴(元/日)")
private BigDecimal sudyPrice;
@ApiModelProperty(value = "出差租房补贴(元/日)")
private BigDecimal rentHousePrice;
@ApiModelProperty(value = "出差交通补贴(元/日)")
private BigDecimal trafficPrice;
@ApiModelProperty(value = "高温补贴(元/日)")
private BigDecimal hotPrice;
@ApiModelProperty(value = "飞手人数")
private Integer flyerNum;
@ApiModelProperty(value = "支付比例")
private BigDecimal payPersent;
@ApiModelProperty(value = "应结工资")
private BigDecimal shouldPay;
@ApiModelProperty(value = "补贴合计-单价(不计算人数)")
private BigDecimal daySudyUnit;
public void defaultValue() {
if (this.wagPrice == null) {
this.wagPrice = BigDecimal.ZERO;
}
if (this.sudyPrice == null) {
this.sudyPrice = BigDecimal.ZERO;
}
if (this.rentHousePrice == null) {
this.rentHousePrice = BigDecimal.ZERO;
}
if (this.trafficPrice == null) {
this.trafficPrice = BigDecimal.ZERO;
}
if (this.wagPrice == null) {
this.wagPrice = BigDecimal.ZERO;
}
if (this.payPersent == null) {
this.payPersent = BigDecimal.ZERO;
}
if (this.flyerNum == null) {
this.flyerNum = 0;
}
}
}
package com.mmc.pms.model.qo;
import com.mmc.pms.model.vo.Freeze;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author LW
* @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;
}
}
package com.mmc.pms.model.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/5/24 11:08
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CategoriesInfoVO {
private Integer id;
private String name;
private String icon;
}
...@@ -15,50 +15,36 @@ import java.io.Serializable; ...@@ -15,50 +15,36 @@ import java.io.Serializable;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.GoodsGroupVO", description = "商品分类") public class ClassifyInfoVO implements Serializable {
public class GoodsGroupVO implements Serializable { @ApiModelProperty(value = "id")
@ApiModelProperty(value = "id") @NotNull(message = "id不能为空", groups = {Update.class})
@NotNull( private Integer id;
message = "id不能为空",
groups = {Update.class}) @ApiModelProperty(value = "所属目录id")
private Integer id; @NotNull(message = "所属目录id不能为空", groups = {Update.class, Create.class})
private Integer directoryId;
@ApiModelProperty(value = "分类类型id")
@NotNull( @ApiModelProperty(value = "分类名称", required = true)
message = "分类类型id不能为空", @Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
groups = {Update.class, Create.class}) @NotNull(message = "分类名称不能为空", groups = {Update.class, Create.class})
private Integer sortTypeId; private String classifyName;
@ApiModelProperty(value = "分类名称", required = true) @ApiModelProperty(value = "pid:一级分类的pid是0 二级分类pid是一级分类id", required = true)
@Size( @NotNull(message = "pid不能为空", groups = {Create.class, Update.class})
max = 15, private Integer pid;
message = "分类名称不能超过15个字",
groups = {Update.class, Create.class}) @ApiModelProperty(value = "描述")
@NotNull( @Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
message = "分类名称不能为空", private String description;
groups = {Update.class, Create.class})
private String groupName; @ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "pid:一级分类的pid是0 二级分类pid是一级分类id", required = true)
@NotNull( @ApiModelProperty(value = "小程序底部备注")
message = "pid不能为空", @Size(max = 150, message = "小程序底部备注不能超过150个字", groups = {Update.class, Create.class})
groups = {Create.class, Update.class}) private String remark;
private Integer pid;
@ApiModelProperty(value = "分类所属模块id(0:通用分类 1:作业服务分类 2:设备租赁分类 3:飞手培训分类 4:产品商城分类)")
@ApiModelProperty(value = "描述") @NotNull(message = "分类所属模块id不能为空", groups = {Update.class, Create.class})
@Size( private Integer type;
max = 70,
message = "分类描述不能超过70个字",
groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@ApiModelProperty(value = "小程序底部备注")
@Size(
max = 150,
message = "小程序底部备注不能超过150个字",
groups = {Update.class, Create.class})
private String remark;
} }
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/5/24 11:06
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DirectoryInfoVO {
@ApiModelProperty(value = "目录id")
private Integer id;
@ApiModelProperty(value = "目录名称")
private String directoryName;
@ApiModelProperty(value = "关联目录的id")
private Integer relevance;
@ApiModelProperty(value = "分类模块:(0:通用分类 1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类)")
private Integer type;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
* @date 2022/10/14 11:30
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsAddVO implements Serializable {
private static final long serialVersionUID = 7041502536618388167L;
@ApiModelProperty(value = "商品类型:0:销售商品 1:租赁商品")
@NotNull(message = "新增商品类型不能为空", groups = {Create.class})
private Integer goodsType;
@ApiModelProperty(value = "id")
@NotNull(message = "修改时id不能为空", groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "商品图片")
@NotEmpty(message = "主图不能为空", groups = {Update.class, Create.class})
private List<GoodsImgVO> images;
@ApiModelProperty(value = "商品视频")
private String goodsVideo;
@ApiModelProperty(value = "商品名称")
@NotNull(message = "商品名称不能为空", groups = {Update.class, Create.class})
private String goodsName;
@ApiModelProperty(value = "商品详情")
private GoodsDetailVO goodsDetailVO;
@ApiModelProperty(value = "所属目录")
@NotNull(message = "所属目录不能为空", groups = {Update.class, Create.class})
private Integer directoryId;
@ApiModelProperty(value = "一级分类id")
@NotNull(message = "分类不能为空", groups = {Update.class, Create.class})
private Integer categoryByOne;
@ApiModelProperty(value = "二级分类id")
private Integer categoryByTwo;
@ApiModelProperty(value = "商品标签")
private String tag;
@ApiModelProperty(value = "商品状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "规格信息")
private List<GoodsProdSpecVO> productSpec;
@ApiModelProperty(value = "其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 ")
private List<Integer> otherService;
}
...@@ -14,24 +14,17 @@ import java.io.Serializable; ...@@ -14,24 +14,17 @@ import java.io.Serializable;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.GoodsDetailVO", description = "商品详情")
public class GoodsDetailVO implements Serializable { public class GoodsDetailVO implements Serializable {
private static final long serialVersionUID = -3842207843504795301L; private static final long serialVersionUID = -3842207843504795301L;
@ApiModelProperty(value = "商品描述 :70字内") @ApiModelProperty(value = "商品描述 :70字内")
@Size( @Size(max = 250, message = "商品描述不能超过250个字符", groups = {Create.class, Update.class})
max = 250, private String goodsDesc;
message = "商品描述不能超过250个字符",
groups = {Create.class, Update.class})
private String goodsDesc;
@ApiModelProperty(value = "产品介绍") @ApiModelProperty(value = "产品介绍")
private String productDesc; private String productDesc;
@ApiModelProperty(value = "商品备注:100字以内") @ApiModelProperty(value = "商品备注:100字以内")
@Size( @Size(max = 100, message = "商品备注不能超过100个字符", groups = {Create.class, Update.class})
max = 100, private String remark;
message = "商品备注不能超过100个字符",
groups = {Create.class, Update.class})
private String remark;
} }
package com.mmc.pms.model.vo;
import com.mmc.pms.model.dto.ProductSpecVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
* @date 2023/5/29 9:58
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsProdSpecVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格名称")
private String goodsSpecName;
@ApiModelProperty(value = "产品类型id")
private Integer categoryId;
@ApiModelProperty(value = "产品:自定义时此字段可不用填写")
private Integer skuId;
@ApiModelProperty(value = "规格来源 0:获取 1:自定义")
private Integer flag;
@ApiModelProperty(value = "产品名称(自定义的时候才需要传值)")
private String productName;
@ApiModelProperty(value = "选项来源")
private List<Integer> specIds;
@ApiModelProperty(value = "选择方式")
private Integer chooseType;
@ApiModelProperty(value = "规格单位")
private Integer skuUnitId;
@ApiModelProperty(value = "是否必选")
private Integer must;
@ApiModelProperty(value = "自定义规格的信息填充")
private List<ProductSpecVO> customizeInfo;
@ApiModelProperty(value = "删除的自定义规格id")
private List<Integer> delProductSpecId;
}
package com.mmc.pms.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author LW
* @date 2022/9/23 10:33
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsProductSkuVO 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 = "产品类型不能为空", groups = {Update.class, Create.class})
@ApiModelProperty(value = "产品类型")
private Integer goodsTypeId;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "产品品牌")
private String productBrand;
@ApiModelProperty(value = "品牌id")
private Integer productBrandId;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
}
...@@ -16,41 +16,41 @@ import java.util.List; ...@@ -16,41 +16,41 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class GoodsSpecVO implements Serializable { public class GoodsSpecVO implements Serializable {
private static final long serialVersionUID = -8681372139970849591L; private static final long serialVersionUID = -8681372139970849591L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "规格名称") @ApiModelProperty(value = "规格名称")
private String goodsSpecName; private String goodsSpecName;
@ApiModelProperty(value = "产品类型") @ApiModelProperty(value = "产品类型")
private Integer goodsTypeId; private Integer goodsTypeId;
@ApiModelProperty(value = "产品:自定义时此字段可不用填写") @ApiModelProperty(value = "产品:自定义时此字段可不用填写")
private Integer skuId; private Integer skuId;
@ApiModelProperty(value = "规格来源 0:获取 1:自定义") @ApiModelProperty(value = "规格来源 0:获取 1:自定义")
private Integer flag; private Integer flag;
@ApiModelProperty(value = "产品名称(自定义的时候才需要传值)") @ApiModelProperty(value = "产品名称(自定义的时候才需要传值)")
private String productName; private String productName;
@ApiModelProperty(value = "选项来源") @ApiModelProperty(value = "选项来源")
private List<MallProductSpecVO> specIds; private List<MallProductSpecVO> specIds;
@ApiModelProperty(value = "选择方式") @ApiModelProperty(value = "选择方式")
private Integer chooseType; private Integer chooseType;
@ApiModelProperty(value = "规格单位") @ApiModelProperty(value = "规格单位")
private Integer skuUnitId; private Integer skuUnitId;
@ApiModelProperty(value = "是否必选") @ApiModelProperty(value = "是否必选")
private Integer must; private Integer must;
@ApiModelProperty(value = "自定义的信息填充") @ApiModelProperty(value = "自定义的信息填充")
private List<ProductSpecVO> customizeInfo; private List<ProductSpecVO> customizeInfo;
@ApiModelProperty(value = "删除的自定义规格id") @ApiModelProperty(value = "删除的自定义规格id")
private List<Integer> delProductSpecId; private List<Integer> delProductSpecId;
} }
package com.mmc.pms.model.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small @Date 2023/5/25 10:08 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseOrderVO implements Serializable {
private static final long serialVersionUID = 3876353091071918771L;
private String orderNo;
private Integer wareInfoId;
private String wareNo;
private String wareTitle;
private String mainImg;
private Integer skuInfoId;
private String skuTitle;
private Integer repoAccountId;
private String uid;
private String buyerName;
private String buyerPhone;
private BigDecimal unitPrice;
private Integer wareNum;
private BigDecimal shouldPay;
private BigDecimal actualPay;
private Integer orderType;
private BigDecimal deposit;
private BigDecimal rentPrice;
private Date startDate;
private Date endDate;
private Integer payDay;
private Integer exWare;
private String tranStatus;
private String remark;
private Integer rcdCompanyId;
private Date createTime;
private OrderReceiptVO orderReceipt;
}
package com.mmc.pms.model.vo;
import com.mmc.pms.entity.OrderReceiptDO;
import com.mmc.pms.model.dto.RepoAddressDTO;
import com.mmc.pms.model.dto.RepoInfoDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/25 10:06 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.vo.OrderReceiptVO", description = "收货地址类")
public class OrderReceiptVO implements Serializable {
private static final long serialVersionUID = -3695743775258866831L;
@ApiModelProperty(value = "", hidden = true)
private Integer id;
@ApiModelProperty(value = "订单id")
private Integer orderInfoId;
@ApiModelProperty(value = "", hidden = true)
private Integer receiptMethod;
@ApiModelProperty(value = "", hidden = true)
private String takeName;
@ApiModelProperty(value = "", hidden = true)
private String takePhone;
@ApiModelProperty(value = "", hidden = true)
private String region;
@ApiModelProperty(value = "", hidden = true)
private String detailAddress;
@ApiModelProperty(value = "门店名称")
private String repoName;
@ApiModelProperty(value = "门店地址")
private String repoAddress;
@ApiModelProperty(value = "预留手机号")
private String bookPhone;
@ApiModelProperty(value = "物流公司编码")
private String sendExCode;
@ApiModelProperty(value = "物流单号")
private String sendExNo;
public void buildAddress(RepoAddressDTO d) {
this.takeName = d.getRealName();
this.takePhone = d.getPhoneNum();
this.region = d.getRegion();
this.detailAddress = d.getDetailAddress();
}
public void buildAddress(RepoInfoDTO d, String bookPhone) {
this.repoName = d.getRepoName();
this.repoAddress = d.getRepoAddress();
this.bookPhone = bookPhone;
}
public OrderReceiptDO buildOrderReceiptDO() {
return OrderReceiptDO.builder()
.orderInfoId(this.orderInfoId)
.sendExCode(this.sendExCode)
.sendExNo(this.sendExNo)
.build();
}
}
...@@ -15,11 +15,14 @@ import java.util.List; ...@@ -15,11 +15,14 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class ProductSpecCPQVO implements Serializable { public class ProductSpecCPQVO implements Serializable {
private static final long serialVersionUID = 6055658459871113781L; private static final long serialVersionUID = 6055658459871113781L;
@ApiModelProperty(value = "产品规格id") @ApiModelProperty(value = "产品规格id")
private Integer productSpecId; private Integer productSpecId;
@ApiModelProperty(value = "销售:0 租赁:1")
@ApiModelProperty(value = "规格价格配置VO") private Integer type;
private List<SpecPriceVO> specPrice; @ApiModelProperty(value = "租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)")
private Integer leaseTerm;
@ApiModelProperty(value = "规格价格配置VO")
private List<SpecPriceVO> specPrice;
} }
package com.mmc.pms.model.vo;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author LW
* @date 2023/5/25 11:25
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QueryClassifyVO implements Serializable {
@ApiModelProperty(value = "所属目录id")
@NotNull(message = "所属目录id不能为空", groups = {Update.class, Create.class})
private Integer directoryId;
@ApiModelProperty(value = "分类所属模块id(0:通用分类 1:作业服务分类 2:设备租赁分类 3:飞手培训分类 4:产品商城分类)")
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;
}
}
...@@ -14,8 +14,8 @@ import java.math.BigDecimal; ...@@ -14,8 +14,8 @@ import java.math.BigDecimal;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class SpecPriceVO implements Serializable { public class SpecPriceVO implements Serializable {
private static final long serialVersionUID = -8976672168410262190L; private static final long serialVersionUID = -8976672168410262190L;
private Integer id; private Integer id;
private Integer tagInfoId; private Integer cooperationTag;
private BigDecimal price; private BigDecimal price;
} }
package com.mmc.pms.redis;
/**
* @Author small @Date 2023/5/23 13:49 @Version 1.0
*/
public class RedisConstant {
/** 验证码-key */
public static final String VERIFYCODEKEY = "verifyCode";
/** 电话号码-key */
public static final String PHONENUMKEY = "phoneNum";
/** 当天用户量统计-key */
public static final String ACTIVE_USER_TOTAL_COUNT_TODAY = "active_user_total_count_today";
/** 后台-当天用户量统计-key */
public static final String ADMIN_ACTIVE_COUNT_TODAY = "admin_active_count_today";
/** 云享飞-当天用户量统计-key */
public static final String YXF_ACTIVE_COUNT_TODAY = "yxf_active_count_today";
/** 云飞手-当天用户量统计-key */
public static final String YFS_ACTIVE_COUNT_TODAY = "yfs_active_count_today";
/** 云仓-当天用户量统计-key */
public static final String YC_ACTIVE_COUNT_TODAY = "yc_active_count_today";
/** 登录信息token前缀 */
public static final String LOGING_TOKEN_BEFORE = "CLOUD-SHARED-FLIGHT-USERID@";
/**
* token黑名单-key
*
* @param userId
* @return
*/
/** 实名认证 redis 的键 */
public static final String REALNAMEREDISKEY = "realName";
/** token失效 */
public static final String DISABLE_TOKEN = "DISABLE-TOKEN";
/**
* 分片上传的key
*
* @param userId
* @return
*/
public static final String PART_UPLOAD = "UPLOAD_PART_";
/** 飞手端-假数据-分页信息-可以 */
public static final String FLYER_DUMMY_DATA_PAGE = "FLYER_DUMMY_DATA_PAGE";
/** token失效列表的key */
public static final String DISABLE_TOKEN_LIST = "DISABLE_TOKEN_LIST";
/** 无人机城的订单状态 */
public static final String UAV_MALL_ORDER_STATUS = "UAV_MALL_ORDER_STATUS";
/** 无人机城的快递公司编码 */
public static final String UAV_MALL_EXP_COM = "UAV_MALL_EXP_COM";
/** 无人机城的快递状态码 */
public static final String UAV_MALL_EXP_STATUS = "UAV_MALL_EXP_STATUS";
/**
* 微信access_token
*
* @param userId
* @return
*/
public static final String WX_ACCESS_TOKEN_BEFORE = "WX_ACCESS_TOKEN_";
public static final String REPO_SEND_PAY_MESSAGE = "REPO_ORDER_REMIND_PAY_";
public static final String FLYER_PUBLIC_DEFAULT_NAME = "FLYER_PUBLIC_DEFAULT_NAME";
public static final String EVALUATION = "EVALUATION";
public static final String FLYER_DUMMY_DATA = "FLYER_DUMMY_DATA_KEY";
public static final String UAV_DUMMY_DATA = "UAV_DUMMY_DATA_KEY";
/** tagInfoAllot表的缓存key */
public static final String TAGINFOALLOT_QUESTALL = "csf-service-system:tagInfoAllot:questAll";
public static String getDisableTokenKey(String accountId, String roleId, String tokenType) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.DISABLE_TOKEN);
key.append("_ROLE_");
key.append(roleId);
key.append("_");
key.append(accountId);
return key.toString();
}
/**
* 生成唯一的分片上传key
*
* @param uploadId
* @return
*/
public static String createPartUploadKey(String uploadId) {
StringBuffer key = new StringBuffer();
key.append(uploadId);
return key.toString();
}
/** 生成微信api的access_token的key */
public static String createWxToken(String wxAppid) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.WX_ACCESS_TOKEN_BEFORE);
key.append(wxAppid);
return key.toString();
}
/** 表单重复提交key */
public static String createRepeatKey(String token, String url, String params) {
StringBuffer key = new StringBuffer();
key.append(token);
key.append(url);
key.append(params);
return key.toString();
}
public static String createRepeatKey(String token, String url) {
return RedisConstant.createRepeatKey(token, url, "");
}
/** 登录缓存信息 */
public static String createLoginCacheKey(String tokenType, Integer id) {
StringBuffer key = new StringBuffer();
key.append(tokenType);
key.append("_");
key.append(id);
return key.toString();
}
/** 每位账号的的token的key的前缀 */
public static String tokenPreFix(String tokenType, String roleId) {
StringBuffer key = new StringBuffer();
key.append(tokenType);
key.append("_ROLE_");
key.append(roleId);
key.append("_");
return key.toString();
}
/** 每位账号的token保存的key */
public static String createLoginTokenKey(String tokenType, String roleId, String accountId) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.tokenPreFix(tokenType, roleId));
key.append(accountId);
return key.toString();
}
public static String createRepoOrderOver(Integer orderInfoId) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.REPO_SEND_PAY_MESSAGE);
key.append(orderInfoId);
return key.toString();
}
public static String getLockKey(String userId, String tokenType, String path) {
StringBuffer sb = new StringBuffer();
sb.append(userId);
sb.append("_");
sb.append(tokenType);
sb.append("_");
sb.append(path);
return sb.toString();
}
public static String createInspection(Integer id) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.EVALUATION);
key.append(id);
return key.toString();
}
public static String accessTokenKey(String clientId, Integer roleId, String grantType) {
StringBuilder key = new StringBuilder();
key.append("OAUTH_");
key.append(clientId);
key.append("_");
key.append(roleId);
key.append("_");
key.append(grantType);
return key.toString();
}
public static String getCompanyChildKey(Integer companyId) {
StringBuilder key = new StringBuilder();
key.append("company_cache:");
key.append(companyId);
return key.toString();
}
public static String getXEAccessTokenKey() {
StringBuilder key = new StringBuilder();
key.append("XE_ACCESS_TOKEN");
return key.toString();
}
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.page.PageResult;
/**
* @Author LW
* @date 2023/3/14 13:26
* 概要:
*/
public interface BrandManageService {
/**
* 添加品牌信息
*
* @param brandName 品牌名称
* @return {@link ResultBody}
*/
ResultBody addBrandInfo(String brandName);
/**
* 品牌列表信息
*
* @param pageNo 页面没有
* @param pageSize 页面大小
* @return {@link PageResult}
*/
PageResult listBrandInfo(Integer pageNo, Integer pageSize);
// /**
// * 删除品牌信息
// *
// * @param id id
// * @return {@link ResultBody}
// */
// ResultBody deleteBrandInfo(Integer id);
/**
* 编辑品牌信息
*
* @param id id
* @param name 名字
* @return {@link ResultBody}
*/
ResultBody editBrandInfo(Integer id, String name);
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.vo.ClassifyInfoVO;
import com.mmc.pms.model.vo.DirectoryInfoVO;
import com.mmc.pms.model.vo.QueryClassifyVO;
import com.mmc.pms.page.PageResult;
/**
* @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Service
* @createDate 2023-05-24 10:29:28
*/
public interface CategoriesService {
ResultBody addOrEditDirectory(DirectoryInfoVO param);
PageResult directoryList(Integer pageNo, Integer pageSize);
ResultBody removeDirectory(Integer id);
ResultBody addClassification(ClassifyInfoVO classifyInfoVO);
ResultBody updateClassification(ClassifyInfoVO classifyInfoVO);
ResultBody exchangeSortType(Integer firstId, Integer secondId);
PageResult getClassificationList(QueryClassifyVO queryClassifyVO);
ResultBody getClassifyDetails(Integer id);
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.vo.GoodsAddVO;
/**
* @author 23214
* @description 针对表【goods_info(商品基本信息)】的数据库操作Service
* @createDate 2023-05-27 14:08:45
*/
public interface GoodsInfoService {
ResultBody addGoods(GoodsAddVO goodsAddVO);
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO);
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.BrandManageDao;
import com.mmc.pms.entity.BrandInfoDO;
import com.mmc.pms.model.dto.BrandInfoDTO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.BrandManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author LW
* @date 2023/3/14 13:27
* 概要:
*/
@Service
public class BrandManageServiceImpl implements BrandManageService {
@Autowired
private BrandManageDao brandManageDao;
/**
* 添加品牌信息
*
* @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);
}
// /**
// * 删除品牌信息
// *
// * @param id id
// * @return {@link ResultBody}
// */
// @Override
// public ResultBody deleteBrandInfo(Integer id) {
// // 判断该品牌是否绑定产品信息
// int count = productSpecDao.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();
}
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.CategoriesDao;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.Directory;
import com.mmc.pms.model.dto.ClassifyInfoDTO;
import com.mmc.pms.model.vo.ClassifyInfoVO;
import com.mmc.pms.model.vo.DirectoryInfoVO;
import com.mmc.pms.model.vo.QueryClassifyVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.CategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author lw
* @description 针对表【categories(通用分类表)】的数据库操作Service实现
* @createDate 2023-05-24 10:29:28
*/
@Service
public class CategoriesServiceImpl implements CategoriesService {
@Autowired
private CategoriesDao categoriesDao;
@Override
public ResultBody addOrEditDirectory(DirectoryInfoVO param) {
int type = categoriesDao.countUpdateDirectoryName(param);
if (type > 0) {
return ResultBody.error(ResultEnum.DIRECTORY_NAME_HAS_BEEN_EXIST);
}
Directory directory = new Directory(param);
if (param.getId() == null) {
categoriesDao.insertDirectory(directory);
} else {
categoriesDao.updateDirectory(directory);
}
return ResultBody.success();
}
@Override
public PageResult directoryList(Integer pageNo, Integer pageSize) {
int count = categoriesDao.countDirectoryList();
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
List<Directory> directoryList = categoriesDao.directoryList((pageNo - 1) * pageSize, pageSize);
List<DirectoryInfoVO> list = directoryList.stream().map(Directory::buildDirectoryInfoVO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, list);
}
@Override
public ResultBody removeDirectory(Integer id) {
// 查询该目录下是否有分类有的话就不给删除
int count = categoriesDao.countDirectory(id);
if (count > 0) {
return ResultBody.error(ResultEnum.THERE_ARE_CATEGORIES_IN_THE_DIRECTORY);
}
categoriesDao.removeDirectory(id);
return ResultBody.success();
}
@Override
public ResultBody addClassification(ClassifyInfoVO classifyInfoVO) {
int count = categoriesDao.countClassificationByName(classifyInfoVO);
if (count > 0) {
return ResultBody.error(ResultEnum.WARE_TYPE_NAME_HAS_BEEN_EXIST);
}
Categories categories = new Categories(classifyInfoVO);
if (classifyInfoVO.getPid() == 0) {
if (classifyInfoVO.getIcon() != null) {
int typeCount = categoriesDao.getCountCategoriesByPid(0, classifyInfoVO.getType());
categories.setSort(typeCount + 1);
categoriesDao.insertClassification(categories);
} else {
return ResultBody.error(ResultEnum.WARE_TYPE_ICON_NOT_NULL);
}
} else {
categoriesDao.insertClassification(categories);
}
return ResultBody.success();
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody updateClassification(ClassifyInfoVO classifyInfoVO) {
int count = categoriesDao.countClassificationByName(classifyInfoVO);
if (count > 0) {
return ResultBody.error(ResultEnum.WARE_TYPE_NAME_HAS_BEEN_EXIST);
}
if (classifyInfoVO.getPid() == 0) {
if (classifyInfoVO.getIcon() != null) {
categoriesDao.updateClassification(classifyInfoVO);
} else {
return ResultBody.error(ResultEnum.WARE_TYPE_ICON_NOT_NULL);
}
} else {
categoriesDao.updateClassification(classifyInfoVO);
}
return ResultBody.success();
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody exchangeSortType(Integer firstId, Integer secondId) {
Categories firstCategories = categoriesDao.getGoodsGroupById(firstId);
Categories secondCategories = categoriesDao.getGoodsGroupById(secondId);
int updateCount1 = categoriesDao.updateTypeSort(firstId, secondCategories.getSort());
int updateCount2 = categoriesDao.updateTypeSort(secondId, firstCategories.getSort());
if (updateCount1 == updateCount2) {
return ResultBody.success();
} else {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultBody.error("排序失败");
}
}
@Override
public PageResult getClassificationList(QueryClassifyVO queryClassifyVO) {
int count = categoriesDao.countListClassification(queryClassifyVO);
if (count == 0) {
return PageResult.buildPage(queryClassifyVO.getPageNo(), queryClassifyVO.getPageSize(), count);
}
int pageNo = queryClassifyVO.getPageNo();
queryClassifyVO.buildCurrentPage();
List<Categories> categories = categoriesDao.selectAllClassification(queryClassifyVO);
List<ClassifyInfoDTO> categoriesList = categories.stream().map(Categories::buildClassifyInfoDTO).collect(Collectors.toList());
List<ClassifyInfoDTO> topLevelCategories = new ArrayList<>();
Map<Integer, ClassifyInfoDTO> categoriesMap = new HashMap<>();
// 将每个数据模型对象添加到Map中,以便在递归过程中查找它们的父母
for (ClassifyInfoDTO category : categoriesList) {
category.setChildren(new ArrayList<>());
categoriesMap.put(category.getId(), category);
}
// 构建树结构
for (ClassifyInfoDTO category : categoriesList) {
if (category.getPid() == 0) {
topLevelCategories.add(category);
} else {
ClassifyInfoDTO parent = categoriesMap.get(category.getPid());
parent.getChildren().add(category);
}
}
return PageResult.buildPage(pageNo, queryClassifyVO.getPageSize(), count, topLevelCategories);
}
@Override
public ResultBody getClassifyDetails(Integer id) {
Categories goodsGroup = categoriesDao.getGoodsGroupById(id);
return ResultBody.success(goodsGroup == null ? null : goodsGroup.buildClassifyDetailsDTO()
);
}
}
package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.GoodsInfoDao;
import com.mmc.pms.dao.ProductSkuDao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.vo.*;
import com.mmc.pms.service.GoodsInfoService;
import com.mmc.pms.util.CodeUtil;
import com.mmc.pms.util.TDateUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author 23214
* @description 针对表【goods_info(商品基本信息)】的数据库操作Service实现
* @createDate 2023-05-27 14:08:45
*/
@Service
public class GoodsInfoServiceImpl implements GoodsInfoService {
@Resource
private GoodsInfoDao goodsInfoDao;
@Resource
private ProductSkuDao productSkuDao;
@Resource
private ProductSkuServiceImpl productSkuService;
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody addGoods(GoodsAddVO goodsAddVO) {
// 判断商品名称是否存在
if (goodsInfoDao.countGoodsInfoByName(goodsAddVO) > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
// 判断商品详情中描述是否为空
if (goodsAddVO.getGoodsDetailVO().getGoodsDesc() == null) {
return ResultBody.error(ResultEnum.GOODS_DESC_IS_NOT_NULL);
}
String YYYY_MM_DD_HH_MM_SS = "yyyyMMddHHmmss";
// 初始化商品对象,并构建对象
GoodsInfo goodsInfo = new GoodsInfo(goodsAddVO);
goodsInfo.setGoodsNo("IUAV" + TDateUtil.getDateStr(new Date(), YYYY_MM_DD_HH_MM_SS) + CodeUtil.getRandomNum(4));
// 暂未接入用户默认传1
goodsInfo.setAddGoodsUserId(1);
goodsInfo.setSort(goodsInfoDao.countGoodsInfo() + 1);
// 插入商品基本信息
goodsInfoDao.insertGoodsInfo(goodsInfo);
// 调用图片视频插入信息方法
addGoodsImageInfo(goodsInfo.getId(), goodsAddVO);
// 调用商品详情信息方法
addGoodsDetail(goodsInfo.getId(), goodsAddVO.getGoodsDetailVO());
// 判断其他服务是否为空,不为空则插入
if (!CollectionUtils.isEmpty(goodsAddVO.getOtherService())) {
addOtherService(goodsAddVO.getOtherService(), goodsInfo.getId());
}
// 调用产品规格的新增方法
if (!goodsAddVO.getDirectoryId().equals(2)) {
// 添加产品规格信息
productSkuSpecOperation(goodsInfo, goodsAddVO.getProductSpec());
}
return ResultBody.success();
}
@Transactional(rollbackFor = Exception.class)
public void productSkuSpecOperation(GoodsInfo goodsInfo, List<GoodsProdSpecVO> productSpec) {
// 遍历规格信息,获取其中非自定义的规格信息
List<GoodsProdSpecVO> customGoodsSpecList = productSpec.stream().filter(spec -> spec.getFlag().equals(1)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(customGoodsSpecList)) {
addCustomization(goodsInfo, customGoodsSpecList);
}
// 遍历规格信息,获取其中非自定义的规格信息
List<GoodsProdSpecVO> goodsSpecList = productSpec.stream().filter(spec -> spec.getFlag().equals(0)).collect(Collectors.toList());
for (GoodsProdSpecVO goodsSpec : goodsSpecList) {
MallProdSkuInfoDO mallProdSkuInfoDO = buildMallProdSkuInfo(goodsInfo, goodsSpec, goodsSpec.getSkuId());
mallProdSkuInfoDO.setProductSpecIdList(goodsSpec.getSpecIds().stream().map(String::valueOf).collect(Collectors.joining(",")));
// 插入数据库商品对应的sku信息
productSkuDao.insertMallProdSkuInfo(mallProdSkuInfoDO);
}
}
@Transactional(rollbackFor = Exception.class)
public MallProdSkuInfoDO buildMallProdSkuInfo(GoodsInfo goodsInfo, GoodsProdSpecVO goodsSpec, Integer id) {
MallProdSkuInfoDO mallProdSkuInfoDO = new MallProdSkuInfoDO();
mallProdSkuInfoDO.setGoodsInfoId(goodsInfo.getId());
mallProdSkuInfoDO.setProdSkuId(id);
mallProdSkuInfoDO.setProdSkuSpecName(goodsSpec.getGoodsSpecName());
mallProdSkuInfoDO.setCategoryId(goodsSpec.getCategoryId());
mallProdSkuInfoDO.setChooseType(goodsSpec.getChooseType());
mallProdSkuInfoDO.setMust(goodsSpec.getMust());
mallProdSkuInfoDO.setFlag(goodsSpec.getFlag());
mallProdSkuInfoDO.setSkuUnitId(goodsSpec.getSkuUnitId());
return mallProdSkuInfoDO;
}
@Transactional(rollbackFor = Exception.class)
public void addCustomization(GoodsInfo goodsInfo, List<GoodsProdSpecVO> customGoodsSpecList) {
// 遍历自定义规格信息
for (GoodsProdSpecVO productSpec : customGoodsSpecList) {
// 构建商品对应的sku信息
ProductSkuDO productSkuDO = new ProductSkuDO().setCategoriesId(productSpec.getCategoryId())
.setProductName(productSpec.getProductName()).setCustomize(1)
.setDirectoryId(goodsInfo.getDirectoryId());
// 插入产品sku信息
productSkuDao.insertProductSku(productSkuDO);
// 先将自定的信息存储到数据库中
List<ProductSpecDO> customizeSpec = productSpec.getCustomizeInfo().stream().map(param -> {
ProductSpecDO productSpecDO = new ProductSpecDO().setProductSkuId(productSkuDO.getId())
.setVersionDesc("自定义").setSpecImage(param.getSpecImage())
.setSpecName(param.getSpecName()).setPartNo(param.getPartNo());
// 新增产品sku
productSkuDao.insertProductSpec(productSpecDO);
// 批量配置价格信息
ProductSpecCPQVO productSpecCPQVO = param.getProductSpecCPQVO();
if (productSpecCPQVO != null) {
productSpecCPQVO.setProductSpecId(productSpecDO.getId());
productSkuService.insertSpecPrice(productSpecCPQVO);
}
return productSpecDO;
}).collect(Collectors.toList());
List<Integer> ids = customizeSpec.stream().map(ProductSpecDO::getId).collect(Collectors.toList());
MallProdSkuInfoDO mallProdSkuInfoDO = buildMallProdSkuInfo(goodsInfo, productSpec, productSkuDO.getId());
mallProdSkuInfoDO.setProductSpecIdList(ids.stream().map(String::valueOf).collect(Collectors.joining(",")));
// 插入数据库商品对应的sku信息
productSkuDao.insertMallProdSkuInfo(mallProdSkuInfoDO);
}
}
@Transactional(rollbackFor = Exception.class)
public void addOtherService(List<Integer> otherService, Integer goodsId) {
// 插入其他服务
List<GoodsServiceDO> otherList = otherService.stream().map(d -> {
GoodsServiceDO goodsServiceDO = new GoodsServiceDO();
goodsServiceDO.setGoodsInfoId(goodsId);
goodsServiceDO.setSaleServiceId(d);
return goodsServiceDO;
}).collect(Collectors.toList());
goodsInfoDao.insertGoodsService(otherList);
}
@Transactional(rollbackFor = Exception.class)
public void addGoodsDetail(Integer goodsId, GoodsDetailVO goodsDetailVO) {
GoodsDetailDO goodsDetailDO = new GoodsDetailDO(goodsDetailVO);
goodsDetailDO.setGoodsInfoId(goodsId);
goodsInfoDao.insertGoodsDetail(goodsDetailDO);
}
@Transactional(rollbackFor = Exception.class)
public void addGoodsImageInfo(Integer goodsId, GoodsAddVO goodsAddVO) {
List<GoodsImgDO> list = goodsAddVO.getImages().stream().map(d -> {
GoodsImgDO goodsImgDO = new GoodsImgDO(d);
goodsImgDO.setGoodsInfoId(goodsId);
return goodsImgDO;
}).collect(Collectors.toList());
// 插入图片信息
goodsInfoDao.insertGoodsImgInfo(list);
// 插入商品视频信息
if (goodsAddVO.getGoodsVideo() != null) {
GoodsVideoDO goodsVideoDO = new GoodsVideoDO().setGoodsInfoId(goodsId).setVideoUrl(goodsAddVO.getGoodsVideo());
goodsInfoDao.insertVideoInfo(goodsVideoDO);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody editGoodsInfo(GoodsAddVO goodsAddVO) {
// 判断商品是否还存在
int count = goodsInfoDao.countGoodsInfoById(goodsAddVO.getId());
if (count <= 0) {
return ResultBody.error(ResultEnum.GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF);
}
// 判断商品名称是否存在
if (goodsInfoDao.countGoodsInfoByName(goodsAddVO) > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
// 判断商品详情中描述是否为空
if (goodsAddVO.getGoodsDetailVO().getGoodsDesc() == null) {
return ResultBody.error(ResultEnum.GOODS_DESC_IS_NOT_NULL);
}
// 初始化商品对象,并构建对象
GoodsInfo goodsInfo = new GoodsInfo(goodsAddVO);
// 插入商品基本信息
goodsInfoDao.updateGoodsInfo(goodsInfo);
// 修改商品详情信息
updateGoodsDetail(goodsAddVO);
// 修改商品图片及视频信息
updateImageInfo(goodsAddVO);
// 修改其他服务信息
updateOtherService(goodsAddVO);
return null;
}
private void updateOtherService(GoodsAddVO goodsAddVO) {
// 删除其他服务
goodsInfoDao.deleteGoodsServiceByGoodsId(goodsAddVO.getId());
// 插入其他服务
if (!CollectionUtils.isEmpty(goodsAddVO.getOtherService())) {
List<Integer> other = goodsAddVO.getOtherService();
List<GoodsServiceDO> otherList = other.stream().map(d -> {
GoodsServiceDO goodsServiceDO = new GoodsServiceDO();
goodsServiceDO.setGoodsInfoId(goodsAddVO.getId());
goodsServiceDO.setSaleServiceId(d);
return goodsServiceDO;
}).collect(Collectors.toList());
goodsInfoDao.insertGoodsService(otherList);
}
}
@Transactional(rollbackFor = Exception.class)
public void updateImageInfo(GoodsAddVO goodsAddVO) {
Set<Integer> imgIds = goodsAddVO.getImages().stream().map(GoodsImgVO::getId).filter(Objects::nonNull).collect(Collectors.toSet());
List<GoodsImgDO> dbImgList = goodsInfoDao.listGoodsInfoByGoodsId(goodsAddVO.getId());
List<Integer> deleteIds = dbImgList.stream().map(GoodsImgDO::getId).filter(id -> !imgIds.contains(id)).collect(Collectors.toList());
if (deleteIds.size() != 0) {
// 删除多余的图片
goodsInfoDao.deleteImgByIds(deleteIds);
}
// 新增图片
List<GoodsImgDO> imgDOList = goodsAddVO.getImages().stream().filter(d -> d.getId() == null).map(d -> {
GoodsImgDO goodsImgDO = new GoodsImgDO(d);
goodsImgDO.setGoodsInfoId(goodsAddVO.getId());
return goodsImgDO;
}).collect(Collectors.toList());
if (imgDOList.size() != 0) {
goodsInfoDao.insertGoodsImgInfo(imgDOList);
}
// 删除视频
goodsInfoDao.deleteGoodsVideoById(goodsAddVO.getId());
// 插入视频
if (goodsAddVO.getGoodsVideo() != null) {
GoodsVideoDO goodsVideoDO = new GoodsVideoDO();
goodsVideoDO.setGoodsInfoId(goodsAddVO.getId());
goodsVideoDO.setVideoUrl(goodsAddVO.getGoodsVideo());
goodsInfoDao.insertVideoInfo(goodsVideoDO);
}
}
@Transactional(rollbackFor = Exception.class)
public void updateGoodsDetail(GoodsAddVO goodsAddVO) {
GoodsDetailDO goodsDetailDO = new GoodsDetailDO(goodsAddVO.getGoodsDetailVO()).setGoodsInfoId(goodsAddVO.getId());
// 商品详情修改
goodsInfoDao.updateGoodsDetail(goodsDetailDO);
}
}
...@@ -4,10 +4,10 @@ import com.mmc.pms.common.ResultBody; ...@@ -4,10 +4,10 @@ import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum; import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.MiniProgramProductMallDao; import com.mmc.pms.dao.MiniProgramProductMallDao;
import com.mmc.pms.dao.WebDeviceDao; import com.mmc.pms.dao.WebDeviceDao;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.*; import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.GoodsInfoQO; import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.vo.GoodsProductSkuVO;
import com.mmc.pms.page.PageResult; import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.MiniProgramProductMallService; import com.mmc.pms.service.MiniProgramProductMallService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -19,7 +19,6 @@ import java.util.ArrayList; ...@@ -19,7 +19,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @Author small @Date 2023/5/16 15:08 @Version 1.0 * @Author small @Date 2023/5/16 15:08 @Version 1.0
...@@ -27,122 +26,124 @@ import java.util.stream.Stream; ...@@ -27,122 +26,124 @@ import java.util.stream.Stream;
@Service @Service
public class MiniProgramProductMallServiceImpl implements MiniProgramProductMallService { public class MiniProgramProductMallServiceImpl implements MiniProgramProductMallService {
@Autowired private MiniProgramProductMallDao goodsInfoDao; @Autowired
@Autowired private WebDeviceDao webDeviceDao; private MiniProgramProductMallDao goodsInfoDao;
@Autowired
private WebDeviceDao webDeviceDao;
@Override @Override
public ResultBody getAppGoodsInfoDetail(Integer goodsId) { public ResultBody getAppGoodsInfoDetail(Integer goodsId) {
// 查询此商品是否下架或删除 // 查询此商品是否下架或删除
GoodsInfoDO goodsInfoDO = goodsInfoDao.getGoodsInfoByGoodsId(goodsId); GoodsInfoDO goodsInfoDO = goodsInfoDao.getGoodsInfoByGoodsId(goodsId);
if (goodsInfoDO == null || goodsInfoDO.getShelfStatus().equals(0)) { if (goodsInfoDO == null || goodsInfoDO.getShelfStatus().equals(0)) {
return ResultBody.error(ResultEnum.SHOP_GOODS_NOT_ERROR); return ResultBody.error(ResultEnum.SHOP_GOODS_NOT_ERROR);
} }
AppGoodsInfoDetailDTO appGoodsInfoDetailDTO = new AppGoodsInfoDetailDTO(); AppGoodsInfoDetailDTO appGoodsInfoDetailDTO = new AppGoodsInfoDetailDTO();
appGoodsInfoDetailDTO appGoodsInfoDetailDTO
.setId(goodsInfoDO.getId()) .setId(goodsInfoDO.getId())
.setGoodsName(goodsInfoDO.getGoodsName()) .setGoodsName(goodsInfoDO.getGoodsName())
.setGoodsVideoId(goodsInfoDO.getGoodsVideoId()) .setGoodsVideoId(goodsInfoDO.getGoodsVideoId())
.setMasterTypeId(goodsInfoDO.getMasterTypeId()) .setMasterTypeId(goodsInfoDO.getMasterTypeId())
.setRepoId(goodsInfoDO.getRepoId()) .setRepoId(goodsInfoDO.getRepoId())
.setSortTypeId(goodsInfoDO.getSortTypeId()) .setSortTypeId(goodsInfoDO.getSortTypeId())
.setShelfStatus(goodsInfoDO.getShelfStatus()) .setShelfStatus(goodsInfoDO.getShelfStatus())
.setSlaveTypeId(goodsInfoDO.getSlaveTypeId()) .setSlaveTypeId(goodsInfoDO.getSlaveTypeId())
.setShareFlyServiceId(goodsInfoDO.getShareFlyServiceId()) .setShareFlyServiceId(goodsInfoDO.getShareFlyServiceId())
.setGoodsVideo(goodsInfoDO.getVideoUrl()) .setGoodsVideo(goodsInfoDO.getVideoUrl())
.setTag(goodsInfoDO.getTag()) .setTag(goodsInfoDO.getTag())
.setPid(goodsInfoDO.getPid()); .setPid(goodsInfoDO.getPid());
// 获取商品图片信息 // 获取商品图片信息
List<GoodsImgDO> goodsImgDO = goodsInfoDao.listGoodsInfoByGoodsId(goodsId); List<GoodsImgDO> goodsImgDO = goodsInfoDao.listGoodsInfoByGoodsId(goodsId);
appGoodsInfoDetailDTO.setImages( appGoodsInfoDetailDTO.setImages(
goodsImgDO.stream().map(GoodsImgDO::buildGoodsImgDTO).collect(Collectors.toList())); goodsImgDO.stream().map(GoodsImgDO::buildGoodsImgDTO).collect(Collectors.toList()));
// 获取商品详情信息 // 获取商品详情信息
GoodsDetailDO goodsDetailDO = goodsInfoDao.getGoodsDetailByGoodsId(goodsId); GoodsDetailDO goodsDetailDO = goodsInfoDao.getGoodsDetailByGoodsId(goodsId);
appGoodsInfoDetailDTO.setGoodsDetail(goodsDetailDO.buildGoodsDetailInfoDTO()); appGoodsInfoDetailDTO.setGoodsDetail(goodsDetailDO.buildGoodsDetailInfoDTO());
// 获取常见问题信息 // 获取常见问题信息
List<GoodsQaDO> goodsQaDO = goodsInfoDao.listGoodsQaInfoByGoodsId(goodsId); List<GoodsQaDO> goodsQaDO = goodsInfoDao.listGoodsQaInfoByGoodsId(goodsId);
appGoodsInfoDetailDTO.setQuestion( appGoodsInfoDetailDTO.setQuestion(
goodsQaDO.stream().map(GoodsQaDO::buildGoodsQaDTO).collect(Collectors.toList())); goodsQaDO.stream().map(GoodsQaDO::buildGoodsQaDTO).collect(Collectors.toList()));
// 获取其他服务信息 // 获取其他服务信息
List<GoodsServiceDO> goodsServiceDO = goodsInfoDao.listGoodsServiceByGoodsId(goodsId); List<GoodsServiceDO> goodsServiceDO = goodsInfoDao.listGoodsServiceByGoodsId(goodsId);
appGoodsInfoDetailDTO.setOtherService( appGoodsInfoDetailDTO.setOtherService(
goodsServiceDO.stream() goodsServiceDO.stream()
.map(GoodsServiceDO::buildGoodsOtherServiceDTO) .map(GoodsServiceDO::buildGoodsOtherServiceDTO)
.collect(Collectors.toList())); .collect(Collectors.toList()));
// 判断商品是什么类型 // 判断商品是什么类型
if (!goodsInfoDO.getSortTypeId().equals(2)) { if (!goodsInfoDO.getSortTypeId().equals(2)) {
// 获取该商品绑定的sku信息 // 获取该商品绑定的sku信息
List<MallProdSkuInfoDO> mallProdSkuInfo = goodsInfoDao.getMallProdInfoByGoodsId(goodsId); List<MallProdSkuInfoDO> mallProdSkuInfo = goodsInfoDao.getMallProdInfoByGoodsId(goodsId);
// 获取该商品绑定的规格信息 // 获取该商品绑定的规格信息
List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecList = List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecList =
goodsInfoDao.listMallProdSkuInfoSpec(goodsId); goodsInfoDao.listMallProdSkuInfoSpec(goodsId);
Map<Integer, List<MallProdSkuInfoSpecDO>> specMap = Map<Integer, List<MallProdSkuInfoSpecDO>> specMap =
mallProdSkuInfoSpecList.stream() mallProdSkuInfoSpecList.stream()
.collect(Collectors.groupingBy(MallProdSkuInfoSpecDO::getMallProdSkuInfoId)); .collect(Collectors.groupingBy(MallProdSkuInfoSpecDO::getMallProdSkuInfoId));
List<GoodsSpecDTO> list = List<GoodsSpecDTO> list =
mallProdSkuInfo.stream() mallProdSkuInfo.stream()
.map( .map(
d -> { d -> {
// 获取sku下规格信息 // 获取sku下规格信息
List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecDOList = specMap.get(d.getId()); List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpecDOList = specMap.get(d.getId());
List<ProductSpecDO> productSpecList = List<ProductSpecDO> productSpecList =
goodsInfoDao.listProductSpecInfo( goodsInfoDao.listProductSpecInfo(
mallProdSkuInfoSpecDOList.stream() mallProdSkuInfoSpecDOList.stream()
.map(MallProdSkuInfoSpecDO::getProductSpecId) .map(MallProdSkuInfoSpecDO::getProductSpecId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
List<MallProductSpecDTO> collect = List<MallProductSpecDTO> collect =
productSpecList.stream() productSpecList.stream()
.map(ProductSpecDO::buildMallProductSpecDTO) .map(ProductSpecDO::buildMallProductSpecDTO)
.collect(Collectors.toList());
collect.stream()
.peek(
m -> {
for (MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO :
mallProdSkuInfoSpecDOList) {
if (m.getProductSpec()
.equals(mallProdSkuInfoSpecDO.getProductSpecId())) {
m.setId(mallProdSkuInfoSpecDO.getId());
break;
}
}
})
.collect(Collectors.toList());
GoodsSpecDTO goodsSpecDTO = new GoodsSpecDTO();
goodsSpecDTO
.setId(d.getId())
.setSkuId(d.getProdSkuId())
.setGoodsSpecName(d.getProdSkuSpecName())
.setSkuName(d.getProductSkuName())
.setBrandInfoId(d.getBrandInfoId())
.setGoodsTypeId(d.getCategoryId())
.setTypeName(d.getTypeName())
.setChooseType(d.getChooseType())
.setSkuUnitId(d.getSkuUnitId())
.setUnitName(d.getUnitName())
.setMust(d.getMust())
.setProductSpecList(collect);
return goodsSpecDTO;
})
.collect(Collectors.toList()); .collect(Collectors.toList());
collect.stream() appGoodsInfoDetailDTO.setGoodsSpec(list);
.peek( } else {
m -> { appGoodsInfoDetailDTO.setGoodsSpec(getIndustrySpecInfo(goodsId));
for (MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO : }
mallProdSkuInfoSpecDOList) { return ResultBody.success(appGoodsInfoDetailDTO);
if (m.getProductSpec()
.equals(mallProdSkuInfoSpecDO.getProductSpecId())) {
m.setId(mallProdSkuInfoSpecDO.getId());
break;
}
}
})
.collect(Collectors.toList());
GoodsSpecDTO goodsSpecDTO = new GoodsSpecDTO();
goodsSpecDTO
.setId(d.getId())
.setSkuId(d.getProdSkuId())
.setGoodsSpecName(d.getProdSkuSpecName())
.setSkuName(d.getProductSkuName())
.setBrandInfoId(d.getBrandInfoId())
.setGoodsTypeId(d.getGoodsTypeId())
.setTypeName(d.getTypeName())
.setChooseType(d.getChooseType())
.setSkuUnitId(d.getSkuUnitId())
.setUnitName(d.getUnitName())
.setMust(d.getMust())
.setProductSpecList(collect);
return goodsSpecDTO;
})
.collect(Collectors.toList());
appGoodsInfoDetailDTO.setGoodsSpec(list);
} else {
appGoodsInfoDetailDTO.setGoodsSpec(getIndustrySpecInfo(goodsId));
} }
return ResultBody.success(appGoodsInfoDetailDTO);
}
@Override @Override
public ResultBody listGoodsByQO(GoodsInfoQO param) { public ResultBody listGoodsByQO(GoodsInfoQO param) {
int count = goodsInfoDao.countListGoodsByQO(param); int count = goodsInfoDao.countListGoodsByQO(param);
if (count == 0) { if (count == 0) {
return ResultBody.success( return ResultBody.success(
PageResult.buildPage(param.getPageNo(), param.getPageSize(), count)); PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
} }
int pageNo = param.getPageNo(); int pageNo = param.getPageNo();
param.buildCurrentPage(); param.buildCurrentPage();
List<GoodsInfoDO> list = goodsInfoDao.listGoodsByQO(param); List<GoodsInfoDO> list = goodsInfoDao.listGoodsByQO(param);
// 找出行业对应的序号 // 找出行业对应的序号
List<GoodsTypeDO> ids = goodsInfoDao.listIndustryIdBySort(); List<GoodsTypeDO> ids = goodsInfoDao.listIndustryIdBySort();
int order = 0; int order = 0;
/*if (param.getMasterTypeId() != null) { /*if (param.getMasterTypeId() != null) {
for (int i = 0; i < ids.size(); i++) { for (int i = 0; i < ids.size(); i++) {
if (param.getMasterTypeId().toString().equals(ids.get(i).getId().toString())) { if (param.getMasterTypeId().toString().equals(ids.get(i).getId().toString())) {
...@@ -151,88 +152,88 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall ...@@ -151,88 +152,88 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
} }
} }
}*/ }*/
List<AppGoodsInfoDTO> pageList = new ArrayList<>(); List<AppGoodsInfoDTO> pageList = new ArrayList<>();
for (GoodsInfoDO d : list) { for (GoodsInfoDO d : list) {
AppGoodsInfoDTO appGoodsInfoDTO = d.buildAppGoodsInfoDTO(); AppGoodsInfoDTO appGoodsInfoDTO = d.buildAppGoodsInfoDTO();
// 直接看该服务在当前行业对应所有服务中在第几个 // 直接看该服务在当前行业对应所有服务中在第几个
for (int j = 0; j < list.size(); j++) { for (int j = 0; j < list.size(); j++) {
if (appGoodsInfoDTO.getId().toString().equals(list.get(j).getId().toString())) { if (appGoodsInfoDTO.getId().toString().equals(list.get(j).getId().toString())) {
if (j < 9) { if (j < 9) {
appGoodsInfoDTO.setCode(order + "0" + (j + 1)); appGoodsInfoDTO.setCode(order + "0" + (j + 1));
} else { } else {
appGoodsInfoDTO.setCode(order + "" + (j + 1)); appGoodsInfoDTO.setCode(order + "" + (j + 1));
} }
break; break;
}
}
if (appGoodsInfoDTO.getShelfStatus() == 1) {
pageList.add(appGoodsInfoDTO);
}
} }
} return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
if (appGoodsInfoDTO.getShelfStatus() == 1) {
pageList.add(appGoodsInfoDTO);
}
} }
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
}
private List<GoodsSpecDTO> getIndustrySpecInfo(Integer goodsInfoId) { private List<GoodsSpecDTO> getIndustrySpecInfo(Integer goodsInfoId) {
// 获取商品对应绑定的行业sku信息 // 获取商品对应绑定的行业sku信息
List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList = goodsInfoDao.getMallIndustrySkuInfo(goodsInfoId); List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList = goodsInfoDao.getMallIndustrySkuInfo(goodsInfoId);
List<GoodsSpecDTO> list = mallIndustrySkuInfoList.stream().map(MallIndustrySkuInfoDO::buildGoodsSpecDTO).collect(Collectors.toList()); List<GoodsSpecDTO> list = mallIndustrySkuInfoList.stream().map(MallIndustrySkuInfoDO::buildGoodsSpecDTO).collect(Collectors.toList());
// 根据商品id查出该商品下绑定的规格信息 // 根据商品id查出该商品下绑定的规格信息
List<MallIndustrySkuInfoSpecDO> mallIndustrySkuInfoSpec = goodsInfoDao.getIndustrySkuInfoSpec(goodsInfoId); List<MallIndustrySkuInfoSpecDO> mallIndustrySkuInfoSpec = goodsInfoDao.getIndustrySkuInfoSpec(goodsInfoId);
list = list.stream().peek(d -> { list = list.stream().peek(d -> {
List<MallIndustrySpecDTO> industrySpec = new ArrayList<>(); List<MallIndustrySpecDTO> industrySpec = new ArrayList<>();
for (MallIndustrySkuInfoSpecDO e : mallIndustrySkuInfoSpec) { for (MallIndustrySkuInfoSpecDO e : mallIndustrySkuInfoSpec) {
if (d.getId().equals(e.getMallIndustrySkuInfoId())) { if (d.getId().equals(e.getMallIndustrySkuInfoId())) {
IndustrySpecDO industrySpecDO = e.getIndustrySpecDO(); IndustrySpecDO industrySpecDO = e.getIndustrySpecDO();
// 获取商品清单信息 // 获取商品清单信息
List<IndustryProductInventoryDO> industryProdInventory = goodsInfoDao.getIndustryProductInventory(e.getIndustrySpecId()); List<IndustryProductInventoryDO> industryProdInventory = goodsInfoDao.getIndustryProductInventory(e.getIndustrySpecId());
List<ProductInventoryVO> productInventoryList = new ArrayList<>(); List<ProductInventoryVO> productInventoryList = new ArrayList<>();
// 获取行业规格绑定的产品规格信息 // 获取行业规格绑定的产品规格信息
List<InventorySpecDO> inventorySpecDOList = goodsInfoDao.listInventorySpec(industryProdInventory.stream().map(IndustryProductInventoryDO::getId).collect(Collectors.toList())); List<InventorySpecDO> inventorySpecDOList = goodsInfoDao.listInventorySpec(industryProdInventory.stream().map(IndustryProductInventoryDO::getId).collect(Collectors.toList()));
Map<Integer, List<InventorySpecDO>> inventoryMap = inventorySpecDOList.stream().collect(Collectors.groupingBy(InventorySpecDO::getIndustryProductInventoryId)); Map<Integer, List<InventorySpecDO>> inventoryMap = inventorySpecDOList.stream().collect(Collectors.groupingBy(InventorySpecDO::getIndustryProductInventoryId));
getIndustrySpecOnProdSpecInfo(industryProdInventory, productInventoryList, inventoryMap); getIndustrySpecOnProdSpecInfo(industryProdInventory, productInventoryList, inventoryMap);
MallIndustrySpecDTO industrySpecDTO = industrySpecDO.buildMallIndustrySpecDTO(); MallIndustrySpecDTO industrySpecDTO = industrySpecDO.buildMallIndustrySpecDTO();
industrySpecDTO.setId(e.getId()); industrySpecDTO.setId(e.getId());
industrySpecDTO.setIndustrySpecId(e.getIndustrySpecId()); industrySpecDTO.setIndustrySpecId(e.getIndustrySpecId());
industrySpecDTO.setIndustrySkuId(d.getSkuId()); industrySpecDTO.setIndustrySkuId(d.getSkuId());
industrySpecDTO.setProductInventoryList(productInventoryList); industrySpecDTO.setProductInventoryList(productInventoryList);
industrySpec.add(industrySpecDTO); industrySpec.add(industrySpecDTO);
} }
} }
d.setIndustrySpecList(industrySpec); d.setIndustrySpecList(industrySpec);
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return list; return list;
} }
private void getIndustrySpecOnProdSpecInfo( private void getIndustrySpecOnProdSpecInfo(
List<IndustryProductInventoryDO> industryProdInventory, List<IndustryProductInventoryDO> industryProdInventory,
List<ProductInventoryVO> productInventoryList, List<ProductInventoryVO> productInventoryList,
Map<Integer, List<InventorySpecDO>> inventoryMap) { Map<Integer, List<InventorySpecDO>> inventoryMap) {
for (IndustryProductInventoryDO industryProductInventoryDO : industryProdInventory) { for (IndustryProductInventoryDO industryProductInventoryDO : industryProdInventory) {
List<InventorySpecDO> inventorySpec = inventoryMap.get(industryProductInventoryDO.getId()); List<InventorySpecDO> inventorySpec = inventoryMap.get(industryProductInventoryDO.getId());
if (!CollectionUtils.isEmpty(inventorySpec)) { if (!CollectionUtils.isEmpty(inventorySpec)) {
List<ProductSpecVO> productSpecList = List<ProductSpecVO> productSpecList =
inventorySpec.stream() inventorySpec.stream()
.map( .map(
in -> { in -> {
ProductSpecDO productSpecDetail = ProductSpecDO productSpecDetail =
goodsInfoDao.getProductSpecDetail(in.getProductSpecId()); goodsInfoDao.getProductSpecDetail(in.getProductSpecId());
ProductSpecVO productSpecVO = new ProductSpecVO(); ProductSpecVO productSpecVO = new ProductSpecVO();
BeanUtils.copyProperties(productSpecDetail, productSpecVO); BeanUtils.copyProperties(productSpecDetail, productSpecVO);
return productSpecVO; return productSpecVO;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
ProductSkuDO productSkuDetail = ProductSkuDO productSkuDetail =
goodsInfoDao.getProductSkuDetail(industryProductInventoryDO.getProductSkuId()); goodsInfoDao.getProductSkuDetail(industryProductInventoryDO.getProductSkuId());
GoodsProductSkuVO goodsProductSkuVO = new GoodsProductSkuVO(); GoodsProductSkuVO goodsProductSkuVO = new GoodsProductSkuVO();
BeanUtils.copyProperties(productSkuDetail, goodsProductSkuVO); BeanUtils.copyProperties(productSkuDetail, goodsProductSkuVO);
// 添加数据 // 添加数据
ProductInventoryVO productInventoryVO = new ProductInventoryVO(); ProductInventoryVO productInventoryVO = new ProductInventoryVO();
productInventoryVO.setSelect(industryProductInventoryDO.getSelected()); productInventoryVO.setSelect(industryProductInventoryDO.getSelected());
productInventoryVO.setProductSku(goodsProductSkuVO); productInventoryVO.setProductSku(goodsProductSkuVO);
productInventoryVO.setProductSpecList(productSpecList); productInventoryVO.setProductSpecList(productSpecList);
productInventoryList.add(productInventoryVO); productInventoryList.add(productInventoryVO);
} }
}
} }
}
} }
package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.ProductSkuDao;
import com.mmc.pms.entity.ProductSkuDO;
import com.mmc.pms.entity.ProductSpecDO;
import com.mmc.pms.entity.ProductSpecPriceDO;
import com.mmc.pms.model.dto.*;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.ProductSkuService;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Service实现
* @createDate 2023-05-25 14:55:56
*/
@Service
public class ProductSkuServiceImpl implements ProductSkuService {
@Autowired
private ProductSkuDao productSkuDao;
@Override
public ResultBody addProductSku(ProductSkuVO param) {
// 获取名称判断此前是否已经存在
int count = productSkuDao.countSkuName(param);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
ProductSkuDO productSkuDO = new ProductSkuDO(param);
// 新增产品sku
int status = productSkuDao.insertProductSku(productSkuDO);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_ADD_DATA);
}
return ResultBody.success();
}
@Override
public ResultBody getProductSkuDetail(Integer id) {
// 校验此sku是否还存在或已删除
int count = productSkuDao.countSkuIsExist(id);
if (count <= 0) {
return ResultBody.error(ResultEnum.SKU_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
}
ProductSkuDO productSkuDO = productSkuDao.getProductSkuDetail(id);
return ResultBody.success(productSkuDO.buildProductSkuDTO());
}
@Override
public ResultBody editProductSku(ProductSkuVO param) {
// 获取名称判断此前是否已经存在
int count = productSkuDao.countSkuName(param);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
ProductSkuDO productSkuDO = new ProductSkuDO(param);
int status = productSkuDao.updateProductSku(productSkuDO);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_EDIT_DATA);
}
return ResultBody.success();
}
@Override
public ResultBody listPageProductSku(ProductSkuQO productSkuQO) {
int count = productSkuDao.countListPageProductSku(productSkuQO);
if (count == 0) {
return ResultBody.success(PageResult.buildPage(productSkuQO.getPageNo(), productSkuQO.getPageSize(), count));
}
Integer pageNo = productSkuQO.getPageNo();
productSkuQO.buildCurrentPage();
List<ProductSkuDO> productSkuList = productSkuDao.listPageProductSku(productSkuQO);
List<ProductSkuDTO> list = productSkuList.stream().map(ProductSkuDO::buildProductSkuDTO).collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageNo, productSkuQO.getPageSize(), count, list));
}
@Override
public ResultBody addOrEditProductSpec(ProductSpecVO param) {
// 获取名称判断此前是否已经存在
int count = productSkuDao.countSpecName(param);
if (count > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
if (param.getId() == null) {
ProductSpecDO productSpecDO = new ProductSpecDO(param);
// 新增产品sku
int status = productSkuDao.insertProductSpec(productSpecDO);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_ADD_DATA);
}
} else {
ProductSpecDO productSpecDO = new ProductSpecDO(param);
int status = productSkuDao.updateProductSpec(productSpecDO);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_EDIT_DATA);
}
}
return ResultBody.success();
}
@Override
public ResultBody getProductSpecDetail(Integer id) {
// 校验此sku是否还存在或已删除
int count = productSkuDao.countSpecIsExist(id);
if (count <= 0) {
return ResultBody.error(ResultEnum.SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
}
ProductSpecDO productSpecDO = productSkuDao.getProductSpecDetail(id);
return ResultBody.success(productSpecDO.buildProductSpecDTO());
}
@Override
public ResultBody listPageProductSpec(Integer pageNo, Integer pageSize, Integer productSkuId) {
int count = productSkuDao.countListPageProductSpec(productSkuId);
if (count == 0) {
return ResultBody.success(PageResult.buildPage(pageNo, pageSize, count));
}
List<ProductSpecDO> productSpecList = productSkuDao.listPageProductSpec((pageNo - 1) * pageSize, pageSize, productSkuId);
List<ProductSpecDTO> list = productSpecList.stream().map(ProductSpecDO::buildProductSpecDTO).collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageNo, pageSize, count, list));
}
@Override
public ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
// 判断该规格是否存在
int count = productSkuDao.countSpecIsExist(productSpecCPQVO.getProductSpecId());
if (count <= 0) {
return ResultBody.error(ResultEnum.SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED);
}
// 批量插入规格销售或租赁价格
return insertSpecPrice(productSpecCPQVO);
}
@Override
public List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO) {
// 批量插入规格价格
return productSpecCPQVO.getSpecPrice().stream().map(d -> {
ProductSpecPriceDO productSpecPriceDO = new ProductSpecPriceDO();
productSpecPriceDO.setCooperationTag(d.getCooperationTag());
productSpecPriceDO.setPrice(d.getPrice());
productSpecPriceDO.setType(productSpecCPQVO.getType());
productSpecPriceDO.setProductSpecId(productSpecCPQVO.getProductSpecId());
if (productSpecCPQVO.getType().equals(1)) {
productSpecPriceDO.setLeaseTerm(productSpecCPQVO.getLeaseTerm());
}
return productSpecPriceDO;
}).collect(Collectors.toList());
}
@Override
public ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
// 先删除原来该规格下的所有价格配置信息
productSkuDao.removeProductSpecCPQ(productSpecCPQVO);
// 批量插入规格销售或租赁价格
return insertSpecPrice(productSpecCPQVO);
}
@NotNull
public ResultBody insertSpecPrice(ProductSpecCPQVO productSpecCPQVO) {
List<ProductSpecPriceDO> list = getProductSpecPriceDOS(productSpecCPQVO);
// 批量插入规格销售价格
if (productSpecCPQVO.getType().equals(0)) {
int status = productSkuDao.batchInsertSpecPrice(list);
if (status <= 0) {
return ResultBody.error(ResultEnum.FAILED_TO_ADD_DATA);
}
} else {
// 批量插入租赁价格
productSkuDao.batchInsertLeaseSpecPrice(list);
}
return ResultBody.success();
}
@Override
public ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO) {
if (productSpecCPQVO.getType().equals(1) && productSpecCPQVO.getLeaseTerm() == null) {
return ResultBody.error("租赁期限不能为空!");
}
List<ProductSpecPriceDO> productSpecPriceList = productSkuDao.getProductSpecPrice(productSpecCPQVO);
List<ProductSpecPriceDTO> list = productSpecPriceList.stream()
.map(ProductSpecPriceDO::buildProductSpecPriceDTO).collect(Collectors.toList());
return ResultBody.success(list);
}
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.ProductSpecPriceDO;
import com.mmc.pms.model.dto.ProductSkuVO;
import com.mmc.pms.model.dto.ProductSpecVO;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.ProductSpecCPQVO;
import java.util.List;
/**
* @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Service
* @createDate 2023-05-25 14:55:56
*/
public interface ProductSkuService {
ResultBody addProductSku(ProductSkuVO param);
ResultBody getProductSkuDetail(Integer id);
ResultBody editProductSku(ProductSkuVO param);
ResultBody listPageProductSku(ProductSkuQO productSkuQO);
ResultBody addOrEditProductSpec(ProductSpecVO param);
ResultBody getProductSpecDetail(Integer id);
ResultBody listPageProductSpec(Integer pageNo, Integer pageSize, Integer productSkuId);
ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO);
ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
}
package com.mmc.pms.util;
import java.util.Random;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午3:17:24
* @explain 编号操作类
*/
public class CodeUtil {
private static Random random = new Random();
// 数据生成有位数字或字母的随机数
public static String randomCode(int num) {
// 0-61 9 9+26=35 35+26 =61 65-90 97-122
StringBuffer sb = new StringBuffer();
for (int i = 0; i < num; i++) {
int y = random.nextInt(62);
if (y <= 9) {
// 数值
sb.append(y);
} else {
if (y <= 35) {
// 大写字母
y += 55;
} else {
// 小写字母
y += 61;
}
sb.append((char) y);
}
}
return sb.toString();
}
/**
* 生成随机数字
*
* @param length[生成随机数的长度]
* @return
*/
public static String getRandomNum(int length) {
StringBuffer sb = new StringBuffer();
Random random = new Random();
for (int i = 0; i < length; i++) {
sb.append(String.valueOf(random.nextInt(10)));
}
return sb.toString();
}
/**
* 生成用户uid
*
* @return
*/
public static String createUserUID() {
return "UID" + CodeUtil.getRandomNum(7);
}
/**
* 生成-现金流水账目no
*/
public static String createPayCashNO() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-信用流水账目no
*/
public static String createPayCreditNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-飞手工资流水账目no
*/
public static String createPayWagNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成订单no
*/
public static String createOrderTaskNO() {
StringBuffer sb = new StringBuffer();
sb.append("D");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-信用返利账目no
*/
public static String createPayRebateNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成行业no
*/
public static String createIndustryNO() {
StringBuffer sb = new StringBuffer();
sb.append("HY");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成服务no
*/
public static String createInspectionNO() {
StringBuffer sb = new StringBuffer();
sb.append("FW");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成服务no
*/
public static String createRoleNo() {
StringBuffer sb = new StringBuffer();
sb.append("JS");
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成商品编号
*
* @return
*/
public static String createWareID() {
return "ID" + CodeUtil.getRandomNum(10);
}
/**
* 生成云仓订单编号
*/
public static String createRepoOrderNo() {
StringBuffer sb = new StringBuffer();
sb.append("R");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 云仓现金流水
*/
public static String createRepoCashNo() {
StringBuffer sb = new StringBuffer();
sb.append("J");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成商品编号
*
* @return
*/
public static String createDeviceCode() {
return "DC" + CodeUtil.getRandomNum(6);
}
/**
* 云仓现金流水
*/
public static String createOrderRefund() {
StringBuffer sb = new StringBuffer();
sb.append("RD");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 返祖订单号
*/
public static String createShareOrderNo() {
StringBuffer sb = new StringBuffer();
sb.append("GX");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 型号编号
*/
public static String createDeviceModelNo() {
return "DM" + CodeUtil.getRandomNum(8);
}
/**
* 仓库编号
*/
public static String createRepoNo() {
return "RN" + CodeUtil.getRandomNum(8);
}
public static String uavOrderCode(Long id) {
StringBuffer sb = new StringBuffer();
sb.append("UD");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmmss"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 活动编号
*/
public static String generateActivityNo() {
return "AC" + CodeUtil.getRandomNum(5);
}
}
package com.mmc.pms.util;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/**
* @Author small @Date 2023/5/23 10:16 @Version 1.0
*/
@Slf4j
public class FileLoadUtil {
/**
* 批量生成文件
*
* @throws IOException
* @throws IllegalStateException
*/
public static ResultBody bathCreateFile(String directory, MultipartFile[] files)
throws IllegalStateException, IOException {
if (files == null || files.length == 0) {
return ResultBody.error(
ResultEnum.FILE_UPLOAD_NULL_ERROR.getResultCode(),
ResultEnum.FILE_UPLOAD_NULL_ERROR.getResultMsg());
}
List<String> downloadPaths = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
String filename = FileLoadUtil.createNewFileName(files[i].getOriginalFilename());
// 创建新路径
String newFileDir = FileLoadUtil.createFileDirctory(directory);
// 创建文件对象
File uploadFile = new File(newFileDir + filename);
if (!uploadFile.getParentFile().exists()) {
uploadFile.getParentFile().mkdirs();
}
while (uploadFile.exists()) { // 文件名重复
filename = filename + "(" + i + ")";
uploadFile = new File(newFileDir + filename);
i++;
}
uploadFile.createNewFile();
files[i].transferTo(uploadFile);
downloadPaths.add(FileLoadUtil.createDownLoadPath(directory, filename));
}
return ResultBody.success(downloadPaths);
}
/**
* 文件名
*
* @param originalFilename
* @return
*/
public static String createNewFileName(String originalFilename) {
int i = originalFilename.lastIndexOf('.');
String endWith = "";
StringBuffer sb = new StringBuffer();
if (i >= 0) {
endWith = originalFilename.substring(i);
}
sb.append(System.currentTimeMillis());
sb.append(endWith);
return sb.toString();
}
/** 文件夹路径 */
public static String createFileDirctory(String directory) {
return FileServletConstant.MOUNTVOLUME
+ directory
+ File.separator
+ TDateUtil.getCurrentDateByType("yyyyMMdd")
+ File.separator;
}
/** 解析下载路径 */
public static String explainLoadPath(String path) {
return FileServletConstant.MOUNTVOLUME + path.replaceAll("@", FileServletConstant.separator);
}
/** 生成下载地址 */
public static String createDownLoadPath(String directory, String filename) {
return FileServletConstant.DOWNLOADPATH
+ directory
+ "@"
+ TDateUtil.getCurrentDateByType("yyyyMMdd")
+ "@"
+ filename;
}
/**
* 判断文件大小
*
* @param len
* @param size
* @param unit
*/
public static boolean checkFileSize(Long len, int size, String unit) {
double fileSize = 0;
if ("B".equals(unit.toUpperCase())) {
fileSize = (double) len;
} else if ("K".equals(unit.toUpperCase())) {
fileSize = (double) len / 1024;
} else if ("M".equals(unit.toUpperCase())) {
fileSize = (double) len / 1048576;
} else if ("G".equals(unit.toUpperCase())) {
fileSize = (double) len / 1073741824;
}
if (fileSize > size) {
return false;
}
return true;
}
/**
* 将文件头转换成16进制字符串
*
* @return 16进制字符串
*/
private static String bytesToHexString(byte[] src) {
StringBuilder stringBuilder = new StringBuilder();
if (src == null || src.length <= 0) {
return null;
}
for (int i = 0; i < src.length; i++) {
int v = src[i] & 0xFF;
String hv = Integer.toHexString(v);
if (hv.length() < 2) {
stringBuilder.append(0);
}
stringBuilder.append(hv);
}
return stringBuilder.toString();
}
/**
* 得到文件头
*
* @return 文件头
* @throws IOException
*/
private static String getFileContent(InputStream is) throws IOException {
final int len = 20;
byte[] b = new byte[len];
final boolean isMark = is.markSupported();
if (isMark) {
is.mark(len);
}
try {
is.read(b, 0, len);
} catch (IOException e) {
log.warn("读取文件头信息失败: ", e);
throw e;
} finally {
if (isMark) {
is.reset();
}
}
return bytesToHexString(b);
}
public static FileTypeConstant getType(InputStream is) throws IOException {
return getType(getFileContent(is));
}
public static FileTypeConstant getType(final byte[] bytes) throws IOException {
return getType(bytesToHexString(bytes));
}
public static FileTypeConstant getType(String fileHead) throws IOException {
if (fileHead == null || fileHead.length() == 0) {
return null;
}
fileHead = fileHead.toUpperCase();
FileTypeConstant[] fileTypes = FileTypeConstant.values();
for (FileTypeConstant type : fileTypes) {
String s = type.getValue().toUpperCase();
if (fileHead.contains(type.getValue().toUpperCase())) {
return type;
}
}
return null;
}
public static Integer checkFileType(FileTypeConstant value) {
Integer type = 4; // 其他
// 图片
FileTypeConstant[] pics = {
FileTypeConstant.JPEG, FileTypeConstant.PNG, FileTypeConstant.BMP, FileTypeConstant.GIF
};
FileTypeConstant[] docs = {
FileTypeConstant.PST,
FileTypeConstant.XLS_DOC,
FileTypeConstant.XLSX_DOCX,
FileTypeConstant.WPS,
FileTypeConstant.PDF,
FileTypeConstant.PPTX_DOCX
};
FileTypeConstant[] videos = {
FileTypeConstant.AVI,
FileTypeConstant.RAM,
FileTypeConstant.RM,
FileTypeConstant.MPG,
FileTypeConstant.MOV,
FileTypeConstant.ASF,
FileTypeConstant.MP4,
FileTypeConstant.FLV,
FileTypeConstant.MID
};
// 图片
for (FileTypeConstant fileType : pics) {
if (fileType.equals(value)) {
type = 1;
}
}
// 文档
for (FileTypeConstant fileType : docs) {
if (fileType.equals(value)) {
type = 2;
}
}
// 视频
for (FileTypeConstant fileType : videos) {
if (fileType.equals(value)) {
type = 3;
}
}
return type;
}
}
package com.mmc.pms.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.File;
/**
* @Author small @Date 2023/5/23 10:24 @Version 1.0
*/
@Component
public class FileServletConstant {
public static String MOUNTVOLUME;
public static String separator;
public static String DOWNLOADPATH; // 下载地址
public FileServletConstant(
@Value("${mount.directory}") String mountVolume,
@Value("${mmcflying.download.path}") String downloadPath) {
if (File.separator.equals("\\")) {
separator = "\\\\";
} else {
separator = File.separator;
}
MOUNTVOLUME = mountVolume.replaceAll("@", separator);
DOWNLOADPATH = downloadPath;
}
}
package com.mmc.pms.util;
/**
* @Author small @Date 2023/5/23 10:17 @Version 1.0
*/
public enum FileTypeConstant {
/** JEPG. */
JPEG("FFD8FF"),
/** PNG. */
PNG("89504E47"),
/** Windows Bitmap. */
BMP("424D"),
/** GIF. */
GIF("47494638"),
/** Outlook (pst). */
PST("2142444E"),
/** MS Word/Excel. */
XLS_DOC("D0CF11E0"),
XLSX_DOCX("504B030414000600080000002100"),
PPTX_DOCX("504B03040A0000000000874EE240000000000000"),
XLSX_DOC("504B03041400000008000A52F64E926EBD1F8501"),
/** WPS文字wps、表格et、演示dps都是一样的 */
WPS("D0CF11E0A1B11AE10000"),
/** Adobe Acrobat. */
PDF("255044462D312E"),
/** Wave. */
WAV("57415645"),
/** AVI. */
AVI("41564920"),
/** Real Audio. */
RAM("2E7261FD"),
/** Real Media. */
RM("2E524D46"),
/** MPEG (mpg). */
MPG("000001BA"),
/** Quicktime. */
MOV("6D6F6F76"),
/** Windows Media. */
ASF("3026B2758E66CF11"),
/** MIDI. */
MID("4D546864"),
/** MP4. */
// MP4("00000020667479706"),
// mp4("00000018667479706D70"),
MP4("667479706"),
/** MP3. */
MP3("49443303000000002176"),
/** FLV. */
FLV("464C5601050000000900");
private String value = "";
/**
* Constructor.
*
* @param value
*/
private FileTypeConstant(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.mmc.pms.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @Author small @Date 2023/5/23 10:26 @Version 1.0
*/
@Component
public class OssConstant {
public static String ENDPOINT;
public static String ACCESSKEYID;
public static String ACCESSKEYSECRET;
public static String BUCKET;
public OssConstant(
@Value("${aliyun.oss.endpoint}") String endPoint,
@Value("${aliyun.oss.access-key-id}") String accessKeyId,
@Value("${aliyun.oss.access-key-secret}") String accessKeySecret,
@Value("${aliyun.oss.bucket}") String bucket) {
ENDPOINT = endPoint;
ACCESSKEYID = accessKeyId;
ACCESSKEYSECRET = accessKeySecret;
BUCKET = bucket;
}
}
package com.mmc.pms.util;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small @Date 2023/5/23 13:48 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PartUploadInfo implements Serializable {
private static final long serialVersionUID = 4138719631627565554L;
private String uploadId;
private String bucketName;
private String objectName;
}
package com.mmc.pms.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @Author small @Date 2023/5/23 10:25 @Version 1.0
*/
public class TDateUtil {
public static final String ONE_WEEK = "oneweek";
public static final String ONE_MONTH = "onemonth";
public static final String THREE_MONTH = "threemonth";
public static final String SIX_MONTH = "sixmonth";
public static final String ONE_YEAR = "oneyear";
public static String getCurrentDate() {
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm"); // 设置日期格式
String date = df.format(new Date()); // new Date()为获取当前系统时间
return date;
}
public static String getCurrentDateByType(String format) {
SimpleDateFormat df = new SimpleDateFormat(format); // 设置日期格式
String date = df.format(new Date()); // new Date()为获取当前系统时间
return date;
}
public static String getCurrentDateMidd() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
String date = df.format(new Date()); // new Date()为获取当前系统时间
return date;
}
public static Date getDate(String str, String format) {
Date date = null;
try {
SimpleDateFormat df = new SimpleDateFormat(format); // 设置日期格式
// String dates=df.format(new Date());// new Date()为获取当前系统时间
date = df.parse(str);
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
/** date类型转字符串 */
public static String getDateStr(Date date, String type) {
SimpleDateFormat format = new SimpleDateFormat(type);
String s = format.format(date);
return s;
}
/** 根据日期获得随机数 */
public static Integer getDateRandom(Date date, String format, int count) {
String code = "";
for (int i = 0; i < count; i++) {
code = code + (int) (Math.random() * 9);
}
code = TDateUtil.getDateStr(date, format) + code;
return Integer.parseInt(code);
}
/**
* 10位数的秒转日期字符
*
* @param mss
* @return
*/
public static Date dateFromSecond(long sceondTime) {
return new Date(sceondTime * 1000);
}
/**
* 10位数的秒转日期字符
*
* @param mss
* @return
*/
public static String dateFromSecondStr(long sceondTime) {
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(sceondTime * 1000));
}
/**
* 秒转时分秒
*
* @param secondTime
* @return
*/
public static String hmsFromSecond(Integer secondTime) {
Integer hour = secondTime / 60 / 60;
Integer minutes = secondTime / 60 % 60;
Integer remainingSeconds = secondTime % 60;
return (hour + "h" + minutes + "min" + remainingSeconds + "s");
}
public static String hmsFromSecondFormat(long secondTime) {
long day = secondTime / 60 / 60 / 24;
long hour = secondTime / 60 / 60 % 24;
long minutes = secondTime / 60 % 60;
long remainingSeconds = secondTime % 60;
if (day > 0) {
return (day + "天" + hour + "小时" + minutes + "分" + remainingSeconds + "秒");
}
return (hour + "小时" + minutes + "分" + remainingSeconds + "秒");
}
/**
* 两个日期的相差秒数
*
* @param maxDate
* @param minDate
* @return
*/
public static long calLastedTime(Date maxDate, Date minDate) {
long a = maxDate.getTime();
long b = minDate.getTime();
long c = (a - b) / 1000;
return c;
}
/** 获取某个月的月底最后一天的时间 */
public static Date getMonthLatestDay(Date date) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前月最后一天
Calendar ca = Calendar.getInstance();
ca.setTime(date);
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
String last = format.format(ca.getTime());
Date dates = getDate(last, "yyyy-MM-dd");
return dates;
}
/** 某个时间 加N天 */
public static Date nextNumDay(Date d, int num) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
Date now = d;
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.DAY_OF_MONTH, num);
String last = format.format(calendar.getTime());
date = getDate(last, "yyyy-MM-dd");
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
/**
* 某天个时间加 N 小时
*
* @param now
* @param num
* @return
*/
public static Date addHourTime(Date now, int num) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.HOUR, num);
String last = format.format(calendar.getTime());
date = getDate(last, "yyyy-MM-dd HH:mm:ss");
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
/** 某个时间加n个月加n天(负数为减) */
@SuppressWarnings("static-access")
public static Date getMonthNDayN(Date date, int month, int day) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date news = null;
try {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, month);
calendar.add(calendar.DATE, day);
String last = format.format(calendar.getTime());
news = getDate(last, "yyyy-MM-dd");
} catch (Exception e) {
e.printStackTrace();
}
return news;
}
/** 时间戳-计算小时 */
public static long getDistanceTime(long time1, long time2) {
long diff = 0;
long day = 0;
long hour = 0;
if (time1 < time2) {
diff = time2 - time1;
} else {
diff = time1 - time2;
}
day = diff / (24 * 60 * 60 * 1000);
hour = (diff / (60 * 60 * 1000) - day * 24);
return hour;
}
/**
* 两个时间之间相差距离多少天
*
* @param one 时间参数 1:
* @param two 时间参数 2:
* @return 相差天数
*/
public static int distanceDays(Date one, Date two) {
int days = 0;
long time1 = one.getTime();
long time2 = two.getTime();
long diff;
if (time1 < time2) {
diff = time2 - time1;
} else {
diff = time1 - time2;
}
days = new Long(diff / (1000 * 60 * 60 * 24)).intValue();
return days;
}
public static Date nextNumDateTime(Date d, int num) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
Date now = d;
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.DAY_OF_MONTH, num);
String last = format.format(calendar.getTime());
date = getDate(last, "yyyy-MM-dd HH:mm:ss");
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
public static String createYearWeek(String startStr, String endStr) {
if (startStr == null || "".equals(startStr) || endStr == null || "".equals(endStr)) {
return "起止日期不能为空";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date start = null;
Date end = null;
Date startDate;
Date endDate;
int dayOfWeek;
boolean goOn = true;
int no = 0;
try {
start = sdf.parse(startStr);
end = sdf.parse(endStr);
} catch (ParseException e) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
try {
start = simpleDateFormat.parse(startStr);
end = simpleDateFormat.parse(endStr);
} catch (ParseException pe) {
pe.printStackTrace();
}
}
if (start.compareTo(end) > -1) {
return "结束日期必须大于开始日期";
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(start);
dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
List<Map<String, String>> weekList = new ArrayList<>();
if (dayOfWeek > 1 && dayOfWeek < 7) {
do {
startDate = start;
calendar.add(Calendar.DATE, (8 - dayOfWeek));
endDate = calendar.getTime();
no += 1;
Map<String, String> map = new HashMap<>();
map.put("startOfWeek", sdf.format(startDate));
map.put("weekNo", no + "");
if (endDate.compareTo(end) < 0) {
map.put("endOfWeek", sdf.format(endDate));
weekList.add(map);
calendar.add(Calendar.DATE, 1);
start = calendar.getTime();
dayOfWeek = 2;
} else {
map.put("endOfWeek", sdf.format(end));
weekList.add(map);
goOn = false;
}
} while (goOn);
} else {
no += 1;
startDate = start;
if (dayOfWeek == 1) {
endDate = start;
} else {
calendar.add(Calendar.DATE, 1);
endDate = calendar.getTime();
}
Map<String, String> map = new HashMap<>();
map.put("startOfWeek", sdf.format(startDate));
map.put("endOfWeek", sdf.format(endDate));
map.put("weekNo", no + "");
weekList.add(map);
calendar.add(Calendar.DATE, 1);
start = calendar.getTime();
do {
startDate = start;
calendar.add(Calendar.DATE, 6);
endDate = calendar.getTime();
no += 1;
map = new HashMap<>();
map.put("startOfWeek", sdf.format(startDate));
map.put("weekNo", no + "");
if (endDate.compareTo(end) < 0) {
map.put("endOfWeek", sdf.format(endDate));
weekList.add(map);
calendar.add(Calendar.DATE, 1);
start = calendar.getTime();
} else {
map.put("endOfWeek", sdf.format(end));
weekList.add(map);
goOn = false;
}
} while (goOn);
}
return weekList.toString();
}
/**
* 获取起止日期
*
* @param sdf 需要显示的日期格式
* @param date 需要参照的日期
* @param n 最近n周
* @param option 0 开始日期;1 结束日期
* @param k 0 包含本周 1 不包含本周
* @return
*/
public static String getFromToDate(SimpleDateFormat sdf, Date date, int n, int option, int k) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
int offset = 0 == option ? 1 - dayOfWeek : 7 - dayOfWeek;
int amount = 0 == option ? offset - (n - 1 + k) * 7 : offset - k * 7;
calendar.add(Calendar.DATE, amount);
return sdf.format(calendar.getTime());
}
/**
* 根据当前日期获得最近n周的日期区间(包含本周)
*
* @param n
* @param sdf
* @return
*/
public static String getNWeekTimeInterval(int n, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(format); // 设置日期格式
String beginDate = getFromToDate(sdf, new Date(), n, 0, 0);
String endDate = getFromToDate(sdf, new Date(), n, 1, 0);
return beginDate + "," + endDate;
}
/**
* 根据当前日期获得最近n周的日期区间(不包含本周)
*
* @param n
* @param sdf
* @return
*/
public static String getNWeekTimeIntervalTwo(int n, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(format); // 设置日期格式
String beginDate = getFromToDate(sdf, new Date(), n, 0, 1);
String endDate = getFromToDate(sdf, new Date(), n, 1, 1);
return beginDate + "," + endDate;
}
/**
* 根据当前日期获得本周的日期区间(本周周一和周日日期)
*
* @param sdf
* @return
*/
public static String getThisWeekTimeInterval(String format) {
return getNWeekTimeInterval(1, format);
}
/**
* 根据当前日期获得上周的日期区间(上周周一和周日日期)
*
* @param sdf
* @return
*/
public static String getLastWeekTimeInterval(String format) {
return getNWeekTimeIntervalTwo(1, format);
}
/**
* 获取某个日期最近一个的星期日
*
* @return
*/
public static Date getLatestWeekend(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
Date endDate = TDateUtil.nextNumDay(date, w * -1);
return endDate;
}
/**
* 获取N周的星期一的日期(正加负减)
*
* @param date
* @return
*/
public static Date getMinMonday(Date date, int weekNum) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
Date endDate = TDateUtil.nextNumDay(date, w * -1);
Date startDate = TDateUtil.nextNumDay(endDate, (weekNum * 7) + 1);
return startDate;
}
/** 获取某个月加几个月后一号的日期 */
@SuppressWarnings("static-access")
public static Date getAddMonThDay(Date date, int i) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(calendar.MONTH, i);
calendar.set(Calendar.DAY_OF_MONTH, 1);
String last = format.format(calendar.getTime());
date = getDate(last, "yyyy-MM-dd");
return date;
}
/** 某个月最后一天 */
public static Date getAnyMonthLastDay(Date date) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前月最后一天
Calendar ca = Calendar.getInstance();
ca.setTime(date);
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
String last = format.format(ca.getTime());
date = getDate(last, "yyyy-MM-dd");
return date;
}
public static Date getDate(Date date, String type) {
SimpleDateFormat format = new SimpleDateFormat(type);
String s = format.format(date);
return getDate(s, type);
}
/** 获取去年今天的日期 */
public static Date getLastYearTodayDate() {
Calendar instance = Calendar.getInstance();
instance.add(Calendar.YEAR, -1);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String s = format.format(instance.getTime());
return getDate(s, "yyyy-MM-dd");
}
/**
* 获取昨天的日期
*
* @param type
* @return
*/
public static String getYesterdayDateByType(String type) {
Calendar instance = Calendar.getInstance();
instance.add(Calendar.DAY_OF_MONTH, -1);
Date time = instance.getTime();
SimpleDateFormat format = new SimpleDateFormat(type);
return format.format(time);
}
/** 判断两个时间是不是在同一个月 */
public static boolean isSameMonth(Date date1, Date date2) {
Calendar c = Calendar.getInstance();
c.setTime(date1);
int month1 = c.get(Calendar.MONTH);
c.setTime(date2);
int month2 = c.get(Calendar.MONTH);
if (month1 == month2) {
return true;
}
return false;
}
/**
* 间隔天数
*
* @param startTime
* @param endTime
* @return
*/
public static int isolateDayNum(String startTime, String endTime) {
Date startDate = getDate(startTime, "yyyy-MM-dd");
Date endDate = getDate(endTime, "yyyy-MM-dd");
long differentMillis = endDate.getTime() - startDate.getTime();
long dayNum = differentMillis / (1000 * 60 * 60 * 24);
return (int) dayNum;
}
/**
* 获取某月最后一天的时间
*
* @param yearMonth
* @return
*/
public static String getLastDateTimeOfMonth(String yearMonth) {
SimpleDateFormat format0 = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar instance = Calendar.getInstance();
try {
Date parse = format0.parse(yearMonth);
instance.setTime(parse);
instance.set(Calendar.DAY_OF_MONTH, instance.getActualMaximum(Calendar.DAY_OF_MONTH));
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
String format = format1.format(instance.getTime());
return format;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static Date getStrToDate(String str) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
Date date = null;
try {
if (str == null) {
date = null;
} else {
date = dateFormat.parse(str);
}
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public static int getStageByDate(Date date) {
Calendar instance = Calendar.getInstance();
instance.setTime(date);
// 当前时间
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
String format = dateFormat.format(date);
try {
Date currentTime = dateFormat.parse(format);
Date parse1 = dateFormat.parse("05:00:00");
Date parse2 = dateFormat.parse("11:00:00");
Date parse3 = dateFormat.parse("17:00:00");
Date parse4 = dateFormat.parse("00:00:00");
// A:05:00-11:00 | B:11:00-17:00 | C:00:00-05:00,17:00-00:00
if (currentTime.after(parse4) && currentTime.before(parse1)) {
return 3;
} else if (currentTime.after(parse1) && currentTime.before(parse2)) {
return 1;
} else if (currentTime.after(parse2) && currentTime.before(parse3)) {
return 2;
} else if (currentTime.after(parse3) && currentTime.after(parse4)) {
return 4;
}
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
public static String getCurrentYear() {
Calendar date = Calendar.getInstance();
String year = String.valueOf(date.get(Calendar.YEAR));
return year;
}
}
...@@ -2,17 +2,21 @@ spring: ...@@ -2,17 +2,21 @@ spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_pms?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://mysql.default:3306/iuav_pms?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: tmj username: tmj
password: MMC@2022&MYSQL password: MMC@2022&MYSQL
redis: redis:
database: 3 database: 3
host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com host: redis.default
port: 6379 port: 6379
password: MMC@2022&REDIS password: MMC@2022&REDIS
jedis: jedis:
pool: pool:
max-active: 2 max-active: 2
servlet:
multipart:
max-file-size: 200MB
max-request-size: 200MB
springfox: springfox:
documentation: documentation:
...@@ -20,4 +24,17 @@ springfox: ...@@ -20,4 +24,17 @@ springfox:
enabled: false enabled: false
enabled: true #开启文档 enabled: true #开启文档
aliyun:
oss:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: LTAI4FzCpyrA33PegnxWS6XV
access-key-secret: ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket: pad-video-x
mmcflying:
download:
path: /ossservlet/upload/download/
mount:
directory: D:@javaVolume@
...@@ -13,6 +13,22 @@ spring: ...@@ -13,6 +13,22 @@ spring:
jedis: jedis:
pool: pool:
max-active: 2 max-active: 2
servlet:
multipart:
max-file-size: 200MB
max-request-size: 200MB
#mybatis-plus
mybatis-plus:
global-config:
db-config:
id-type: auto
type-aliases-package: com.mmc.pms
mapper-locations: classpath*:mapper/**/*Dao.xml
configuration:
# 开启 "_" 转大写的驼峰功能
map-underscore-to-camel-case: true
# mybatis日志
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
springfox: springfox:
documentation: documentation:
...@@ -20,4 +36,17 @@ springfox: ...@@ -20,4 +36,17 @@ springfox:
enabled: false enabled: false
enabled: true #开启文档 enabled: true #开启文档
aliyun:
oss:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: LTAI4FzCpyrA33PegnxWS6XV
access-key-secret: ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket: pad-video-x
mmcflying:
download:
path: /ossservlet/upload/download/
mount:
directory: D:@javaVolume@
...@@ -2,20 +2,37 @@ spring: ...@@ -2,20 +2,37 @@ spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_pms?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://mysql.default:3306/iuav_pms?characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: tmj username: tmj
password: MMC@2022&MYSQL password: MMC@2022&MYSQL
redis: redis:
database: 3 database: 3
host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com host: redis.default
port: 6379 port: 6379
password: MMC@2022&REDIS password: MMC@2022&REDIS
jedis: jedis:
pool: pool:
max-active: 2 max-active: 2
servlet:
multipart:
max-file-size: 200MB
max-request-size: 200MB
springfox: springfox:
documentation: documentation:
swagger-ui: swagger-ui:
enabled: false enabled: false
enabled: true #开启文档 enabled: true #开启文档
aliyun:
oss:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: LTAI4FzCpyrA33PegnxWS6XV
access-key-secret: ILuNh3zJfRjg3iARSipMWBKCjglz3u
bucket: pad-video-x
mmcflying:
download:
path: /ossservlet/upload/download/
mount:
directory: D:@javaVolume@
...@@ -4,7 +4,7 @@ server: ...@@ -4,7 +4,7 @@ server:
context-path: /pms context-path: /pms
spring: spring:
profiles: profiles:
active: dev active: local
application: application:
name: pms name: pms
mvc: mvc:
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.pms.dao.BrandManageDao">
<insert id="insertBrandInfo">
insert into brand_info (brand_name)
values (#{brandName});
</insert>
<update id="removeBrandInfoById">
update brand_info
set is_delete = 1
where id = #{id}
</update>
<update id="updateBrandInfo">
update brand_info
set brand_name = #{brandName}
where id = #{id}
</update>
<select id="countBrandInfoByName" resultType="java.lang.Integer">
select count(*)
from brand_info
where brand_name = #{brandName}
<if test="id!=null and id!=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="listBrandInfo" resultType="com.mmc.pms.entity.BrandInfoDO">
select id, brand_name, create_time
from brand_info
where is_delete = 0
order by create_time desc
limit #{itemIndex}, #{pageSize}
</select>
<select id="listBrandInfoByIds" resultType="com.mmc.pms.entity.BrandInfoDO">
select id,brand_name
from brand_info
where id in( <foreach collection="ids" separator="," index="index" item="item">
#{item}
</foreach>)
</select>
<select id="countBrandInfo" resultType="java.lang.Integer">
select count(*)
from brand_info
where is_delete = 0
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.pms.dao.CategoriesDao">
<resultMap id="BaseResultMap" type="com.mmc.pms.entity.Categories">
<id property="id" column="id" jdbcType="OTHER"/>
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="icon" column="icon" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="sort" column="sort" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="TINYINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="deleted" column="is_deleted" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id
,parent_id,name,
icon,description,sort,
type,create_time,update_time,
is_deleted
</sql>
<insert id="insertDirectory">
insert into directory(directory_name, relevance,
`type`)
values (#{directoryName}, #{relevance}, #{type})
</insert>
<insert id="insertClassification">
insert into categories (parent_id,
directory_id,
`name`,
icon,
description,
sort,
`type`, remark)
values (#{parentId}, #{directoryId}, #{name}, #{icon}, #{description}, #{sort}, #{type}, #{remark})
</insert>
<update id="updateDirectory">
update directory
set directory_name = #{directoryName},
relevance = #{relevance},
`type` = #{type}
where id = #{id}
</update>
<update id="removeDirectory">
update directory
set is_deleted = 1
where id = #{id}
</update>
<update id="updateClassification">
update categories
<set>
<if test="name != null and name != ''">
`name` = #{classifyName},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="icon != null and icon != ''">
icon = #{icon},
</if>
<if test="remark != null">
remark = #{remark}
</if>
</set>
where id = #{id}
</update>
<update id="updateTypeSort">
update categories
set sort = #{sort}
where id = #{id}
</update>
<select id="countUpdateDirectoryName" resultType="java.lang.Integer">
SELECT COUNT(*) FROM directory
WHERE directory_name = #{directoryName} and is_deleted = 0 and `type` = #{type}
<if test="id!=null and id!=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="countDirectoryList" resultType="java.lang.Integer">
select count(*)
from directory
where is_deleted = 0
</select>
<select id="directoryList" resultType="com.mmc.pms.entity.Directory">
select id,
directory_name,
relevance,
`type`,
create_time
from directory
where is_deleted = 0
</select>
<select id="countDirectory" resultType="java.lang.Integer">
SELECT count(*)
FROM directory d
INNER JOIN categories c ON d.id = c.directory_id
AND c.is_deleted = 0
WHERE d.id = #{id}
</select>
<select id="countClassificationByName" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM categories
WHERE `name` = #{classifyName} and `type` = #{type}
and is_deleted = 0
<if test="id!=null and id!=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="getCountCategoriesByPid" resultType="java.lang.Integer">
select count(*)
from categories
where parent_id = #{pid}
and `type` = #{type}
</select>
<select id="getGoodsGroupById" resultType="com.mmc.pms.entity.Categories">
select id,
parent_id,
directory_id,
`name`,
icon,
description,
sort,
`type`,
remark
from categories
where id = #{id}
</select>
<select id="selectAllClassification" resultType="com.mmc.pms.entity.Categories">
SELECT id,
parent_id,
directory_id,
`name`,
icon,
description,
sort,
`type`,
remark,
create_time
FROM categories
WHERE is_deleted = 0
AND directory_id = #{directoryId}
AND type = #{type}
ORDER BY sort asc
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="countListClassification" resultType="java.lang.Integer">
select count(*)
FROM categories
WHERE is_deleted = 0
AND directory_id = #{directoryId}
AND type = #{type}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.pms.dao.GoodsInfoDao">
<insert id="insertGoodsInfo" parameterType="com.mmc.pms.entity.GoodsInfo"
useGeneratedKeys="true" keyProperty="id">
insert into goods_info(goods_no,
goods_name,
directory_id,
category_by_one,
category_by_two,
eco_label,
shelf_status,
sort,
goods_type,
add_goods_user_id)
values (#{goodsNo}, #{goodsName}, #{directoryId}, #{categoryByOne}, #{categoryByTwo}, #{ecoLabel},
#{shelfStatus}, #{sort}, #{goodsType}, #{addGoodsUserId})
</insert>
<insert id="insertGoodsImgInfo">
insert into
goods_img
(goods_info_id,img_url,img_type)
values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.goodsInfoId},
#{item.imgUrl},
#{item.imgType}
)
</foreach>
</insert>
<insert id="insertVideoInfo">
insert into goods_video
(goods_info_id, video_url)
values (#{goodsInfoId}, #{videoUrl})
</insert>
<insert id="insertGoodsDetail">
insert into goods_detail (goods_info_id, goods_desc, content, remark)
values (#{goodsInfoId}, #{goodsDesc}, #{content}, #{remark})
</insert>
<insert id="insertGoodsService">
insert into
goods_service
(goods_info_id,sale_service_id)
values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.goodsInfoId},
#{item.saleServiceId}
)
</foreach>
</insert>
<update id="updateGoodsInfo">
update goods_info
set goods_name = #{goodsName},
eco_label = #{ecoLabel},
category_by_one = #{categoryByOne},
category_by_two = #{categoryByTwo},
shelf_status = #{shelfStatus}
where id = #{id}
</update>
<update id="updateGoodsDetail">
update goods_detail
set goods_desc = #{goodsDesc},
content = #{content},
remark = #{remark}
where goods_info_id = #{goodsInfoId}
</update>
<update id="deleteImgByIds">
update goods_img set is_deleted = 1 where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="deleteGoodsVideoById">
update goods_video
set is_deleted = 1
where goods_info_id = #{goodsId}
</update>
<delete id="deleteGoodsServiceByGoodsId">
delete
from goods_service
where goods_info_id = #{goodsId}
</delete>
<select id="countGoodsInfoByName" resultType="java.lang.Integer">
select count(*)
from goods_info
where is_deleted = 0
and goods_name = #{goodsName}
<if test="id!=null and id!=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="countGoodsInfo" resultType="java.lang.Integer">
select count(*)
from goods_info
</select>
<select id="countGoodsInfoById" resultType="java.lang.Integer">
select count(*)
from goods_info
where id = #{id}
and is_deleted = 0
</select>
<select id="listGoodsInfoByGoodsId" resultType="com.mmc.pms.entity.GoodsImgDO">
SELECT id,
img_url,
img_type
FROM goods_img
WHERE is_deleted = 0
AND goods_info_id = #{id}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.pms.dao.ProductSkuDao">
<insert id="insertProductSku" parameterType="com.mmc.pms.entity.ProductSkuDO"
useGeneratedKeys="true" keyProperty="id">
insert into product_sku (product_name, categories_id, model, brand_info_id, directory_id)
values (#{productName}, #{categoriesId}, #{model}, #{brandInfoId}, #{directoryId})
</insert>
<insert id="insertProductSpec" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.pms.entity.ProductSpecDO">
insert into product_spec (product_sku_id, spec_name, spec_image, part_no, version_desc)
values (#{productSkuId}, #{specName}, #{specImage}, #{partNo}, #{versionDesc})
</insert>
<insert id="batchInsertSpecPrice" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.pms.entity.ProductSpecPriceDO">
insert into product_spec_price (product_spec_id,cooperation_tag,price,`type`)
values
<foreach collection="list" item="item" separator=",">
(#{item.productSpecId},#{item.cooperationTag},#{item.price},#{item.type})
</foreach>
</insert>
<insert id="batchInsertLeaseSpecPrice">
insert into product_spec_price (product_spec_id,cooperation_tag,price,`type`,lease_term)
values
<foreach collection="list" item="item" separator=",">
(#{item.productSpecId},#{item.cooperationTag},#{item.price},#{item.type},#{item.leaseTerm})
</foreach>
</insert>
<insert id="insertMallProdSkuInfo">
insert into mall_prod_sku_info (goods_info_id, prod_sku_id, prod_sku_spec_name, category_id, choose_type,
sku_unit_id, is_must, product_spec_id_list, flag)
values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categoryId}, #{chooseType}, #{skuUnitId}, #{must},
#{productSpecIdList}, #{flag})
</insert>
<update id="updateProductSku">
update product_sku
set product_name = #{productName},
categories_id = #{categoriesId},
model = #{model},
brand_info_id = #{brandInfoId},
where id = #{id}
</update>
<update id="updateProductSpec">
update product_spec
set spec_name = #{specName},
spec_image = #{specImage},
part_no = #{partNo},
version_desc = #{versionDesc},
product_sku_id = #{productSkuId}
where id = #{id}
</update>
<delete id="removeProductSpecCPQ">
DELETE
FROM product_spec_price
WHERE product_spec_id = #{id}
and `type` = #{type}
</delete>
<select id="countSkuName" resultType="java.lang.Integer">
select count(*) from product_sku
where product_name = #{productName} and is_deleted = 0
<if test="id !=null and id !=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="countSkuIsExist" resultType="java.lang.Integer">
select count(*)
from product_sku
where id = #{id}
and is_deleted = 0
</select>
<select id="getProductSkuDetail" resultType="com.mmc.pms.entity.ProductSkuDO">
SELECT ps.id,
ps.product_name,
ps.model,
ps.create_time,
c.`name` categoryName,
d.directory_name directoryName,
bi.brand_name brandName
FROM product_sku ps
INNER JOIN categories c ON ps.categories_id = c.id
INNER JOIN `directory` d ON ps.directory_id = d.id
LEFT JOIN brand_info bi ON ps.brand_info_id = bi.id
WHERE ps.id = #{id}
</select>
<select id="countListPageProductSku" resultType="java.lang.Integer">
select count(*) from product_sku
<where>
is_deleted = 0
and customize <![CDATA[<>]]> 1
<if test="productName != null and productName !=''">
and product_name like CONCAT ('%',#{productName},'%')
</if>
<if test="categoryId != null">
and categories = #{categoryId}
</if>
<if test="directoryId != null">
and directory_id = #{directoryId}
</if>
</where>
</select>
<select id="listPageProductSku" resultType="com.mmc.pms.entity.ProductSkuDO">
SELECT
SELECT
ps.id,
ps.product_name,
ps.model,
ps.create_time,
ps.brand_info_id,
ps.categories_id,
ps.directory_id,
c.`name` categoryName,
d.directory_name directoryName,
bi.brand_name brandName
FROM
product_sku ps
INNER JOIN categories c ON ps.categories_id = c.id
INNER JOIN `directory` d ON ps.directory_id = d.id
LEFT JOIN brand_info bi ON ps.brand_info_id = bi.id
<where>
ps.is_deleted = 0
and is_customize <![CDATA[<>]]> 1
<if test="productName != null and productName != ''">
and ps.product_name like CONCAT ('%',#{productName},'%')
</if>
<if test="categoryId != null">
and ps.categories_id = #{categoryId}
</if>
<if test="directoryId != null">
and ps.directory_id = #{directoryId}
</if>
</where>
order by ps.create_time desc
limit #{pageNo},#{pageSize}
</select>
<select id="countSpecName" resultType="java.lang.Integer">
select count(*) from product_spec
where spec_name = #{specName} and is_deleted = 0 and product_sku_id = #{productSkuId}
<if test="id !=null and id !=''">
and id <![CDATA[<>]]> #{id}
</if>
</select>
<select id="countSpecIsExist" resultType="java.lang.Integer">
select count(*)
from product_spec
where id = #{id}
and is_deleted = 0
</select>
<select id="getProductSpecDetail" resultType="com.mmc.pms.entity.ProductSpecDO">
select id,
product_sku_id productSkuId,
spec_name specName,
spec_image specImage,
part_no partNo,
version_desc versionDesc,
create_time createTime
from product_spec
where id = #{id}
</select>
<select id="countListPageProductSpec" resultType="java.lang.Integer">
select count(*)
from product_spec
where is_deleted = 0
and product_sku_id = #{id}
</select>
<select id="listPageProductSpec" resultType="com.mmc.pms.entity.ProductSpecDO">
select id,
product_sku_id productSkuId,
spec_name specName,
spec_image specImage,
part_no partNo,
version_desc versionDesc,
create_time createTime
from product_spec
where is_deleted = 0
and product_sku_id = #{productSkuId}
order by create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select id="getProductSpecPrice" resultType="com.mmc.pms.entity.ProductSpecPriceDO">
select id,
product_spec_id productSpecId,
cooperation_tag cooperationTag,
price,
create_time createTime,
lease_term
from product_spec_price
<where>
product_spec_id = #{productSpecId}
and `type` =#{type}
<if test="leaseTerm != null">
and lease_term = #{leaseTerm}
</if>
</where>
</select>
</mapper>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<resultMap id="resultMapGoodsInfo" type="com.mmc.pms.entity.GoodsInfoDO"> <resultMap id="resultMapGoodsInfo" type="com.mmc.pms.entity.GoodsInfoDO">
<id property="id" column="id"/> <id property="id" column="id"/>
<result property="goodsName" column="goods_name"/> <result property="goodsName" column="goods_name"/>
<result property="goodsDesc" column="goods_desc"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="shelfStatus" column="shelf_status"/> <result property="shelfStatus" column="shelf_status"/>
<result property="masterTypeId" column="master_type_id"/> <result property="masterTypeId" column="master_type_id"/>
...@@ -78,6 +79,7 @@ ...@@ -78,6 +79,7 @@
gi.parts_id, gi.parts_id,
gi.mode_id, gi.mode_id,
gi.quality_id, gi.quality_id,
gd.goods_desc,
img.img_url, img.img_url,
gt.type_name AS master_type_name, gt.type_name AS master_type_name,
gty.type_name AS slave_type_name, gty.type_name AS slave_type_name,
...@@ -90,6 +92,7 @@ ...@@ -90,6 +92,7 @@
LEFT JOIN goods_type gt ON gt.id = gi.master_type_id LEFT JOIN goods_type gt ON gt.id = gi.master_type_id
LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id LEFT JOIN goods_type gty ON gty.id = gi.slave_type_id
LEFT JOIN sort_type st ON st.id = gi.sort_type_id LEFT JOIN sort_type st ON st.id = gi.sort_type_id
LEFT JOIN goods_detail gd ON gd.goods_info_id = gi.id
<where> <where>
gi.is_deleted = 0 gi.is_deleted = 0
<if test="districtId != null"> <if test="districtId != null">
...@@ -108,7 +111,7 @@ ...@@ -108,7 +111,7 @@
and (gi.quality_id = #{qualityId}) and (gi.quality_id = #{qualityId})
</if> </if>
<if test="productCategoryId != null"> <if test="productCategoryId != null">
and (gi.sort_type_id = #{productCategoryId}) and (gi.goods_category_id = #{productCategoryId})
</if> </if>
</where> </where>
ORDER BY ORDER BY
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论