提交 121e5a29 作者: panda

Merge remote-tracking branch 'origin/master'

...@@ -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
......
...@@ -5,3 +5,5 @@ metadata: ...@@ -5,3 +5,5 @@ metadata:
namespace: default namespace: default
data: data:
SPRING_PROFILES_ACTIVE: default SPRING_PROFILES_ACTIVE: default
SW_AGENT_COLLECTOR_BACKEND_SERVICES: "default-oap.default:11800"
SW_AGENT_NAME: pms
...@@ -14,10 +14,14 @@ spec: ...@@ -14,10 +14,14 @@ spec:
metadata: metadata:
labels: labels:
app: pms app: pms
swck-java-agent-injected: 'true'
spec: 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
...@@ -29,4 +33,18 @@ spec: ...@@ -29,4 +33,18 @@ spec:
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
name: pms-map name: pms-map
key: SPRING_PROFILES_ACTIVE key: SPRING_PROFILES_ACTIVE
\ No newline at end of file - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
valueFrom:
configMapKeyRef:
name: pms-map
key: SW_AGENT_COLLECTOR_BACKEND_SERVICES
- name: SW_AGENT_NAME
valueFrom:
configMapKeyRef:
name: pms-map
key: SW_AGENT_NAME
volumes:
- name: log-of-app
hostPath:
path: /var/log/app
\ 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: 506594e8af493b698ecb2e75c3f5b291e2f83181 newTag: ccc7c809c80517b9c27c53b03fafcb3feefd04b6
...@@ -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/pms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/pms
newTag: f481d859358f8a8bfbd8b127a3c25a05fc288fa3 newTag: 5e9165eda0f547dc245accbd881d1cbdcf00f20d
...@@ -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) {
......
...@@ -6,18 +6,16 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; ...@@ -6,18 +6,16 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* @author: zj * @author: zj @Date: 2023/5/28 10:52
* @Date: 2023/5/28 10:52
*/ */
@Configuration @Configuration
public class MvcConfiguration implements WebMvcConfigurer { public class MvcConfiguration implements WebMvcConfigurer {
@Autowired @Autowired private TokenCheckHandleInterceptor tokenCheckHandleInterceptor;
private TokenCheckHandleInterceptor tokenCheckHandleInterceptor;
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(tokenCheckHandleInterceptor); registry.addInterceptor(tokenCheckHandleInterceptor);
WebMvcConfigurer.super.addInterceptors(registry); WebMvcConfigurer.super.addInterceptors(registry);
} }
} }
...@@ -8,16 +8,15 @@ import org.springframework.context.annotation.PropertySource; ...@@ -8,16 +8,15 @@ import org.springframework.context.annotation.PropertySource;
import java.util.List; import java.util.List;
/** /**
* @author: zj * @author: zj @Date: 2023/5/28 13:54
* @Date: 2023/5/28 13:54
*/ */
@Data @Data
@Configuration @Configuration
@ConfigurationProperties(prefix = "data-filter", ignoreUnknownFields = false) @ConfigurationProperties(prefix = "data-filter", ignoreUnknownFields = false)
@PropertySource("classpath:not-check.yml") @PropertySource("classpath:not-check.yml")
public class NotCheckUriConfig { public class NotCheckUriConfig {
// 不需要验证token的请求地址 // 不需要验证token的请求地址
private List<String> notAuthPath; private List<String> notAuthPath;
// 不需要验证token的请求地址;// 不需要验证token的请求地址 // 不需要验证token的请求地址;// 不需要验证token的请求地址
private List<String> uploadPath; private List<String> uploadPath;
} }
package com.mmc.pms.auth; package com.mmc.pms.auth;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
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.PathUtil; import com.mmc.pms.util.PathUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter; import java.io.PrintWriter;
/** /**
* @author: zj * @author: zj @Date: 2023/5/28 10:46
* @Date: 2023/5/28 10:46
*/ */
@Slf4j @Slf4j
@Component @Component
public class TokenCheckHandleInterceptor implements HandlerInterceptor { public class TokenCheckHandleInterceptor implements HandlerInterceptor {
@Autowired @Autowired private StringRedisTemplate stringRedisTemplate;
private StringRedisTemplate stringRedisTemplate;
@Autowired @Autowired private NotCheckUriConfig notCheckUriConfig;
private NotCheckUriConfig notCheckUriConfig;
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
String requestURI = request.getRequestURI(); throws Exception {
// //根据uri确认是否要拦截 String requestURI = request.getRequestURI();
if (!shouldFilter(requestURI)) { // //根据uri确认是否要拦截
return true; 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;
} }
String token = request.getHeader("token");
@Override if (StringUtils.isBlank(token)) {
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { exceptionProcess(response);
return false;
} }
String tokenJson = stringRedisTemplate.opsForValue().get(token);
@Override if (StringUtils.isBlank(tokenJson)) {
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 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;
}
public void exceptionProcess(HttpServletResponse response) throws Exception { @Override
response.setContentType("application/json;charset=utf-8"); public void postHandle(
PrintWriter writer = response.getWriter(); HttpServletRequest request,
writer.write(ResultBody.error(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR).toString()); HttpServletResponse response,
writer.close(); 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) { private boolean shouldFilter(String path) {
// 路径与配置的相匹配,则执行过滤 // 路径与配置的相匹配,则执行过滤
for (String pathPattern : notCheckUriConfig.getNotAuthPath()) { for (String pathPattern : notCheckUriConfig.getNotAuthPath()) {
if (PathUtil.isPathMatch(pathPattern, path)) { if (PathUtil.isPathMatch(pathPattern, path)) {
// 如果匹配 // 如果匹配
return false; return false;
} }
}
return true;
} }
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;
}
}
...@@ -7,24 +7,24 @@ import lombok.NoArgsConstructor; ...@@ -7,24 +7,24 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @author 作者 geDuo * @author 作者 geDuo
* @version 创建时间:2021年8月31日 下午8:06:14 * @version 创建时间:2021年8月31日 下午8:06:14
* @explain 类说明 * @explain 类说明
*/ */
@Builder @Builder
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class LoginSuccessDTO implements Serializable { public class LoginSuccessDTO implements Serializable {
private static final long serialVersionUID = -1200834589953161925L; private static final long serialVersionUID = -1200834589953161925L;
private String token; private String token;
private Integer userAccountId; private Integer userAccountId;
private String accountNo; private String accountNo;
private Integer portType; private Integer portType;
private String uid; private String uid;
private String phoneNum; private String phoneNum;
private String userName; private String userName;
private String nickName; private String nickName;
// private RoleInfoDTO roleInfo; // 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;
public interface DateConstant {
String YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";
}
package com.mmc.pms.constant;
/**
* @author: zj
* @Date: 2023/5/31 20:07
*/
public class TokenConstant {
public static final String TOKEN = "token";
}
...@@ -8,90 +8,130 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDTO; ...@@ -8,90 +8,130 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO; import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO; import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.*; 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.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.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; 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 = "新增(租赁/销售)商品")
@PostMapping("addGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addGoods(@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.addGoods(goodsAddVO);
}
@ApiOperation(value = "修改(租赁/销售)商品")
@PostMapping("editGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editGoodsInfo(@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.editGoodsInfo(goodsAddVO);
}
@ApiOperation(value = "PC端-商品详情")
@GetMapping("getGoodsInfoDetail")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
public ResultBody getGoodsInfoDetail(@ApiParam("商品id") @RequestParam Integer goodsInfoId) {
return goodsInfoService.getGoodsInfoDetail(goodsInfoId);
}
@ApiOperation(value = "单位信息")
@GetMapping("getSkuUnit")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)})
public ResultBody getSkuUnit() {
return goodsInfoService.getSkuUnit();
}
@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);
}
@ApiOperation(value = "新增(租赁/销售)商品")
@PostMapping("addGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addGoods(
@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.addGoods(goodsAddVO);
}
@ApiOperation(value = "修改(租赁/销售)商品")
@PostMapping("editGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editGoodsInfo(
@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) {
return goodsInfoService.editGoodsInfo(goodsAddVO);
}
@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; package com.mmc.pms.controller;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.group.Create; import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update; import com.mmc.pms.model.group.Update;
import com.mmc.pms.model.qo.ServiceQO; import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO; 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.model.work.vo.ServiceVO;
import com.mmc.pms.page.PageResult; import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import com.mmc.pms.service.BackstageTaskService; import com.mmc.pms.service.BackstageTaskService;
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.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/6/6 10:41 *
* 概要: * @date 2023/6/6 10:41 概要:
*/ */
@Api(tags = {"后台-服务管理-模块"}) @Api(tags = {"后台-服务管理-模块"})
@RestController @RestController
@RequestMapping("/backstage/work") @RequestMapping("/backstage/work")
public class BackstageTaskServiceController extends BaseController { public class BackstageTaskServiceController extends BaseController {
@Resource @Resource private BackstageTaskService backstageTaskService;
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)})
@PostMapping("deleteWorkService")
public ResultBody deleteWorkService(@ApiParam("作业服务id") @RequestBody List<Integer> ids) {
return backstageTaskService.deleteByIds(ids);
}
@ApiOperation(value = "新增作业服务") @ApiOperation(value = "批量上下架作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("addWorkService") @PostMapping("batchUpAndDownWorkService")
public ResultBody addWorkService(@Validated(Create.class) @RequestBody ServiceVO param, HttpServletRequest request) { public ResultBody batchUpAndDownWorkService(@RequestBody UpAndDownServiceVO param) {
return backstageTaskService.addWorkService(param, this.getUserLoginInfoFromRedis(request).getUserAccountId()); return backstageTaskService.batchUpAndDownWorkService(param);
} }
@ApiOperation(value = "修改作业服务") @ApiOperation(value = "查询作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@PostMapping("updateWorkService") @GetMapping("queryWorkService")
public ResultBody updateWorkService(@Validated(Update.class) @RequestBody ServiceVO param) { public ResultBody<ServiceDTO> queryWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) {
return backstageTaskService.updateById(param); return backstageTaskService.queryById(id);
} }
@ApiOperation(value = "删除作业服务") @ApiOperation(value = "查询服务管理列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@GetMapping("deleteWorkService") @PostMapping("queryServiceManagerList")
public ResultBody deleteWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) { public ResultBody<ServiceDTO> queryServiceManagerList(
return backstageTaskService.deleteById(id); @Validated(Page.class) @RequestBody ServiceQO param, HttpServletRequest request) {
} return ResultBody.success(backstageTaskService.queryServiceManagerList(param, this.getUserLoginInfoFromRedis(request).getUserAccountId()));
}
@ApiOperation(value = "查询作业服务") @ApiOperation(value = "web接口-条件查询作业服务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = WorkServiceDTO.class)})
@GetMapping("queryWorkService") @PostMapping("queryWorkServiceList")
public ResultBody queryWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) { public ResultBody<WorkServiceDTO> queryWorkServiceList(@Validated(Page.class) @RequestBody ServiceQO param, HttpServletRequest request) {
return backstageTaskService.queryById(id); return ResultBody.success(backstageTaskService.queryWorkServiceList(param,request));
} }
@ApiOperation(value = "查询工作服务列表") @ApiOperation(value = "远程查询作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ServiceDTO.class)})
@PostMapping("queryWorkServiceList") @PostMapping("feignQueryWorkServiceListById")
public PageResult queryWorkServiceList(@Validated(Create.class) @RequestBody ServiceQO param, HttpServletRequest request) { @ApiIgnore
return backstageTaskService.queryWorkServiceList(param, this.getUserLoginInfoFromRedis(request).getUserAccountId()); public List<ServiceDTO> feignQueryWorkServiceListById(@RequestBody List<Integer> ids) {
} return backstageTaskService.feignQueryWorkServiceListById(ids);
}
} }
...@@ -11,48 +11,48 @@ import org.springframework.data.redis.core.StringRedisTemplate; ...@@ -11,48 +11,48 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* @author: zj * @author: zj @Date: 2023/5/25 18:11
* @Date: 2023/5/25 18:11
*/ */
public abstract class BaseController { public abstract class BaseController {
@Autowired @Autowired private StringRedisTemplate stringRedisTemplate;
private StringRedisTemplate stringRedisTemplate;
/** /**
* 解析token,获取用户信息 * 解析token,获取用户信息
* @param request *
* @return * @param request
*/ * @return
// public BaseAccountDTO getUserLoginInfo(HttpServletRequest request) { */
// String token = request.getHeader("token"); // public BaseAccountDTO getUserLoginInfo(HttpServletRequest request) {
// try { // String token = request.getHeader("token");
// Claims claims = JwtUtil.parseJwt(token); // try {
// String userId = claims.get(JwtConstant.USER_ACCOUNT_ID).toString(); // Claims claims = JwtUtil.parseJwt(token);
//// String roleId = claims.get("").toString(); // String userId = claims.get(JwtConstant.USER_ACCOUNT_ID).toString();
// String tokenType = claims.get(JwtConstant.TOKEN_TYPE).toString(); //// String roleId = claims.get("").toString();
// return BaseAccountDTO.builder().id(Integer.parseInt(userId)).tokenPort(tokenType).build(); // String tokenType = claims.get(JwtConstant.TOKEN_TYPE).toString();
// }catch (Exception e){ // return
// throw new BizException("Invalid token"); // BaseAccountDTO.builder().id(Integer.parseInt(userId)).tokenPort(tokenType).build();
// } // }catch (Exception e){
// } // throw new BizException("Invalid token");
// }
// }
/** /**
* 使用token从redis获取用户信息 * 使用token从redis获取用户信息
* *
* @param request * @param request
* @return * @return
*/ */
public LoginSuccessDTO getUserLoginInfoFromRedis(HttpServletRequest request) { public LoginSuccessDTO getUserLoginInfoFromRedis(HttpServletRequest request) {
String token = request.getHeader("token"); String token = request.getHeader("token");
if (StringUtils.isBlank(token)) { if (StringUtils.isBlank(token)) {
throw new BizException(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR); 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;
} }
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 getApplicationList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_APPLICATION);
}
@ApiOperation(value = "获取对应行业列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoriesDTO.class)})
@PostMapping("getIndustryList")
public ResultBody getIndustryList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_INDUSTRY);
}
}
...@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum; ...@@ -5,20 +5,16 @@ import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.model.lease.dto.BrandDTO; import com.mmc.pms.model.lease.dto.BrandDTO;
import com.mmc.pms.model.lease.dto.DeviceCategoryDTO; import com.mmc.pms.model.lease.dto.DeviceCategoryDTO;
import com.mmc.pms.model.lease.dto.WareInfoDTO; import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.model.lease.dto.WareInfoItemDTO;
import com.mmc.pms.model.lease.vo.LeaseVo; import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.other.dto.DistrictInfoDTO; import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import com.mmc.pms.model.other.dto.ModelDTO; import com.mmc.pms.model.other.dto.ModelDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.sale.dto.SkuInfoDTO; import com.mmc.pms.model.sale.dto.SkuInfoDTO;
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.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -57,13 +53,13 @@ public class MiniProgramDeviceController { ...@@ -57,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)})
......
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;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
* @date 2023/6/7 13:33
* 概要:
*/
@Api(tags = {"分类信息"})
@RestController
@RequestMapping("/category")
public class WebAndMiniProgramCategoryController {
// @ApiOperation(value = "web-分类信息")
// @PostMapping("queryCategoryByType")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
// public ResultBody<GoodsInfoListDTO> listPageGoodsInfo(
// @ApiParam("商品查询条件QO") @RequestBody GoodsInfoQO param) {
// return ResultBody.success(webProductMallService.listPageGoodsInfo(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.common.ResultEnum;
import com.mmc.pms.model.lease.dto.BrandDTO;
import com.mmc.pms.model.lease.dto.DeviceCategoryDTO;
import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.model.lease.dto.WareInfoItemDTO;
import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.other.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.other.dto.DistrictInfoDTO; import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import com.mmc.pms.model.other.dto.ModelDTO;
import com.mmc.pms.model.qo.WareInfoQO;
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
...@@ -29,75 +21,18 @@ import org.springframework.web.bind.annotation.*; ...@@ -29,75 +21,18 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/webDevice") @RequestMapping("/webDevice")
public class WebDeviceController { public class WebDeviceController {
@Autowired @Autowired private WebDeviceService webDeviceService;
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)})
@GetMapping("/getSecondDistrictInfo") @GetMapping("/getSecondDistrictInfo")
public ResultBody<DistrictInfoDTO> getSecondDistrictInfo() { public ResultBody<DistrictInfoDTO> getSecondDistrictInfo() {
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("设备广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> 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);
}
@ApiOperation("设备广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> ad() {
return webDeviceService.ad();
}
} }
package com.mmc.pms.controller.web;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
* @date 2023/6/8 15:19
* 概要:
*/
@RestController
@RequestMapping("/lease/goods")
@Api(tags = {"web端-设备租赁-相关接口"})
public class WebLeaseGoodsController {
}
package com.mmc.pms.dao; package com.mmc.pms.dao;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.ServiceDO; import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.model.qo.ServiceQO; import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
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;
/** /**
* @Author LW * @Author LW
* @date 2023/6/6 10:48 *
* 概要: * @date 2023/6/6 10:48 概要:
*/ */
@Mapper @Mapper
public interface BackstageTaskServiceDao { public interface BackstageTaskServiceDao {
Integer insert(ServiceDO serviceDO); Integer insert(ServiceDO serviceDO);
Integer update(ServiceDO serviceDO); Integer update(ServiceDO serviceDO);
Integer deleteById(Integer id); Integer deleteByIds(@Param("ids") List<Integer> ids);
ServiceDO queryById(Integer id); ServiceDO queryById(Integer id);
List<ServiceDO> queryAllByLimit(ServiceQO param); List<ServiceDO> queryAllByLimit(ServiceQO param);
Integer count(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);
Integer batchUpAndDownWorkService(@Param("param") UpAndDownServiceVO param);
} }
...@@ -14,53 +14,54 @@ import java.util.Set; ...@@ -14,53 +14,54 @@ 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(DirectoryDO directory); void insertDirectory(DirectoryDO directory);
void updateDirectory(DirectoryDO directory); void updateDirectory(DirectoryDO directory);
int countDirectoryList(); int countDirectoryList();
List<DirectoryDO> directoryList(int pageNo, Integer pageSize, Integer type); List<DirectoryDO> directoryList(int pageNo, Integer pageSize, Integer type);
int countDirectory(Integer id); int countDirectory(Integer id);
void removeDirectory(Integer id); void removeDirectory(Integer id);
int countClassificationByName(ClassifyInfoVO classifyInfoVO); int countClassificationByName(ClassifyInfoVO classifyInfoVO);
int getCountCategoriesByPid(Integer pid, Integer type); int getCountCategoriesByPid(Integer pid, Integer type);
void insertClassification(Categories categories); void insertClassification(Categories categories);
void updateClassification(ClassifyInfoVO classifyInfoVO); void updateClassification(ClassifyInfoVO classifyInfoVO);
Categories getGoodsGroupById(Integer id); Categories getGoodsGroupById(Integer id);
int updateTypeSort(Integer id, 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);
int selectDirectoryById(Integer id); DirectoryDO selectDirectoryById(Integer id);
int deleteById(Integer id); int deleteById(Integer id);
List<DirectoryDO> getDirectoryList(Integer type); List<DirectoryDO> getDirectoryList(Integer type);
List<Categories> getCategoriesByDirectoryId(Integer directoryId); List<Categories> getCategoriesByDirectoryId(Integer directoryId);
List<Categories> getCategoriesListByIds(@Param("ids") Set<Integer> ids);
}
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; package com.mmc.pms.dao;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; 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 org.apache.ibatis.annotations.Param;
...@@ -11,89 +13,105 @@ import java.util.Set; ...@@ -11,89 +13,105 @@ 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 {
int countGoodsInfoByName(GoodsAddVO goodsAddVO); int countGoodsInfoByName(GoodsAddVO goodsAddVO);
void insertGoodsInfo(GoodsInfo goodsInfo); void insertGoodsInfo(GoodsInfo goodsInfo);
int countGoodsInfo(); int countGoodsInfo();
void insertGoodsImgInfo(List<GoodsImgDO> list); void insertGoodsImgInfo(List<GoodsImgDO> list);
void insertVideoInfo(GoodsVideoDO goodsVideoDO); void insertVideoInfo(GoodsVideoDO goodsVideoDO);
void insertGoodsDetail(GoodsDetailDO goodsDetailDO); void insertGoodsDetail(GoodsDetailDO goodsDetailDO);
void insertGoodsService(List<GoodsServiceDO> otherList); void insertGoodsService(List<GoodsServiceDO> otherList);
int countGoodsInfoById(Integer id); int countGoodsInfoById(Integer id);
void updateGoodsInfo(GoodsInfo goodsInfo); void updateGoodsInfo(GoodsInfo goodsInfo);
void updateGoodsDetail(GoodsDetailDO goodsDetailDO); void updateGoodsDetail(GoodsDetailDO goodsDetailDO);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer id); List<GoodsImgDO> listGoodsInfoByGoodsId(Integer id);
void deleteImgByIds(List<Integer> deleteIds); void deleteImgByIds(List<Integer> deleteIds);
void deleteGoodsVideoById(Integer id); void deleteGoodsVideoById(Integer id);
void deleteGoodsServiceByGoodsId(Integer id); void deleteGoodsServiceByGoodsId(Integer id);
void insertMallIndustrySkuInfo(MallIndustrySkuInfoDO mallIndustrySkuInfoDO); void insertMallIndustrySkuInfo(MallIndustrySkuInfoDO mallIndustrySkuInfoDO);
void insertMallIndustrySkuInfoSpec(MallIndustrySkuInfoSpecDO mallIndustrySkuInfoSpecDO); void insertMallIndustrySkuInfoSpec(MallIndustrySkuInfoSpecDO mallIndustrySkuInfoSpecDO);
List<MallProdInfoDO> getMallProSkuInfo(Integer id); List<MallProdInfoDO> getMallProSkuInfo(Integer id);
void batchUpdateMallProductSku(List<Integer> delIds); void batchUpdateMallProductSku(List<Integer> delIds);
void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> mallProdSkuInfoList); void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> list);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id); List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id);
GoodsInfo getGoodsSimpleInfo(Integer goodsInfoId); GoodsInfo getGoodsSimpleInfo(Integer goodsInfoId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsInfoId); GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsInfoId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsInfoId); List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsInfoId);
List<SkuUnitDO> getSkuUnit(); List<SkuUnitDO> getSkuUnit();
List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids); List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids);
void insertMallProdSkuInfo(MallProdInfoDO mallProdSkuInfoDO); void insertMallProdSkuInfo(MallProdInfoDO mallProdSkuInfoDO);
void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO); void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO);
void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id); void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
List<MallProdSkuInfoSpecDO> listMallProdSpecInfo(List<Integer> mallSkuIds); List<MallProdSkuInfoSpecDO> listMallProdSpecInfo(List<Integer> mallSkuIds);
void batchUpdateMallProdSpec(List<Integer> delSpecId); void batchUpdateMallProdSpec(List<Integer> delSpecId);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds); List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds); List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds);
List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds); List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds);
List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo(@Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds); List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo(
@Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds);
List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds); List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds);
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds); List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id); List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id);
List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId); 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);
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId);
}
...@@ -13,89 +13,90 @@ import java.util.Set; ...@@ -13,89 +13,90 @@ import java.util.Set;
/** /**
* @Author LW * @Author LW
* @date 2022/10/8 10:58 *
* 概要: * @date 2022/10/8 10:58 概要:
*/ */
@Mapper @Mapper
public interface IndustrySpecDao { public interface IndustrySpecDao {
int countSkuName(IndustrySkuVO param); int countSkuName(IndustrySkuVO param);
int insertIndustrySku(IndustrySku industrySku); int insertIndustrySku(IndustrySku industrySku);
int countIndustrySkuById(Integer id); int countIndustrySkuById(Integer id);
IndustrySku getIndustrySkuById(Integer id); IndustrySku getIndustrySkuById(Integer id);
int updateIndustrySku(IndustrySku industrySku); int updateIndustrySku(IndustrySku industrySku);
int countListPageIndustrySku(IndustrySkuQO param); int countListPageIndustrySku(IndustrySkuQO param);
List<IndustrySku> listPageIndustrySku(IndustrySkuQO param); List<IndustrySku> listPageIndustrySku(IndustrySkuQO param);
int countSpecName(IndustrySpecVO param); int countSpecName(IndustrySpecVO param);
int insertIndustrySpec(IndustrySpecDO industrySpecDO); int insertIndustrySpec(IndustrySpecDO industrySpecDO);
void insertIndustryProductInventory(IndustryProductInventoryDO industryProductInventoryDO); void insertIndustryProductInventory(IndustryProductInventoryDO industryProductInventoryDO);
void insertInventorySpec(InventorySpecDO inventorySpecDO); void insertInventorySpec(InventorySpecDO inventorySpecDO);
int countIndustrySpec(Integer industrySpecId); int countIndustrySpec(Integer industrySpecId);
IndustrySpecDO getIndustrySpecById(Integer industrySpecId); IndustrySpecDO getIndustrySpecById(Integer industrySpecId);
List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId); List<IndustryProductInventoryDO> getIndustryProductInventory(Integer industrySpecId);
int updateIndustrySpec(IndustrySpecDO industrySpecDO); int updateIndustrySpec(IndustrySpecDO industrySpecDO);
void batchDeleteInventorySpec(List<Integer> industryProductInventoryIds); void batchDeleteInventorySpec(List<Integer> industryProductInventoryIds);
void deleteIndustryProductInventory(Integer id); void deleteIndustryProductInventory(Integer id);
int countListPageIndustrySpec(Integer id, String keyword); int countListPageIndustrySpec(Integer id, String keyword);
List<IndustrySpecDO> listPageIndustrySpec(int pageNo, Integer pageSize, Integer industrySkuId, String keyword); List<IndustrySpecDO> listPageIndustrySpec(
int pageNo, Integer pageSize, Integer industrySkuId, String keyword);
int batchInsertSpecPrice(List<IndustrySpecPriceDO> list); int batchInsertSpecPrice(List<IndustrySpecPriceDO> list);
void removeIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ); void removeIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ);
void batchInsertLeaseSpecPrice(List<IndustrySpecPriceDO> list); void batchInsertLeaseSpecPrice(List<IndustrySpecPriceDO> list);
List<IndustrySpecPriceDO> getIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ); List<IndustrySpecPriceDO> getIndustrySpecCPQ(IndustrySpecCPQVO industrySpecCPQQ);
void batchUpdateMallIndustrySpec(@Param("list") List<Integer> list, @Param("id") Integer id); void batchUpdateMallIndustrySpec(@Param("list") List<Integer> list, @Param("id") Integer id);
void batchUpdateMallIndustrySku(@Param("list") List<Integer> list); void batchUpdateMallIndustrySku(@Param("list") List<Integer> list);
void batchUpdateMallIndustrySkuInfo(List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList); void batchUpdateMallIndustrySkuInfo(List<MallIndustrySkuInfoDO> mallIndustrySkuInfoList);
List<MallIndustrySkuInfoSpecDO> listMallIndustrySpecInfo(List<Integer> mallSkuIds); List<MallIndustrySkuInfoSpecDO> listMallIndustrySpecInfo(List<Integer> mallSkuIds);
void batchUpdateMallIndustSpec(@Param("list") List<Integer> list, @Param("id") Integer id); void batchUpdateMallIndustSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
List<IndustryProductInventoryDO> listIndustryProdInventory(
@Param("inventoryIds") Set<Integer> inventoryIds);
List<IndustryProductInventoryDO> listIndustryProdInventory(Set<Integer> inventoryIds); List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds);
List<IndustrySpecDO> listIndustrySpec(Set<Integer> industrySpecIds); int countIndustrySpecBySkuId(Integer id);
int countIndustrySpecBySkuId(Integer id); void removeIndustrySku(Integer id);
void removeIndustrySku(Integer id); List<MallIndustrySkuInfoSpecDO> listMallIndustrySpec(Integer id);
List<MallIndustrySkuInfoSpecDO> listMallIndustrySpec(Integer id); void removeIndustryProductInventory(List<Integer> collect);
void removeIndustryProductInventory(List<Integer> collect); List<InventorySpecDO> listInventorySpec(List<Integer> ids);
List<InventorySpecDO> listInventorySpec(List<Integer> ids); void removeInventorySpec(List<Integer> ids);
void removeInventorySpec(List<Integer> ids); void removeIndustrySpec(Integer id);
void removeIndustrySpec(Integer id); List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId); List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer tagInfoId, List<Integer> industrySpecIds);
List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer tagInfoId, List<Integer> industrySpecIds); List<IndustrySpecPriceDO> getIndustrySpecPriceList(List<Integer> specIds);
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);
}
...@@ -19,101 +19,103 @@ import java.util.Set; ...@@ -19,101 +19,103 @@ import java.util.Set;
/** /**
* @author 23214 * @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper * @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @createDate 2023-05-25 14:55:56 * @createDate 2023-05-25 14:55:56 @Entity com.mmc.pms.entity.ProductSku
* @Entity com.mmc.pms.entity.ProductSku
*/ */
@Mapper @Mapper
public interface ProductDao { public interface ProductDao {
int countSkuName(ProductSkuVO param); int countSkuName(ProductSkuVO param);
int insertProductSku(ProductSkuDO productSkuDO); int insertProductSku(ProductSkuDO productSkuDO);
int countSkuIsExist(Integer id); int countSkuIsExist(Integer id);
ProductSkuDO getProductSkuDetail(Integer id); ProductSkuDO getProductSkuDetail(Integer id);
int updateProductSku(ProductSkuDO productSkuDO); int updateProductSku(ProductSkuDO productSkuDO);
int countListPageProductSku(ProductSkuQO productSkuQO); int countListPageProductSku(ProductSkuQO productSkuQO);
List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO); List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO);
int countSpecName(ProductSpecVO param); int countSpecName(ProductSpecVO param);
int insertProductSpec(ProductSpecDO productSpecDO); int insertProductSpec(ProductSpecDO productSpecDO);
int updateProductSpec(ProductSpecDO productSpecDO); int updateProductSpec(ProductSpecDO productSpecDO);
int countSpecIsExist(Integer id); int countSpecIsExist(Integer id);
ProductSpecDO getProductSpecDetail(Integer id); ProductSpecDO getProductSpecDetail(Integer id);
int countListPageProductSpec(Integer productSkuId); int countListPageProductSpec(@Param("id") Integer id, @Param("keyword") String keyword);
List<ProductSpecDO> listPageProductSpec(int pageNo, Integer pageSize, Integer productSkuId); 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); int batchInsertSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list); void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO); void insertMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
void insertMallProdSkuInfo(MallProdInfoDO mallProdInfoDO); List<ProductSpecDO> listProductSpec(Integer id);
List<ProductSpecDO> listProductSpec(Integer id); List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId);
List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId); List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds);
List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds); List<ProductSpecDO> listProductSpecInfo(List<Integer> productSpecIds);
List<ProductSpecDO> listProductSpecInfo(List<Integer> productSpecIds); void batchUpdateMallProdSpec(List<Integer> delProductSpecId);
void batchUpdateMallProdSpec(List<Integer> delProductSpecId); int countProductSpecByBrandId(Integer id);
int countProductSpecByBrandId(Integer id); int countSpecByProdSkuId(Integer id);
int countSpecByProdSkuId(Integer id); void removeProductSku(Integer id);
void removeProductSku(Integer id); void removeProductSpec(Integer id);
List<MallProdInfoDO> listMallProdInfo(String id); List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds);
void removeProductSpec(Integer id); List<InventorySpecDO> listInventorySpec(Integer id);
List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds); BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
List<InventorySpecDO> listInventorySpec(Integer id); List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition); /**
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds); ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
/** List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds);
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId); List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId);
List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds); Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds);
List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId); List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds);
List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<MallProdSkuInfoSpecDO> listMallProductSpec(Integer id);
}
List<MallProdSkuInfoSpecDO> listMallProductSpec(Integer id);
List<ProductSpecPriceDO> getProductSpecPriceList(List<Integer> specIds);
ProductSpecPriceDO getProductSpecPriceById(Integer id);
List<DirectoryDO> productDirectoryList();
}
...@@ -4,6 +4,7 @@ import com.mmc.pms.entity.*; ...@@ -4,6 +4,7 @@ import com.mmc.pms.entity.*;
import com.mmc.pms.model.lease.vo.LeaseVo; import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.qo.WareInfoQO; import com.mmc.pms.model.qo.WareInfoQO;
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;
...@@ -12,36 +13,42 @@ import java.util.List; ...@@ -12,36 +13,42 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface WebDeviceDao { public interface WebDeviceDao {
List<DistrictDO> listSecondDistrict(); List<DistrictDO> listSecondDistrict();
List<DeviceCategory> category(); List<DeviceCategory> category();
List<Brand> brand(); List<Brand> brand();
List<Brand> deviceBrand(); List<Brand> deviceBrand();
List<Model> model(); List<Model> model();
List<Model> deviceModel(); List<Model> deviceModel();
List<DeviceListDO> deviceList( List<DeviceListDO> deviceList(
Integer districtId, Integer categoryId, Integer brandId, Integer modelId); Integer districtId, Integer categoryId, Integer brandId, Integer modelId);
int update(LeaseVo param); int update(LeaseVo param);
InventoryDO findInventory(Integer inventoryId); InventoryDO findInventory(Integer inventoryId);
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);
WareDetailDO getWareDetailById(Integer id); WareDetailDO getWareDetailById(Integer id);
List<AdDO> ad(); List<AdDO> ad();
List<SkuInfoDO> listSkuInfo(Integer id); List<SkuInfoDO> listSkuInfo(Integer id);
} }
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.categories.dto.CategoriesInfoListDTO;
import com.mmc.pms.model.categories.dto.CategoryTypeDTO;
import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO; import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.categories.dto.ClassifyInfoDTO; import com.mmc.pms.model.categories.dto.ClassifyInfoDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
...@@ -12,57 +13,79 @@ import java.io.Serializable; ...@@ -12,57 +13,79 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* @author lw * @author lw @TableName categories
* @TableName categories
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Categories implements Serializable { public class Categories implements Serializable {
private Integer id; private Integer id;
private Integer parentId; private Integer parentId;
private String name; private String name;
private String icon; private String icon;
private String description; private String description;
private Integer sort; private Integer sort;
private Integer type; private Integer type;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer deleted; private Integer deleted;
private Integer directoryId; private Integer directoryId;
private String remark; private String remark;
public Categories(ClassifyInfoVO classifyInfoVO) { public Categories(ClassifyInfoVO classifyInfoVO) {
this.id = classifyInfoVO.getId(); this.id = classifyInfoVO.getId();
this.parentId = classifyInfoVO.getPid(); this.parentId = classifyInfoVO.getPid();
this.name = classifyInfoVO.getClassifyName(); this.name = classifyInfoVO.getClassifyName();
this.icon = classifyInfoVO.getIcon(); this.icon = classifyInfoVO.getIcon();
this.description = classifyInfoVO.getDescription(); this.description = classifyInfoVO.getDescription();
this.type = classifyInfoVO.getType(); this.type = classifyInfoVO.getType();
this.directoryId = classifyInfoVO.getDirectoryId(); this.directoryId = classifyInfoVO.getDirectoryId();
this.remark = classifyInfoVO.getRemark(); this.remark = classifyInfoVO.getRemark();
} }
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)
public ClassifyDetailsDTO buildClassifyDetailsDTO() { .createTime(createTime)
return ClassifyDetailsDTO.builder().id(id).description(description) .directoryId(directoryId)
.icon(icon).classifyName(name) .type(type)
.remark(remark).build(); .build();
} }
}
\ No newline at end of file public ClassifyDetailsDTO buildClassifyDetailsDTO() {
return ClassifyDetailsDTO.builder()
.id(id)
.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.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* 目录管理表(Directory)实体类 * 目录管理表(Directory)实体类
...@@ -18,47 +24,52 @@ import java.util.Date; ...@@ -18,47 +24,52 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class DirectoryDO implements Serializable { public class DirectoryDO implements Serializable {
private static final long serialVersionUID = 713939370607409336L; private static final long serialVersionUID = 713939370607409336L;
/** /** 主键id */
* 主键id private Integer id;
*/ /** 目录名称 */
private Integer id; private String directoryName;
/** /** 其他目录关联id */
* 目录名称 private Integer pid;
*/ /** 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录) */
private String directoryName; private Integer type;
/** /** 创建时间 */
* 其他目录关联id private Date createTime;
*/ /** 修改时间 */
private Integer pid; private Date updateTime;
/** /** 是否删除 */
* 类型:(0:通用目录 1:作业服务目录 2:设备目录 3:飞手目录 4:商城目录) private Integer deleted;
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Integer deleted;
private String relevanceName; private String show;
public DirectoryDO(DirectoryInfoVO param) { private String relevanceName;
this.id = param.getId();
this.directoryName = param.getDirectoryName(); public DirectoryDO(DirectoryInfoVO param) {
this.pid = param.getPid(); if (CollectionUtils.isNotEmpty(param.getShow())) {
this.type = param.getType(); 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() { public DirectoryInfoVO buildDirectoryInfoVO() {
return DirectoryInfoVO.builder().id(id).directoryName(directoryName).pid(pid).relevanceName(relevanceName).type(type).build(); 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.categories.vo.RelevanceGoodsInfoVO; 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 com.mmc.pms.model.sale.vo.GoodsAddVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -10,69 +12,94 @@ import java.io.Serializable; ...@@ -10,69 +12,94 @@ 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
@AllArgsConstructor @AllArgsConstructor
public class GoodsInfo implements Serializable { public class GoodsInfo implements Serializable {
private Integer id; private Integer id;
private Integer pid; private Integer pid;
private String goodsNo; private String goodsNo;
private String goodsName; private String goodsName;
private Integer directoryId; private Integer directoryId;
private Integer addGoodsUserId; private Integer addGoodsUserId;
private Integer categoryByOne; private Integer categoryByOne;
private Integer categoryByTwo; private Integer categoryByTwo;
private String ecoLabel; private String ecoLabel;
private Integer shelfStatus; private Integer shelfStatus;
private Integer showCode; private Integer showCode;
private Integer sort; private Integer sort;
private Date createTime; private Date createTime;
private Integer goodsType; private Integer goodsType;
private Date updateTime; private Date updateTime;
private Integer deleted; private Integer deleted;
private Integer goodsVideoId; private Integer goodsVideoId;
private String videoUrl; private String videoUrl;
private String mainImg; private String mainImg;
private static final long serialVersionUID = 1L; private Integer isCoupons;
public GoodsInfo(GoodsAddVO goodsAddVO) { private String directoryName;
this.id = goodsAddVO.getId();
this.goodsName = goodsAddVO.getGoodsName();
this.shelfStatus = goodsAddVO.getShelfStatus();
this.categoryByOne = goodsAddVO.getCategoryByOne();
this.categoryByTwo = goodsAddVO.getCategoryByTwo();
this.directoryId = goodsAddVO.getDirectoryId();
this.ecoLabel = goodsAddVO.getTag();
this.goodsType = goodsAddVO.getGoodsType();
}
public GoodsInfo(Integer id) { private static final long serialVersionUID = 1L;
this.id = id;
}
public RelevanceGoodsInfoVO buildRelevanceGoodsInfoVO() { public GoodsInfo(GoodsAddVO goodsAddVO) {
return RelevanceGoodsInfoVO.builder().id(id).goodsName(goodsName).shelf(shelfStatus).mainImage(mainImg).build(); this.id = goodsAddVO.getId();
} this.goodsName = goodsAddVO.getGoodsName();
} this.shelfStatus = goodsAddVO.getShelfStatus();
\ No newline at end of file this.categoryByOne = goodsAddVO.getCategoryByOne();
this.categoryByTwo = goodsAddVO.getCategoryByTwo();
this.directoryId = goodsAddVO.getDirectoryId();
this.ecoLabel = goodsAddVO.getTag();
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;
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;
}
...@@ -18,56 +18,51 @@ import java.util.Date; ...@@ -18,56 +18,51 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class MallProdInfoDO 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 categoriesId; private Integer categoriesId;
private Integer chooseType; private Integer chooseType;
private Integer must; private Integer must;
private Integer skuUnitId; private Integer skuUnitId;
private Integer deleted; private Integer deleted;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer flag; private Integer flag;
private String productSpecIdList; /** 辅助字段 start */
private String beforeUpdateSpec; private String typeName;
/**
* 辅助字段 start
*/
private String typeName;
private String goodsName;
private String unitName;
private String productSkuName;
private Integer brandInfoId;
/** private String goodsName;
* 辅助字段 end private String unitName;
*/ private String productSkuName;
public MallProdInfoDO(GoodsProdSpecVO goodsSpecVO) { private Integer brandInfoId;
this.categoriesId = goodsSpecVO.getCategoryId();
this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName();
this.chooseType = goodsSpecVO.getChooseType();
this.skuUnitId = goodsSpecVO.getSkuUnitId();
this.must = goodsSpecVO.getMust();
this.flag = goodsSpecVO.getFlag();
}
public GoodsSpecDTO buildGoodsSpecDTO() { /** 辅助字段 end */
return GoodsSpecDTO.builder() public MallProdInfoDO(GoodsProdSpecVO goodsSpecVO) {
.id(this.id) this.categoriesId = goodsSpecVO.getCategoryId();
.goodsSpecName(this.prodSkuSpecName) this.prodSkuSpecName = goodsSpecVO.getGoodsSpecName();
.categoryId(this.categoriesId) this.chooseType = goodsSpecVO.getChooseType();
.chooseType(this.chooseType) this.skuUnitId = goodsSpecVO.getSkuUnitId();
.skuUnitId(skuUnitId) this.must = goodsSpecVO.getMust();
.unitName(this.unitName) this.flag = goodsSpecVO.getFlag();
.skuId(this.prodSkuId) }
.typeName(this.typeName)
.must(must) public GoodsSpecDTO buildGoodsSpecDTO() {
.skuName(this.productSkuName) return GoodsSpecDTO.builder()
.brandInfoId(brandInfoId) .id(this.id)
.flag(flag) .goodsSpecName(this.prodSkuSpecName)
.build(); .categoryId(this.categoriesId)
} .chooseType(this.chooseType)
.skuUnitId(skuUnitId)
.unitName(this.unitName)
.skuId(this.prodSkuId)
.typeName(this.typeName)
.must(must)
.skuName(this.productSkuName)
.brandInfoId(brandInfoId)
.flag(flag)
.build();
}
} }
...@@ -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;
/** /**
...@@ -16,16 +17,17 @@ import java.util.Date; ...@@ -16,16 +17,17 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class MallProdSkuInfoSpecDO implements Serializable { public class MallProdSkuInfoSpecDO implements Serializable {
private static final long serialVersionUID = -8247363408322497387L; private static final long serialVersionUID = -8247363408322497387L;
private Integer id; private Integer id;
private Integer mallProdSkuInfoId; private Integer mallProdSkuInfoId;
private Integer goodsInfoId; private Integer goodsInfoId;
private Integer productSpecId; private Integer productSpecId;
private Integer deleted; private Integer deleted;
private Date createTime; private Date createTime;
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.core.toolkit.StringUtils;
import com.mmc.pms.model.other.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.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -20,53 +20,53 @@ import java.util.Date; ...@@ -20,53 +20,53 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class RepoCashDO implements Serializable { public class RepoCashDO implements Serializable {
private static final long serialVersionUID = -7930603317037474755L; private static final long serialVersionUID = -7930603317037474755L;
private Integer id; private Integer id;
private Integer repoAccountId; private Integer repoAccountId;
private String uid; private String uid;
private String accountName; private String accountName;
private Integer orderInfoId; private Integer orderInfoId;
private String orderNo; private String orderNo;
private Integer skuInfoId; private Integer skuInfoId;
private String skuTitle; private String skuTitle;
private Integer wareInfoId; private Integer wareInfoId;
private String wareNo; private String wareNo;
private String wareTitle; private String wareTitle;
private String payNo; private String payNo;
private Integer payMethod; private Integer payMethod;
private BigDecimal amtPaid; private BigDecimal amtPaid;
private BigDecimal cashAmt; private BigDecimal cashAmt;
private Date payTime; private Date payTime;
private String refundNo; private String refundNo;
private String voucher; private String voucher;
private String remark; private String remark;
private Integer createUser; private Integer createUser;
private Date createTime; private Date createTime;
private Integer updateUser; private Integer updateUser;
private Date updateTime; private Date updateTime;
public RepoCashDTO buildRepoCashDTO() { public RepoCashDTO buildRepoCashDTO() {
return RepoCashDTO.builder() return RepoCashDTO.builder()
.id(this.id) .id(this.id)
.repoAccountId(this.repoAccountId) .repoAccountId(this.repoAccountId)
.uid(this.uid) .uid(this.uid)
.accountName(this.accountName) .accountName(this.accountName)
.orderInfoId(this.orderInfoId) .orderInfoId(this.orderInfoId)
.orderNo(this.orderNo) .orderNo(this.orderNo)
.skuInfoId(this.skuInfoId) .skuInfoId(this.skuInfoId)
.skuTitle(this.skuTitle) .skuTitle(this.skuTitle)
.wareInfoId(this.wareInfoId) .wareInfoId(this.wareInfoId)
.wareNo(this.wareNo) .wareNo(this.wareNo)
.wareTitle(this.wareTitle) .wareTitle(this.wareTitle)
.payNo(this.payNo) .payNo(this.payNo)
.payMethod(this.payMethod) .payMethod(this.payMethod)
.amtPaid(this.amtPaid) .amtPaid(this.amtPaid)
.refundNo(this.refundNo) .refundNo(this.refundNo)
.createUser(this.createUser) .createUser(this.createUser)
.voucher(StringUtils.isBlank(this.voucher) ? null : Arrays.asList(this.voucher.split(","))) .voucher(StringUtils.isBlank(this.voucher) ? null : Arrays.asList(this.voucher.split(",")))
.cashAmt(this.cashAmt) .cashAmt(this.cashAmt)
.payTime(this.payTime) .payTime(this.payTime)
.remark(this.remark) .remark(this.remark)
.build(); .build();
} }
} }
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();
}
}
...@@ -12,8 +12,8 @@ import java.util.Date; ...@@ -12,8 +12,8 @@ import java.util.Date;
/** /**
* @Author LW * @Author LW
* @date 2023/6/8 10:33 *
* 概要: * @date 2023/6/8 10:33 概要:
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
...@@ -21,73 +21,65 @@ import java.util.Date; ...@@ -21,73 +21,65 @@ import java.util.Date;
@Builder @Builder
public class ServiceDO implements Serializable { public class ServiceDO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id; private Integer id;
@ApiModelProperty(value = "服务名称") @ApiModelProperty(value = "服务名称")
private String serviceName; private String serviceName;
@ApiModelProperty(value = "应用") @ApiModelProperty(value = "应用")
private Integer applicationId; private Integer applicationId;
@ApiModelProperty(value = "行业") @ApiModelProperty(value = "行业")
private Integer industryId; private Integer industryId;
@ApiModelProperty(value = "展示状态") @ApiModelProperty(value = "展示状态")
private Integer displayState; private Integer displayState;
@ApiModelProperty(value = "封面图") @ApiModelProperty(value = "封面图")
private String coverPlan; private String coverPlan;
@ApiModelProperty(value = "分享卡片") @ApiModelProperty(value = "分享卡片")
private String shareCard; private String shareCard;
@ApiModelProperty(value = "视频") @ApiModelProperty(value = "视频")
private String video; private String video;
@ApiModelProperty(value = "服务介绍") @ApiModelProperty(value = "服务介绍")
private String serviceIntroduction; private String serviceIntroduction;
@ApiModelProperty(value = "创建人id") @ApiModelProperty(value = "创建人id")
private Integer accountId; private Integer accountId;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "逻辑删除字段") @ApiModelProperty(value = "逻辑删除字段")
private Integer isDeleted; private Integer isDeleted;
public ServiceDO(ServiceVO param, Integer accountId) { public ServiceDO(ServiceVO param, Integer accountId) {
this.id = param.getId(); this(param);
this.serviceName = param.getServiceName(); this.accountId = accountId;
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();
this.accountId = accountId;
}
public ServiceDO(ServiceVO param) { public ServiceDO(ServiceVO param) {
this.id = param.getId(); this.id = param.getId();
this.serviceName = param.getServiceName(); this.serviceName = param.getServiceName();
this.applicationId = param.getApplicationId(); this.applicationId = param.getApplicationId();
this.industryId = param.getIndustryId(); this.industryId = param.getIndustryId();
this.displayState = param.getDisplayState(); this.displayState = param.getDisplayState();
this.coverPlan = param.getCoverPlan(); this.coverPlan = param.getCoverPlan();
this.shareCard = param.getShareCard(); this.shareCard = param.getShareCard();
this.video = param.getVideo(); this.video = param.getVideo();
this.serviceIntroduction = param.getServiceIntroduction(); this.serviceIntroduction = param.getServiceIntroduction();
} }
public ServiceDO(Integer id, Integer accountId) { public ServiceDO(Integer id, Integer accountId) {
this.id = id; this.id = id;
this.accountId = accountId; this.accountId = accountId;
} }
} }
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;
}
}
...@@ -13,107 +13,107 @@ import java.util.List; ...@@ -13,107 +13,107 @@ import java.util.List;
*/ */
public class JsonUtil { public class JsonUtil {
public static void main(String[] args) { public static void main(String[] args) {
String array = "[1,24,23]"; String array = "[1,24,23]";
List<Integer> list = JSONArray.parseArray(array, Integer.class); List<Integer> list = JSONArray.parseArray(array, Integer.class);
System.out.println(list.get(2)); System.out.println(list.get(2));
} }
/** /**
* 把Java对象转换成json字符串 * 把Java对象转换成json字符串
* *
* @param object 待转化为JSON字符串的Java对象 * @param object 待转化为JSON字符串的Java对象
* @return json 串 or null * @return json 串 or null
*/ */
public static String parseObjToJson(Object object) { public static String parseObjToJson(Object object) {
String string = null; String string = null;
try { try {
string = JSONObject.toJSONString(object); string = JSONObject.toJSONString(object);
} catch (Exception e) { } catch (Exception e) {
// LOGGER.error(e.getMessage()); // LOGGER.error(e.getMessage());
}
return string;
} }
return string;
}
/** /**
* 将Json字符串信息转换成对应的Java对象 * 将Json字符串信息转换成对应的Java对象
* *
* @param json json字符串对象 * @param json json字符串对象
* @param c 对应的类型 * @param c 对应的类型
*/ */
public static <T> T parseJsonToObj(String json, Class<T> c) { public static <T> T parseJsonToObj(String json, Class<T> c) {
try { try {
JSONObject jsonObject = JSON.parseObject(json); JSONObject jsonObject = JSON.parseObject(json);
return JSON.toJavaObject(jsonObject, c); return JSON.toJavaObject(jsonObject, c);
} catch (Exception e) { } catch (Exception e) {
// LOGGER.error(e.getMessage()); // LOGGER.error(e.getMessage());
}
return null;
} }
return null;
}
/** /**
* 读取json文件 * 读取json文件
* *
* @param fileName * @param fileName
* @return * @return
*/ */
public static String readJsonFile(String fileName) { public static String readJsonFile(String fileName) {
String jsonStr = ""; String jsonStr = "";
try { try {
File jsonFile = new File(fileName); File jsonFile = new File(fileName);
FileReader fileReader = new FileReader(jsonFile); FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8"); Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
int ch = 0; int ch = 0;
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) { while ((ch = reader.read()) != -1) {
sb.append((char) ch); sb.append((char) ch);
} }
fileReader.close(); fileReader.close();
reader.close(); reader.close();
jsonStr = sb.toString(); jsonStr = sb.toString();
return jsonStr; return jsonStr;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
}
} }
}
/** /**
* 将JSON数据格式化并保存到文件中 * 将JSON数据格式化并保存到文件中
* *
* @param jsonData 需要输出的json数 * @param jsonData 需要输出的json数
* @param filePath 输出的文件地址 * @param filePath 输出的文件地址
* @return * @return
*/ */
public static boolean createJsonFile(Object jsonData, String filePath) { public static boolean createJsonFile(Object jsonData, String filePath) {
String content = String content =
JSON.toJSONString( JSON.toJSONString(
jsonData, jsonData,
SerializerFeature.PrettyFormat, SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue, SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteDateUseDateFormat); SerializerFeature.WriteDateUseDateFormat);
// 标记文件生成是否成功 // 标记文件生成是否成功
boolean flag = true; boolean flag = true;
// 生成json格式文件 // 生成json格式文件
try { try {
// 保证创建一个新文件 // 保证创建一个新文件
File file = new File(filePath); File file = new File(filePath);
if (!file.getParentFile().exists()) { // 如果父目录不存在,创建父目录 if (!file.getParentFile().exists()) { // 如果父目录不存在,创建父目录
file.getParentFile().mkdirs(); file.getParentFile().mkdirs();
} }
if (file.exists()) { // 如果已存在,删除旧文件 if (file.exists()) { // 如果已存在,删除旧文件
file.delete(); file.delete();
} }
file.createNewFile(); file.createNewFile();
// 将格式化后的字符串写入文件 // 将格式化后的字符串写入文件
Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
write.write(content); write.write(content);
write.flush(); write.flush();
write.close(); write.close();
} catch (Exception e) { } catch (Exception e) {
flag = false; flag = false;
e.printStackTrace(); e.printStackTrace();
}
return flag;
} }
return flag;
}
} }
/**
* 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
/** 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;
/**
* Auto-generated: 2023-06-08 16:2:43
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CategoriesInfoListDTO implements Serializable {
private static final long serialVersionUID = -8381856228953745772L;
private Integer id;
private Integer directoryId;
private String name;
private String icon;
}
package com.mmc.pms.model.categories.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
*
* @date 2023/6/10 13:46 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CategoryTypeDTO implements Serializable {
private Integer id;
private String categoryName;
}
...@@ -6,25 +6,27 @@ import lombok.Builder; ...@@ -6,25 +6,27 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/5/24 11:06 *
* 概要: * @date 2023/5/24 11:06 概要:
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DirectoryInfoVO { public class DirectoryInfoVO {
@ApiModelProperty(value = "目录id") @ApiModelProperty(value = "目录id")
private Integer id; private Integer id;
@ApiModelProperty(value = "目录名称")
private String directoryName; @ApiModelProperty(value = "目录名称")
@ApiModelProperty(value = "关联目录的id") private String directoryName;
private Integer pid;
@ApiModelProperty(value = "关联目录名称") @ApiModelProperty(value = "分类模块:(0:通用分类 1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类)")
private String relevanceName; private Integer type;
@ApiModelProperty(value = "分类模块:(0:通用分类 1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类)")
private Integer type; @ApiModelProperty(value = "显示:1:作业服务分类 2:设备分类 3:飞手分类 4:商城分类")
private List<Integer> show;
} }
package com.mmc.pms.model.lease.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author small @Date 2023/5/16 9:53 @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseGoodsInfoDTO implements Serializable {
private static final long serialVersionUID = -4354269497656808831L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品图片")
private String images;
@ApiModelProperty(value = "价格")
private BigDecimal price;
}
package com.mmc.pms.model.qo; package com.mmc.pms.model.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze; import com.mmc.pms.model.group.Freeze;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
......
package com.mmc.pms.model.qo; package com.mmc.pms.model.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze; import com.mmc.pms.model.group.Freeze;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.model.qo; package com.mmc.pms.model.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze; import com.mmc.pms.model.group.Freeze;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
......
package com.mmc.pms.model.qo; package com.mmc.pms.model.qo;
import com.mmc.pms.common.Page; import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze; import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -13,11 +12,12 @@ import org.hibernate.validator.constraints.Length; ...@@ -13,11 +12,12 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/6/8 10:33 *
* 概要: * @date 2023/6/8 10:33 概要:
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
...@@ -25,34 +25,44 @@ import java.io.Serializable; ...@@ -25,34 +25,44 @@ import java.io.Serializable;
@Builder @Builder
public class ServiceQO implements Serializable { public class ServiceQO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id; private Integer id;
@ApiModelProperty(value = "服务名称", example = "服务名称")
@Length(message = "最大不超过30字", max = 30)
private String serviceName;
@ApiModelProperty(value = "分类id集合(应用/行业等)")
private List<Integer> categoryId;
@ApiModelProperty(value = "服务名称", example = "服务名称") @ApiModelProperty(value = "应用id")
@Length(message = "最大不超过30字", max = 30) private Integer applicationId;
private String serviceName;
@ApiModelProperty(value = "应用", example = "1") @ApiModelProperty(value = "行业id")
private Integer applicationId; private Integer industryId;
@ApiModelProperty(value = "行业", example = "2") @ApiModelProperty(value = "省份编码", example = "440000")
private Integer industryId; private Integer provinceId;
@ApiModelProperty(value = "账号id") @ApiModelProperty(value = "展示状态")
private Integer accountId; private Integer displayState;
@ApiModelProperty(value = "页码", required = true) @ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = {Page.class, Freeze.class}) @NotNull(
@Min(value = 1, groups = Page.class) message = "页码不能为空",
private Integer pageNo; groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true) @ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = {Page.class, Freeze.class}) @NotNull(
@Min(value = 1, groups = Page.class) message = "每页显示数不能为空",
private Integer pageSize; groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() { public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize; this.pageNo = (pageNo - 1) * pageSize;
} }
} }
package com.mmc.pms.model.qo; package com.mmc.pms.model.qo;
import com.mmc.pms.page.Page; import com.mmc.pms.common.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -9,6 +9,7 @@ import lombok.NoArgsConstructor; ...@@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @Author small @Date 2023/5/16 9:55 @Version 1.0 * @Author small @Date 2023/5/16 9:55 @Version 1.0
...@@ -16,42 +17,24 @@ import java.io.Serializable; ...@@ -16,42 +17,24 @@ import java.io.Serializable;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.qo.WareInfoQO", description = "model")
public class WareInfoQO implements Serializable { public class WareInfoQO implements Serializable {
private static final long serialVersionUID = -2953141525621912414L; private static final long serialVersionUID = -2953141525621912414L;
@ApiModelProperty(name = "id", value = "设备id", example = "1", required = false) @ApiModelProperty(name = "districtId", value = "地域id", example = "440000")
private Integer id; private Integer provinceId;
@ApiModelProperty(name = "districtId", value = "地域id", example = "1", required = false) @ApiModelProperty(name = "categoryId", value = "分类id")
private Integer districtId; private List<Integer> categoryId;
@ApiModelProperty(name = "categoryId", value = "类目id", example = "类目id") @ApiModelProperty(name = "产品类型:0商城 1租赁")
private Integer categoryId; private Integer type;
@ApiModelProperty(name = "brandIdl", value = "品牌id", example = "品牌id") @ApiModelProperty(value = "页码", required = true, example = "1")
private Integer brandId;
@ApiModelProperty(name = "modelId", value = "型号id", example = "型号id")
private Integer modelId;
/*@ApiModelProperty(value = "关键字")
private String keyword;
@ApiModelProperty(value = "商品状态,出租中或仓库中")
private Integer wareStatus;
@ApiModelProperty(value = "商品类型")
private Integer wareTypeId;
@ApiModelProperty(value = "活动属性")
private Integer propInfoId;*/
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class) @NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageNo; private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true) @ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(message = "每页显示数不能为空", groups = Page.class) @NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageSize; private Integer pageSize;
......
...@@ -7,43 +7,63 @@ import lombok.NoArgsConstructor; ...@@ -7,43 +7,63 @@ 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.List; import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2022/10/14 11:30 *
* 概要: * @date 2022/10/14 11:30 概要:
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class MallGoodsDetailDTO implements Serializable { public class MallGoodsDetailDTO implements Serializable {
private static final long serialVersionUID = 7041502536618388167L; private static final long serialVersionUID = 7041502536618388167L;
@ApiModelProperty(value = "id")
private Integer id; @ApiModelProperty(value = "id")
@ApiModelProperty(value = "商品图片") private Integer id;
private List<GoodsImgDTO> images;
@ApiModelProperty(value = "商品视频") @ApiModelProperty(value = "商品图片")
private String goodsVideo; private List<GoodsImgDTO> images;
@ApiModelProperty(value = "商品视频id")
private Integer goodsVideoId; @ApiModelProperty(value = "商品视频")
@ApiModelProperty(value = "商品名称") private String goodsVideo;
private String goodsName;
@ApiModelProperty(value = "商品详情") @ApiModelProperty(value = "商品视频id")
private GoodsDetailInfoDTO goodsDetail; private Integer goodsVideoId;
@ApiModelProperty(value = "所属目录")
private Integer directoryId; @ApiModelProperty(value = "商品名称")
@ApiModelProperty(value = "一级分类id") private String goodsName;
private Integer categoryByOne;
@ApiModelProperty(value = "二级分类id") @ApiModelProperty(value = "商品编号")
private Integer categoryByTwo; private String goodsNo;
@ApiModelProperty(value = "商品标签")
private String tag; @ApiModelProperty(value = "商品详情")
@ApiModelProperty(value = "商品状态 0:下架 1:上架") private GoodsDetailInfoDTO goodsDetail;
private Integer shelfStatus;
@ApiModelProperty(value = "规格信息") @ApiModelProperty(value = "所属目录")
private List<GoodsSpecDTO> goodsSpec; private Integer directoryId;
@ApiModelProperty(value = "其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 ")
private List<GoodsOtherServiceDTO> otherService; @ApiModelProperty(value = "一级分类id")
private Integer categoryByOne;
@ApiModelProperty(value = "二级分类id")
private Integer categoryByTwo;
@ApiModelProperty(value = "商品标签")
private String tag;
@ApiModelProperty(value = "商品状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "规格信息")
private List<GoodsSpecDTO> goodsSpec;
@ApiModelProperty(value = "其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 ")
private List<GoodsOtherServiceDTO> otherService;
@ApiModelProperty(value = "price(用于租赁商品)")
private BigDecimal price;
} }
...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors; ...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author small @Date 2023/5/16 15:30 @Version 1.0 * @Author small @Date 2023/5/16 15:30 @Version 1.0
...@@ -19,26 +20,29 @@ import java.util.Date; ...@@ -19,26 +20,29 @@ import java.util.Date;
@Builder @Builder
@Accessors @Accessors
public class ProductSpecDTO implements Serializable { public class ProductSpecDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "productSkuId") @ApiModelProperty(value = "productSkuId")
private Integer productSkuId; private Integer productSkuId;
@ApiModelProperty(value = "规格名称") @ApiModelProperty(value = "规格名称")
private String specName; private String specName;
@ApiModelProperty(value = "规格图片") @ApiModelProperty(value = "规格图片")
private String specImage; private String specImage;
@ApiModelProperty(value = "料号") @ApiModelProperty(value = "料号")
private String partNo; private String partNo;
@ApiModelProperty(value = "版本描述") @ApiModelProperty(value = "版本描述")
private String versionDesc; private String versionDesc;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "价格配置")
private List<ProductSpecPriceDTO> priceList;
} }
package com.mmc.pms.model.sale.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2022/3/28 10:48
* 概要:
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.SaleServiceDTO", description = "其他服务信息DTO")
public class SaleServiceDTO {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "其他服务名称")
private String saleServiceName;
}
package com.mmc.pms.model.sale.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author LW
*
* @date 2022/3/22 9:44 概要:商品列表查询QO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallGoodsQO {
@ApiModelProperty(value = "商品名称", example = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品类型 0:销售 1:租赁", example = "0")
private Integer goodsType;
@ApiModelProperty(value = "开始时间", example = "2023-06-09 00:00:00")
private String startTime;
@ApiModelProperty(value = "结束时间", example = "2023-06-11 23:59:59")
private String endTime;
@ApiModelProperty(value = "状态 0:下架(仓库中)1:上架", example = "1")
private Integer status;
@ApiModelProperty(value = "目录id", example = "1")
private Integer directoryId;
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(
message = "页码不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(
message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.pms.model.sale.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
*
* @date 2022/4/1 20:22 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.vo.BatchShelfVO", description = "商品上下架参数")
public class BatchShelfVO implements Serializable {
@ApiModelProperty(value = "商品id")
private List<Integer> goodsIds;
@ApiModelProperty(value = "状态:上架:1,下架:0")
private Integer status;
}
package com.mmc.pms.model.sale.vo; package com.mmc.pms.model.sale.vo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Create; import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Freeze; import com.mmc.pms.model.group.Freeze;
import com.mmc.pms.model.group.Update; import com.mmc.pms.model.group.Update;
import com.mmc.pms.page.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -15,30 +15,34 @@ import java.io.Serializable; ...@@ -15,30 +15,34 @@ import java.io.Serializable;
/** /**
* @Author LW * @Author LW
* @date 2023/5/25 11:25 *
* 概要: * @date 2023/5/25 11:25 概要:
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class QueryClassifyVO implements Serializable { public class QueryClassifyVO implements Serializable {
@ApiModelProperty(value = "所属目录id") @ApiModelProperty(value = "所属目录id")
@NotNull(message = "所属目录id不能为空", groups = {Update.class, Create.class}) @NotNull(
private Integer directoryId; message = "所属目录id不能为空",
groups = {Update.class, Create.class})
private Integer directoryId;
@ApiModelProperty(value = "分类所属模块id(0:通用分类 1:作业服务分类 2:设备租赁分类 3:飞手培训分类 4:产品商城分类)") @ApiModelProperty(value = "页码", required = true)
private Integer type; @NotNull(
@ApiModelProperty(value = "页码", required = true) message = "页码不能为空",
@NotNull(message = "页码不能为空", groups = {Page.class, Freeze.class}) groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageNo; private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() { @ApiModelProperty(value = "每页显示数", required = true)
this.pageNo = (pageNo - 1) * pageSize; @NotNull(
} message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
} }
...@@ -14,8 +14,10 @@ import java.math.BigDecimal; ...@@ -14,8 +14,10 @@ import java.math.BigDecimal;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class SpecPriceVO implements Serializable { public class SpecPriceVO implements Serializable {
private static final long serialVersionUID = -8976672168410262190L; private static final long serialVersionUID = -8976672168410262190L;
private Integer id; private Integer id;
private Integer cooperationTag; private Integer cooperationTag;
private BigDecimal price; private BigDecimal price;
private Integer productSpecId;
private Integer leaseTerm;
} }
package com.mmc.pms.model.work.dto; package com.mmc.pms.model.work.dto;
import com.mmc.pms.entity.InspComtDO;
import com.mmc.pms.entity.ServiceDO; import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.model.work.vo.ServiceVO; import com.mmc.pms.model.work.vo.ServiceVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -10,6 +11,7 @@ import lombok.NoArgsConstructor; ...@@ -10,6 +11,7 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author LW * @Author LW
...@@ -59,6 +61,12 @@ public class ServiceDTO implements Serializable { ...@@ -59,6 +61,12 @@ public class ServiceDTO implements Serializable {
@ApiModelProperty(value = "账号id") @ApiModelProperty(value = "账号id")
private Integer accountId; private Integer accountId;
@ApiModelProperty(value = "评论列表")
private List<InspComtDO> inspComtList;
@ApiModelProperty(value = "评论数量")
private Integer inspComtAmount;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
......
package com.mmc.pms.model.work.dto;
import com.mmc.pms.entity.InspComtDO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WorkServiceDTO implements Serializable {
private static final long serialVersionUID = -15752785758L;
private Integer id;
@ApiModelProperty(value = "服务名称")
private String serviceName;
@ApiModelProperty(value = "服务价格")
private BigDecimal servicePrice;
@ApiModelProperty(value = "封面图")
private String coverPlan;
@ApiModelProperty(value = "分享卡片")
private String shareCard;
@ApiModelProperty(value = "视频")
private String video;
@ApiModelProperty(value = "服务介绍")
private String serviceIntroduction;
@ApiModelProperty(value = "公司名称")
private String companyName;
@ApiModelProperty(value = "评论列表")
private List<InspComtDO> inspComtList;
@ApiModelProperty(value = "评论数量")
private Integer inspComtAmount;
}
...@@ -15,8 +15,8 @@ import java.io.Serializable; ...@@ -15,8 +15,8 @@ import java.io.Serializable;
/** /**
* @Author LW * @Author LW
* @date 2023/6/8 10:33 *
* 概要: * @date 2023/6/8 10:33 概要:
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
...@@ -24,37 +24,47 @@ import java.io.Serializable; ...@@ -24,37 +24,47 @@ import java.io.Serializable;
@Builder @Builder
public class ServiceVO implements Serializable { public class ServiceVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "修改服务id不能为空", groups = {Update.class}) @NotNull(
private Integer id; message = "修改服务id不能为空",
groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "服务名称", example = "服务名称") @ApiModelProperty(value = "服务名称", example = "服务名称")
@NotBlank(message = "服务名称不能为空", groups = {Create.class, Update.class}) @NotBlank(
@Length(message = "最大不超过30字", max = 30) message = "服务名称不能为空",
private String serviceName; groups = {Create.class})
@Length(message = "最大不超过30字", max = 30)
private String serviceName;
@ApiModelProperty(value = "应用", example = "1") @ApiModelProperty(value = "应用", example = "1")
private Integer applicationId; private Integer applicationId;
@ApiModelProperty(value = "行业", example = "2") @ApiModelProperty(value = "行业", example = "2")
@NotNull(message = "行业id不能为空", groups = {Create.class, Update.class}) @NotNull(
private Integer industryId; message = "行业id不能为空",
groups = {Create.class})
private Integer industryId;
@ApiModelProperty(value = "展示状态,0为上架,1下架", example = "0") @ApiModelProperty(value = "展示状态,0为上架,1下架", example = "0")
@NotNull(message = "展示状态不能为空", groups = {Create.class, Update.class}) @NotNull(
private Integer displayState; message = "展示状态不能为空",
groups = {Create.class})
private Integer displayState;
@ApiModelProperty(value = "封面图") @ApiModelProperty(value = "封面图")
@NotBlank(message = "封面图不能为空", groups = {Create.class, Update.class}) @NotBlank(
private String coverPlan; message = "封面图不能为空",
groups = {Create.class})
private String coverPlan;
@ApiModelProperty(value = "分享卡片") @ApiModelProperty(value = "分享卡片")
private String shareCard; private String shareCard;
@ApiModelProperty(value = "视频") @ApiModelProperty(value = "视频")
private String video; private String video;
@ApiModelProperty(value = "服务介绍") @ApiModelProperty(value = "服务介绍")
private String serviceIntroduction; private String serviceIntroduction;
} }
package com.mmc.pms.model.work.vo;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UpAndDownServiceVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id集合")
@Size(min = 1,message = "修改时id集合不能为空",groups = Update.class)
private List<Integer> ids;
@ApiModelProperty(value = "展示状态,0为上架,1下架", example = "0")
@NotNull(message = "修改时展示状态不能为空",groups = Update.class)
private Integer displayState;
}
package com.mmc.pms.page;
/**
* @Author small @Date 2023/5/16 10:09 @Version 1.0
*/
public interface Page {}
package com.mmc.pms.service; package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.ServiceQO; import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.vo.ServiceVO; import com.mmc.pms.model.work.vo.ServiceVO;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import com.mmc.pms.page.PageResult; import com.mmc.pms.page.PageResult;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @Author LW * @Author LW
* @date 2023/6/6 10:46 *
* 概要: * @date 2023/6/6 10:46 概要:
*/ */
public interface BackstageTaskService { public interface BackstageTaskService {
ResultBody addWorkService(ServiceVO param, Integer userAccountId); ResultBody addWorkService(ServiceVO param, Integer userAccountId);
ResultBody updateById(ServiceVO param);
ResultBody deleteByIds(List<Integer> ids);
ResultBody<ServiceDTO> queryById(Integer id);
ResultBody updateById(ServiceVO param); PageResult queryServiceManagerList(ServiceQO param, Integer userAccountId);
ResultBody deleteById(Integer id); PageResult queryWorkServiceList(ServiceQO param, HttpServletRequest request);
ResultBody queryById(Integer id); List<ServiceDTO> feignQueryWorkServiceListById(List<Integer> ids);
PageResult queryWorkServiceList(ServiceQO param, Integer userAccountId); ResultBody batchUpAndDownWorkService(UpAndDownServiceVO param);
} }
...@@ -4,13 +4,14 @@ import com.mmc.pms.common.ResultBody; ...@@ -4,13 +4,14 @@ import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.Categories; import com.mmc.pms.entity.Categories;
import com.mmc.pms.entity.DirectoryDO; import com.mmc.pms.entity.DirectoryDO;
import com.mmc.pms.entity.DistrictDO; import com.mmc.pms.entity.DistrictDO;
import com.mmc.pms.model.categories.vo.CategoriesInfoVO; import com.mmc.pms.model.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.sale.vo.QueryClassifyVO; import com.mmc.pms.model.sale.vo.QueryClassifyVO;
import com.mmc.pms.page.PageResult; import com.mmc.pms.page.PageResult;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
...@@ -42,10 +43,13 @@ public interface CategoriesService { ...@@ -42,10 +43,13 @@ public interface CategoriesService {
ResultBody getDirectoryList(Integer type); ResultBody getDirectoryList(Integer type);
ResultBody queryCategoryInfoByType(Integer type);
List<Categories> getCategoriesListByDirectoryName(String directoryName); List<Categories> getCategoriesListByDirectoryName(String directoryName);
ResultBody getApplicationList(String directoryName); ResultBody getApplicationList(String directoryName);
List<Categories> getCategoriesListByIds(Set<Integer> ids); List<Categories> getCategoriesListByIds(Set<Integer> ids);
List<AllCategoryDTO> feigQqueryCategoryInfoByType(Integer type);
} }
package com.mmc.pms.service; package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.order.dto.OrderGoodsIndstDTO; import com.mmc.pms.model.order.dto.OrderGoodsIndstDTO;
import com.mmc.pms.model.order.dto.OrderGoodsProdDTO; import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO; import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO; import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.MallGoodsShopCarDTO; import com.mmc.pms.model.sale.dto.MallGoodsShopCarDTO;
import com.mmc.pms.model.sale.dto.MallProductSpecPriceDTO; import com.mmc.pms.model.sale.dto.MallProductSpecPriceDTO;
import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; import com.mmc.pms.model.sale.vo.GoodsAddVO;
import com.mmc.pms.page.PageResult;
import java.util.List; import java.util.List;
...@@ -19,21 +21,29 @@ import java.util.List; ...@@ -19,21 +21,29 @@ import java.util.List;
*/ */
public interface GoodsInfoService { public interface GoodsInfoService {
ResultBody addGoods(GoodsAddVO goodsAddVO); ResultBody addGoods(GoodsAddVO goodsAddVO);
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO);
ResultBody getGoodsInfoDetail(Integer goodsInfoId, Integer type, Integer leaseTerm);
ResultBody getSkuUnit();
ResultBody getSaleServiceInfoToList();
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO); List<MallGoodsShopCarDTO> fillGoodsInfo(List<MallGoodsShopCarDTO> param);
ResultBody getGoodsInfoDetail(Integer goodsInfoId); List<MallProductSpecPriceDTO> feignListProductSpecPrice(ProductSpecPriceQO productSpecPriceQO);
ResultBody getSkuUnit(); ProductSpecPriceDTO feignGetUnitPriceByTag(Integer specId, Integer tagId);
List<MallGoodsShopCarDTO> fillGoodsInfo(List<MallGoodsShopCarDTO> param); List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<MallProductSpecPriceDTO> feignListProductSpecPrice(ProductSpecPriceQO productSpecPriceQO); List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
ProductSpecPriceDTO feignGetUnitPriceByTag(Integer specId, Integer tagId); PageResult listPageGoodsInfo(MallGoodsQO param);
List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); ResultBody batchOnShelfOrTakeDown(List<Integer> goodsIds, Integer status);
List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); ResultBody batchRemoveWareInfo(List<Integer> ids);
} }
package com.mmc.pms.service.Impl;
import com.mmc.pms.dao.InspComtDao;
import com.mmc.pms.entity.InspComtDO;
import com.mmc.pms.service.InspComtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 评论表 服务实现类
* </p>
*
* @author Pika
* @since 2023-06-09
*/
@Service
public class InspComtServiceImpl implements InspComtService {
@Autowired
private InspComtDao inspComtDao;
@Override
public List<InspComtDO> randomGetInspComtList(Integer size) {
return inspComtDao.randomGetInspComtList(size);
}
}
...@@ -6,9 +6,10 @@ import com.mmc.pms.entity.AdDO; ...@@ -6,9 +6,10 @@ import com.mmc.pms.entity.AdDO;
import com.mmc.pms.entity.GoodsInfoDO; import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory; import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.other.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import com.mmc.pms.model.qo.GoodsInfoQO; import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO; import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import com.mmc.pms.page.PageResult; import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.WebProductMallService; import com.mmc.pms.service.WebProductMallService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,78 +24,77 @@ import java.util.stream.Collectors; ...@@ -23,78 +24,77 @@ import java.util.stream.Collectors;
@Service @Service
public class WebProductMallServiceImpl implements WebProductMallService { public class WebProductMallServiceImpl implements WebProductMallService {
@Autowired @Autowired private WebProductMallDao webProductMallDao;
private WebProductMallDao webProductMallDao;
@Override @Override
public ResultBody productCategory() { public ResultBody productCategory() {
List<ProductCategory> category = webProductMallDao.productCategory(); List<ProductCategory> category = webProductMallDao.productCategory();
List<ProductCategoryDTO> collect = List<ProductCategoryDTO> collect =
category.stream() category.stream()
.map( .map(
t -> { t -> {
return t.productCategoryDTO(); return t.productCategoryDTO();
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return ResultBody.success(collect); return ResultBody.success(collect);
} }
@Override @Override
public ResultBody productParts() { public ResultBody productParts() {
List<ProductCategory> category = webProductMallDao.productParts(); List<ProductCategory> category = webProductMallDao.productParts();
List<ProductCategoryDTO> collect = List<ProductCategoryDTO> collect =
category.stream() category.stream()
.map( .map(
t -> { t -> {
return t.productCategoryDTO(); return t.productCategoryDTO();
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return ResultBody.success(collect); return ResultBody.success(collect);
} }
@Override @Override
public ResultBody productQuality() { public ResultBody productQuality() {
List<ProductCategory> category = webProductMallDao.productQuality(); List<ProductCategory> category = webProductMallDao.productQuality();
List<ProductCategoryDTO> collect = List<ProductCategoryDTO> collect =
category.stream() category.stream()
.map( .map(
t -> { t -> {
return t.productCategoryDTO(); return t.productCategoryDTO();
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return ResultBody.success(collect); return ResultBody.success(collect);
} }
@Override @Override
public PageResult listPageGoodsInfo(GoodsInfoQO param) { public ResultBody<AdDTO> ad() {
int count = webProductMallDao.countListGoodsInfo(param); List<AdDO> ad = webProductMallDao.ad();
if (count == 0) { List<AdDTO> collect =
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count); ad.stream()
} .map(
Integer pageNo = param.getPageNo(); t -> {
param.buildCurrentPage(); return t.adDTO();
List<GoodsInfoDO> goodsInfo = webProductMallDao.listGoodsInfo(param); })
goodsInfo.stream() .collect(Collectors.toList());
.forEach( return ResultBody.success(collect);
t -> { }
Integer product = webProductMallDao.findProduct(t.getId());
t.setIsCoupons(product);
});
List<GoodsInfoListDTO> pageList =
goodsInfo.stream().map(GoodsInfoDO::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
@Override @Override
public ResultBody<AdDTO> ad() { public PageResult listPageGoodsInfo(GoodsInfoQO param) {
List<AdDO> ad = webProductMallDao.ad(); int count = webProductMallDao.countListGoodsInfo(param);
List<AdDTO> collect = if (count == 0) {
ad.stream() return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
.map(
t -> {
return t.adDTO();
})
.collect(Collectors.toList());
return ResultBody.success(collect);
} }
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfoDO> goodsInfo = webProductMallDao.listGoodsInfo(param);
goodsInfo.stream()
.forEach(
t -> {
Integer product = webProductMallDao.findProduct(t.getId());
t.setIsCoupons(product);
});
List<GoodsInfoListDTO> pageList =
goodsInfo.stream().map(GoodsInfoDO::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
} }
package com.mmc.pms.service;
import com.mmc.pms.entity.InspComtDO;
import java.util.List;
/**
* <p>
* 评论表 服务类
* </p>
*
* @author Pika
* @since 2023-06-09
*/
public interface InspComtService {
List<InspComtDO> randomGetInspComtList(Integer size);
}
package com.mmc.pms.service; package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.GoodsInfoQO;
/** /**
* @Author small @Date 2023/5/16 15:08 @Version 1.0 * @Author small @Date 2023/5/16 15:08 @Version 1.0
*/ */
public interface MiniProgramProductMallService { public interface MiniProgramProductMallService {
ResultBody getAppGoodsInfoDetail(Integer id); ResultBody getAppGoodsInfoDetail(Integer id);
ResultBody listGoodsByQO(GoodsInfoQO param);
} }
...@@ -2,6 +2,7 @@ package com.mmc.pms.service; ...@@ -2,6 +2,7 @@ package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.ProductSpecPriceDO; import com.mmc.pms.entity.ProductSpecPriceDO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.lease.vo.PriceAcquisition; 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.sale.dto.ProductSkuVO; import com.mmc.pms.model.sale.dto.ProductSkuVO;
...@@ -18,32 +19,34 @@ import java.util.List; ...@@ -18,32 +19,34 @@ import java.util.List;
*/ */
public interface ProductSkuService { public interface ProductSkuService {
ResultBody addProductSku(ProductSkuVO param); ResultBody addProductSku(ProductSkuVO param);
ResultBody getProductSkuDetail(Integer id); ResultBody getProductSkuDetail(Integer id);
ResultBody editProductSku(ProductSkuVO param); ResultBody editProductSku(ProductSkuVO param);
ResultBody listPageProductSku(ProductSkuQO productSkuQO); ResultBody listPageProductSku(ProductSkuQO productSkuQO);
ResultBody addOrEditProductSpec(ProductSpecVO param); ResultBody addOrEditProductSpec(ProductSpecVO param);
ResultBody getProductSpecDetail(Integer id); ResultBody getProductSpecDetail(Integer id);
ResultBody listPageProductSpec(Integer pageNo, Integer pageSize, Integer productSkuId); ResultBody listPageProductSpec(
Integer pageNo, Integer pageSize, Integer productSkuId, String keyword);
ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO); List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO);
ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody removeProductSku(Integer id); ResultBody removeProductSku(Integer id);
ResultBody removeProductSpec(Integer id); ResultBody removeProductSpec(Integer id);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition); BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
ResultBody<DirectoryInfoVO> productDirectoryList();
} }
package com.mmc.pms.service; package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.categories.dto.CategoryTypeDTO;
import com.mmc.pms.model.lease.dto.WareInfoDTO; import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.model.lease.vo.LeaseVo; import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.other.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.qo.WareInfoQO; import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.sale.dto.SkuInfoDTO; import com.mmc.pms.model.sale.dto.SkuInfoDTO;
import com.mmc.pms.model.sale.vo.ProductSpecCPQVO;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
* @Author small @Date 2023/5/15 14:28 @Version 1.0 * @Author small @Date 2023/5/15 14:28 @Version 1.0
*/ */
public interface WebDeviceService { public interface WebDeviceService {
ResultBody listSecondDistrict(); ResultBody listSecondDistrict();
ResultBody category(); ResultBody category();
ResultBody brand(); ResultBody brand();
ResultBody deviceBrand(); ResultBody deviceBrand();
ResultBody model(); ResultBody model();
ResultBody deviceModel(); ResultBody deviceModel();
ResultBody deviceList(Integer districtId, Integer categoryId, Integer brandId, Integer modelId); ResultBody deviceList(Integer districtId, Integer categoryId, Integer brandId, Integer modelId);
ResultBody update(LeaseVo param); ResultBody update(LeaseVo param);
ResultBody detail(Integer id); ResultBody detail(Integer id);
ResultBody listWareInfoPage(WareInfoQO param); ResultBody listWareInfoPage(WareInfoQO param, HttpServletRequest request, Integer userAccountId);
WareInfoDTO getWareInfoById(Integer id); WareInfoDTO getWareInfoById(Integer id);
ResultBody<AdDTO> ad(); ResultBody<AdDTO> ad();
List<SkuInfoDTO> listWareSkuById(Integer id); List<SkuInfoDTO> listWareSkuById(Integer id);
ResultBody getLeaseGoodsDetail(
Integer goodsId, Integer userAccountId, HttpServletRequest request, Integer type);
ResultBody<CategoryTypeDTO> getPageHomeCategories(Integer type);
ResultBody<ProductSpecCPQVO> getLeaseGoodsPriceDetail(Integer productSpecId, Integer leaseTerm);
} }
package com.mmc.pms.util;
import org.springframework.beans.BeanUtils;
import java.util.Objects;
/**
* @author 作者 dahang
* @version 创建时间:2022年7月23日
* @explain 同名属性拷贝值
*/
public class BeanCopyUtils {
public static <T> T properties(Object source, T target) {
if (Objects.isNull(source)) {
return target;
}
BeanUtils.copyProperties(source, target);
return target;
}
public static <T> T properties(Object source, Class<T> target) {
T t = null;
try {
t = target.newInstance();
if (Objects.isNull(source)) {
return t;
}
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
BeanUtils.copyProperties(source, t);
return t;
}
}
...@@ -3,7 +3,6 @@ package com.mmc.pms.util; ...@@ -3,7 +3,6 @@ package com.mmc.pms.util;
import com.mmc.pms.common.BaseErrorInfoInterface; import com.mmc.pms.common.BaseErrorInfoInterface;
import com.mmc.pms.common.ResultEnum; import com.mmc.pms.common.ResultEnum;
/** /**
* @author 作者 geDuo * @author 作者 geDuo
* @version 创建时间:2021年8月13日 上午9:25:43 * @version 创建时间:2021年8月13日 上午9:25:43
...@@ -11,80 +10,76 @@ import com.mmc.pms.common.ResultEnum; ...@@ -11,80 +10,76 @@ import com.mmc.pms.common.ResultEnum;
*/ */
public class BizException extends RuntimeException { public class BizException extends RuntimeException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /** 错误码 */
* 错误码 protected String errorCode;
*/ /** 错误信息 */
protected String errorCode; protected String errorMsg;
/**
* 错误信息 public BizException() {
*/ super();
protected String errorMsg; }
public BizException() { public BizException(BaseErrorInfoInterface errorInfoInterface) {
super(); super(errorInfoInterface.getResultCode());
} this.errorCode = errorInfoInterface.getResultCode();
this.errorMsg = errorInfoInterface.getResultMsg();
public BizException(BaseErrorInfoInterface errorInfoInterface) { }
super(errorInfoInterface.getResultCode());
this.errorCode = errorInfoInterface.getResultCode(); public BizException(BaseErrorInfoInterface errorInfoInterface, Throwable cause) {
this.errorMsg = errorInfoInterface.getResultMsg(); super(errorInfoInterface.getResultCode(), cause);
} this.errorCode = errorInfoInterface.getResultCode();
this.errorMsg = errorInfoInterface.getResultMsg();
public BizException(BaseErrorInfoInterface errorInfoInterface, Throwable cause) { }
super(errorInfoInterface.getResultCode(), cause);
this.errorCode = errorInfoInterface.getResultCode(); public BizException(ResultEnum enums) {
this.errorMsg = errorInfoInterface.getResultMsg(); super(enums.getResultCode());
} this.errorCode = enums.getResultCode();
this.errorMsg = enums.getResultMsg();
public BizException(ResultEnum enums) { }
super(enums.getResultCode());
this.errorCode = enums.getResultCode(); public BizException(String errorMsg) {
this.errorMsg = enums.getResultMsg(); super(errorMsg);
} this.errorCode = "-1";
this.errorMsg = errorMsg;
public BizException(String errorMsg) { }
super(errorMsg);
this.errorCode = "-1"; public BizException(String errorCode, String errorMsg) {
this.errorMsg = errorMsg; super(errorCode);
} this.errorCode = errorCode;
this.errorMsg = errorMsg;
public BizException(String errorCode, String errorMsg) { }
super(errorCode);
this.errorCode = errorCode; public BizException(String errorCode, String errorMsg, Throwable cause) {
this.errorMsg = errorMsg; super(errorCode, cause);
} this.errorCode = errorCode;
this.errorMsg = errorMsg;
public BizException(String errorCode, String errorMsg, Throwable cause) { }
super(errorCode, cause);
this.errorCode = errorCode; public String getErrorCode() {
this.errorMsg = errorMsg; return errorCode;
} }
public String getErrorCode() { public void setErrorCode(String errorCode) {
return errorCode; this.errorCode = errorCode;
} }
public void setErrorCode(String errorCode) { public String getErrorMsg() {
this.errorCode = errorCode; return errorMsg;
} }
public String getErrorMsg() { public void setErrorMsg(String errorMsg) {
return errorMsg; this.errorMsg = errorMsg;
} }
public void setErrorMsg(String errorMsg) { @Override
this.errorMsg = errorMsg; public String getMessage() {
} return errorMsg;
}
@Override
public String getMessage() { @Override
return errorMsg; public Throwable fillInStackTrace() {
} return this;
}
@Override
public Throwable fillInStackTrace() {
return this;
}
} }
...@@ -8,9 +8,9 @@ import org.springframework.util.AntPathMatcher; ...@@ -8,9 +8,9 @@ import org.springframework.util.AntPathMatcher;
* @explain 解析地址类 * @explain 解析地址类
*/ */
public class PathUtil { public class PathUtil {
private static AntPathMatcher matcher = new AntPathMatcher(); private static AntPathMatcher matcher = new AntPathMatcher();
public static boolean isPathMatch(String pattern, String path) { public static boolean isPathMatch(String pattern, String path) {
return matcher.match(pattern, path); return matcher.match(pattern, path);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论