提交 a417060c 作者: zhenjie

Merge branch 'develop'

...@@ -73,7 +73,7 @@ jobs: ...@@ -73,7 +73,7 @@ jobs:
# 2.2 (Optional) Build and push image ACR EE # 2.2 (Optional) Build and push image ACR EE
- name: Build and push image to ACR EE - name: Build and push image to ACR EE
run: | run: |
mvn clean package mvn clean package -DskipTests
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" . docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
......
...@@ -75,7 +75,7 @@ jobs: ...@@ -75,7 +75,7 @@ jobs:
# 2.2 (Optional) Build and push image ACR EE # 2.2 (Optional) Build and push image ACR EE
- name: Build and push image to ACR EE - name: Build and push image to ACR EE
run: | run: |
mvn clean package mvn clean package -DskipTests
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" . docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
......
...@@ -32,3 +32,4 @@ build/ ...@@ -32,3 +32,4 @@ build/
### VS Code ### ### VS Code ###
.vscode/ .vscode/
kustomization/overlays/prod/kustomize kustomization/overlays/prod/kustomize
*.log
\ No newline at end of file
FROM openjdk:8-jdk-alpine FROM openjdk:8-jdk-alpine
#VOLUME ["/tmp","/files","/var/logs/"] VOLUME ["/var/log/app/"]
ARG JAVA_OPTS ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS ENV JAVA_OPTS=$JAVA_OPTS
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
......
# application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: pms-application
namespace: argocd
spec:
project: default # 项目名
source:
repoURL: http://git.mmcuav.cn/iuav/pms.git
targetRevision: HEAD #develop master # 分支名
path: kustomization/overlays/dev # 资源文件路径
destination:
server: https://kubernetes.default.svc # API Server 地址
namespace: dev # 部署应用的命名空间
# 默认情况下每 3 分钟会检测 Git 仓库一次
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
prune: true
...@@ -18,6 +18,9 @@ spec: ...@@ -18,6 +18,9 @@ spec:
containers: containers:
- name: pms - name: pms
image: REGISTRY/NAMESPACE/IMAGE:TAG image: REGISTRY/NAMESPACE/IMAGE:TAG
volumeMounts:
- name: log-of-app
mountPath: /var/log/app
resources: resources:
limits: limits:
memory: 1024Mi memory: 1024Mi
...@@ -30,3 +33,7 @@ spec: ...@@ -30,3 +33,7 @@ spec:
configMapKeyRef: configMapKeyRef:
name: pms-map name: pms-map
key: SPRING_PROFILES_ACTIVE key: SPRING_PROFILES_ACTIVE
volumes:
- name: log-of-app
hostPath:
path: /var/log/app
\ No newline at end of file
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
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,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: 4e0d17cc7a55f85a01edacf741e04cf2d303e9b1 newTag: 085325ec9d91bf422bd2e4ad311d7e4f5ef70cb3
...@@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication @SpringBootApplication
@EnableFeignClients @EnableFeignClients(basePackages = "com.mmc.pms.feign")
public class PmsApplication { public class PmsApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
package com.mmc.pms.auth;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.ClassPathResource;
import java.util.Objects;
/**
* Author: geDuo
* Date: 2022/6/2 17:26
*/
@Configuration
public class DataFilterYml {
@Bean
public static PropertySourcesPlaceholderConfigurer loadYml() {
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
yaml.setResources(new ClassPathResource("not-check.yml"));
configurer.setProperties(Objects.requireNonNull(yaml.getObject()));
return configurer;
}
}
package com.mmc.pms.auth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author: zj @Date: 2023/5/28 10:52
*/
@Configuration
public class MvcConfiguration implements WebMvcConfigurer {
@Autowired private TokenCheckHandleInterceptor tokenCheckHandleInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(tokenCheckHandleInterceptor);
WebMvcConfigurer.super.addInterceptors(registry);
}
}
package com.mmc.pms.auth;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import java.util.List;
/**
* @author: zj @Date: 2023/5/28 13:54
*/
@Data
@Configuration
@ConfigurationProperties(prefix = "data-filter", ignoreUnknownFields = false)
@PropertySource("classpath:not-check.yml")
public class NotCheckUriConfig {
// 不需要验证token的请求地址
private List<String> notAuthPath;
// 不需要验证token的请求地址;// 不需要验证token的请求地址
private List<String> uploadPath;
}
package com.mmc.pms.auth;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.util.PathUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
* @author: zj @Date: 2023/5/28 10:46
*/
@Slf4j
@Component
public class TokenCheckHandleInterceptor implements HandlerInterceptor {
@Autowired private StringRedisTemplate stringRedisTemplate;
@Autowired private NotCheckUriConfig notCheckUriConfig;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
String requestURI = request.getRequestURI();
// //根据uri确认是否要拦截
if (!shouldFilter(requestURI)) {
return true;
}
String token = request.getHeader("token");
if (StringUtils.isBlank(token)) {
exceptionProcess(response);
return false;
}
String tokenJson = stringRedisTemplate.opsForValue().get(token);
if (StringUtils.isBlank(tokenJson)) {
exceptionProcess(response);
return false;
}
//
// String serverName = request.getServerName();
// String remoteHost = request.getRemoteHost();
// log.info("hostName: {}", hostName);
// log.info("serverName: {}", serverName);
// log.info("remoteHost: {}", remoteHost);
// log.info("forwardedFor: {}", forwardedFor);
// log.info("forwardedHost: {}", forwardedHost);
// if (hostName.equals("iuav.mmcuav.cn") || hostName.equals("test.iuav.mmcuav.cn") ||
// hostName.equals("www.iuav.shop") || hostName.equals("test.iuav.shop")){
// String token = request.getHeader("token");
// if (StringUtils.isBlank(token)){
// exceptionProcess(response);
// return false;
// }
// String tokenJson = stringRedisTemplate.opsForValue().get(token);
// if (StringUtils.isBlank(tokenJson)){
// exceptionProcess(response);
// return false;
// }
// return true;
// }
// 测试-打印请求信息
return true;
}
@Override
public void postHandle(
HttpServletRequest request,
HttpServletResponse response,
Object handler,
ModelAndView modelAndView)
throws Exception {}
@Override
public void afterCompletion(
HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
throws Exception {}
public void exceptionProcess(HttpServletResponse response) throws Exception {
response.setContentType("application/json;charset=utf-8");
PrintWriter writer = response.getWriter();
writer.write(ResultBody.error(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR).toString());
writer.close();
}
private boolean shouldFilter(String path) {
// 路径与配置的相匹配,则执行过滤
for (String pathPattern : notCheckUriConfig.getNotAuthPath()) {
if (PathUtil.isPathMatch(pathPattern, path)) {
// 如果匹配
return false;
}
}
return true;
}
}
package com.mmc.pms.auth.dto;
import com.mmc.pms.common.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;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/25 13:32
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BUserAccountQO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "关键字", required = false)
private String keyword;
@ApiModelProperty(value = "地区", required = false)
private String area;
@ApiModelProperty(value = "省份编码", required = false)
private Integer provinceCode;
@ApiModelProperty(value = "城市编码", required = false)
private Integer cityCode;
@ApiModelProperty(value = "县区编码", required = false)
private Integer districtCode;
@ApiModelProperty(value = "角色id", required = false)
private Integer roleId;
@ApiModelProperty(value = "账号状态:0禁用 1可用")
private Integer accountStatus;
@ApiModelProperty(value = "账号状态:0合伙人 1员工")
private Integer userType;
@ApiModelProperty(value = "用户id集合")
private List<Integer> userIds;
@ApiModelProperty(value = "推荐单位id")
private Integer rcdCompanyId;
@ApiModelProperty(value = "单位集合", hidden = true)
private List<Integer> companys;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.pms.auth.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月31日 下午8:06:14
* @explain 类说明
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginSuccessDTO implements Serializable {
private static final long serialVersionUID = -1200834589953161925L;
private String token;
private Integer userAccountId;
private String accountNo;
private Integer portType;
private String uid;
private String phoneNum;
private String userName;
private String nickName;
// private RoleInfoDTO roleInfo;
}
package com.mmc.pms.auth.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/5/18 17:28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserAccountSimpleDTO implements Serializable {
private static final long serialVersionUID = 3451336520607073343L;
@ApiModelProperty(value = "用户id")
private Integer id;
@ApiModelProperty(value = "用户类型")
private Integer accountType;
@ApiModelProperty(value = "用户账号")
private String accountNo;
@ApiModelProperty(value = "用户uid")
private String uid;
@ApiModelProperty(value = "手机号")
private String phoneNum;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "用户昵称")
private String nickName;
@ApiModelProperty(value = "用户头像")
private String userImg;
@ApiModelProperty(value = "用户性别:0未知、1男、2女")
private Integer userSex;
@ApiModelProperty(value = "用户邮箱")
private String email;
@ApiModelProperty(value = "用户来源,0自然流、1海报、2抖音、3公众号、4社群、5招投标、6官网")
private Integer source;
@ApiModelProperty(value = "用户可用状态:0禁用、1可用")
private Integer accountStatus;
@ApiModelProperty(value = "账号类型:0后台管理账号 ; 100云享飞-客户端;")
private Integer portType;
@ApiModelProperty(value = "企业认证状态, 0未通过,1通过")
private Integer companyAuthStatus;
@ApiModelProperty(value = "合作标签id")
private Integer cooperationTagId;
}
\ No newline at end of file
package com.mmc.pms.config;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
//Converter<S,T> S: 代表的是源,将要转换的数据类型 T:目标类型,将会转成什么数据类型
@Component
public class GlobalFormDateConvert implements Converter<String, Date> {
// 静态初始化定义日期字符串参数列表(需要转换的)
private static final List<String> paramList = new ArrayList<>();
// 静态初始化可能初夏你的日期格式
private static final String param1 = "yyyy-MM";
private static final String param2 = "yyyy-MM-dd";
private static final String param3 = "yyyy-MM-dd HH:mm";
private static final String param4 = "yyyy-MM-dd HH:mm:ss";
// 静态代码块,将日期参数加入到列表中
static {
paramList.add(param1);
paramList.add(param2);
paramList.add(param3);
paramList.add(param4);
}
// 自定义函数,将字符串转Date 参1:传入的日期字符串 参2:格式参数
public Date parseDate(String source, String format) {
System.out.println("parseDate转换日期");
Date date = null;
try {
// 日期格式转换器
DateFormat dateFormat = new SimpleDateFormat(format);
date = dateFormat.parse(source);
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
// convert转换方法 ,s是将会传递过来的日期的字符串
@Override
public Date convert(String source) {
System.out.println("convert日期格式转换器");
if (StringUtils.isEmpty(source)) {
return null;
}
source = source.trim(); // 去除首尾空格
// 正则表达式判断是哪一种格式参数
if (source.matches("^\\d{4}-\\d{1,2}$")) {
return parseDate(source, paramList.get(0));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) {
return parseDate(source, paramList.get(1));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")) {
return parseDate(source, paramList.get(2));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) {
return parseDate(source, paramList.get(3));
} else {
throw new IllegalArgumentException("还未定义该种字符串转Date的日期转换格式 --> 【日期格式】:" + source);
}
}
}
package com.mmc.pms.config;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import org.springframework.util.StringUtils;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GlobalJsonDateConvert extends StdDateFormat {
private static final long serialVersionUID = -6738131740618766141L;
// 静态初始化final,共享
public static final GlobalJsonDateConvert instance = new GlobalJsonDateConvert();
// 覆盖parse(String)这个方法即可实现
@Override
public Date parse(String dateStr, ParsePosition pos) {
return getDate(dateStr, pos);
}
@Override
public Date parse(String dateStr) {
ParsePosition pos = new ParsePosition(0);
return getDate(dateStr, pos);
}
private Date getDate(String dateStr, ParsePosition pos) {
SimpleDateFormat sdf = null;
if (StringUtils.isEmpty(dateStr)) {
return null;
} else if (dateStr.matches("^\\d{4}-\\d{1,2}$")) {
sdf = new SimpleDateFormat("yyyy-MM");
return sdf.parse(dateStr, pos);
} else if (dateStr.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) {
sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.parse(dateStr, pos);
} else if (dateStr.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")) {
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return sdf.parse(dateStr, pos);
} else if (dateStr.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) {
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.parse(dateStr, pos);
} else if (dateStr.length() == 23) {
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
return sdf.parse(dateStr, pos);
}
return super.parse(dateStr, pos);
}
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(date, toAppendTo, fieldPosition);
}
@Override
public GlobalJsonDateConvert clone() {
return new GlobalJsonDateConvert();
}
}
package com.mmc.pms.config;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Configuration
public class WebConfig {
// JSON格式 全局日期转换器配置
@Bean
public MappingJackson2HttpMessageConverter getMappingJackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
// 设置日期格式
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setDateFormat(GlobalJsonDateConvert.instance);
objectMapper.setSerializationInclusion(JsonInclude.Include.ALWAYS);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
// 设置中文编码格式
List<MediaType> list = new ArrayList<MediaType>();
list.add(MediaType.APPLICATION_JSON_UTF8);
mappingJackson2HttpMessageConverter.setSupportedMediaTypes(list);
return mappingJackson2HttpMessageConverter;
}
// 表单格式 全局日期转换器
@Bean
@Autowired
public ConversionService getConversionService(GlobalFormDateConvert globalDateConvert) {
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
Set<Converter> converters = new HashSet<>();
converters.add(globalDateConvert);
factoryBean.setConverters(converters);
return factoryBean.getObject();
}
}
package com.mmc.pms.constant;
/**
* @author: zj
* @Date: 2023/5/31 20:07
*/
public class TokenConstant {
public static final String TOKEN = "token";
}
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.BrandInfoDTO; import com.mmc.pms.model.sale.dto.BrandInfoDTO;
import com.mmc.pms.service.BrandManageService; import com.mmc.pms.service.BrandManageService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("/brand") @RequestMapping("/brand")
@Api(tags = {"品牌管理-相关接口"}) @Api(tags = {"后台-品牌管理-相关接口"})
public class BackstageBrandManageController { public class BackstageBrandManageController {
@Autowired @Autowired
...@@ -37,12 +37,12 @@ public class BackstageBrandManageController { ...@@ -37,12 +37,12 @@ public class BackstageBrandManageController {
return ResultBody.success(brandManageService.listBrandInfo(pageNo, pageSize)); return ResultBody.success(brandManageService.listBrandInfo(pageNo, pageSize));
} }
// @ApiOperation(value = "删除品牌") @ApiOperation(value = "删除品牌")
// @GetMapping("deleteBrandInfo") @GetMapping("deleteBrandInfo")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// public ResultBody deleteBrandInfo(Integer id) { public ResultBody deleteBrandInfo(Integer id) {
// return brandManageService.deleteBrandInfo(id); return brandManageService.deleteBrandInfo(id);
// } }
@ApiOperation(value = "编辑品牌") @ApiOperation(value = "编辑品牌")
@GetMapping("editBrandInfo") @GetMapping("editBrandInfo")
......
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.ClassifyDetailsDTO; import com.mmc.pms.model.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.dto.ClassifyInfoDTO; import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.vo.*; import com.mmc.pms.model.categories.dto.ClassifyInfoDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.categories.vo.RelevantBusinessVO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.sale.vo.QueryClassifyVO;
import com.mmc.pms.service.CategoriesService; import com.mmc.pms.service.CategoriesService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Min;
import java.util.List;
/** /**
* @Author lw @Date 2023/5/15 13:24 @Version 1.0 * @Author lw @Date 2023/5/15 13:24 @Version 1.0
*/ */
...@@ -17,8 +26,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -17,8 +26,7 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/classify") @RequestMapping("/classify")
public class BackstageCategoriesController { public class BackstageCategoriesController {
@Autowired @Autowired private CategoriesService categoriesService;
private CategoriesService categoriesService;
@ApiOperation(value = "新增or修改目录") @ApiOperation(value = "新增or修改目录")
@PostMapping("addOrEditDirectory") @PostMapping("addOrEditDirectory")
...@@ -30,37 +38,45 @@ public class BackstageCategoriesController { ...@@ -30,37 +38,45 @@ public class BackstageCategoriesController {
@ApiOperation(value = "目录列表") @ApiOperation(value = "目录列表")
@GetMapping("directoryList") @GetMapping("directoryList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = DirectoryInfoVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = DirectoryInfoVO.class)})
public ResultBody directoryList(@RequestParam Integer pageNo, @RequestParam Integer pageSize) { public ResultBody directoryList(
return ResultBody.success(categoriesService.directoryList(pageNo, pageSize)); @RequestParam Integer pageNo,
@RequestParam Integer pageSize,
@RequestParam(required = false) Integer type) {
return ResultBody.success(categoriesService.directoryList(pageNo, pageSize, type));
} }
@ApiOperation(value = "删除目录") @ApiOperation(value = "删除目录")
@GetMapping("removeDirectory") @GetMapping("removeDirectory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody removeDirectory(@ApiParam(value = "id") @RequestParam(value = "id") Integer id) { public ResultBody removeDirectory(
@ApiParam(value = "id") @RequestParam(value = "id") Integer id) {
return categoriesService.removeDirectory(id); return categoriesService.removeDirectory(id);
} }
@ApiOperation(value = "分类新增") @ApiOperation(value = "分类新增")
@PostMapping("addClassification") @PostMapping("addClassification")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addClassification(@Validated(Create.class) @RequestBody ClassifyInfoVO classifyInfoVO) { public ResultBody addClassification(
@Validated(Create.class) @RequestBody ClassifyInfoVO classifyInfoVO) {
return categoriesService.addClassification(classifyInfoVO); return categoriesService.addClassification(classifyInfoVO);
} }
@ApiOperation(value = "分类修改") @ApiOperation(value = "分类修改")
@PostMapping("updateClassification") @PostMapping("updateClassification")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updateClassification(@Validated(Update.class) @RequestBody ClassifyInfoVO classifyInfoVO) { public ResultBody updateClassification(
@Validated(Update.class) @RequestBody ClassifyInfoVO classifyInfoVO) {
return categoriesService.updateClassification(classifyInfoVO); return categoriesService.updateClassification(classifyInfoVO);
} }
@ApiOperation(value = "分类信息-排序") @ApiOperation(value = "分类信息-排序")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("exchangeSortType") @GetMapping("exchangeSortType")
public ResultBody exchangeSortType(@ApiParam(value = "第一个分类id", required = true) @RequestParam(value = "firstId") Integer firstId, public ResultBody exchangeSortType(
@ApiParam(value = "第二个分类id", required = true) @RequestParam(value = "secondId") Integer secondId) { @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); return categoriesService.exchangeSortType(firstId, secondId);
} }
...@@ -71,11 +87,55 @@ public class BackstageCategoriesController { ...@@ -71,11 +87,55 @@ public class BackstageCategoriesController {
return ResultBody.success(categoriesService.getClassificationList(queryClassifyVO)); return ResultBody.success(categoriesService.getClassificationList(queryClassifyVO));
} }
@ApiOperation(value = "分类详情") @ApiOperation(value = "分类详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ClassifyDetailsDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ClassifyDetailsDTO.class)})
@GetMapping("getClassifyDetails") @GetMapping("getClassifyDetails")
public ResultBody getClassifyDetails(@ApiParam(value = "分类id", required = true) @RequestParam(value = "id") Integer id) { public ResultBody getClassifyDetails(
@ApiParam(value = "分类id", required = true) @RequestParam(value = "id") Integer id) {
return categoriesService.getClassifyDetails(id); return categoriesService.getClassifyDetails(id);
} }
@ApiOperation(value = "分类详情下关联业务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = RelevantBusinessVO.class)})
@GetMapping("queryRelevantBusiness")
public ResultBody queryRelevantBusiness(
@ApiParam(value = "分类id", required = true) @RequestParam(value = "id") Integer id,
@ApiParam(value = "业务类型", required = true) @Min(value = 0) @RequestParam(value = "type")
Integer type) {
return categoriesService.queryRelevantBusiness(id, type);
}
@ApiOperation(value = "分类删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = RelevantBusinessVO.class)})
@GetMapping("deleteRelevantBusiness")
public ResultBody deleteRelevantBusiness(
@ApiParam(value = "分类id", required = true) @Min(value = 1) @RequestParam(value = "id")
Integer id) {
return categoriesService.deleteRelevantBusiness(id);
}
@ApiOperation(value = "目录列表不含分页")
@GetMapping("getDirectoryList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = DirectoryInfoVO.class)})
public ResultBody getDirectoryList(Integer type) {
return categoriesService.getDirectoryList(type);
}
@ApiOperation(value = "根据类型获取各个目录及分类信息")
@GetMapping("queryCategoryInfoByType")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AllCategoryDTO.class)})
public ResultBody queryCategoryInfoByType(
@ApiParam(value = "类型:1:作业服务 2:设备 3:培训 4:产品商城", required = true) @RequestParam(value = "type")
Integer type) {
return categoriesService.queryCategoryInfoByType(type);
}
@ApiOperation(value = "feign根据类型获取各个目录及分类信息", hidden = true)
@GetMapping("feignQqueryCategoryInfoByType")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = AllCategoryDTO.class)})
public List<AllCategoryDTO> feignQqueryCategoryInfoByType(
@ApiParam(value = "类型:1:作业服务 2:设备 3:培训 4:产品商城", required = true) @RequestParam(value = "type")
Integer type) {
return categoriesService.feigQqueryCategoryInfoByType(type);
}
} }
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.vo.Create; import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.vo.GoodsAddVO; import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.vo.Update; import com.mmc.pms.model.order.dto.OrderGoodsIndstDTO;
import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.*;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.BatchShelfVO;
import com.mmc.pms.model.sale.vo.GoodsAddVO;
import com.mmc.pms.service.GoodsInfoService; import com.mmc.pms.service.GoodsInfoService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
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; import javax.annotation.Resource;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/3/14 13:22 *
* 概要: * @date 2023/3/14 13:22 概要:
*/ */
@RestController @RestController
@RequestMapping("/goods") @RequestMapping("/goods")
@Api(tags = {"商品管理-相关接口"}) @Api(tags = {"后台-商品管理-相关接口"})
public class BackstageGoodsManageController { public class BackstageGoodsManageController {
@Resource @Resource private GoodsInfoService goodsInfoService;
private GoodsInfoService goodsInfoService;
@ApiOperation(value = "新增(租赁/销售)商品") @ApiOperation(value = "新增(租赁/销售)商品")
@PostMapping("addGoodsInfo") @PostMapping("addGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addGoods(@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO) { public ResultBody addGoods(
@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.addGoods(goodsAddVO); return goodsInfoService.addGoods(goodsAddVO);
} }
@ApiOperation(value = "修改(租赁/销售)商品") @ApiOperation(value = "修改(租赁/销售)商品")
@PostMapping("editGoodsInfo") @PostMapping("editGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editGoodsInfo(@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) { public ResultBody editGoodsInfo(
@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.editGoodsInfo(goodsAddVO); return goodsInfoService.editGoodsInfo(goodsAddVO);
} }
@ApiOperation(value = "PC端-商品详情")
@GetMapping("getGoodsInfoDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
public ResultBody getGoodsInfoDetail(
@ApiParam("商品id") @RequestParam Integer goodsInfoId,
@RequestParam Integer type,
@RequestParam(required = false) @ApiParam("租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)")
Integer leaseTerm) {
return goodsInfoService.getGoodsInfoDetail(goodsInfoId, type, leaseTerm);
}
@ApiOperation(value = "商品列表-分页")
@PostMapping("listPageGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody MallGoodsQO param) {
return ResultBody.success(goodsInfoService.listPageGoodsInfo(param));
}
@ApiOperation(value = "商品批量上下架")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("batchOnShelfOrTakeDown")
public ResultBody batchOnShelfOrTakeDown(
@ApiParam(value = "商品上下架参数", required = true) @RequestBody BatchShelfVO batchOnShelfVO) {
return goodsInfoService.batchOnShelfOrTakeDown(
batchOnShelfVO.getGoodsIds(), batchOnShelfVO.getStatus());
}
@ApiOperation(value = "商品批量删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("batchRemoveWareInfo")
public ResultBody batchRemoveWareInfo(
@ApiParam(value = "商品id数组", required = true) @RequestBody List<Integer> ids) {
return goodsInfoService.batchRemoveWareInfo(ids);
}
@ApiOperation(value = "单位信息")
@GetMapping("getSkuUnit")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)})
public ResultBody getSkuUnit() {
return goodsInfoService.getSkuUnit();
}
@ApiOperation(value = "PC端-其他服务-列表")
@GetMapping("listOtherService")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SaleServiceDTO.class)})
public ResultBody listOtherService() {
return goodsInfoService.getSaleServiceInfoToList();
}
@ApiOperation(value = "feign根据购物车信息填充未知信息", hidden = true)
@PostMapping("fillGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsShopCarDTO.class)})
public List<MallGoodsShopCarDTO> fillGoodsInfo(@RequestBody List<MallGoodsShopCarDTO> param) {
return goodsInfoService.fillGoodsInfo(param);
}
@ApiOperation(value = "feign根据渠道等级和产品规格id获取对应价格", hidden = true)
@PostMapping("feignListProductSpecPrice")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public List<MallProductSpecPriceDTO> feignListProductSpecPrice(
@RequestBody ProductSpecPriceQO productSpecPriceQO) {
return goodsInfoService.feignListProductSpecPrice(productSpecPriceQO);
}
@ApiOperation(value = "feign根据渠道等级获取单价信息", hidden = true)
@GetMapping("feignGetUnitPriceByTag")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
public ProductSpecPriceDTO feignGetUnitPriceByTag(
@RequestParam(value = "specId") Integer specId,
@RequestParam(value = "tagId") Integer tagId) {
return goodsInfoService.feignGetUnitPriceByTag(specId, tagId);
}
@ApiOperation(value = "feign根据商品的产品规格id查询商品信息", hidden = true)
@PostMapping("feignListProdGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(
@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListProdGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "feign根据商品的行业规格id查询商品清单信息", hidden = true)
@PostMapping("feignListIndstGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(
@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListIndstGoodsSkuInfo(mallOrderGoodsInfoQO);
}
} }
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.qo.IndustrySkuQO;
import com.mmc.pms.model.sale.dto.*;
import com.mmc.pms.model.sale.vo.IndustrySkuVO;
import com.mmc.pms.model.sale.vo.IndustrySpecVO;
import com.mmc.pms.service.IndustrySpecService;
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/10/8 10:57
* 概要:
*/
@RestController
@RequestMapping("/industry/spec/")
@Api(tags = {"后台-行业管理-相关接口"})
public class BackstageIndustrySpecController {
@Autowired
IndustrySpecService industrySpecService;
@ApiOperation(value = "新增行业sku")
@PostMapping("addIndustrySku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addIndustrySku(@Validated(Create.class) @ApiParam("行业skuVO") @RequestBody IndustrySkuVO param) {
return industrySpecService.addIndustrySku(param);
}
@ApiOperation(value = "行业sku详情")
@GetMapping("getIndustrySkuDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustrySkuVO.class)})
public ResultBody getIndustrySkuDetail(@ApiParam("id") @RequestParam(value = "id") Integer id) {
return industrySpecService.getIndustrySkuDetail(id);
}
@ApiOperation(value = "行业sku管理---编辑行业sku")
@PostMapping("editIndustrySku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editIndustrySku(@Validated(Update.class) @ApiParam("行业skuVO") @RequestBody IndustrySkuVO param) {
return industrySpecService.editIndustrySku(param);
}
@ApiOperation(value = "行业sku管理---分页列表")
@PostMapping("listPageIndustrySku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustrySkuDTO.class)})
public ResultBody listPageIndustrySku(@ApiParam("条件参数") @RequestBody IndustrySkuQO param) {
return industrySpecService.listPageIndustrySku(param);
}
@ApiOperation(value = "新增方案规格")
@PostMapping("addIndustrySpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addIndustrySpec(@Validated(Create.class) @ApiParam("条件参数") @RequestBody IndustrySpecVO param) {
return industrySpecService.addIndustrySpec(param);
}
@ApiOperation(value = "方案规格回显")
@GetMapping("getIndustrySpecDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustrySpecDTO.class)})
public ResultBody getIndustrySpecDetail(@ApiParam("行业规格id") @RequestParam(value = "industrySpecId") Integer industrySpecId) {
return industrySpecService.getIndustrySpecDetail(industrySpecId);
}
@ApiOperation(value = "编辑方案规格")
@PostMapping("editIndustrySpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editIndustrySpec(@Validated(Update.class) @ApiParam("行业skuVO") @RequestBody IndustrySpecVO param) {
return industrySpecService.editIndustrySpec(param);
}
@ApiOperation(value = "行业sku管理---方案规格管理---分页列表")
@GetMapping("listPageIndustrySpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustrySpecDTO.class)})
public ResultBody listPageIndustrySpec(@ApiParam(value = "页码") @RequestParam(value = "pageNo") Integer pageNo,
@ApiParam(value = "每页显示数") @RequestParam(value = "pageSize") Integer pageSize,
@ApiParam(value = "产品skuId") @RequestParam(value = "productSkuId") Integer industrySkuId,
@ApiParam(value = "关键字") @RequestParam(value = "keyword", required = false) String keyword) {
return industrySpecService.listPageIndustrySpec(pageNo, pageSize, industrySkuId, keyword);
}
@ApiOperation(value = "行业方案规格-价格配置")
@PostMapping("industrySpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody industrySpecCPQ(@RequestBody IndustrySpecCPQVO industrySpecCPQQ) {
return industrySpecService.industrySpecCPQ(industrySpecCPQQ);
}
@ApiOperation(value = "行业方案规格管理-价格配置信息的修改")
@PostMapping("updateIndustrySpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updateIndustrySpecCPQ(@RequestBody IndustrySpecCPQVO industrySpecCPQQ) {
return industrySpecService.updateIndustrySpecCPQ(industrySpecCPQQ);
}
@ApiOperation(value = "行业sku管理---方案规格管理---获取价格配置信息")
@PostMapping("getIndustrySpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustrySpecPriceDTO.class)})
public ResultBody getIndustrySpecCPQ(@RequestBody IndustrySpecCPQVO industrySpecCPQQ) {
return industrySpecService.getIndustrySpecCPQ(industrySpecCPQQ);
}
@ApiOperation(value = "行业sku管理---删除行业sku")
@GetMapping("removeIndustrySku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody removeIndustrySku(@ApiParam("id") @RequestParam(value = "id") Integer id) {
return industrySpecService.removeIndustrySku(id);
}
@ApiOperation(value = "行业sku管理---方案规格管理---删除行业规格")
@GetMapping("removeIndustrySpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = RemoveSkuDTO.class)})
public ResultBody removeIndustrySpec(@ApiParam("id") @RequestParam(value = "id") Integer id) {
return industrySpecService.removeIndustrySpec(id);
}
}
\ No newline at end of file
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.*; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.lease.vo.PriceAcquisition;
import com.mmc.pms.model.qo.ProductSkuQO; import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.vo.Create; import com.mmc.pms.model.sale.dto.*;
import com.mmc.pms.model.vo.ProductSpecCPQVO; import com.mmc.pms.model.sale.vo.ProductSpecCPQVO;
import com.mmc.pms.model.vo.Update;
import com.mmc.pms.service.ProductSkuService; import com.mmc.pms.service.ProductSkuService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
/** /**
* @Author LW * @Author LW
* @date 2022/9/22 10:28 *
* 概要: * @date 2022/9/22 10:28 概要:
*/ */
@RestController @RestController
@RequestMapping("/product/spec/") @RequestMapping("/product/spec/")
@Api(tags = {"产品管理模块-相关接口"}) @Api(tags = {"产品管理模块-相关接口"})
public class BackstageProductSpecController { public class BackstageProductSpecController {
@Autowired @Autowired private ProductSkuService productSkuService;
private ProductSkuService productSkuService;
@ApiOperation(value = "新增产品sku") @ApiOperation(value = "新增产品sku")
@PostMapping("addProductSku") @PostMapping("addProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addProductSku(@Validated(Create.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) { public ResultBody addProductSku(
@Validated(Create.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) {
return productSkuService.addProductSku(param); return productSkuService.addProductSku(param);
} }
...@@ -41,10 +45,18 @@ public class BackstageProductSpecController { ...@@ -41,10 +45,18 @@ public class BackstageProductSpecController {
@ApiOperation(value = "编辑产品sku") @ApiOperation(value = "编辑产品sku")
@PostMapping("editProductSku") @PostMapping("editProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editProductSku(@Validated(Update.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) { public ResultBody editProductSku(
@Validated(Update.class) @ApiParam("产品skuVO") @RequestBody ProductSkuVO param) {
return productSkuService.editProductSku(param); return productSkuService.editProductSku(param);
} }
@ApiOperation(value = "产品目录列表")
@GetMapping("productDirectoryList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = DirectoryInfoVO.class)})
public ResultBody<DirectoryInfoVO> productDirectoryList() {
return productSkuService.productDirectoryList();
}
@ApiOperation(value = "产品sku分页列表") @ApiOperation(value = "产品sku分页列表")
@PostMapping("listPageProductSku") @PostMapping("listPageProductSku")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSkuDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSkuDTO.class)})
...@@ -52,17 +64,19 @@ public class BackstageProductSpecController { ...@@ -52,17 +64,19 @@ public class BackstageProductSpecController {
return productSkuService.listPageProductSku(productSkuQO); return productSkuService.listPageProductSku(productSkuQO);
} }
// @ApiOperation(value = "产品sku管理---删除产品sku") @ApiOperation(value = "删除产品sku")
// @GetMapping("removeProductSku") @GetMapping("removeProductSku")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// public ResultBody removeProductSku(@ApiParam("id") @RequestParam(value = "id") Integer id) { public ResultBody removeProductSku(@ApiParam("id") @RequestParam(value = "id") Integer id) {
// return productSpecService.removeProductSku(id); return productSkuService.removeProductSku(id);
// } }
//
@ApiOperation(value = "新增or修改产品规格") @ApiOperation(value = "新增or修改产品规格")
@PostMapping("addOrEditProductSpec") @PostMapping("addOrEditProductSpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addOrEditProductSpec(@Validated({Create.class, Update.class}) @ApiParam("产品规格VO") @RequestBody ProductSpecVO param) { public ResultBody addOrEditProductSpec(
@Validated({Create.class, Update.class}) @ApiParam("产品规格VO") @RequestBody
ProductSpecVO param) {
return productSkuService.addOrEditProductSpec(param); return productSkuService.addOrEditProductSpec(param);
} }
...@@ -76,10 +90,12 @@ public class BackstageProductSpecController { ...@@ -76,10 +90,12 @@ public class BackstageProductSpecController {
@ApiOperation(value = "产品规格分页列表") @ApiOperation(value = "产品规格分页列表")
@GetMapping("listPageProductSpec") @GetMapping("listPageProductSpec")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecDTO.class)})
public ResultBody listPageProductSpec(@ApiParam(value = "页码") @RequestParam(value = "pageNo") Integer pageNo, public ResultBody listPageProductSpec(
@ApiParam(value = "页码") @RequestParam(value = "pageNo") Integer pageNo,
@ApiParam(value = "每页显示数") @RequestParam(value = "pageSize") Integer pageSize, @ApiParam(value = "每页显示数") @RequestParam(value = "pageSize") Integer pageSize,
@ApiParam(value = "产品skuId") @RequestParam(value = "productSkuId") Integer productSkuId) { @ApiParam(value = "产品skuId") @RequestParam(value = "productSkuId") Integer productSkuId,
return productSkuService.listPageProductSpec(pageNo, pageSize, productSkuId); @ApiParam(value = "关键字") @RequestParam(value = "keyword", required = false) String keyword) {
return productSkuService.listPageProductSpec(pageNo, pageSize, productSkuId, keyword);
} }
@ApiOperation(value = "产品规格管理-价格配置") @ApiOperation(value = "产品规格管理-价格配置")
...@@ -89,7 +105,6 @@ public class BackstageProductSpecController { ...@@ -89,7 +105,6 @@ public class BackstageProductSpecController {
return productSkuService.productSpecCPQ(productSpecCPQVO); return productSkuService.productSpecCPQ(productSpecCPQVO);
} }
@ApiOperation(value = "价格配置信息的修改") @ApiOperation(value = "价格配置信息的修改")
@PostMapping("updateProductSpecCPQ") @PostMapping("updateProductSpecCPQ")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
...@@ -105,26 +120,38 @@ public class BackstageProductSpecController { ...@@ -105,26 +120,38 @@ public class BackstageProductSpecController {
} }
// //
// @ApiOperation(value = "价格配置信息--恢复全局默认设置") // @ApiOperation(value = "价格配置信息--恢复全局默认设置")
// @GetMapping("getDefaultSettings") // @GetMapping("getDefaultSettings")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)}) // @ApiResponses({@ApiResponse(code = 200, message = "OK", response =
// public ResultBody getDefaultSettings(@ApiParam(value = "规格id") @RequestParam(value = "productSpecId") Integer productSpecId) { // ProductSpecPriceDTO.class)})
// return productSpecService.getDefaultSettings(productSpecId); // 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)}) @ApiOperation(value = "产品规格管理---删除规格")
// public ResultBody removeProductSpec(@ApiParam("id") @RequestParam(value = "id") Integer id) { @GetMapping("removeProductSpec")
// return productSpecService.removeProductSpec(id); @ApiResponses({@ApiResponse(code = 200, message = "OK", response = RemoveSkuDTO.class)})
// } public ResultBody removeProductSpec(@ApiParam("id") @RequestParam(value = "id") Integer id) {
// return productSkuService.removeProductSpec(id);
// @ApiOperation(value = "feign根据渠道等级获取单价信息") }
// @GetMapping("feignGetUnitPriceByTag") //
// @ApiIgnore // @ApiOperation(value = "feign根据渠道等级获取单价信息")
// @ApiResponses({@ApiResponse(code = 200, message = "OK",response = ProductSpecPriceDTO.class)}) // @GetMapping("feignGetUnitPriceByTag")
// public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId")Integer specId, // @ApiIgnore
// @RequestParam(value = "tagId")Integer tagId) { // @ApiResponses({@ApiResponse(code = 200, message = "OK",response =
// return productSpecService.feignGetUnitPriceByTag(specId,tagId); // ProductSpecPriceDTO.class)})
// } // public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId")Integer
// specId,
// @RequestParam(value = "tagId")Integer
// tagId) {
// return productSpecService.feignGetUnitPriceByTag(specId,tagId);
// }
@ApiOperation(value = "feign根据渠道等级获取单价信息")
@PostMapping("feignGetSpecLeaseUnitPrice")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public BigDecimal feignGetUnitPriceByTag(@RequestBody PriceAcquisition priceAcquisition) {
return productSkuService.feignGetUnitPriceByTag(priceAcquisition);
}
} }
package com.mmc.pms.controller;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.dto.WorkServiceDTO;
import com.mmc.pms.model.work.vo.ServiceVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.BackstageTaskService;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Author LW
*
* @date 2023/6/6 10:41 概要:
*/
@Api(tags = {"后台-服务管理-模块"})
@RestController
@RequestMapping("/backstage/work")
public class BackstageTaskServiceController extends BaseController {
@Resource private BackstageTaskService backstageTaskService;
@ApiOperation(value = "新增作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("addWorkService")
public ResultBody addWorkService(
@Validated(Create.class) @RequestBody ServiceVO param, HttpServletRequest request) {
return backstageTaskService.addWorkService(
param, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "修改作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("updateWorkService")
public ResultBody updateWorkService(@Validated(Update.class) @RequestBody ServiceVO param) {
return backstageTaskService.updateById(param);
}
@ApiOperation(value = "删除作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("deleteWorkService")
public ResultBody deleteWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) {
return backstageTaskService.deleteById(id);
}
@ApiOperation(value = "查询作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@GetMapping("queryWorkService")
public ResultBody<ServiceDTO> queryWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) {
return backstageTaskService.queryById(id);
}
@ApiOperation(value = "查询服务管理列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@PostMapping("queryServiceManagerList")
public ResultBody<ServiceDTO> queryServiceManagerList(
@Validated(Page.class) @RequestBody ServiceQO param, HttpServletRequest request) {
return ResultBody.success(backstageTaskService.queryServiceManagerList(param, this.getUserLoginInfoFromRedis(request).getUserAccountId()));
}
@ApiOperation(value = "web接口-条件查询作业服务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WorkServiceDTO.class)})
@PostMapping("queryWorkServiceList")
public ResultBody<WorkServiceDTO> queryWorkServiceList(@Validated(Page.class) @RequestBody ServiceQO param, HttpServletRequest request) {
return ResultBody.success(backstageTaskService.queryWorkServiceList(param,request));
}
@ApiOperation(value = "远程查询作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@PostMapping("feignQueryWorkServiceListById")
@ApiIgnore
public List<ServiceDTO> feignQueryWorkServiceListById(@RequestBody List<Integer> ids) {
return backstageTaskService.feignQueryWorkServiceListById(ids);
}
}
package com.mmc.pms.controller;
import com.alibaba.fastjson.JSONObject;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.util.BizException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.servlet.http.HttpServletRequest;
/**
* @author: zj @Date: 2023/5/25 18:11
*/
public abstract class BaseController {
@Autowired private StringRedisTemplate stringRedisTemplate;
/**
* 解析token,获取用户信息
*
* @param request
* @return
*/
// public BaseAccountDTO getUserLoginInfo(HttpServletRequest request) {
// String token = request.getHeader("token");
// try {
// Claims claims = JwtUtil.parseJwt(token);
// String userId = claims.get(JwtConstant.USER_ACCOUNT_ID).toString();
//// String roleId = claims.get("").toString();
// String tokenType = claims.get(JwtConstant.TOKEN_TYPE).toString();
// return
// BaseAccountDTO.builder().id(Integer.parseInt(userId)).tokenPort(tokenType).build();
// }catch (Exception e){
// throw new BizException("Invalid token");
// }
// }
/**
* 使用token从redis获取用户信息
*
* @param request
* @return
*/
public LoginSuccessDTO getUserLoginInfoFromRedis(HttpServletRequest request) {
String token = request.getHeader("token");
if (StringUtils.isBlank(token)) {
throw new BizException(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR);
}
String json = stringRedisTemplate.opsForValue().get(token);
if (StringUtils.isBlank(json)) {
throw new BizException(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR);
}
LoginSuccessDTO loginSuccessDTO = JSONObject.parseObject(json, LoginSuccessDTO.class);
return loginSuccessDTO;
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.model.categories.dto.CategoriesDTO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.CategoriesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
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.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 前端控制器
* </p>
*
* @author Pika
* @since 2023-06-08
*/
@Api(tags = {"后台-目录管理-接口"})
@RestController
@RequestMapping("/directory")
public class DirectoryController {
private final String DIRECTORY_NAME_APPLICATION = "应用";
private final String DIRECTORY_NAME_INDUSTRY = "行业";
@Autowired
private CategoriesService categoriesService;
@ApiOperation(value = "获取应用类型列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoriesDTO.class)})
@PostMapping("getApplicationList")
public ResultBody<CategoriesDTO> getApplicationList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_APPLICATION);
}
@ApiOperation(value = "获取对应行业列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoriesDTO.class)})
@PostMapping("getIndustryList")
public ResultBody<CategoriesDTO> getIndustryList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_INDUSTRY);
}
}
...@@ -2,17 +2,19 @@ package com.mmc.pms.controller; ...@@ -2,17 +2,19 @@ package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum; import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.model.dto.*; import com.mmc.pms.model.lease.dto.BrandDTO;
import com.mmc.pms.model.qo.WareInfoQO; import com.mmc.pms.model.lease.dto.DeviceCategoryDTO;
import com.mmc.pms.model.vo.LeaseVo; import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.page.Page; import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import com.mmc.pms.model.other.dto.ModelDTO;
import com.mmc.pms.model.sale.dto.SkuInfoDTO;
import com.mmc.pms.service.WebDeviceService; import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -22,7 +24,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -22,7 +24,8 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/appDevice") @RequestMapping("/appDevice")
public class MiniProgramDeviceController { public class MiniProgramDeviceController {
@Autowired private WebDeviceService webDeviceService; @Autowired
private WebDeviceService webDeviceService;
@ApiOperation(value = "地域") @ApiOperation(value = "地域")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
...@@ -50,13 +53,13 @@ public class MiniProgramDeviceController { ...@@ -50,13 +53,13 @@ public class MiniProgramDeviceController {
return webDeviceService.model(); return webDeviceService.model();
} }
@ApiOperation(value = "设备列表筛选") // @ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)}) // @ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping("/deviceList") // @PostMapping("/deviceList")
public ResultBody<WareInfoItemDTO> listWareInfoPage( // public ResultBody<WareInfoItemDTO> listWareInfoPage(
@RequestBody @Validated(Page.class) WareInfoQO param) { // @RequestBody @Validated(Page.class) WareInfoQO param) {
return webDeviceService.listWareInfoPage(param); // return webDeviceService.listWareInfoPage(param, request);
} // }
@ApiOperation(value = "设备详情") @ApiOperation(value = "设备详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
...@@ -76,7 +79,7 @@ public class MiniProgramDeviceController { ...@@ -76,7 +79,7 @@ public class MiniProgramDeviceController {
} }
@ApiOperation(value = "获取设备sku") @ApiOperation(value = "获取设备sku")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SkuInfoDTO.class) }) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuInfoDTO.class)})
@GetMapping("listWareSkuById") @GetMapping("listWareSkuById")
public ResultBody<SkuInfoDTO> listWareSkuById(@RequestParam Integer id) { public ResultBody<SkuInfoDTO> listWareSkuById(@RequestParam Integer id) {
return ResultBody.success(webDeviceService.listWareSkuById(id)); return ResultBody.success(webDeviceService.listWareSkuById(id));
......
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.qo.GoodsInfoQO; import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.service.MiniProgramProductMallService; import com.mmc.pms.service.MiniProgramProductMallService;
import com.mmc.pms.service.WebProductMallService; import com.mmc.pms.service.WebProductMallService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
...@@ -18,9 +18,11 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,9 +18,11 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/AppProductMall/") @RequestMapping("/AppProductMall/")
public class MiniProgramProductMallController { public class MiniProgramProductMallController {
@Autowired private WebProductMallService webProductMallService; @Autowired
private WebProductMallService webProductMallService;
@Autowired private MiniProgramProductMallService miniProgramProductMallService; @Autowired
private MiniProgramProductMallService miniProgramProductMallService;
@ApiOperation(value = "小程序-商品信息-分页") @ApiOperation(value = "小程序-商品信息-分页")
@PostMapping("listPageGoodsInfo") @PostMapping("listPageGoodsInfo")
......
package com.mmc.pms.controller;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.constant.TokenConstant;
import com.mmc.pms.model.categories.dto.CategoryTypeDTO;
import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.sale.dto.MallGoodsDetailDTO;
import com.mmc.pms.model.sale.vo.ProductSpecCPQVO;
import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @Author LW
*
* @date 2023/6/8 17:16 概要:
*/
@Api(tags = {"v1.0.1-租赁销售-相关接口"})
@RestController
@RequestMapping("/product/mall")
public class ProductMallController extends BaseController {
@Autowired private WebDeviceService webDeviceService;
@ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseGoodsInfoDTO.class)})
@PostMapping("/deviceList")
public ResultBody<LeaseGoodsInfoDTO> listWareInfoPage(
@RequestBody @Validated(Page.class) WareInfoQO param, HttpServletRequest request) {
return webDeviceService.listWareInfoPage(
param,
request,
StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))
? null
: this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "设备商品详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
@GetMapping("/getLeaseGoodsDetail")
public ResultBody<MallGoodsDetailDTO> getLeaseGoodsDetail(
Integer goodsId,
HttpServletRequest request,
@ApiParam(value = "租赁:1 销售商品:0") @RequestParam(value = "type") Integer type) {
return webDeviceService.getLeaseGoodsDetail(
goodsId,
StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))
? null
: this.getUserLoginInfoFromRedis(request).getUserAccountId(),
request,
type);
}
@ApiOperation(value = "web-首页分类数据-展示")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoryTypeDTO.class)})
@GetMapping("/getPageHomeCategories")
public ResultBody<CategoryTypeDTO> getPageHomeCategories(
@ApiParam(value = "类型:1:作业服务 2:设备 3:培训 4:产品商城") @RequestParam(value = "type") Integer type) {
return webDeviceService.getPageHomeCategories(type);
}
@ApiOperation(value = "获取设备商品规格价格详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecCPQVO.class)})
@GetMapping("/getLeaseGoodsPriceDetail")
public ResultBody<ProductSpecCPQVO> getLeaseGoodsPriceDetail(
@ApiParam(value = "商品id") @RequestParam(value = "productSpecId") Integer productSpecId,
@ApiParam(value = "租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)")
@RequestParam(value = "leaseTerm")
Integer leaseTerm) {
return webDeviceService.getLeaseGoodsPriceDetail(productSpecId, leaseTerm);
}
}
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.aliyun.oss.ClientBuilderConfiguration; import com.aliyun.oss.ClientBuilderConfiguration;
import com.aliyun.oss.OSS; import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder; import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.ObjectMetadata;
import com.aliyun.oss.model.PutObjectRequest;
import com.aliyun.oss.model.UploadFileRequest;
import com.aliyun.oss.model.UploadFileResult;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum; import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.util.FileLoadUtil; import com.mmc.pms.util.FileLoadUtil;
import com.mmc.pms.util.OssConstant; import com.mmc.pms.util.OssConstant;
import com.mmc.pms.util.XmlUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -20,6 +26,7 @@ import javax.servlet.ServletOutputStream; ...@@ -20,6 +26,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -74,6 +81,73 @@ public class UploadController { ...@@ -74,6 +81,73 @@ public class UploadController {
return ResultBody.success(jsObj); return ResultBody.success(jsObj);
} }
@PostMapping("/breakpoint")
public ResultBody breakpoint(
@RequestParam("uploadFile") MultipartFile uploadFile, HttpServletRequest request) throws IOException {
OSS ossClient =
new OSSClientBuilder()
.build(OssConstant.ENDPOINT, OssConstant.ACCESSKEYID, OssConstant.ACCESSKEYSECRET);
File file = XmlUtil.ossUpload(uploadFile);
String location =null;
try {
ObjectMetadata meta = new ObjectMetadata();
// 指定上传的内容类型。
// meta.setContentType("text/plain");
// 文件上传时设置访问权限ACL。
// meta.setObjectAcl(CannedAccessControlList.Private);
String oldName = uploadFile.getOriginalFilename();
String newName =
"file/"
+ UUID.randomUUID().toString()
+ oldName.substring(oldName.lastIndexOf("."), oldName.length());
// 通过UploadFileRequest设置多个参数。
// 依次填写Bucket名称(例如examplebucket)以及Object完整路径(例如exampledir/exampleobject.txt),Object完整路径中不能包含Bucket名称。
UploadFileRequest uploadFileRequest = new UploadFileRequest("pad-video-x",newName);
// 通过UploadFileRequest设置单个参数。
// 填写本地文件的完整路径,例如D:\\localpath\\examplefile.txt。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
uploadFileRequest.setUploadFile(file.toString());
// 指定上传并发线程数,默认值为1。
uploadFileRequest.setTaskNum(15);
// 指定上传的分片大小,单位为字节,取值范围为100 KB~5 GB。默认值为100 KB。
uploadFileRequest.setPartSize(1 * 1024 * 1024);
// 开启断点续传,默认关闭。
uploadFileRequest.setEnableCheckpoint(true);
// 记录本地分片上传结果的文件。上传过程中的进度信息会保存在该文件中,如果某一分片上传失败,再次上传时会根据文件中记录的点继续上传。上传完成后,该文件会被删除。
// 如果未设置该值,默认与待上传的本地文件同路径,名称为${uploadFile}.ucp。
uploadFileRequest.setCheckpointFile("uploadFile.ucp");
// 文件的元数据。
uploadFileRequest.setObjectMetadata(meta);
// 设置上传回调,参数为Callback类型。
//uploadFileRequest.setCallback("yourCallbackEvent");
// 断点续传上传。
UploadFileResult uploadFileResult = ossClient.uploadFile(uploadFileRequest);
location = uploadFileResult.getMultipartUploadResult().getLocation();
System.out.println(uploadFileResult);
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (Throwable ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} finally {
// 关闭OSSClient。
if (ossClient != null) {
ossClient.shutdown();
}
}
return ResultBody.success(location);
}
@ApiOperation(value = "V1.0.1-上传多个文件到阿里云oss") @ApiOperation(value = "V1.0.1-上传多个文件到阿里云oss")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam( @ApiImplicitParam(
......
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.dto.*; import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import com.mmc.pms.page.Page;
import com.mmc.pms.service.WebDeviceService; import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @Author small @Date 2023/5/15 13:25 @Version 1.0 * @Author small @Date 2023/5/15 13:25 @Version 1.0
...@@ -32,65 +30,9 @@ public class WebDeviceController { ...@@ -32,65 +30,9 @@ public class WebDeviceController {
return webDeviceService.listSecondDistrict(); return webDeviceService.listSecondDistrict();
} }
@ApiOperation("设备类目")
@GetMapping("/category")
public ResultBody<DeviceCategoryDTO> category() {
return webDeviceService.category();
}
@ApiOperation("品牌")
@GetMapping("/brand")
public ResultBody<BrandDTO> brand() {
return webDeviceService.brand();
}
@ApiOperation("型号")
@GetMapping("/model")
public ResultBody<ModelDTO> model() {
return webDeviceService.model();
}
@ApiOperation("设备品牌")
@GetMapping("/deviceBrand")
public ResultBody<BrandDTO> deviceBrand() {
return webDeviceService.deviceBrand();
}
@ApiOperation("设备型号")
@GetMapping("/deviceModel")
public ResultBody<ModelDTO> deviceModel() {
return webDeviceService.deviceModel();
}
@ApiOperation(value = "设备详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/detail")
public ResultBody<WareInfoDTO> detail(@RequestParam(value = "id", required = true) Integer id) {
WareInfoDTO wareInfoDTO = webDeviceService.getWareInfoById(id);
return wareInfoDTO == null
? ResultBody.error(ResultEnum.NOT_FOUND)
: ResultBody.success(wareInfoDTO);
}
@ApiOperation(value = "立即租赁")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/update")
public ResultBody update(@RequestBody LeaseVo param) {
return webDeviceService.update(param);
}
@ApiOperation("设备广告位") @ApiOperation("设备广告位")
@GetMapping("/ad") @GetMapping("/ad")
public ResultBody<AdDTO> ad() { public ResultBody<AdDTO> ad() {
return webDeviceService.ad(); return webDeviceService.ad();
} }
@ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
@PostMapping("/deviceList")
public ResultBody<WareInfoItemDTO> listWareInfoPage(
@RequestBody @Validated(Page.class) WareInfoQO param) {
return webDeviceService.listWareInfoPage(param);
}
} }
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.dto.AppGoodsInfoDetailDTO; import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.dto.ProductCategoryDTO;
import com.mmc.pms.model.qo.GoodsInfoQO; import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.service.MiniProgramProductMallService; import com.mmc.pms.service.MiniProgramProductMallService;
import com.mmc.pms.service.WebProductMallService; import com.mmc.pms.service.WebProductMallService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
...@@ -19,9 +19,11 @@ import org.springframework.web.bind.annotation.*; ...@@ -19,9 +19,11 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/webProductMall") @RequestMapping("/webProductMall")
public class WebProductMallController { public class WebProductMallController {
@Autowired private WebProductMallService webProductMallService; @Autowired
private WebProductMallService webProductMallService;
@Autowired private MiniProgramProductMallService miniProgramProductMallService; @Autowired
private MiniProgramProductMallService miniProgramProductMallService;
@ApiOperation("产品类目") @ApiOperation("产品类目")
@GetMapping("/category") @GetMapping("/category")
......
package com.mmc.pms.dao;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author LW
*
* @date 2023/6/6 10:48 概要:
*/
@Mapper
public interface BackstageTaskServiceDao {
Integer insert(ServiceDO serviceDO);
Integer update(ServiceDO serviceDO);
Integer deleteById(Integer id);
ServiceDO queryById(Integer id);
List<ServiceDO> queryAllByLimit(ServiceQO param);
Integer count(ServiceQO param);
int conditionCount(@Param("param") ServiceQO param, @Param("categoriesIds") List<Integer> categoriesIds, @Param("userIds") List<Integer> userIds);
List<ServiceDO> queryPageByLimit(@Param("param") ServiceQO param,@Param("categoriesIds") List<Integer> categoriesIds, @Param("userIds") List<Integer> userIds);
List<ServiceDTO> QueryWorkServiceListById(@Param("ids") List<Integer> ids);
}
package com.mmc.pms.dao; package com.mmc.pms.dao;
import com.mmc.pms.entity.Categories; import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.Directory; import com.mmc.pms.entity.DirectoryDO;
import com.mmc.pms.model.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.vo.DirectoryInfoVO; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.vo.QueryClassifyVO; import com.mmc.pms.model.sale.vo.QueryClassifyVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @author 23214 * @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Mapper * @description 针对表【categories(通用分类表)】的数据库操作Mapper
* @createDate 2023-05-24 10:29:28 * @createDate 2023-05-24 10:29:28 @Entity com.mmc.pms.entity.Categories
* @Entity com.mmc.pms.entity.Categories
*/ */
@Mapper @Mapper
public interface CategoriesDao { public interface CategoriesDao {
int countUpdateDirectoryName(DirectoryInfoVO param); int countUpdateDirectoryName(DirectoryInfoVO param);
void insertDirectory(Directory directory); void insertDirectory(DirectoryDO directory);
void updateDirectory(Directory directory); void updateDirectory(DirectoryDO directory);
int countDirectoryList(); int countDirectoryList();
List<Directory> directoryList(int i, Integer pageSize); List<DirectoryDO> directoryList(int pageNo, Integer pageSize, Integer type);
int countDirectory(Integer id); int countDirectory(Integer id);
...@@ -42,13 +43,25 @@ public interface CategoriesDao { ...@@ -42,13 +43,25 @@ public interface CategoriesDao {
Categories getGoodsGroupById(Integer id); Categories getGoodsGroupById(Integer id);
int updateTypeSort(Integer firstId, Integer sort); int updateTypeSort(Integer id, Integer sort);
List<Categories> selectAllClassification(QueryClassifyVO queryClassifyVO); List<Categories> selectAllClassification(QueryClassifyVO queryClassifyVO);
int countListClassification(QueryClassifyVO queryClassifyVO); int countListClassification(QueryClassifyVO queryClassifyVO);
}
DirectoryDO selectDirectoryById(Integer id);
int deleteById(Integer id);
List<DirectoryDO> getDirectoryList(Integer type);
List<Categories> getCategoriesByDirectoryId(Integer directoryId);
List<Categories> getCategoriesListByIds(@Param("ids") Set<Integer> ids);
List<Categories> selectCategoryByDirectoryId(List<Integer> directoryIds);
List<Categories> getCategoriesListByDirectoryIds(List<Integer> directoryIds);
int countChildById(Integer id);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.DirectoryDO;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author Pika
* @since 2023-06-08
*/
@Mapper
public interface DirectoryDao {
DirectoryDO getDirectoryByName(String directoryName);
}
package com.mmc.pms.dao; package com.mmc.pms.dao;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.vo.GoodsAddVO; import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO;
import com.mmc.pms.model.sale.vo.SpecPriceVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @author 23214 * @author 23214
* @description 针对表【goods_info(商品基本信息)】的数据库操作Mapper * @description 针对表【goods_info(商品基本信息)】的数据库操作Mapper
* @createDate 2023-05-27 14:08:45 * @createDate 2023-05-27 14:08:45 @Entity com.mmc.pms.entity.GoodsInfo
* @Entity com.mmc.pms.entity.GoodsInfo
*/ */
@Mapper @Mapper
public interface GoodsInfoDao { public interface GoodsInfoDao {
...@@ -42,8 +45,69 @@ public interface GoodsInfoDao { ...@@ -42,8 +45,69 @@ public interface GoodsInfoDao {
void deleteGoodsVideoById(Integer id); void deleteGoodsVideoById(Integer id);
void deleteGoodsServiceByGoodsId(Integer id); void deleteGoodsServiceByGoodsId(Integer id);
}
void insertMallIndustrySkuInfo(MallIndustrySkuInfoDO mallIndustrySkuInfoDO);
void insertMallIndustrySkuInfoSpec(MallIndustrySkuInfoSpecDO mallIndustrySkuInfoSpecDO);
List<MallProdInfoDO> getMallProSkuInfo(Integer id);
void batchUpdateMallProductSku(List<Integer> delIds);
void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> mallProdSkuInfoList);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id);
GoodsInfo getGoodsSimpleInfo(Integer goodsInfoId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsInfoId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsInfoId);
List<SkuUnitDO> getSkuUnit();
List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids);
void insertMallProdSkuInfo(MallProdInfoDO mallProdSkuInfoDO);
void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO);
void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
List<MallProdSkuInfoSpecDO> listMallProdSpecInfo(List<Integer> mallSkuIds);
void batchUpdateMallProdSpec(List<Integer> delSpecId);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds);
List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds);
List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo(
@Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds);
List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds);
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id);
List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId);
List<MallProdSkuInfoSpecDO> listMallprodSpecById(List<Integer> goodsIds);
List<SaleServiceDO> listSaleServiceInfo();
int countListGoodsInfo(MallGoodsQO param);
List<GoodsInfo> listGoodsInfo(MallGoodsQO param);
void batchUpOrDownWare(@Param("ids") List<Integer> ids, @Param("status") Integer status);
void removeWareInfo(List<Integer> ids);
List<SpecPriceVO> getPriceBySpecId(Integer productSpecId, Integer leaseTerm);
int countGoodsInfoByCategoryId(Integer id);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.qo.IndustrySkuQO;
import com.mmc.pms.model.sale.dto.IndustrySpecCPQVO;
import com.mmc.pms.model.sale.vo.IndustrySkuVO;
import com.mmc.pms.model.sale.vo.IndustrySpecVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* @Author LW
* @date 2022/10/8 10:58
* 概要:
*/
@Mapper
public interface IndustrySpecDao {
int countSkuName(IndustrySkuVO param);
int insertIndustrySku(IndustrySku industrySku);
int countIndustrySkuById(Integer id);
IndustrySku getIndustrySkuById(Integer id);
int updateIndustrySku(IndustrySku industrySku);
int countListPageIndustrySku(IndustrySkuQO param);
List<IndustrySku> listPageIndustrySku(IndustrySkuQO param);
int countSpecName(IndustrySpecVO param);
int insertIndustrySpec(IndustrySpecDO industrySpecDO);
void insertIndustryProductInventory(IndustryProductInventoryDO industryProductInventoryDO);
void insertInventorySpec(InventorySpecDO inventorySpecDO);
int countIndustrySpec(Integer industrySpecId);
IndustrySpecDO getIndustrySpecById(Integer industrySpecId);
List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId);
int updateIndustrySpec(IndustrySpecDO industrySpecDO);
void batchDeleteInventorySpec(List<Integer> industryProductInventoryIds);
void deleteIndustryProductInventory(Integer id);
int countListPageIndustrySpec(Integer id, String keyword);
List<IndustrySpecDO> listPageIndustrySpec(int pageNo, Integer pageSize, Integer industrySkuId, String keyword);
int batchInsertSpecPrice(List<IndustrySpecPriceDO> list);
void removeIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ);
void batchInsertLeaseSpecPrice(List<IndustrySpecPriceDO> list);
List<IndustrySpecPriceDO> getIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ);
void batchUpdateMallIndustrySpec(@Param("list") List<Integer> list, @Param("id") Integer id);
void batchUpdateMallIndustrySku(@Param("list") List<Integer> list);
void batchUpdateMallIndustrySkuInfo(List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList);
List<MallIndustrySkuInfoSpecDO> listMallIndustrySpecInfo(List<Integer> mallSkuIds);
void batchUpdateMallIndustSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
List<IndustryProductInventoryDO> listIndustryProdInventory(Set<Integer> inventoryIds);
List<IndustrySpecDO> listIndustrySpec(Set<Integer> industrySpecIds);
int countIndustrySpecBySkuId(Integer id);
void removeIndustrySku(Integer id);
List<MallIndustrySkuInfoSpecDO> listMallIndustrySpec(Integer id);
void removeIndustryProductInventory(List<Integer> collect);
List<InventorySpecDO> listInventorySpec(List<Integer> ids);
void removeInventorySpec(List<Integer> ids);
void removeIndustrySpec(Integer id);
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer tagInfoId, List<Integer> industrySpecIds);
List<IndustrySpecPriceDO> getIndustrySpecPriceList(List<Integer> specIds);
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.InspComtDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 评论表 Mapper 接口
* </p>
*
* @author Pika
* @since 2023-06-09
*/
@Mapper
public interface InspComtDao {
List<InspComtDO> randomGetInspComtList(Integer size);
}
...@@ -2,7 +2,6 @@ package com.mmc.pms.dao; ...@@ -2,7 +2,6 @@ package com.mmc.pms.dao;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.qo.GoodsInfoQO; import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.service.Impl.IndustryProductInventoryDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -22,7 +21,7 @@ public interface MiniProgramProductMallDao { ...@@ -22,7 +21,7 @@ public interface MiniProgramProductMallDao {
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsId); List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsId);
List<MallProdSkuInfoDO> getMallProdInfoByGoodsId(Integer goodsId); List<MallProdInfoDO> getMallProdInfoByGoodsId(Integer goodsId);
List<MallProdSkuInfoSpecDO> listMallProdSkuInfoSpec(Integer goodsId); List<MallProdSkuInfoSpecDO> listMallProdSkuInfoSpec(Integer goodsId);
......
package com.mmc.pms.dao;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.lease.vo.PriceAcquisition;
import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSkuQO;
import com.mmc.pms.model.sale.dto.ProductSkuVO;
import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.sale.dto.ProductSpecVO;
import com.mmc.pms.model.sale.vo.ProductSpecCPQVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
/**
* @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @createDate 2023-05-25 14:55:56 @Entity com.mmc.pms.entity.ProductSku
*/
@Mapper
public interface ProductDao {
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(@Param("id") Integer id, @Param("keyword") String keyword);
List<ProductSpecDO> listPageProductSpec(
@Param(value = "pageNo") Integer pageNo,
@Param(value = "pageSize") Integer pageSize,
@Param(value = "productSkuId") Integer productSkuId,
@Param(value = "keyword") String keyword);
int batchInsertSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list);
void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO);
void insertMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<ProductSpecDO> listProductSpec(Integer id);
List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId);
List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds);
List<ProductSpecDO> listProductSpecInfo(List<Integer> productSpecIds);
void batchUpdateMallProdSpec(List<Integer> delProductSpecId);
int countProductSpecByBrandId(Integer id);
int countSpecByProdSkuId(Integer id);
void removeProductSku(Integer id);
void removeProductSpec(Integer id);
List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds);
List<InventorySpecDO> listInventorySpec(Integer id);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
/**
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds);
List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId);
Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds);
List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<MallProdSkuInfoSpecDO> listMallProductSpec(Integer id);
List<ProductSpecPriceDO> getProductSpecPriceList(List<Integer> specIds);
ProductSpecPriceDO getProductSpecPriceById(Integer id);
List<DirectoryDO> productDirectoryList();
}
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.dao;
/**
* @Author LW
* @date 2023/6/7 13:52
* 概要:
*/
public interface WebAndMiniProgramCategoryDao {
}
package com.mmc.pms.dao; package com.mmc.pms.dao;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.AdDTO; import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.qo.WareInfoQO; import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -35,9 +34,15 @@ public interface WebDeviceDao { ...@@ -35,9 +34,15 @@ public interface WebDeviceDao {
List<WareInfoDO> detail(Integer id); List<WareInfoDO> detail(Integer id);
int countListWareInfoPage(WareInfoQO param); int countListWareInfoPage(
@Param("categoryIds") List<Integer> categoryIds,
@Param("userIds") List<Integer> userIds,
@Param("type") Integer type);
List<WareInfoDO> listWareInfoPage(WareInfoQO param); List<GoodsInfo> listWareInfoPage(
@Param("param") WareInfoQO param,
@Param("userIds") List<Integer> userIds,
@Param("type") Integer type);
WareInfoDO getWareInfoById(Integer id); WareInfoDO getWareInfoById(Integer id);
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.dto.DeviceCategoryDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.mmc.pms.model.dto.BrandDTO; import com.mmc.pms.model.lease.dto.BrandDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.BrandInfoDTO; import com.mmc.pms.model.sale.dto.BrandInfoDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.categories.dto.CategoriesInfoListDTO;
import com.mmc.pms.model.dto.ClassifyDetailsDTO; import com.mmc.pms.model.categories.dto.CategoryTypeDTO;
import com.mmc.pms.model.dto.ClassifyInfoDTO; import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.dto.ClassifyInfoDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -12,8 +13,7 @@ import java.io.Serializable; ...@@ -12,8 +13,7 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* @author lw * @author lw @TableName categories
* @TableName categories
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
...@@ -53,16 +53,39 @@ public class Categories implements Serializable { ...@@ -53,16 +53,39 @@ public class Categories implements Serializable {
} }
public ClassifyInfoDTO buildClassifyInfoDTO() { public ClassifyInfoDTO buildClassifyInfoDTO() {
return ClassifyInfoDTO.builder().id(id).description(description) return ClassifyInfoDTO.builder()
.icon(icon).pid(parentId).classifyName(name) .id(id)
.remark(remark).createTime(createTime) .description(description)
.directoryId(directoryId).type(type).build(); .icon(icon)
.pid(parentId)
.classifyName(name)
.remark(remark)
.createTime(createTime)
.directoryId(directoryId)
.type(type)
.build();
} }
public ClassifyDetailsDTO buildClassifyDetailsDTO() { public ClassifyDetailsDTO buildClassifyDetailsDTO() {
return ClassifyDetailsDTO.builder().id(id).description(description) return ClassifyDetailsDTO.builder()
.icon(icon).classifyName(name) .id(id)
.remark(remark).build(); .description(description)
.icon(icon)
.classifyName(name)
.remark(remark)
.build();
}
public CategoriesInfoListDTO buildCategoriesInfoListDTO() {
return CategoriesInfoListDTO.builder()
.id(id)
.directoryId(directoryId)
.icon(icon)
.name(name)
.build();
}
public CategoryTypeDTO buildCategoryTypeDTO() {
return CategoryTypeDTO.builder().id(id).categoryName(name).build();
} }
} }
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.DeviceCategoryDTO; import com.mmc.pms.model.lease.dto.DeviceCategoryDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.DeviceListDTO; import com.mmc.pms.model.lease.dto.DeviceListDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
......
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.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 目录管理表(Directory)实体类
*
* @author makejava
* @since 2023-05-24 14:58:31
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DirectoryDO implements Serializable {
private static final long serialVersionUID = 713939370607409336L;
/** 主键id */
private Integer id;
/** 目录名称 */
private String directoryName;
/** 其他目录关联id */
private Integer pid;
/** 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录) */
private Integer type;
/** 创建时间 */
private Date createTime;
/** 修改时间 */
private Date updateTime;
/** 是否删除 */
private Integer deleted;
private String show;
private String relevanceName;
public DirectoryDO(DirectoryInfoVO param) {
if (CollectionUtils.isNotEmpty(param.getShow())) {
String show = param.getShow().stream().map(Object::toString).collect(Collectors.joining(","));
this.show = show;
}
this.id = param.getId();
this.directoryName = param.getDirectoryName();
this.type = param.getType();
}
public DirectoryInfoVO buildDirectoryInfoVO() {
List<Integer> show = null;
if (!StringUtils.isBlank(this.show)) {
String[] split = this.show.split(",");
show = Arrays.stream(split).map(Integer::parseInt).collect(Collectors.toList());
}
return DirectoryInfoVO.builder()
.id(id)
.directoryName(directoryName)
.show(show)
.type(type)
.build();
}
public AllCategoryDTO buildAllCategoryDTO() {
return AllCategoryDTO.builder().directoryId(id).name(directoryName).build();
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.DistrictInfoDTO; import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsDetailInfoDTO; import com.mmc.pms.model.sale.dto.GoodsDetailInfoDTO;
import com.mmc.pms.model.vo.GoodsDetailVO; import com.mmc.pms.model.sale.vo.GoodsDetailVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsImgDTO; import com.mmc.pms.model.sale.dto.GoodsImgDTO;
import com.mmc.pms.model.vo.GoodsImgVO; import com.mmc.pms.model.sale.vo.GoodsImgVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.vo.GoodsAddVO; import com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO;
import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.sale.vo.GoodsAddVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -9,8 +12,7 @@ import java.io.Serializable; ...@@ -9,8 +12,7 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* @author 23214 * @author 23214 @TableName goods_info
* @TableName goods_info
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
...@@ -48,6 +50,16 @@ public class GoodsInfo implements Serializable { ...@@ -48,6 +50,16 @@ public class GoodsInfo implements Serializable {
private Integer deleted; private Integer deleted;
private Integer goodsVideoId;
private String videoUrl;
private String mainImg;
private Integer isCoupons;
private String directoryName;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public GoodsInfo(GoodsAddVO goodsAddVO) { public GoodsInfo(GoodsAddVO goodsAddVO) {
...@@ -60,4 +72,34 @@ public class GoodsInfo implements Serializable { ...@@ -60,4 +72,34 @@ public class GoodsInfo implements Serializable {
this.ecoLabel = goodsAddVO.getTag(); this.ecoLabel = goodsAddVO.getTag();
this.goodsType = goodsAddVO.getGoodsType(); this.goodsType = goodsAddVO.getGoodsType();
} }
public GoodsInfo(Integer id) {
this.id = id;
}
public RelevanceGoodsInfoVO buildRelevanceGoodsInfoVO() {
return RelevanceGoodsInfoVO.builder()
.id(id)
.goodsName(goodsName)
.shelf(shelfStatus)
.mainImage(mainImg)
.build();
}
public LeaseGoodsInfoDTO buildLeaseGoodsInfoDTO() {
return LeaseGoodsInfoDTO.builder().id(id).goodsName(goodsName).images(mainImg).build();
}
public GoodsInfoListDTO buildGoodsInfoListDTO() {
return GoodsInfoListDTO.builder()
.id(id)
.goodsName(goodsName)
.directoryName(directoryName)
.directoryId(directoryId)
.createTime(createTime)
.imgUrl(mainImg)
.status(shelfStatus)
.isCoupons(this.isCoupons)
.build();
}
} }
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AppGoodsInfoDTO; import com.mmc.pms.model.sale.dto.AppGoodsInfoDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO; import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.vo.CategoryParamAndValueVO; import com.mmc.pms.model.categories.vo.CategoryParamAndValueVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -45,7 +45,9 @@ public class GoodsInfoDO implements Serializable { ...@@ -45,7 +45,9 @@ public class GoodsInfoDO implements Serializable {
private Integer standardProduct; private Integer standardProduct;
private String tag; private String tag;
/** 辅助字段-start */ /**
* 辅助字段-start
*/
private String videoUrl; private String videoUrl;
private Integer goodsVideoId; private Integer goodsVideoId;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsQaDTO;
import com.mmc.pms.model.vo.GoodsQaVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -25,13 +23,4 @@ public class GoodsQaDO implements Serializable { ...@@ -25,13 +23,4 @@ public class GoodsQaDO implements Serializable {
private Integer deleted; private Integer deleted;
private Date updateTime; private Date updateTime;
private Date createTime; private Date createTime;
public GoodsQaDO(GoodsQaVO goodsQaVO) {
this.question = goodsQaVO.getQuestion();
this.answer = goodsQaVO.getAnswer();
}
public GoodsQaDTO buildGoodsQaDTO() {
return GoodsQaDTO.builder().id(this.id).answer(this.answer).question(this.question).build();
}
} }
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsOtherServiceDTO; import com.mmc.pms.model.sale.dto.GoodsOtherServiceDTO;
import com.mmc.pms.model.dto.GoodsServiceDTO; import com.mmc.pms.model.sale.dto.GoodsServiceDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -24,11 +24,16 @@ public class GoodsServiceDO implements Serializable { ...@@ -24,11 +24,16 @@ public class GoodsServiceDO implements Serializable {
private Integer saleServiceId; private Integer saleServiceId;
private Date createTime; private Date createTime;
/** 辅助字段-start */ /**
* 辅助字段-start
*/
private String serviceName; private String serviceName;
private String remark; private String remark;
/** 辅助字段-end */
/**
* 辅助字段-end
*/
public GoodsServiceDTO buildGoodsServiceDTO() { public GoodsServiceDTO buildGoodsServiceDTO() {
return GoodsServiceDTO.builder() return GoodsServiceDTO.builder()
.id(this.id) .id(this.id)
......
package com.mmc.pms.service.Impl; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ProductInventoryVO; import com.mmc.pms.model.sale.dto.ProductInventoryVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity;
import com.mmc.pms.model.sale.dto.IndustrySkuDTO;
import com.mmc.pms.model.sale.vo.IndustrySkuVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* 行业sku表(IndustrySku)实体类
*
* @author makejava
* @since 2023-05-30 15:01:54
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndustrySku implements Serializable {
private static final long serialVersionUID = 165189738203335092L;
private Integer id;
private String solutionName;
private Integer categoriesId;
private String description;
private Date createTime;
private Date updateTime;
private Integer deleted;
private String typeName;
public IndustrySku(IndustrySkuVO param) {
this.id = param.getId();
this.solutionName = param.getSolutionName();
this.categoriesId = param.getCategoryId();
this.description = param.getDescription();
}
public IndustrySkuVO buildIndustrySku() {
return IndustrySkuVO.builder().id(this.id).description(this.description)
.categoryId(this.categoriesId).categoryName(typeName).solutionName(this.solutionName).build();
}
public IndustrySkuDTO buildIndustrySkuDTO() {
return IndustrySkuDTO.builder().id(this.id).description(this.description)
.createTime(this.createTime).categoryId(this.categoriesId)
.categoryName(this.typeName).solutionName(this.solutionName).build();
}
}
package com.mmc.pms.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 行业规格表
* (IndustrySpec)实体类
*
* @author makejava
* @since 2023-05-30 15:02:08
*/
public class IndustrySpec implements Serializable {
private static final long serialVersionUID = -87945230737895634L;
private Integer id;
/**
* 行业sku id
*/
private Integer industrySkuId;
/**
* 规格名称
*/
private String specName;
/**
* 规格图片
*/
private String specImage;
private Date createTime;
private Date updateTime;
private Integer isDeleted;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getIndustrySkuId() {
return industrySkuId;
}
public void setIndustrySkuId(Integer industrySkuId) {
this.industrySkuId = industrySkuId;
}
public String getSpecName() {
return specName;
}
public void setSpecName(String specName) {
this.specName = specName;
}
public String getSpecImage() {
return specImage;
}
public void setSpecImage(String specImage) {
this.specImage = specImage;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.MallIndustrySpecDTO; import com.mmc.pms.model.sale.dto.IndustrySpecDTO;
import com.mmc.pms.model.vo.IndustrySpecVO; import com.mmc.pms.model.sale.dto.MallIndustrySpecDTO;
import com.mmc.pms.model.sale.vo.IndustrySpecVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -34,7 +35,7 @@ public class IndustrySpecDO implements Serializable { ...@@ -34,7 +35,7 @@ public class IndustrySpecDO implements Serializable {
this.specImage = param.getSpecImage(); this.specImage = param.getSpecImage();
} }
/* public IndustrySpecDTO buildIndustrySpecDTO() { public IndustrySpecDTO buildIndustrySpecDTO() {
return IndustrySpecDTO.builder() return IndustrySpecDTO.builder()
.id(this.id) .id(this.id)
.industrySkuId(this.industrySkuId) .industrySkuId(this.industrySkuId)
...@@ -42,7 +43,7 @@ public class IndustrySpecDO implements Serializable { ...@@ -42,7 +43,7 @@ public class IndustrySpecDO implements Serializable {
.specName(this.specName) .specName(this.specName)
.createTime(this.createTime) .createTime(this.createTime)
.build(); .build();
}*/ }
public MallIndustrySpecDTO buildMallIndustrySpecDTO() { public MallIndustrySpecDTO buildMallIndustrySpecDTO() {
return MallIndustrySpecDTO.builder() return MallIndustrySpecDTO.builder()
......
package com.mmc.pms.entity;
import com.mmc.pms.model.sale.dto.IndustrySpecPriceDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author LW
* @date 2022/10/13 16:10
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndustrySpecPriceDO implements Serializable {
private static final long serialVersionUID = -6424007941913778680L;
private Integer id;
private Integer industrySpecId;
private Integer cooperationTag;
private BigDecimal price;
private Date createTime;
private Date updateTime;
private Integer deleted;
private Integer type;
private Integer leaseTerm;
public IndustrySpecPriceDTO buildIndustrySpecPriceDTO() {
return IndustrySpecPriceDTO.builder().id(this.id).industrySpecId(this.industrySpecId)
.cooperationTag(this.cooperationTag).leaseTerm(leaseTerm).price(this.price).createTime(this.createTime).build();
}
}
package com.mmc.pms.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
* 评论表
* </p>
*
* @author Pika
* @since 2023-06-09
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class InspComtDO implements Serializable {
private static final long serialVersionUID = 1896389867L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "头像")
private String userImg;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "评价内容")
private String content;
@ApiModelProperty(value = "评价图片集合 1.jpg,2.jpg 使用逗号隔开")
private String contentImgs;
@ApiModelProperty(value = "评价视频")
private String contentVideo;
@ApiModelProperty(value = "评价星级")
private Integer star;
@ApiModelProperty(value = "关键字集合 深圳市,广州市,长沙市使用逗号隔开")
private String tags;
@ApiModelProperty(value = "是否带图 0:带图 1:不带图")
private Integer isImg;
@ApiModelProperty(value = "评价类型:0:好评 1:差评")
private Integer type;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.order.dto.OrderGoodsIndstDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:50
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsInfoSimpleDO implements Serializable {
private static final long serialVersionUID = -9183566814152128414L;
@ApiModelProperty(value = "商品id")
private Integer id;
@ApiModelProperty(value = "商品所属类型")
private Integer directoryId;
@ApiModelProperty(value = "商品编号")
private String goodsNo;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品主图")
private String mainImg;
@ApiModelProperty(value = "状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "是否删除")
private Integer deleted;
@ApiModelProperty(value = "商品规格信息")
private List<MallGoodsSpecSimpleDO> mallGoodsSpecSimpleDOS;
public OrderGoodsIndstDTO buildOrderGoodsIndstDTO() {
return OrderGoodsIndstDTO.builder().goodsInfoId(this.id).goodsName(this.goodsName).directoryId(this.directoryId).goodsNo(this.goodsNo).mainImg(this.mainImg).valid(this.deleted.equals(0) && this.shelfStatus.equals(1) ? true : false)
.orderGoodsIndstDetailDTOS(mallGoodsSpecSimpleDOS == null ? null : this.mallGoodsSpecSimpleDOS.stream().map(d -> d.buildOrderGoodsIndstDetailDTO()).collect(Collectors.toList())).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.order.dto.OrderGoodsIndstProdListDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:57
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsProductDO implements Serializable {
private static final long serialVersionUID = -8801235084545192790L;
@ApiModelProperty(value = "行业规格id")
private Integer industrySpecId;
@ApiModelProperty(value = "产品规格id")
private Integer productSpecId;
@ApiModelProperty(value = "产品规格名称")
private String specName;
@ApiModelProperty(value = "产品规格图片")
private String prodSkuSpecImage;
@ApiModelProperty(value = "料号")
private String partNo;
@ApiModelProperty(value = "版本描述")
private String versionDesc;
@ApiModelProperty(value = "商品产品类型名称")
private String goodsTypeName;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "品牌")
private String productBrand;
public OrderGoodsIndstProdListDTO buildOrderGoodsIndstProdListDTO() {
return OrderGoodsIndstProdListDTO.builder().productSpecId(this.productSpecId).prodSkuSpecName(this.specName).prodSkuSpecImage(this.prodSkuSpecImage)
.partNo(this.partNo).versionDesc(this.versionDesc).goodsTypeName(this.goodsTypeName).productName(this.productName).model(this.model).productBrand(this.productBrand).build();
}
}
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* author:zhenjie
* Date:2022/10/15
* time:20:52
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsSpecInfoDO implements Serializable {
private static final long serialVersionUID = -7264365143820916901L;
private Integer id;
private Integer directoryId;
private List<SkuSpecDO> skuSpecDOList;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.order.dto.OrderGoodsIndstDetailDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* author:zhenjie
* Date:2022/10/20
* time:16:47
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MallGoodsSpecSimpleDO implements Serializable {
private static final long serialVersionUID = 1452073707519053399L;
private Integer mallIndustrySkuInfoSpecId;
private Integer industrySpecId;
private String specName;
private String specImage;
private BigDecimal unitPrice;
private Integer skuInfoDeleted;
private Integer skuSpecDeleted;
private Integer specDeleted;
private String unitName;
private List<MallGoodsProductDO> mallGoodsProductDOS;
public OrderGoodsIndstDetailDTO buildOrderGoodsIndstDetailDTO() {
return OrderGoodsIndstDetailDTO.builder().mallIndstSkuInfoSpecId(this.mallIndustrySkuInfoSpecId).industrySpecId(this.industrySpecId).industrySkuSpecName(this.specName)
.industrySkuSpecImage(this.specImage).unitPrice(this.unitPrice).valid(this.skuInfoDeleted.equals(0) && this.skuSpecDeleted.equals(0) && this.specDeleted.equals(0) ? true : false)
.orderGoodsIndstProdListDTOS(mallGoodsProductDOS == null ? null : mallGoodsProductDOS.stream().map(d -> d.buildOrderGoodsIndstProdListDTO()).collect(Collectors.toList()))
.unitName(this.unitName).build();
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsSpecDTO; import com.mmc.pms.model.sale.dto.GoodsSpecDTO;
import com.mmc.pms.model.vo.GoodsSpecVO; import com.mmc.pms.model.sale.vo.GoodsProdSpecVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -23,7 +23,7 @@ public class MallIndustrySkuInfoDO implements Serializable { ...@@ -23,7 +23,7 @@ public class MallIndustrySkuInfoDO implements Serializable {
private Integer goodsInfoId; private Integer goodsInfoId;
private Integer industrySkuId; private Integer industrySkuId;
private String industrySkuSpecName; private String industrySkuSpecName;
private Integer goodsTypeId; private Integer categoriesId;
private Integer chooseType; private Integer chooseType;
private Integer must; private Integer must;
private Integer skuUnitId; private Integer skuUnitId;
...@@ -31,19 +31,23 @@ public class MallIndustrySkuInfoDO implements Serializable { ...@@ -31,19 +31,23 @@ public class MallIndustrySkuInfoDO implements Serializable {
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
/** 辅助字段start */ /**
* 辅助字段start
*/
private String typeName; private String typeName;
private String unitName; private String unitName;
private String industrySkuName; private String industrySkuName;
/** 辅助字段end */ /**
public MallIndustrySkuInfoDO(GoodsSpecVO goodsSpecVO) { * 辅助字段end
*/
public MallIndustrySkuInfoDO(GoodsProdSpecVO goodsSpecVO) {
this.industrySkuId = goodsSpecVO.getSkuId(); this.industrySkuId = goodsSpecVO.getSkuId();
this.chooseType = goodsSpecVO.getChooseType(); this.chooseType = goodsSpecVO.getChooseType();
this.industrySkuSpecName = goodsSpecVO.getGoodsSpecName(); this.industrySkuSpecName = goodsSpecVO.getGoodsSpecName();
this.skuUnitId = goodsSpecVO.getSkuUnitId(); this.skuUnitId = goodsSpecVO.getSkuUnitId();
this.goodsTypeId = goodsSpecVO.getGoodsTypeId(); this.categoriesId = goodsSpecVO.getCategoryId();
this.must = goodsSpecVO.getMust(); this.must = goodsSpecVO.getMust();
} }
...@@ -51,7 +55,7 @@ public class MallIndustrySkuInfoDO implements Serializable { ...@@ -51,7 +55,7 @@ public class MallIndustrySkuInfoDO implements Serializable {
return GoodsSpecDTO.builder() return GoodsSpecDTO.builder()
.id(this.id) .id(this.id)
.goodsSpecName(this.industrySkuSpecName) .goodsSpecName(this.industrySkuSpecName)
.goodsTypeId(this.goodsTypeId) .categoryId(this.categoriesId)
.chooseType(this.chooseType) .chooseType(this.chooseType)
.skuUnitId(skuUnitId) .skuUnitId(skuUnitId)
.unitName(this.unitName) .unitName(this.unitName)
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.GoodsSpecDTO; import com.mmc.pms.model.sale.dto.GoodsSpecDTO;
import com.mmc.pms.model.vo.GoodsSpecVO; import com.mmc.pms.model.sale.vo.GoodsProdSpecVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -17,13 +17,13 @@ import java.util.Date; ...@@ -17,13 +17,13 @@ import java.util.Date;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class MallProdSkuInfoDO implements Serializable { public class MallProdInfoDO 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 categoryId; private Integer categoriesId;
private Integer chooseType; private Integer chooseType;
private Integer must; private Integer must;
private Integer skuUnitId; private Integer skuUnitId;
...@@ -31,22 +31,17 @@ public class MallProdSkuInfoDO implements Serializable { ...@@ -31,22 +31,17 @@ public class MallProdSkuInfoDO implements Serializable {
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer flag; private Integer flag;
private String productSpecIdList; /** 辅助字段 start */
private String beforeUpdateSpec;
/**
* 辅助字段 start
*/
private String typeName; private String typeName;
private String goodsName;
private String unitName; private String unitName;
private String productSkuName; private String productSkuName;
private Integer brandInfoId; private Integer brandInfoId;
/** /** 辅助字段 end */
* 辅助字段 end public MallProdInfoDO(GoodsProdSpecVO goodsSpecVO) {
*/ this.categoriesId = goodsSpecVO.getCategoryId();
public MallProdSkuInfoDO(GoodsSpecVO goodsSpecVO) {
this.categoryId = goodsSpecVO.getGoodsTypeId();
this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName(); this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName();
this.chooseType = goodsSpecVO.getChooseType(); this.chooseType = goodsSpecVO.getChooseType();
this.skuUnitId = goodsSpecVO.getSkuUnitId(); this.skuUnitId = goodsSpecVO.getSkuUnitId();
...@@ -58,7 +53,7 @@ public class MallProdSkuInfoDO implements Serializable { ...@@ -58,7 +53,7 @@ public class MallProdSkuInfoDO implements Serializable {
return GoodsSpecDTO.builder() return GoodsSpecDTO.builder()
.id(this.id) .id(this.id)
.goodsSpecName(this.prodSkuSpecName) .goodsSpecName(this.prodSkuSpecName)
.goodsTypeId(this.categoryId) .categoryId(this.categoriesId)
.chooseType(this.chooseType) .chooseType(this.chooseType)
.skuUnitId(skuUnitId) .skuUnitId(skuUnitId)
.unitName(this.unitName) .unitName(this.unitName)
......
...@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor; ...@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -26,6 +27,7 @@ public class MallProdSkuInfoSpecDO implements Serializable { ...@@ -26,6 +27,7 @@ public class MallProdSkuInfoSpecDO implements Serializable {
private Date updateTime; private Date updateTime;
private String goodsName; private String goodsName;
private BigDecimal price;
private ProductSpecDO productSpecDO; private ProductSpecDO productSpecDO;
} }
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.mmc.pms.model.dto.ModelDTO; import com.mmc.pms.model.other.dto.ModelDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderInfoDTO; import com.mmc.pms.model.order.dto.OrderInfoDTO;
import com.mmc.pms.model.vo.LeaseOrderVO; import com.mmc.pms.model.order.vo.LeaseOrderVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.OrderReceiptDTO; import com.mmc.pms.model.order.dto.OrderReceiptDTO;
import com.mmc.pms.model.vo.OrderReceiptVO; import com.mmc.pms.model.order.vo.OrderReceiptVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ProductCategoryDTO; import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ProductSkuDTO; import com.mmc.pms.model.sale.dto.ProductSkuDTO;
import com.mmc.pms.model.dto.ProductSkuVO; import com.mmc.pms.model.sale.dto.ProductSkuVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -58,6 +58,9 @@ public class ProductSkuDO implements Serializable { ...@@ -58,6 +58,9 @@ public class ProductSkuDO implements Serializable {
.model(this.model) .model(this.model)
.productBrand(this.brandName) .productBrand(this.brandName)
.createTime(this.createTime) .createTime(this.createTime)
.categoriesId(categoriesId)
.productBrandId(brandInfoId)
.directoryId(directoryId)
.categoryName(this.categoryName) .categoryName(this.categoryName)
.directoryName(directoryName) .directoryName(directoryName)
.build(); .build();
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.MallProductSpecDTO; import com.mmc.pms.model.sale.dto.ProductSpecDTO;
import com.mmc.pms.model.dto.ProductSpecDTO; import com.mmc.pms.model.sale.dto.ProductSpecVO;
import com.mmc.pms.model.dto.ProductSpecVO; import com.mmc.pms.model.sale.dto.MallProductSpecDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.ProductSpecPriceDTO; import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.RepoCashDTO; import com.mmc.pms.model.other.dto.RepoCashDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
......
package com.mmc.pms.entity;
import com.mmc.pms.model.sale.dto.SaleServiceDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author LW
*
* @date 2022/3/28 10:24 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaleServiceDO implements Serializable {
private Integer id;
private String serviceName;
private String remark;
private Integer deleted;
private Date updateTime;
private Date createTime;
public SaleServiceDTO buildSaleServiceDTO() {
return SaleServiceDTO.builder().id(this.id).saleServiceName(this.serviceName).build();
}
}
package com.mmc.pms.entity;
import com.mmc.pms.model.work.vo.ServiceVO;
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 LW
*
* @date 2023/6/8 10:33 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ServiceDO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@ApiModelProperty(value = "服务名称")
private String serviceName;
@ApiModelProperty(value = "应用")
private Integer applicationId;
@ApiModelProperty(value = "行业")
private Integer industryId;
@ApiModelProperty(value = "展示状态")
private Integer displayState;
@ApiModelProperty(value = "封面图")
private String coverPlan;
@ApiModelProperty(value = "分享卡片")
private String shareCard;
@ApiModelProperty(value = "视频")
private String video;
@ApiModelProperty(value = "服务介绍")
private String serviceIntroduction;
@ApiModelProperty(value = "创建人id")
private Integer accountId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "逻辑删除字段")
private Integer isDeleted;
public ServiceDO(ServiceVO param, Integer accountId) {
this(param);
this.accountId = accountId;
}
public ServiceDO(ServiceVO param) {
this.id = param.getId();
this.serviceName = param.getServiceName();
this.applicationId = param.getApplicationId();
this.industryId = param.getIndustryId();
this.displayState = param.getDisplayState();
this.coverPlan = param.getCoverPlan();
this.shareCard = param.getShareCard();
this.video = param.getVideo();
this.serviceIntroduction = param.getServiceIntroduction();
}
public ServiceDO(Integer id, Integer accountId) {
this.id = id;
this.accountId = accountId;
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.SkuInfoDTO; import com.mmc.pms.model.lease.vo.WareSkuInfoVO;
import com.mmc.pms.model.vo.WareSkuInfoVO; import com.mmc.pms.model.sale.dto.SkuInfoDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -54,10 +54,10 @@ public class SkuInfoDO implements Serializable { ...@@ -54,10 +54,10 @@ public class SkuInfoDO implements Serializable {
this.stockNum = d.getStockNum(); this.stockNum = d.getStockNum();
} }
public SkuInfoDTO buildSkuInfoDTO(){ public SkuInfoDTO buildSkuInfoDTO() {
return SkuInfoDTO.builder().id(this.id).wareInfoId(this.wareInfoId).skuTitle(this.skuTitle).rentPrice(this.rentPrice).rentDeposit(this.rentDeposit) return SkuInfoDTO.builder().id(this.id).wareInfoId(this.wareInfoId).skuTitle(this.skuTitle).rentPrice(this.rentPrice).rentDeposit(this.rentDeposit)
.stockNum(this.stockNum).saleNum(this.saleNum).createTime(this.createTime).updateTime(this.updateTime) .stockNum(this.stockNum).saleNum(this.saleNum).createTime(this.createTime).updateTime(this.updateTime)
.skuPriceDTOList(CollectionUtils.isEmpty(this.skuPriceDOList) ? null : this.skuPriceDOList.stream().map(d->{ .skuPriceDTOList(CollectionUtils.isEmpty(this.skuPriceDOList) ? null : this.skuPriceDOList.stream().map(d -> {
return d.buildSkuPriceDTO(); return d.buildSkuPriceDTO();
}).collect(Collectors.toList())).build(); }).collect(Collectors.toList())).build();
} }
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.SkuPriceDTO; import com.mmc.pms.model.lease.vo.WareSkuPriceVO;
import com.mmc.pms.model.vo.WareSkuPriceVO; import com.mmc.pms.model.sale.dto.SkuPriceDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -35,7 +35,7 @@ public class SkuPriceDO implements Serializable { ...@@ -35,7 +35,7 @@ public class SkuPriceDO implements Serializable {
this.maxDay = dd.getMaxDay(); this.maxDay = dd.getMaxDay();
} }
public SkuPriceDTO buildSkuPriceDTO(){ public SkuPriceDTO buildSkuPriceDTO() {
return SkuPriceDTO.builder().id(this.id).wareInfoId(this.wareInfoId).skuInfoId(this.skuInfoId).rentPrice(this.rentPrice).minDay(this.minDay) return SkuPriceDTO.builder().id(this.id).wareInfoId(this.wareInfoId).skuInfoId(this.skuInfoId).rentPrice(this.rentPrice).minDay(this.minDay)
.maxDay(this.maxDay).createTime(this.createTime).build(); .maxDay(this.maxDay).createTime(this.createTime).build();
} }
......
package com.mmc.pms.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* author:zhenjie
* Date:2022/10/15
* time:20:55
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SkuSpecDO implements Serializable {
private static final long serialVersionUID = -7601558723724855293L;
private Integer id;
private Integer specDeleted;
private Integer skuSpecDeleted;
private String specName;
}
package com.mmc.pms.entity;
import com.mmc.pms.model.sale.dto.SkuUnitDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author LW
* @date 2022/10/27 16:00
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SkuUnitDO implements Serializable {
private static final long serialVersionUID = 4353340603217315101L;
private Integer id;
private String unitName;
private Integer deleted;
private Date createTime;
private Date updateTime;
public SkuUnitDTO buildSkuUnitDTO() {
return SkuUnitDTO.builder().id(this.id).unitName(this.unitName).createTime(this.createTime).build();
}
}
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.WareDetailDTO; import com.mmc.pms.model.lease.dto.WareDetailDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.WareImgDTO; import com.mmc.pms.model.lease.dto.WareImgDTO;
import com.mmc.pms.model.vo.WareImgVO; import com.mmc.pms.model.lease.vo.WareImgVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AppletWareInfoDTO; import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.model.dto.WareInfoDTO; import com.mmc.pms.model.lease.dto.WareInfoItemDTO;
import com.mmc.pms.model.dto.WareInfoItemDTO; import com.mmc.pms.model.lease.dto.AppletWareInfoDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -43,7 +43,9 @@ public class WareInfoDO implements Serializable { ...@@ -43,7 +43,9 @@ public class WareInfoDO implements Serializable {
private Date updateTime; private Date updateTime;
private Integer pid; private Integer pid;
/** 辅助字段-start */ /**
* 辅助字段-start
*/
private List<WareImgDO> wareImgs; private List<WareImgDO> wareImgs;
// private List<WareVideoDO> wareVideos; // private List<WareVideoDO> wareVideos;
private WarePropDO warePropDO; private WarePropDO warePropDO;
...@@ -51,7 +53,9 @@ public class WareInfoDO implements Serializable { ...@@ -51,7 +53,9 @@ public class WareInfoDO implements Serializable {
// private WareDetailDO wareDetailDO; // private WareDetailDO wareDetailDO;
// private List<SkuInfoDO> skuInfoDOList; // private List<SkuInfoDO> skuInfoDOList;
/** 辅助字段-end */ /**
* 辅助字段-end
*/
public WareInfoDTO buildWareInfoDTO() { public WareInfoDTO buildWareInfoDTO() {
return WareInfoDTO.builder() return WareInfoDTO.builder()
.id(this.id) .id(this.id)
......
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.dto.WarePropDTO; import com.mmc.pms.model.lease.dto.WarePropDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package com.mmc.pms.feign;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mmc.pms.auth.dto.BUserAccountQO;
import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import com.mmc.pms.feign.hystrix.UserAppApiHystrix;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: zj
* @Date: 2023/5/18 17:06
*/
//@FeignClient(name = "cms-svc", fallback = UserAppApiHystrix.class)
@FeignClient(url = "${iuav.userapp.url}", name = "cms-svc", fallback = UserAppApiHystrix.class)
public interface UserAppApi {
/**
* 根据用户id获取基本信息
*
* @param userAccountId
* @return
*/
@RequestMapping(value = "/userapp/user-account/feignGetUserSimpleInfo", method = RequestMethod.GET)
public UserAccountSimpleDTO feignGetUserSimpleInfo(@RequestParam Integer userAccountId, @RequestHeader("token") String token);
/**
* 根据地区信息查询用户id
*
* @param provinceCode
* @param cityCode
* @param districtCode
* @return
*/
@GetMapping("/userapp/user-account/feignListUserAccountIds")
List<Integer> feignListUserAccountIds(@RequestParam Integer provinceCode, @RequestParam(required = false) Integer cityCode,
@RequestParam(required = false) Integer districtCode, @RequestHeader(value = "token", required = false) String token);
/**
* 获取用户集合列表页面
*
* @param bUserAccountQO 问:b用户帐户
* @return {@link List}<{@link UserAccountSimpleDTO}>
*/
@PostMapping("/userapp/back-user/feignListBAccountPage")
List<UserAccountSimpleDTO> feignListBAccountPage(@ApiParam(value = "账号查询QO", required = true) @RequestBody BUserAccountQO bUserAccountQO, @RequestHeader("token") String token);
}
package com.mmc.pms.feign.config;
import com.mmc.pms.feign.hystrix.UserAppApiHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author: zj
* @Date: 2023/5/18 18:21
*/
@ComponentScan(basePackages = "com.mmc.pms.feign")
@Configuration
public class FeignConfiguration {
@Bean(name = "userAppApiHystrix")
public UserAppApiHystrix userAppApi() {
return new UserAppApiHystrix();
}
}
package com.mmc.pms.feign.hystrix;
import com.mmc.pms.auth.dto.BUserAccountQO;
import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import com.mmc.pms.feign.UserAppApi;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/18 17:08
*/
@Slf4j
public class UserAppApiHystrix implements UserAppApi {
@Override
public UserAccountSimpleDTO feignGetUserSimpleInfo(Integer userAccountId, String token) {
log.error("熔断:feignGetUserSimpleInfo:{}", userAccountId);
return null;
}
@Override
public List<Integer> feignListUserAccountIds(Integer provinceCode, Integer cityCode, Integer districtCode, String token) {
log.error("熔断:feignListUserAccountIds:{}, {}, {}", provinceCode, cityCode, districtCode);
return null;
}
@Override
public List<UserAccountSimpleDTO> feignListBAccountPage(BUserAccountQO bUserAccountQO, String token) {
log.error("熔断:feignListBAccountPage:{}", bUserAccountQO);
return null;
}
}
/**
* Copyright 2023 bejson.com
*/
package com.mmc.pms.model.categories.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* Auto-generated: 2023-06-08 16:2:43
*
* @author 23214
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AllCategoryDTO implements Serializable {
private static final long serialVersionUID = 1171841063641249397L;
private Integer directoryId;
private String name;
private List<CategoriesInfoListDTO> categoriesInfoListDTO;
}
\ No newline at end of file
package com.mmc.pms.model.categories.dto;
import com.mmc.pms.entity.Categories;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author lw
* @TableName categories
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CategoriesDTO implements Serializable {
private Integer id;
@ApiModelProperty(value = "分类名称")
private String name;
@ApiModelProperty(value = "分类类型")
private Integer type;
public CategoriesDTO(Categories categories) {
this.id = categories.getId();
this.name = categories.getName();
this.type = categories.getType();
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论