add file
This commit is contained in:
31
pluss-manage-page/autoStart.sh
Normal file
31
pluss-manage-page/autoStart.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
while true
|
||||
do
|
||||
ONE='one'
|
||||
ONE_FILE='./one/manage.war'
|
||||
ONE_TIME=$(stat -c %Y $ONE_FILE)
|
||||
|
||||
ANOTHER='another'
|
||||
ANOTHER_FILE='./another/manage.war'
|
||||
ANOTHER_TIME=$(stat -c %Y $ANOTHER_FILE)
|
||||
|
||||
if [ "$ONE_TIME" -gt "$ANOTHER_TIME" ]
|
||||
then
|
||||
FILE_NAME="$ONE_FILE"
|
||||
FOLD="$ONE"
|
||||
else
|
||||
FILE_NAME="$ANOTHER_FILE"
|
||||
FOLD="$ANOTHER"
|
||||
fi
|
||||
|
||||
echo "最新的文件是${FILE_NAME}"
|
||||
echo "最新的文件夹是${FOLD}"
|
||||
|
||||
# 先操作7002的端口
|
||||
proc70021=$(pgrep -f "${ONE_FILE} --spring.profiles.active=prod --server.port=7002$")
|
||||
proc70022=$(pgrep -f "${ANOTHER_FILE} --spring.profiles.active=prod --server.port=7002$")
|
||||
if [ "$proc70021"x == "x" ] && [ "$proc70022"x == "x" ] ; then
|
||||
./manageStart7002.sh $FOLD
|
||||
fi
|
||||
|
||||
sleep 30
|
||||
done
|
||||
135
pluss-manage-page/pom.xml
Normal file
135
pluss-manage-page/pom.xml
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pluss-parent</artifactId>
|
||||
<groupId>cn.pluss.platform</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>pluss-manage-page</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.pluss.platform</groupId>
|
||||
<artifactId>pluss-service-bundle</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--jsp支持 start -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-jasper</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.taglibs</groupId>
|
||||
<artifactId>taglibs-standard-impl</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.shiro</groupId>-->
|
||||
<!-- <artifactId>shiro-spring</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.16.21.ALL</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>manage</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>static/**</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>static/**</include>
|
||||
</includes>
|
||||
</resource>
|
||||
|
||||
<!--2022-07-22 add-->
|
||||
<!-- <resource>
|
||||
<directory>src/main/webapp</directory>
|
||||
<targetPath>META-INF/resources</targetPath>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>-->
|
||||
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>1.4.2.RELEASE</version>
|
||||
<configuration>
|
||||
<mainClass>cn.pluss.platform.ManageApplication</mainClass>
|
||||
<outputDirectory>./</outputDirectory>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.pluss.platform;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
@MapperScan("cn.pluss.platform.mapper")
|
||||
@SpringBootApplication(exclude = MultipartAutoConfiguration.class)
|
||||
public class ManageApplication extends SpringBootServletInitializer {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ManageApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ManageApplication.class, args);
|
||||
logger.info("ManageApplication Service Start Success");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
return builder.sources(ManageApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.pluss.platform.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface OpLog {
|
||||
|
||||
/**
|
||||
* 操作日志code
|
||||
* @return 操作code
|
||||
*/
|
||||
String opCode() default "";
|
||||
|
||||
/**
|
||||
* 操作日志-详情
|
||||
* @return 操作详情
|
||||
*/
|
||||
String opDetail() default "";
|
||||
|
||||
/**
|
||||
* 被操作人的用户id字段名称
|
||||
* @return
|
||||
*/
|
||||
String opUserId() default "";
|
||||
|
||||
/**
|
||||
* 操作日志名称
|
||||
* @return 操作名称
|
||||
*/
|
||||
String opName() default "";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.pluss.platform.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface PassToken {
|
||||
boolean required() default true;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.pluss.platform.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface UserLoginToken {
|
||||
boolean required() default true;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.pluss.platform.aop;
|
||||
|
||||
import cn.pluss.platform.annotation.OpLog;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.entity.OperationRecord;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.operationRecord.OperationRecordService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* 因为登录注册,以及忘记密码的时候,没有token,所以这三个操作的操作日志不通过注解实现
|
||||
* 保存APP操作日志,取请求头中的用户信息
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
public class OpLogAspect {
|
||||
|
||||
@Autowired
|
||||
private OperationRecordService opRecordService;
|
||||
|
||||
@Autowired
|
||||
private UserAppService userAppService;
|
||||
|
||||
// 定义切点
|
||||
// 记录后台接口的操作记录
|
||||
// 拦截Controller所在的包
|
||||
@Pointcut("execution(* cn.pluss.platform.controller..*.*(..)) && @annotation(cn.pluss.platform.annotation.OpLog))")
|
||||
public void executionService() {
|
||||
}
|
||||
|
||||
|
||||
@AfterReturning(returning="rvt", value = "executionService()")
|
||||
public void after(JoinPoint point, Object rvt) {
|
||||
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request;
|
||||
if (attributes != null) {
|
||||
request = ((ServletRequestAttributes) attributes).getRequest();
|
||||
} else {
|
||||
log.warn("未获取到request");
|
||||
return;
|
||||
}
|
||||
|
||||
MethodSignature signature = (MethodSignature) point.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
OpLog annotation = method.getAnnotation(OpLog.class);
|
||||
|
||||
String opUserId = request.getParameter(annotation.opUserId());
|
||||
|
||||
String userId = request.getHeader("userId");
|
||||
|
||||
OperationRecord opRecord = new OperationRecord();
|
||||
opRecord.setDictValue(annotation.opCode());
|
||||
opRecord.setRemark(annotation.opDetail());
|
||||
opRecord.setOperator(userId);
|
||||
opRecord.setUserId(opUserId);
|
||||
|
||||
if (rvt instanceof Result) {
|
||||
Object data = ((Result<?>) rvt).getData();
|
||||
try {
|
||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(data);
|
||||
String orderNumber = jsonObject.getString("orderNumber");
|
||||
JSONObject extra = new JSONObject();
|
||||
extra.put("orderNumber", orderNumber);
|
||||
opRecord.setExtension(extra);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
opRecordService.save(opRecord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.pluss.platform.config;
|
||||
|
||||
import cn.pluss.platform.interceptor.AuthenticationInterceptor;
|
||||
import cn.pluss.platform.interceptor.RequestInfoInterceptor;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializeConfig;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.serializer.ToStringSerializer;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
// 解决跨域问题
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**").allowedMethods("*").allowedOrigins("*").allowedHeaders("*");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationInterceptor authenticationInterceptor() {
|
||||
return new AuthenticationInterceptor();
|
||||
}
|
||||
|
||||
// 添加拦截器
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new RequestInfoInterceptor());
|
||||
registry.addInterceptor(authenticationInterceptor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.clear();
|
||||
converters.add(getFastJsonConverter());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FastJsonHttpMessageConverter getFastJsonConverter() {
|
||||
// 初始化转换器
|
||||
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
||||
// 初始化一个转换器配置
|
||||
FastJsonConfig fastJsonConfig = new FastJsonConfig();
|
||||
JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
fastJsonConfig.setSerializerFeatures(SerializerFeature.BrowserCompatible,
|
||||
SerializerFeature.PrettyFormat,
|
||||
SerializerFeature.WriteNullStringAsEmpty,
|
||||
SerializerFeature.WriteDateUseDateFormat,
|
||||
SerializerFeature.DisableCircularReferenceDetect);
|
||||
//解决Long转json精度丢失的问题
|
||||
SerializeConfig serializeConfig = SerializeConfig.getGlobalInstance();
|
||||
serializeConfig.put(BigInteger.class, ToStringSerializer.instance);
|
||||
serializeConfig.put(Long.class, ToStringSerializer.instance);
|
||||
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
|
||||
fastJsonConfig.setSerializeConfig(serializeConfig);
|
||||
// 将配置设置给转换器并添加到HttpMessageConverter转换器列表中
|
||||
fastConverter.setFastJsonConfig(fastJsonConfig);
|
||||
|
||||
List<MediaType> supportedMediaTypes = new ArrayList<>();
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_JSON);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_ATOM_XML);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_OCTET_STREAM);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_PDF);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_RSS_XML);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_XHTML_XML);
|
||||
supportedMediaTypes.add(MediaType.APPLICATION_XML);
|
||||
supportedMediaTypes.add(MediaType.IMAGE_GIF);
|
||||
supportedMediaTypes.add(MediaType.IMAGE_JPEG);
|
||||
supportedMediaTypes.add(MediaType.IMAGE_PNG);
|
||||
supportedMediaTypes.add(MediaType.TEXT_EVENT_STREAM);
|
||||
supportedMediaTypes.add(MediaType.TEXT_HTML);
|
||||
supportedMediaTypes.add(MediaType.TEXT_MARKDOWN);
|
||||
supportedMediaTypes.add(MediaType.TEXT_PLAIN);
|
||||
supportedMediaTypes.add(MediaType.TEXT_XML);
|
||||
fastConverter.setSupportedMediaTypes(supportedMediaTypes);
|
||||
|
||||
return fastConverter;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package cn.pluss.platform.controller;
|
||||
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.RoleInfo;
|
||||
import cn.pluss.platform.entity.RoleUserInfo;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.roleInfo.RoleInfoService;
|
||||
import cn.pluss.platform.roleUserInfo.RoleUserInfoService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
public class BaseController<S extends IService<T>, T> extends BaseModelController<S, T> {
|
||||
|
||||
@Autowired
|
||||
protected HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
protected UserInfoService uiService;
|
||||
|
||||
@Autowired
|
||||
protected UserAppService uaService;
|
||||
|
||||
@Autowired
|
||||
protected RoleUserInfoService ruiService;
|
||||
|
||||
@Autowired
|
||||
protected RoleInfoService riService;
|
||||
/**
|
||||
* 获取登录用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ShiroUser queryCurrentShiroUser() {
|
||||
try {
|
||||
String userId = request.getHeader("userId");
|
||||
UserInfo ui = uiService.getById(userId);
|
||||
UserApp ua = new UserApp();
|
||||
ua.setUserId(ui.getId());
|
||||
ua = uaService.getOne(new QueryWrapper<>(ua));
|
||||
ShiroUser shiroUser = new ShiroUser();
|
||||
shiroUser.setUserType(ua.getUserType());
|
||||
shiroUser.setId(ui.getId());
|
||||
shiroUser.setStatus(ui.getStatus());
|
||||
shiroUser.setLoginName(ui.getLoginName());
|
||||
shiroUser.setStaffType(ua.getStaffType() + "");
|
||||
shiroUser.setUserType(ua.getUserType());
|
||||
shiroUser.setMerchantCode(ua.getMerchantCode());
|
||||
|
||||
return shiroUser;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Boolean verifyUserRole() {
|
||||
try {
|
||||
String userId = request.getHeader("userId");
|
||||
RoleUserInfo roleUserInfo = new RoleUserInfo();
|
||||
roleUserInfo.setUserId(Long.parseLong(userId));
|
||||
roleUserInfo = ruiService.getOne(new QueryWrapper<>(roleUserInfo));
|
||||
|
||||
RoleInfo roleInfo = new RoleInfo();
|
||||
roleInfo.setId(roleUserInfo.getRoleId());
|
||||
roleInfo = riService.getOne(new QueryWrapper<>(roleInfo));
|
||||
return roleInfo.getName().equals("超级系统管理员");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 读取request数据
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public String readRequestMsg(HttpServletRequest request) {
|
||||
java.io.BufferedReader bis = null;
|
||||
String line = null;
|
||||
String result = "";
|
||||
try {
|
||||
bis = new java.io.BufferedReader(new java.io.InputStreamReader(
|
||||
request.getInputStream(), "UTF-8"));
|
||||
while ((line = bis.readLine()) != null) {
|
||||
result += line + "\r\n";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是管理员
|
||||
*/
|
||||
public void getRole() {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (bol) {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不是管理员 获取的权限 是商户
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
request.setAttribute("merchant", "merchant");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package cn.pluss.platform.controller;
|
||||
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.RoleInfo;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.exception.UnauthorizedException;
|
||||
import cn.pluss.platform.roleInfo.RoleInfoService;
|
||||
import cn.pluss.platform.roleUserInfo.RoleUserInfoService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
protected HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
protected UserInfoService uiService;
|
||||
|
||||
@Autowired
|
||||
protected UserAppService uaService;
|
||||
|
||||
@Autowired
|
||||
protected RoleUserInfoService ruiService;
|
||||
|
||||
@Autowired
|
||||
protected RoleInfoService riService;
|
||||
/**
|
||||
* 获取登录用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ShiroUser queryCurrentShiroUser() {
|
||||
String userId = request.getHeader("userId");
|
||||
if (StringUtils.isEmpty(userId) || "null".equals(userId)) {
|
||||
throw new UnauthorizedException("非法请求");
|
||||
}
|
||||
|
||||
UserInfo ui = uiService.getById(userId);
|
||||
UserApp ua = new UserApp();
|
||||
ua.setUserId(ui.getId());
|
||||
|
||||
ShiroUser shiroUser = new ShiroUser();
|
||||
shiroUser.setId(ui.getId());
|
||||
shiroUser.setStatus(ui.getStatus());
|
||||
shiroUser.setLoginName(ui.getLoginName());
|
||||
|
||||
ua = uaService.getOne(new QueryWrapper<>(ua));
|
||||
if (ua == null) {
|
||||
return shiroUser;
|
||||
}
|
||||
|
||||
shiroUser.setUserType(ua.getUserType());
|
||||
shiroUser.setStaffType(ua.getStaffType() + "");
|
||||
shiroUser.setUserType(ua.getUserType());
|
||||
shiroUser.setMerchantCode(ua.getMerchantCode());
|
||||
|
||||
return shiroUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Boolean verifyUserRole() {
|
||||
String userId = request.getHeader("userId");
|
||||
UserInfo ui = uiService.getById(userId);
|
||||
List<RoleInfo> roleNames = riService.getRoleNames(ui.getLoginName());
|
||||
for (RoleInfo roleName : roleNames) {
|
||||
if (roleName.getName().equals("超级系统管理员")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 读取request数据
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public String readRequestMsg(HttpServletRequest request) {
|
||||
java.io.BufferedReader bis = null;
|
||||
String line = null;
|
||||
String result = "";
|
||||
try {
|
||||
bis = new java.io.BufferedReader(new java.io.InputStreamReader(
|
||||
request.getInputStream(), "UTF-8"));
|
||||
while ((line = bis.readLine()) != null) {
|
||||
result += line + "\r\n";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是管理员
|
||||
*/
|
||||
public void getRole() {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (bol) {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不是管理员 获取的权限 是商户
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
request.setAttribute("merchant", "merchant");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.pluss.platform.controller.DateTimeFormat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.stereotype.Component;
|
||||
/**
|
||||
*
|
||||
* @author yuchen
|
||||
*
|
||||
* @Description
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class DateConverterConfig implements Converter<String, Date> {
|
||||
private static final List<String> FORM_MARTS = new ArrayList<>(4);
|
||||
static {
|
||||
FORM_MARTS.add("yyyy-MM");
|
||||
FORM_MARTS.add("yyyy-MM-dd");
|
||||
FORM_MARTS.add("yyyy-MM-dd hh:mm");
|
||||
FORM_MARTS.add("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date convert(String source) {
|
||||
String value = source.trim();
|
||||
if ("".equals(value)) {
|
||||
return null;
|
||||
}
|
||||
if(source.matches("^\\d{4}-\\d{1,2}$")){
|
||||
return parseDate(source, FORM_MARTS.get(0));
|
||||
}else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")){
|
||||
return parseDate(source, FORM_MARTS.get(1));
|
||||
}else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")){
|
||||
return parseDate(source, FORM_MARTS.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, FORM_MARTS.get(3));
|
||||
}else {
|
||||
throw new IllegalArgumentException("Invalid boolean value '" + source + "'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
* @param dateStr String 字符型日期
|
||||
* @param format String 格式
|
||||
* @return Date 日期
|
||||
*/
|
||||
public Date parseDate(String dateStr, String format) {
|
||||
Date date=null;
|
||||
try {
|
||||
DateFormat dateFormat = new SimpleDateFormat(format);
|
||||
date = dateFormat.parse(dateStr);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.pluss.platform.controller;
|
||||
|
||||
import org.springframework.boot.web.servlet.error.ErrorController;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
*/
|
||||
@Controller
|
||||
public class MainController implements ErrorController {
|
||||
|
||||
@GetMapping({"/", "/index", "/error"})
|
||||
public void index(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
response.sendRedirect(request.getContextPath() + "/login");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorPath() {
|
||||
return "/index";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.pluss.platform.controller.MerchantPlugin;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.MerchantPlugin;
|
||||
import cn.pluss.platform.merchant.MerchantPluginService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.http.HttpRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/merchantPlugin")
|
||||
public class MerchantPluginController {
|
||||
|
||||
@Autowired
|
||||
private MerchantPluginService merchantPluginService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "merchantPlugin/merchantPluginList";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Map<String, Object> listMerchantPlugin(@RequestParam(defaultValue = "1") Integer currPage, Integer size,MerchantPlugin merchantPlugin) {
|
||||
QueryWrapper<MerchantPlugin> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.last("limit " + ((currPage - 1) * size) + "10");
|
||||
if (StringUtil.isNotEmpty(merchantPlugin.getUserId())){
|
||||
queryWrapper.eq("userId",merchantPlugin.getUserId());
|
||||
}
|
||||
List<MerchantPlugin> merchantPluginList = merchantPluginService.list(queryWrapper);
|
||||
for (MerchantPlugin m : merchantPluginList) {
|
||||
if (StringUtil.isNotEmpty(m.getExtra())) {
|
||||
m.setPosMerId(m.getExtra().getString("posMerId"));
|
||||
m.setTermList(m.getExtra().getString("termList"));
|
||||
}
|
||||
}
|
||||
int count = merchantPluginService.count();
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("merchantPluginList", merchantPluginList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, size));
|
||||
result.put("currPage", currPage);
|
||||
result.put("code", 200);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/detail/{id}")
|
||||
public String detail(@PathVariable(value = "id", required = false) Integer id, HttpServletRequest request) {
|
||||
MerchantPlugin merchantPlugin = merchantPluginService.getById(id);
|
||||
if (StringUtil.isNotEmpty(merchantPlugin.getExtra())) {
|
||||
merchantPlugin.setPosMerId(merchantPlugin.getExtra().getString("posMerId"));
|
||||
merchantPlugin.setTermList(merchantPlugin.getExtra().getString("termList"));
|
||||
}
|
||||
request.setAttribute("merchantPlugin", merchantPlugin);
|
||||
return "merchantPlugin/detail";
|
||||
}
|
||||
|
||||
@PostMapping("/updatePlugin")
|
||||
@ResponseBody
|
||||
public Result<MerchantPlugin> updatePlugin(@RequestBody MerchantPlugin merchantPlugin){
|
||||
MerchantPlugin pluginServiceById = merchantPluginService.getById(merchantPlugin.getId());
|
||||
pluginServiceById.getExtra().put("termList",merchantPlugin.getTermList());
|
||||
merchantPluginService.updateById(pluginServiceById);
|
||||
return ResultGenerator.genSuccessResult("修改成功!",null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
package cn.pluss.platform.controller.activityActivate;
|
||||
|
||||
import cn.pluss.platform.activityActivate.ActivityActivateService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.ActivityActivate;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("activityActivate")
|
||||
public class ActivityActivateController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private ActivityActivateService activityActivateService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
getRole();
|
||||
getPermission();
|
||||
return "activityActivate/activityActivateList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityActivateByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryActivityActivateByPage(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
String name) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
Boolean bol = verifyUserRole();
|
||||
// 是否是管理员进行数据筛选和权限标记
|
||||
if (bol) {
|
||||
result.put("admin", "admin");
|
||||
} else {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
result.put("merchant", "merchant");
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
} else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
}
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("name", name);
|
||||
List<ActivityActivate> activityActivateList = null;
|
||||
Integer count = 0 ;
|
||||
if (bol){
|
||||
activityActivateList = activityActivateService.queryActivityActivatePage(map);
|
||||
count = activityActivateService.queryActivityActivatePageCount(map);
|
||||
}else{
|
||||
activityActivateList = activityActivateService.queryNoActivityActivatePage(map);
|
||||
count = activityActivateService.queryNoActivityActivatePageCount(map);
|
||||
}
|
||||
result.put("activityActivateList", activityActivateList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityActivateDetails", method = RequestMethod.GET)
|
||||
public String queryActivityActivateDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setId(id);
|
||||
activityActivate = activityActivateService.queryActivityActivate(activityActivate);
|
||||
request.setAttribute("activityActivate", activityActivate);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityActivate/activityActivateDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他用户查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/otherActivityActivateDetails", method = RequestMethod.GET)
|
||||
public String otherActivityActivateDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setId(id);
|
||||
activityActivate = activityActivateService.queryActivityActivate(activityActivate);
|
||||
request.setAttribute("activityActivate", activityActivate);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityActivate/otherActivityActivateDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityActivateBaseInfo", method = RequestMethod.GET)
|
||||
public String queryActivityActivateBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantNoStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
if (id != null && id != 0) {
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setId(id);
|
||||
activityActivate = activityActivateService.queryActivityActivate(activityActivate);
|
||||
request.setAttribute("activityActivate", activityActivate);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
// 如果是管理员
|
||||
if (bol) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(activityActivate.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
getRole();
|
||||
getPermission();
|
||||
getMerchant();
|
||||
return "activityActivate/activityActivateBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityActivateExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityActivateExtendsInfo() {
|
||||
return "activityActivate/activityActivateExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityActivateFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityActivateFunctionsInfo() {
|
||||
return "activityActivate/activityActivateFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveActivityActivate", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveActivityActivate(ActivityActivate activityActivate) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
// 通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
merchantBaseInfo.setMerchantCode(activityActivate.getMerchantCode());
|
||||
if (StringUtil.isNotEmpty(activityActivate.getMerchantCode())) {
|
||||
merchantBaseInfo.setMerchantCode(activityActivate.getMerchantCode());
|
||||
}else {
|
||||
ShiroUser user=queryCurrentShiroUser();
|
||||
activityActivate.setMerchantCode(user.getMerchantCode());
|
||||
merchantBaseInfo.setMerchantCode(user.getMerchantCode());
|
||||
}
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (merchantBaseInfoList != null && merchantBaseInfoList.size() > 0) {
|
||||
activityActivate.setMerchantName(merchantBaseInfoList.get(0).getMerchantName());
|
||||
}
|
||||
// 通过StoreId查门店信息
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setStoreId(activityActivate.getStoreId());
|
||||
if (StringUtil.isNotEmpty(activityActivate.getStoreId())) {
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
if (merchantStoreList != null && merchantStoreList.size() > 0) {
|
||||
activityActivate.setStoreName(merchantStoreList.get(0).getStoreName());
|
||||
}
|
||||
}
|
||||
if (activityActivate.getId() != null && activityActivate.getId() != 0) {
|
||||
activityActivateService.updateActivityActivate(activityActivate);
|
||||
} else {
|
||||
if (StringUtil.isEmpty(activityActivate.getUserId())) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser)) {
|
||||
activityActivate.setUserId(shiroUser.getId().intValue());
|
||||
}
|
||||
}
|
||||
ActivityActivate activate=new ActivityActivate();
|
||||
activate.setStoreId(activityActivate.getStoreId());
|
||||
activate.setMerchantCode(activityActivate.getMerchantCode());
|
||||
List<ActivityActivate> queryActivityActivateList = activityActivateService.queryActivityActivateList(activate);
|
||||
for (ActivityActivate a : queryActivityActivateList) {
|
||||
activityActivateService.deleteActivityActivate(a);
|
||||
}
|
||||
activityActivateService.saveActivityActivate(activityActivate);
|
||||
}
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateActivityActivate", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateActivityActivate(Integer id) {
|
||||
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setId(id);
|
||||
activityActivateService.updateActivityActivate(activityActivate);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteActivityActivate", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteActivityActivate(Integer id) {
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setId(id);
|
||||
activityActivateService.deleteActivityActivate(activityActivate);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员权限标识
|
||||
*/
|
||||
public void getRole() {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (bol) {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不是管理员 获取的权限 是商户
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
request.setAttribute("merchant", "merchant");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
package cn.pluss.platform.controller.activityConsumReturn;
|
||||
|
||||
import cn.pluss.platform.activityConsumReturn.ActivityConsumReturnService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.ActivityConsumReturn;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("activityConsumReturn")
|
||||
public class ActivityConsumReturnController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private ActivityConsumReturnService activityConsumReturnService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
getRole();
|
||||
getPermission();
|
||||
return "activityConsumReturn/activityConsumReturnList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityConsumReturnByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryActivityConsumReturnByPage(@RequestParam(defaultValue = "1") Integer currPage, ActivityConsumReturn activityConsumReturn) {
|
||||
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("startDt", activityConsumReturn.getStartDt());
|
||||
map.put("endDt", activityConsumReturn.getEndDt());
|
||||
map.put("name", activityConsumReturn.getName());
|
||||
Boolean bol = verifyUserRole();
|
||||
//是否是管理员进行数据筛选和权限标记
|
||||
if (bol) {
|
||||
result.put("admin", "admin");
|
||||
}else {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
result.put("merchant", "merchant");
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
} else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
}
|
||||
List<ActivityConsumReturn> activityConsumReturnList = null;
|
||||
Integer count = 0;
|
||||
if (bol){
|
||||
activityConsumReturnList = activityConsumReturnService.queryActivityConsumReturnPage(map);
|
||||
count = activityConsumReturnService.queryActivityConsumReturnPageCount(map);
|
||||
}else {
|
||||
activityConsumReturnList = activityConsumReturnService.queryActivityNoConsumReturnPage(map);
|
||||
count = activityConsumReturnService.queryActivityNoConsumReturnPageCount(map);
|
||||
}
|
||||
result.put("activityConsumReturnList", activityConsumReturnList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityConsumReturnDetails", method = RequestMethod.GET)
|
||||
public String queryActivityConsumReturnDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setId(id);
|
||||
activityConsumReturn = activityConsumReturnService.queryActivityConsumReturn(activityConsumReturn);
|
||||
request.setAttribute("activityConsumReturn", activityConsumReturn);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityConsumReturn/activityConsumReturnDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他用户查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/otherActivityConsumReturnDetails", method = RequestMethod.GET)
|
||||
public String otherActivityConsumReturnDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setId(id);
|
||||
activityConsumReturn = activityConsumReturnService.queryActivityConsumReturn(activityConsumReturn);
|
||||
request.setAttribute("activityConsumReturn", activityConsumReturn);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityConsumReturn/otherActivityConsumReturnDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityConsumReturnBaseInfo", method = RequestMethod.GET)
|
||||
public String queryActivityConsumReturnBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantNoStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
if (id != null && id != 0) {
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setId(id);
|
||||
activityConsumReturn = activityConsumReturnService.queryActivityConsumReturn(activityConsumReturn);
|
||||
request.setAttribute("activityConsumReturn", activityConsumReturn);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
//如果是管理员
|
||||
if (bol) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(activityConsumReturn.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
getRole();
|
||||
getPermission();
|
||||
getMerchant();
|
||||
return "activityConsumReturn/activityConsumReturnBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityConsumReturnExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityConsumReturnExtendsInfo() {
|
||||
|
||||
return "activityConsumReturn/activityConsumReturnExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityConsumReturnFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityConsumReturnFunctionsInfo() {
|
||||
|
||||
return "activityConsumReturn/activityConsumReturnFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveActivityConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveActivityConsumReturn(ActivityConsumReturn activityConsumReturn) {
|
||||
//通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
if (StringUtil.isNotEmpty(activityConsumReturn.getMerchantCode())){
|
||||
merchantBaseInfo.setMerchantCode(activityConsumReturn.getMerchantCode());
|
||||
}else {
|
||||
ShiroUser user=queryCurrentShiroUser();
|
||||
activityConsumReturn.setMerchantCode(user.getMerchantCode());
|
||||
merchantBaseInfo.setMerchantCode(user.getMerchantCode());
|
||||
}
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (merchantBaseInfoList != null && merchantBaseInfoList.size() > 0) {
|
||||
activityConsumReturn.setMerchantName(merchantBaseInfoList.get(0).getMerchantName());
|
||||
}
|
||||
//通过StoreId查门店信息
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setStoreId(activityConsumReturn.getStoreId());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
if (merchantStoreList != null && merchantStoreList.size() > 0) {
|
||||
activityConsumReturn.setStoreName(merchantStoreList.get(0).getStoreName());
|
||||
}
|
||||
if (activityConsumReturn.getId() != null && activityConsumReturn.getId() != 0) {
|
||||
if (StringUtil.isNotEmpty(activityConsumReturn)) {
|
||||
if (null != activityConsumReturn.getTimeType() && 0 == activityConsumReturn.getTimeType()) {
|
||||
activityConsumReturn.setStartDt(null);
|
||||
activityConsumReturn.setEndDt(null);
|
||||
}
|
||||
}
|
||||
activityConsumReturnService.updateActivityConsumReturn(activityConsumReturn);
|
||||
} else {
|
||||
ActivityConsumReturn aConsumReturn = new ActivityConsumReturn();
|
||||
aConsumReturn.setMerchantCode(activityConsumReturn.getMerchantCode());
|
||||
aConsumReturn.setStoreId(activityConsumReturn.getStoreId());
|
||||
List<ActivityConsumReturn> queryActivityConsumReturnList = activityConsumReturnService.queryActivityConsumReturnList(aConsumReturn);
|
||||
for (ActivityConsumReturn a : queryActivityConsumReturnList) {
|
||||
activityConsumReturnService.deleteActivityConsumReturn(a);
|
||||
}
|
||||
if (StringUtil.isEmpty(activityConsumReturn.getUserId())) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser)) {
|
||||
activityConsumReturn.setUserId(shiroUser.getId().intValue());
|
||||
}
|
||||
}
|
||||
activityConsumReturnService.saveActivityConsumReturn(activityConsumReturn);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateActivityConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateActivityConsumReturn(Integer id) {
|
||||
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setId(id);
|
||||
activityConsumReturnService.updateActivityConsumReturn(activityConsumReturn);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteActivityConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteActivityConsumReturn(Integer id) {
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setId(id);
|
||||
activityConsumReturnService.deleteActivityConsumReturn(activityConsumReturn);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员权限标识
|
||||
*/
|
||||
public void getRole() {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (bol) {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 不是管理员 获取的权限 是商户
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
request.setAttribute("merchant", "merchant");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.pluss.platform.controller.activityEnroll;
|
||||
|
||||
|
||||
import cn.pluss.platform.activityEnroll.ActivityEnrollService;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.entity.ActivityEnroll;
|
||||
import cn.pluss.platform.entity.Dict;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户活动报名记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/activityEnroll")
|
||||
public class ActivityEnrollController extends BaseModelController<ActivityEnrollService, ActivityEnroll> {
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
List<String> actList = new ArrayList<String>(){{this.add("ACTIVITY_TYPE");}};
|
||||
List<Dict> actDictList = dictService.getByCode(actList);
|
||||
request.setAttribute("actTypeList",JSONArray.toJSONString(actDictList));
|
||||
return "activityEnroll/list";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<Page<ActivityEnroll>> page(Page<ActivityEnroll> page, ActivityEnroll condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false).setColumn("createTime");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody ActivityEnroll activityEnroll) {
|
||||
if (activityEnroll.getId() != null){
|
||||
activityEnroll.setAuditTime(new Date());
|
||||
this.baseService.updateById(activityEnroll);
|
||||
}else {
|
||||
activityEnroll.setCreateTime(new Date());
|
||||
this.baseService.save(activityEnroll);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
package cn.pluss.platform.controller.activityRecharge;
|
||||
|
||||
import cn.pluss.platform.activityRecharge.ActivityRechargeService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.ActivityRecharge;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("activityRecharge")
|
||||
public class ActivityRechargeController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private ActivityRechargeService activityRechargeService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
getRole();
|
||||
getPermission();
|
||||
return "activityRecharge/activityRechargeList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRechargeByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryActivityRechargeByPage(@RequestParam(defaultValue = "1") Integer currPage, ActivityRecharge activityRecharge) {
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
if (null != activityRecharge.getStartDt()) {
|
||||
map.put("startDt", activityRecharge.getStartDt());
|
||||
}
|
||||
if (null != activityRecharge.getEndDt()) {
|
||||
map.put("endDt", activityRecharge.getEndDt());
|
||||
}
|
||||
if (null != activityRecharge.getId()) {
|
||||
map.put("id", activityRecharge.getId());
|
||||
}
|
||||
if (null != activityRecharge.getMerchantName() && !"".equals(activityRecharge.getMerchantName())) {
|
||||
map.put("merchantName", activityRecharge.getMerchantName());
|
||||
}
|
||||
//map.put("name", activityRecharge.getName());
|
||||
Boolean bol = verifyUserRole();
|
||||
//是否是管理员进行数据筛选和权限标记
|
||||
if (bol) {
|
||||
result.put("admin", "admin");
|
||||
} else {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
result.put("merchant", "merchant");
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
} else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
}
|
||||
List<ActivityRecharge> activityRechargeList = null;
|
||||
Integer count = 0;
|
||||
if (!bol) {
|
||||
activityRechargeList = activityRechargeService.queryActivityNoRechargePage(map);
|
||||
count = activityRechargeService.queryActivityNoRechargePageCount(map);
|
||||
} else {
|
||||
activityRechargeList = activityRechargeService.queryActivityRechargePage(map);
|
||||
count = activityRechargeService.queryActivityRechargePageCount(map);
|
||||
}
|
||||
result.put("activityRechargeList", activityRechargeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRechargeDetails", method = RequestMethod.GET)
|
||||
public String queryActivityRechargeDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setId(id);
|
||||
activityRecharge = activityRechargeService.queryActivityRecharge(activityRecharge);
|
||||
request.setAttribute("activityRecharge", activityRecharge);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityRecharge/activityRechargeDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他用户查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/otherActivityRechargeDetails", method = RequestMethod.GET)
|
||||
public String otherActivityRechargeDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setId(id);
|
||||
activityRecharge = activityRechargeService.queryActivityRecharge(activityRecharge);
|
||||
request.setAttribute("activityRecharge", activityRecharge);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityRecharge/otherActivityRechargeDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRechargeBaseInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRechargeBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantNoStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
if (id != null && id != 0) {
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setId(id);
|
||||
activityRecharge = activityRechargeService.queryActivityRecharge(activityRecharge);
|
||||
request.setAttribute("activityRecharge", activityRecharge);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
//如果是管理员
|
||||
if (bol) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(activityRecharge.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
getRole();
|
||||
getPermission();
|
||||
getMerchant();
|
||||
return "activityRecharge/activityRechargeBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRechargeExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRechargeExtendsInfo() {
|
||||
|
||||
return "activityRecharge/activityRechargeExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRechargeFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRechargeFunctionsInfo() {
|
||||
|
||||
return "activityRecharge/activityRechargeFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveActivityRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveActivityRecharge(ActivityRecharge activityRecharge) {
|
||||
|
||||
//通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
if (StringUtil.isNotEmpty(activityRecharge.getMerchantCode())) {
|
||||
merchantBaseInfo.setMerchantCode(activityRecharge.getMerchantCode());
|
||||
}else {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
activityRecharge.setMerchantCode(user.getMerchantCode());
|
||||
merchantBaseInfo.setMerchantCode(user.getMerchantCode());
|
||||
}
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (merchantBaseInfoList != null && merchantBaseInfoList.size() > 0) {
|
||||
activityRecharge.setMerchantName(merchantBaseInfoList.get(0).getMerchantName());
|
||||
}
|
||||
//通过StoreId查门店信息
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setStoreId(activityRecharge.getStoreId());
|
||||
if (StringUtil.isNotEmpty(activityRecharge.getStoreId())) {
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
if (merchantStoreList != null && merchantStoreList.size() > 0) {
|
||||
activityRecharge.setStoreName(merchantStoreList.get(0).getStoreName());
|
||||
}
|
||||
}
|
||||
if (activityRecharge.getId() != null && activityRecharge.getId() != 0) {
|
||||
if (StringUtil.isNotEmpty(activityRecharge)) {
|
||||
if (null != activityRecharge.getTimeType() && 0 == activityRecharge.getTimeType()) {
|
||||
activityRecharge.setStartDt(null);
|
||||
activityRecharge.setEndDt(null);
|
||||
}
|
||||
}
|
||||
activityRechargeService.updateActivityRecharge(activityRecharge);
|
||||
} else {
|
||||
if (StringUtil.isEmpty(activityRecharge.getUserId())) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser)) {
|
||||
activityRecharge.setUserId(shiroUser.getId().intValue());
|
||||
}
|
||||
}
|
||||
ActivityRecharge aRecharge = new ActivityRecharge();
|
||||
aRecharge.setMerchantCode(activityRecharge.getMerchantCode());
|
||||
aRecharge.setStoreId(activityRecharge.getStoreId());
|
||||
List<ActivityRecharge> queryActivityRechargeList = activityRechargeService.queryActivityRechargeList(aRecharge);
|
||||
for (ActivityRecharge a : queryActivityRechargeList) {
|
||||
activityRechargeService.deleteActivityRecharge(a);
|
||||
}
|
||||
activityRechargeService.saveActivityRecharge(activityRecharge);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateActivityRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateActivityRecharge(Integer id) {
|
||||
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setId(id);
|
||||
activityRechargeService.updateActivityRecharge(activityRecharge);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteActivityRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteActivityRecharge(Integer id) {
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setId(id);
|
||||
activityRechargeService.deleteActivityRecharge(activityRecharge);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
package cn.pluss.platform.controller.activityRecommend;
|
||||
|
||||
import cn.pluss.platform.activityRecommend.ActivityRecommendService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.ActivityRecommend;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("activityRecommend")
|
||||
public class ActivityRecommendController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Autowired
|
||||
private ActivityRecommendService activityRecommendService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "activityRecommend/activityRecommendList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRecommendByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryActivityRecommendByPage(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
ActivityRecommend activityRecommend) {
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if(StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
}
|
||||
if (StringUtil.isNotEmpty(activityRecommend.getName())) {
|
||||
map.put("name", activityRecommend.getName());
|
||||
}
|
||||
List<ActivityRecommend> activityRecommendList = activityRecommendService.queryActivityRecommendPage(map);
|
||||
Integer count = activityRecommendService.queryActivityRecommendPageCount(map);
|
||||
result.put("activityRecommendList", activityRecommendList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRecommendDetails", method = RequestMethod.GET)
|
||||
public String queryActivityRecommendDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
ActivityRecommend activityRecommend = new ActivityRecommend();
|
||||
activityRecommend.setId(id);
|
||||
activityRecommend = activityRecommendService.queryActivityRecommend(activityRecommend);
|
||||
request.setAttribute("activityRecommend", activityRecommend);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "activityRecommend/activityRecommendDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRecommendBaseInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRecommendBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
// 是否是管理员
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
|
||||
if (id != null && id != 0) {
|
||||
ActivityRecommend activityRecommend = new ActivityRecommend();
|
||||
activityRecommend.setId(id);
|
||||
activityRecommend = activityRecommendService.queryActivityRecommend(activityRecommend);
|
||||
request.setAttribute("activityRecommend", activityRecommend);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
if (bol) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(activityRecommend.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
}
|
||||
}
|
||||
getMerchant();
|
||||
return "activityRecommend/activityRecommendBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRecommendExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRecommendExtendsInfo() {
|
||||
|
||||
return "activityRecommend/activityRecommendExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryActivityRecommendFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryActivityRecommendFunctionsInfo() {
|
||||
|
||||
return "activityRecommend/activityRecommendFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveActivityRecommend", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveActivityRecommend(ActivityRecommend activityRecommend) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
// 通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
merchantBaseInfo.setMerchantCode(activityRecommend.getMerchantCode());
|
||||
if (StringUtil.isNotEmpty(activityRecommend.getMerchantCode())) {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService
|
||||
.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (merchantBaseInfoList != null && merchantBaseInfoList.size() > 0) {
|
||||
activityRecommend.setMerchantName(merchantBaseInfoList.get(0).getMerchantName());
|
||||
}
|
||||
}
|
||||
// 通过StoreId查门店信息
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setStoreId(activityRecommend.getStoreId());
|
||||
if (StringUtil.isNotEmpty(activityRecommend.getStoreId())) {
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
if (merchantStoreList != null && merchantStoreList.size() > 0) {
|
||||
activityRecommend.setStoreName(merchantStoreList.get(0).getStoreName());
|
||||
}
|
||||
}
|
||||
if (activityRecommend.getId() != null && activityRecommend.getId() != 0) {
|
||||
activityRecommendService.updateActivityRecommend(activityRecommend);
|
||||
} else {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser)) {
|
||||
activityRecommend.setUserId(shiroUser.getId().intValue());
|
||||
}
|
||||
activityRecommendService.saveActivityRecommend(activityRecommend);
|
||||
}
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateActivityRecommend", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateActivityRecommend(Integer id) {
|
||||
|
||||
ActivityRecommend activityRecommend = new ActivityRecommend();
|
||||
activityRecommend.setId(id);
|
||||
activityRecommendService.updateActivityRecommend(activityRecommend);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteActivityRecommend", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteActivityRecommend(Integer id) {
|
||||
ActivityRecommend activityRecommend = new ActivityRecommend();
|
||||
activityRecommend.setId(id);
|
||||
activityRecommendService.deleteActivityRecommend(activityRecommend);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package cn.pluss.platform.controller.agent;
|
||||
|
||||
import cn.pluss.platform.agentInfo.AgentInfoService;
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.MerchantImage;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.merchantBankCard.MerchantBankCardService;
|
||||
import cn.pluss.platform.merchantImage.MerchantImageService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.vo.AgentInfo;
|
||||
import cn.pluss.platform.vo.AgentStaffVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("agentInfo")
|
||||
public class AgentInfoController {
|
||||
|
||||
@Autowired
|
||||
private AgentInfoService agentInfoService;
|
||||
|
||||
@Autowired
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Autowired
|
||||
private MerchantImageService merchantImageService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBankCardService merchantBankCardService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/list")
|
||||
public String index() {
|
||||
return "agent/list";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<AgentInfo>> page(Page<AgentInfo> page, AgentInfo agentInfo) {
|
||||
if ("".equals(agentInfo.getIsFixedRate())) {
|
||||
agentInfo.setIsFixedRate(null);
|
||||
}
|
||||
Page<AgentInfo> pageData = agentInfoService.pageData(page, agentInfo);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{userId}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "userId", required = false) Long userId) {
|
||||
AgentInfo agentInfo;
|
||||
if (userId != null) {
|
||||
agentInfo = new AgentInfo().setUserId(userId);
|
||||
agentInfo = agentInfoService.getOne(agentInfo);
|
||||
} else {
|
||||
agentInfo = new AgentInfo();
|
||||
agentInfo.setRate(BigDecimal.valueOf(25));
|
||||
}
|
||||
request.setAttribute("entity", agentInfo);
|
||||
return "agent/detail";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/part/{userId}"})
|
||||
public String part(HttpServletRequest request, @PathVariable(value = "userId", required = false) Long userId) {
|
||||
//超级管理商结算信息:
|
||||
if (userId != null) {
|
||||
//超级管理商基本信息
|
||||
QueryWrapper<UserApp> userAppQueryWrapper = new QueryWrapper<UserApp>().eq("userId", userId);
|
||||
UserApp userAppServiceOne = userAppService.getOne(userAppQueryWrapper);
|
||||
request.setAttribute("userApp", userAppServiceOne);
|
||||
UserApp appInfo = userAppService.queryUserAppJoinByUserId(userId);
|
||||
if (appInfo != null) {
|
||||
if (StringUtils.isNotEmpty(appInfo.getMerchantCode())) {
|
||||
MerchantImage image = new MerchantImage();
|
||||
image.setMerchantCode(appInfo.getMerchantCode());
|
||||
if (appInfo.getMerchantBaseInfo() != null) {
|
||||
request.setAttribute("merchantInfo", appInfo.getMerchantBaseInfo());
|
||||
}
|
||||
if (appInfo.getMerchantBankCard() != null) {
|
||||
request.setAttribute("mercBankCard", appInfo.getMerchantBankCard());
|
||||
}
|
||||
List<MerchantImage> imageList = merchantImageService.queryMerchantImageList(image);
|
||||
String merchantImage1 = null;
|
||||
String merchantImage2 = null;
|
||||
String merchantImage3 = null;
|
||||
String merchantImage6 = null;
|
||||
String merchantImage8 = null;
|
||||
String merchantImage9 = null;
|
||||
String merchantImage98 = null;
|
||||
if (imageList != null && !imageList.isEmpty()) {
|
||||
for (MerchantImage m : imageList) {
|
||||
switch (m.getPhotoType()) {
|
||||
case "01":
|
||||
merchantImage1 = m.getPicUrl();
|
||||
break;
|
||||
case "02":
|
||||
merchantImage2 = m.getPicUrl();
|
||||
break;
|
||||
case "03":
|
||||
merchantImage3 = m.getPicUrl();
|
||||
break;
|
||||
case "06":
|
||||
merchantImage6 = m.getPicUrl();
|
||||
break;
|
||||
case "08":
|
||||
merchantImage8 = m.getPicUrl();
|
||||
break;
|
||||
case "09":
|
||||
merchantImage9 = m.getPicUrl();
|
||||
break;
|
||||
case "98":
|
||||
merchantImage98 = m.getPicUrl();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
request.setAttribute("merchantImage1", merchantImage1);
|
||||
request.setAttribute("merchantImage2", merchantImage2);
|
||||
request.setAttribute("merchantImage3", merchantImage3);
|
||||
request.setAttribute("merchantImage6", merchantImage6);
|
||||
request.setAttribute("merchantImage8", merchantImage8);
|
||||
request.setAttribute("merchantImage9", merchantImage9);
|
||||
request.setAttribute("merchantImage98", merchantImage98);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "agent/particulars";
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<AgentInfo> saveOrUpdate(@RequestBody AgentInfo agentInfo) {
|
||||
agentInfoService.saveOrUpdate(agentInfo);
|
||||
return ResultGenerator.genSuccessResult("保存成功", agentInfo);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Result<AgentInfo> del(@RequestBody AgentInfo agentInfo) {
|
||||
agentInfoService.delete(agentInfo);
|
||||
return ResultGenerator.genSuccessResult("删除成功", agentInfo);
|
||||
}
|
||||
|
||||
@PostMapping("/saveAgentInfo")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ResponseBody
|
||||
public Result<String> saveAgentInfo(UserApp userApp) {
|
||||
merchantBankCardService.updateMerchantBankCardUserId(userApp.getMerchantBankCard());
|
||||
if (StringUtil.isNotEmpty(userApp.getUserId())) {
|
||||
userAppService.updateUserAppUserId(userApp);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/subAgentList")
|
||||
public String subAgentList() {
|
||||
return "agent/subAgentList";
|
||||
}
|
||||
|
||||
@GetMapping("/subAgentPage")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<AgentInfo>> subAgentPage(Page<AgentInfo> page, AgentInfo agentInfo) {
|
||||
Page<AgentInfo> pageData = agentInfoService.pageSubData(page, agentInfo);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/staffList")
|
||||
public String staffList() {
|
||||
return "agent/staffList";
|
||||
}
|
||||
|
||||
@GetMapping("/staffPage")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<AgentStaffVO>> staffPage(Page<AgentStaffVO> page, AgentStaffVO agentStaffVO, OrderItem orderItem) {
|
||||
Page<AgentStaffVO> userAppPage = agentInfoService.staffPage(page, agentStaffVO, orderItem);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(userAppPage));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package cn.pluss.platform.controller.agreement;
|
||||
|
||||
import cn.pluss.platform.agreement.AgreementService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.Agreement;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("agreement")
|
||||
public class AgreementController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private AgreementService agreementService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "agreement/agreementList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryAgreementByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryAgreementByPage(@RequestParam(defaultValue="1") Integer currPage,Agreement agreement){
|
||||
|
||||
Map<String,Object> map=new HashMap<String, Object>(16);
|
||||
Map<String,Object> result=new HashMap<String,Object>(16);
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
if(StringUtil.isNotEmpty(agreement.getName())) {
|
||||
map.put("name", agreement.getName());
|
||||
}
|
||||
List<Agreement> agreementList=agreementService.queryAgreementPage(map);
|
||||
Integer count=agreementService.queryAgreementPageCount(map);
|
||||
result.put("agreementList", agreementList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryAgreementDetails", method = RequestMethod.GET)
|
||||
public String queryAgreementDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
Agreement agreement=new Agreement();
|
||||
agreement.setId(id);
|
||||
agreement=agreementService.queryAgreement(agreement);
|
||||
request.setAttribute("agreement", agreement);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "agreement/agreementDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryAgreementBaseInfo", method = RequestMethod.GET)
|
||||
public String queryAgreementBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
Agreement agreement=new Agreement();
|
||||
agreement.setId(id);
|
||||
agreement=agreementService.queryAgreement(agreement);
|
||||
request.setAttribute("agreement", agreement);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "agreement/agreementBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryAgreementExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryAgreementExtendsInfo(){
|
||||
|
||||
return "agreement/agreementExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryAgreementFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryAgreementFunctionsInfo(){
|
||||
|
||||
return "agreement/agreementFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveAgreement", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveAgreement(Agreement agreement,String oldDiscern){
|
||||
Map<String,Object> result=new HashMap<String,Object>(16);
|
||||
Agreement a=new Agreement();
|
||||
String discern = agreement.getDiscern();
|
||||
a.setDiscern(discern);
|
||||
if(agreement.getId()!=null&&agreement.getId()!=0){
|
||||
if(!agreement.getDiscern().equals(oldDiscern)) {
|
||||
List<Agreement> queryAgreementList = agreementService.queryAgreementList(a);
|
||||
if(queryAgreementList!=null&&queryAgreementList.size()>0) {
|
||||
result.put("code", "0");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
agreementService.updateAgreement(agreement);
|
||||
}else{
|
||||
List<Agreement> queryAgreementList = agreementService.queryAgreementList(a);
|
||||
if(queryAgreementList!=null&&queryAgreementList.size()>0) {
|
||||
result.put("code", "0");
|
||||
return result;
|
||||
}
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
agreement.setCreateor(shiroUser.getLoginName());
|
||||
agreementService.saveAgreement(agreement);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateAgreement", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateAgreement(Integer id){
|
||||
|
||||
Agreement agreement=new Agreement();
|
||||
agreement.setId(id);
|
||||
agreementService.updateAgreement(agreement);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAgreement", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteAgreement(Integer id){
|
||||
Agreement agreement=new Agreement();
|
||||
agreement.setId(id);
|
||||
agreementService.deleteAgreement(agreement);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.pluss.platform.controller.appGuide;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.appGuide.AppGuideService;
|
||||
import cn.pluss.platform.entity.AppGuide;
|
||||
import cn.pluss.platform.entity.AppVersionInfo;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author djh
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/appGuide")
|
||||
public class AppGuideController {
|
||||
|
||||
@Autowired
|
||||
private AppGuideService appGuideService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "appGuide/appGuideList";
|
||||
}
|
||||
|
||||
@RequestMapping("add")
|
||||
public String add() {
|
||||
return "appGuide/appGuideDetail";
|
||||
}
|
||||
|
||||
@GetMapping("/edit/{id}")
|
||||
public ModelAndView edit(@PathVariable Integer id){
|
||||
ModelAndView view = new ModelAndView("appGuide/appGuideDetail");
|
||||
AppGuide v = appGuideService.getById(id);
|
||||
view.addObject("entity",v);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<AppGuide>> page(Page<AppGuide> page, AppGuide condition) {
|
||||
Page<AppGuide> pageData= appGuideService.page(page, new QueryWrapper<>(condition));
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody AppGuide entity) {
|
||||
if (entity.getId() != null && entity.getId() != 0){
|
||||
entity.setUpdateTime(new Date());
|
||||
appGuideService.updateById(entity);
|
||||
}else {
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setUpdateTime(new Date());
|
||||
appGuideService.save(entity);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
@ResponseBody
|
||||
public Result<String> delete(@RequestBody AppVersionInfo appVersionInfo) {
|
||||
appGuideService.removeById(appVersionInfo.getId());
|
||||
if(StringUtil.isNotEmpty(appVersionInfo.getUrl())){
|
||||
OssOperatUtil.deleteFile(appVersionInfo.getUrl());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("操作成功!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package cn.pluss.platform.controller.appVersionInfo;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.appVersionInfo.AppVersionInfoService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.AppVersionInfo;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("appVersionInfo")
|
||||
public class AppVersionInfoController extends BaseNoModelController {
|
||||
|
||||
private final AppVersionInfoService appVersionInfoService;
|
||||
|
||||
@GetMapping("index")
|
||||
public String index() {
|
||||
return "appVersionInfo/list";
|
||||
}
|
||||
|
||||
@RequestMapping("add")
|
||||
public ModelAndView add() {
|
||||
ModelAndView view = new ModelAndView("appVersionInfo/detail");
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam",uploadParam);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping("/edit/{id}")
|
||||
public ModelAndView edit(@PathVariable Integer id){
|
||||
ModelAndView view = new ModelAndView("appVersionInfo/detail");
|
||||
AppVersionInfo v = appVersionInfoService.getById(id);
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam",uploadParam);
|
||||
view.addObject("appVerInfo",v);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<AppVersionInfo>> page(Page<AppVersionInfo> page,AppVersionInfo appVersionInfo) {
|
||||
Page<AppVersionInfo> pageData= appVersionInfoService.pageData(page,appVersionInfo);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody AppVersionInfo appVersionInfo) {
|
||||
if (appVersionInfo.getId()!= 0){
|
||||
appVersionInfo.setUpdateTime(new Date());
|
||||
appVersionInfoService.updateById(appVersionInfo);
|
||||
}else {
|
||||
appVersionInfo.setCreateTime(new Date());
|
||||
appVersionInfo.setUpdateTime(new Date());
|
||||
appVersionInfoService.save(appVersionInfo);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
@ResponseBody
|
||||
public Result<String> delete(@RequestBody AppVersionInfo appVersionInfo) {
|
||||
appVersionInfoService.removeById(appVersionInfo.getId());
|
||||
if(StringUtil.isNotEmpty(appVersionInfo.getUrl())){
|
||||
OssOperatUtil.deleteFile(appVersionInfo.getUrl());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("操作成功!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.pluss.platform.controller.audit;
|
||||
|
||||
|
||||
import cn.pluss.platform.SubMerchantApplyOrderService;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.SubMerchantApplyOrder;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 子渠道工单信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-08-31
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/subMerchantApplyOrder")
|
||||
public class SubMerchantApplyOrderController extends BaseModelController<SubMerchantApplyOrderService, SubMerchantApplyOrder> {
|
||||
@Autowired
|
||||
private SubMerchantApplyOrderService subMerchantApplyOrderService;
|
||||
|
||||
@RequestMapping("/toList")
|
||||
public String toList() {
|
||||
return "subMerchantApplyOrder/list";
|
||||
}
|
||||
|
||||
@RequestMapping("/detail")
|
||||
public String detail() {
|
||||
return "subMerchantApplyOrder/detail";
|
||||
}
|
||||
|
||||
@RequestMapping("/pageMoreDetail")
|
||||
@ResponseBody
|
||||
public Result<Page<Map<String, Object>>> page(Page<Map<String, Object>> page, @RequestParam Map<String, String> condition) {
|
||||
Page<Map<String, Object>> mapPage = baseService.pageMoreDetail(page, condition);
|
||||
return ResultGenerator.genSuccessResult(mapPage);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/remark", method = RequestMethod.GET)
|
||||
public ModelAndView remark(@RequestParam(value = "merchantCode") String merchantCode, Integer channel, ModelAndView view) {
|
||||
view.setViewName("subMerchantApplyOrder/remark");
|
||||
view.addObject("channel", channel);
|
||||
view.addObject("merchantCode", merchantCode);
|
||||
return view;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/disable", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<SubMerchantApplyOrder> disable(String merchantCode, String resultStatus, String channel) {
|
||||
QueryWrapper<SubMerchantApplyOrder> queryWrapper = new QueryWrapper<SubMerchantApplyOrder>()
|
||||
.eq("merchantCode", merchantCode)
|
||||
.eq("channelId", channel);
|
||||
SubMerchantApplyOrder subMerchantApplyOrder = new SubMerchantApplyOrder();
|
||||
subMerchantApplyOrder.setResultStatus(resultStatus);
|
||||
subMerchantApplyOrder.setStatus("2");
|
||||
subMerchantApplyOrderService.update(subMerchantApplyOrder, queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("修改成功", subMerchantApplyOrder);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/complete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> complete(String merchantCode, String channel) {
|
||||
LambdaUpdateWrapper<SubMerchantApplyOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(SubMerchantApplyOrder::getMerchantCode, merchantCode)
|
||||
.eq(SubMerchantApplyOrder::getChannelId, channel)
|
||||
.and(wrapper -> {
|
||||
wrapper.ne(SubMerchantApplyOrder::getStatus, "1")
|
||||
.or()
|
||||
.isNull(SubMerchantApplyOrder::getStatus);
|
||||
})
|
||||
.set(SubMerchantApplyOrder::getResultStatus, SubMerchantApplyOrder.RES_STATUS_COMPLETE)
|
||||
.set(SubMerchantApplyOrder::getStatus, SubMerchantApplyOrder.RES_STATUS_COMPLETE);
|
||||
|
||||
boolean updateCount = baseService.update(updateWrapper);
|
||||
if (!updateCount) {
|
||||
SubMerchantApplyOrder subMerchApplyOrder = new SubMerchantApplyOrder();
|
||||
subMerchApplyOrder.setMerchantCode(merchantCode);
|
||||
subMerchApplyOrder.setChannelId(Integer.parseInt(channel));
|
||||
subMerchApplyOrder.setStatus(SubMerchantApplyOrder.RES_STATUS_SUCCESS);
|
||||
subMerchApplyOrder.setResultStatus(SubMerchantApplyOrder.RES_STATUS_SUCCESS);
|
||||
subMerchApplyOrder.setSubMchType("WX");
|
||||
subMerchApplyOrder.setRemark("已通过手动码或其他方式认证");
|
||||
baseService.save(subMerchApplyOrder);
|
||||
}
|
||||
|
||||
return ResultGenerator.genSuccessResult("修改成功", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.pluss.platform.controller.auth;
|
||||
|
||||
import cn.pluss.platform.entity.MenuInfo;
|
||||
import cn.pluss.platform.shiro.UserService;
|
||||
import cn.pluss.platform.util.JwtUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("auth")
|
||||
public class AuthController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@RequestMapping(value = "/getPermissionMenusOnceAll", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<MenuInfo> getPermissionMenusOnceAll() {
|
||||
String token = request.getHeader("token");
|
||||
Object loginName = JwtUtils.get("loginName", token);
|
||||
List<MenuInfo> menus = userService.getPermissionNames(loginName.toString());
|
||||
return menus;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/menuId", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Integer menuId(){
|
||||
String link="/notification/index";
|
||||
int notificationMenuId = userService.getNotificationMenuId(link);
|
||||
return notificationMenuId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package cn.pluss.platform.controller.banner;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.banner.BannerService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.Banner;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("banner")
|
||||
public class BannerController extends BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
private BannerService bannerService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "banner/bannerList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<Banner>> queryHelpVideoByPage(Page<Banner> page) {
|
||||
QueryWrapper<Banner> bannerQueryWrapper = new QueryWrapper<Banner>().orderByDesc("seq");
|
||||
page = bannerService.page(page, bannerQueryWrapper);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(page));
|
||||
}
|
||||
|
||||
@GetMapping("/add")
|
||||
public ModelAndView add() {
|
||||
ModelAndView view = new ModelAndView("banner/bannerBaseInfo");
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam", uploadParam);
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody Banner banner) {
|
||||
if (banner.getId() == null) {
|
||||
bannerService.save(banner);
|
||||
} else {
|
||||
bannerService.updateById(banner);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@RequestMapping("/edit/{id}")
|
||||
public ModelAndView edit(@PathVariable Integer id) {
|
||||
ModelAndView view = new ModelAndView("banner/bannerBaseInfo");
|
||||
Banner banner = bannerService.getById(id);
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("banner", banner);
|
||||
view.addObject("uploadParam", uploadParam);
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping("/statusUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> statusUpdate(@RequestBody Banner banner) {
|
||||
UpdateWrapper<Banner> bannerUpdateWrapper = new UpdateWrapper<Banner>().eq("id", banner.getId());
|
||||
if (StringUtil.isEmpty(banner.getStatus()) || banner.getStatus().equals("1")) {
|
||||
banner.setStatus("0");
|
||||
bannerService.update(banner, bannerUpdateWrapper);
|
||||
} else {
|
||||
banner.setStatus("1");
|
||||
bannerService.update(banner, bannerUpdateWrapper);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("操作成功!");
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
@ResponseBody
|
||||
public Result<String> delete(@RequestBody Banner banner) {
|
||||
bannerService.removeById(banner.getId());
|
||||
if (StringUtil.isNotEmpty(banner.getPicUrl())) {
|
||||
OssOperatUtil.deleteFile(banner.getPicUrl());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("操作成功!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package cn.pluss.platform.controller.bestNewActivity;
|
||||
|
||||
import cn.pluss.platform.PushService;
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.bestNewActivity.BestNewActivityService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.BestNewActivity;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("bestNewActivity")
|
||||
public class BestNewActivityController extends BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
private BestNewActivityService bestNewActivityService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private PushService pushService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "bestNewActivity/bestNewActivityList";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<BestNewActivity>> page(Page<BestNewActivity> page, BestNewActivity bestNewActivity) {
|
||||
QueryWrapper<BestNewActivity> bestNewActivityQueryWrapper = new QueryWrapper<BestNewActivity>().orderByAsc("seq");
|
||||
if (StringUtil.isNotEmpty(bestNewActivity.getTitle())) {
|
||||
bestNewActivityQueryWrapper.eq("title", bestNewActivity.getTitle());
|
||||
}
|
||||
page = bestNewActivityService.page(page, bestNewActivityQueryWrapper);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(page));
|
||||
}
|
||||
|
||||
//数据回显
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
BestNewActivity bestNewActivity = bestNewActivityService.getById(id);
|
||||
request.setAttribute("entity", bestNewActivity);
|
||||
}
|
||||
return "bestNewActivity/bestNewActivityBaseInfo";
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<BestNewActivity> saveOrUpdate(@RequestBody BestNewActivity bestNewActivity) {
|
||||
|
||||
if (StringUtil.isEmpty(bestNewActivity.getId())) {
|
||||
bestNewActivity.setUpdateTime(new Date());
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
bestNewActivity.setUpdateor(shiroUser.getLoginName());
|
||||
bestNewActivityService.save(bestNewActivity);
|
||||
String pushType = bestNewActivity.getPushType();
|
||||
if(Objects.equals(pushType, "1")){
|
||||
pushService.pushAll(bestNewActivity.getTitle(), bestNewActivity.getDesc());
|
||||
}
|
||||
} else {
|
||||
UpdateWrapper<BestNewActivity> updateWrapper = new UpdateWrapper<BestNewActivity>().eq("id", bestNewActivity.getId());
|
||||
bestNewActivityService.update(bestNewActivity, updateWrapper);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功", bestNewActivity);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Result<BestNewActivity> delete(@RequestBody BestNewActivity bestNewActivity) {
|
||||
bestNewActivityService.removeById(bestNewActivity.getId());
|
||||
return ResultGenerator.genSuccessResult("删除成功!", bestNewActivity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.pluss.platform.controller.business;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.business.BusinessInfoService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.vo.BusinessInfoVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("businessInfo")
|
||||
public class BusinessInfoController {
|
||||
|
||||
|
||||
private final BusinessInfoService businessInfoService;
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/list")
|
||||
public String index() {
|
||||
return "business/list";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<BusinessInfoVo>> page(Page<BusinessInfoVo> page, BusinessInfoVo businessInfoVo) {
|
||||
Page<BusinessInfoVo> pageData = businessInfoService.pageData(page, businessInfoVo);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
/*@PostMapping("/delete")
|
||||
public Result<AgentInfo> del(@RequestBody AgentInfo agentInfo) {
|
||||
agentInfoService.delete(agentInfo);
|
||||
return ResultGenerator.genSuccessResult("删除成功", agentInfo);
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.pluss.platform.controller.cash;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.cashAccount.CashAccountService;
|
||||
import cn.pluss.platform.entity.CashAccount;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2021-07-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/cashAccount")
|
||||
public class CashAccountController extends BaseModelController<CashAccountService, CashAccount> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "cash/account/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
CashAccount cashAccount = new CashAccount().setId(id);
|
||||
cashAccount = baseService.getOne(new QueryWrapper<>(cashAccount));
|
||||
request.setAttribute("entity", cashAccount);
|
||||
}
|
||||
return "cash/account/detail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<CashAccount>> page(Page<CashAccount> page, CashAccount condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
package cn.pluss.platform.controller.cash;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.cash.CashService;
|
||||
import cn.pluss.platform.controller.BaseController;
|
||||
import cn.pluss.platform.entity.Cash;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("cash")
|
||||
public class CashController extends BaseController<CashService, Cash> {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private CashService cashService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantOrderService merchantOrderService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*/
|
||||
@GetMapping(value = "/index")
|
||||
public String index(Cash condition) {
|
||||
String type = request.getParameter("type");
|
||||
request.setAttribute("type", type);
|
||||
Result<Object> otherData = getOtherData(condition);
|
||||
request.setAttribute("otherData",otherData.getData());
|
||||
return "cash/cashList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "otherData")
|
||||
@ResponseBody
|
||||
public Result<Object> getOtherData(Cash condition){
|
||||
String nowDate = DateUtils.currentStringDate();
|
||||
String startTime = nowDate + " 00:00:00";
|
||||
String endTime = nowDate + " 23:59:59";
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("startTime", StringUtil.isNotEmpty(condition.getBeginTime()) ? condition.getBeginTime() : startTime);
|
||||
params.put("endTime", StringUtil.isNotEmpty(condition.getEndTime()) ? condition.getEndTime() : endTime);
|
||||
Map<String, Object> orderData = merchantOrderService.getOrderCountData(params);
|
||||
if (orderData == null) {
|
||||
orderData = new HashMap<>();
|
||||
}
|
||||
params.put("userId", condition.getUserId());
|
||||
if(StringUtil.isNotEmpty(condition.getUserId())){
|
||||
params.remove("startTime");
|
||||
params.remove("endTime");
|
||||
}
|
||||
Map<String, Object> cashData = cashService.getCashCountData(params);
|
||||
orderData.putAll(cashData);
|
||||
return ResultGenerator.genSuccessResult(orderData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryCashByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryCashByPage(@RequestParam(defaultValue = "1") Integer currPage
|
||||
, @RequestParam(defaultValue = "10") Integer pageSize
|
||||
, Cash cash) {
|
||||
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
map.put("pageSize", pageSize);
|
||||
map.put("offset", (currPage - 1) * pageSize);
|
||||
if (StringUtil.isNotEmpty(cash.getType())) {
|
||||
map.put("type", cash.getType());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getUserName())) {
|
||||
map.put("userName", cash.getUserName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getMerchantName())) {
|
||||
map.put("merchantName", cash.getMerchantName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getStatus())) {
|
||||
map.put("status", cash.getStatus());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getPhone())) {
|
||||
map.put("phone", cash.getPhone());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getId())) {
|
||||
map.put("id", cash.getId());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getUserId())) {
|
||||
map.put("userId", cash.getUserId());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getBeginTime())) {
|
||||
map.put("beginTime", cash.getBeginTime());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(cash.getEndTime())) {
|
||||
map.put("endTime", cash.getEndTime());
|
||||
}
|
||||
List<Cash> cashList = cashService.queryCashPage(map);
|
||||
//添加手机号
|
||||
for (Cash cash2 : cashList) {
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId(cash2.getUserId());
|
||||
userInfo = userInfoService.queryUserInfo(userInfo);
|
||||
if (userInfo != null && userInfo.getPhone() != null) {
|
||||
cash2.setPhone(userInfo.getPhone());
|
||||
}
|
||||
}
|
||||
Integer count = cashService.queryCashPageCount(map);
|
||||
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
result.put("cashList", cashList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, pageSize));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryCashDetails", method = RequestMethod.GET)
|
||||
public String queryCashDetails(HttpServletRequest request, Long id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Cash cash = new Cash();
|
||||
cash.setId(id);
|
||||
cash = cashService.queryCash(cash);
|
||||
request.setAttribute("cash", cash);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "cash/cashDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryCashBaseInfo", method = RequestMethod.GET)
|
||||
public String queryCashBaseInfo(HttpServletRequest request, Long id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Cash cash = new Cash();
|
||||
cash.setId(id);
|
||||
cash = cashService.queryCash(cash);
|
||||
request.setAttribute("cash", cash);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "cash/cashBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryCashExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryCashExtendsInfo() {
|
||||
return "cash/cashExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryCashFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryCashFunctionsInfo() {
|
||||
return "cash/cashFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*/
|
||||
@RequestMapping(value = "/saveCash", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveCash(Cash cash) {
|
||||
|
||||
cashService.saveOrUpdate(cash);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateCash", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateCash(Long id) {
|
||||
|
||||
Cash cash = new Cash();
|
||||
cash.setId(id);
|
||||
cashService.updateCash(cash);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteCash", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteCash(Long id) {
|
||||
cashService.removeById(id);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/pass/{id}")
|
||||
public String pass(HttpServletRequest request, @PathVariable("id") String id) {
|
||||
Cash entity = cashService.getById(id);
|
||||
request.setAttribute("entity", entity);
|
||||
return "/cash/cashPass";
|
||||
}
|
||||
|
||||
/**
|
||||
* realAuditPass:(cash提现审核通过). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping("/realAuditPass")
|
||||
@ResponseBody
|
||||
public Result<Object> realAuditPass(Cash cash) {
|
||||
cashService.passAndRemit(cash);
|
||||
return ResultGenerator.genSuccessResult("提现成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:手动通过
|
||||
* @date: 2021/9/2 19:17
|
||||
* @param cash:
|
||||
* @return cn.pluss.platform.api.Result<java.lang.Object>
|
||||
*/
|
||||
@PostMapping("/auditSuccess")
|
||||
@ResponseBody
|
||||
public Result<Object> auditSuccess(Cash cash) {
|
||||
cash.setUpdateDt(new Date());
|
||||
// cash.setUpdator(queryCurrentShiroUser().getId().toString());
|
||||
cashService.updateCash(cash);
|
||||
return ResultGenerator.genSuccessResult("操作成功",null);
|
||||
}
|
||||
|
||||
/**
|
||||
* realAuditPass:(cash提现审核通过). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping("/batchPass")
|
||||
@ResponseBody
|
||||
public Result<Object> batchPass(@RequestParam(value = "ids[]", required = false) String[] ids) {
|
||||
cashService.batchPassAndRemit(Arrays.asList(ids));
|
||||
return ResultGenerator.genSuccessResult("操作成功",null);
|
||||
}
|
||||
|
||||
/**
|
||||
* realauditRefuse:(cash提现审核拒绝). <br/>
|
||||
*
|
||||
* @param cash
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@PostMapping("/realauditRefuse")
|
||||
@ResponseBody
|
||||
public Map<String, Object> realauditRefuse(Cash cash) {
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
cash.setStatus(2);
|
||||
// cash.setUpdator(queryCurrentShiroUser().getId() + "");
|
||||
cash.setUpdateDt(new Date());
|
||||
cashService.updateCash(cash);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.pluss.platform.controller.common;
|
||||
|
||||
import cn.jiguang.common.utils.StringUtils;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.operationRecord.OperationRecordService;
|
||||
import cn.pluss.platform.vo.OperationRecordVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("operationRecord")
|
||||
public class OperationRecordController {
|
||||
|
||||
@Autowired
|
||||
private OperationRecordService opRecordService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "/operationRecord/index";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Object> page(Page<OperationRecordVO> page, OrderItem orderItem, OperationRecordVO condition) {
|
||||
page.getOrders().clear();
|
||||
if (StringUtils.isNotEmpty(orderItem.getColumn())) {
|
||||
switch (orderItem.getColumn()) {
|
||||
case "userName":
|
||||
orderItem.setColumn("ua.userName");
|
||||
break;
|
||||
case "count":
|
||||
orderItem.setColumn("t.count");
|
||||
break;
|
||||
default:
|
||||
orderItem.setColumn("opr." + orderItem.getColumn());
|
||||
break;
|
||||
}
|
||||
}
|
||||
page.getOrders().add(orderItem);
|
||||
|
||||
Page<OperationRecordVO> data = opRecordService.pageVO(page, condition);
|
||||
return ResultGenerator.genSuccessResult(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package cn.pluss.platform.controller.common;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.common.RiskBlacklistService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.dto.RiskBlacklistDTO;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.vo.RiskBlacklistVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 风控黑名单表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2021-09-07
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/riskBlacklist")
|
||||
public class RiskBlacklistController extends BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
private RiskBlacklistService riskBlacklistService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "/riskBlacklist/list";
|
||||
}
|
||||
|
||||
@GetMapping("/simpleForm")
|
||||
public String blacklistForm(HttpServletRequest request, String userId) {
|
||||
request.setAttribute("userId", userId);
|
||||
return "/riskBlacklist/simple_form";
|
||||
}
|
||||
|
||||
@GetMapping("/batchForm")
|
||||
public String blacklistBatchForm(HttpServletRequest request, String[] userId) {
|
||||
request.setAttribute("userIds", userId);
|
||||
return "/riskBlacklist/batch_form";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Object> pageVO(Page<RiskBlacklistVO> page, @RequestParam Map<String, Object> map) {
|
||||
page.getOrders().clear();
|
||||
page.getOrders().add(OrderItem.desc("rb.createTime"));
|
||||
page = riskBlacklistService.page(page, map);
|
||||
return ResultGenerator.genSuccessResult("查询成功", page);
|
||||
}
|
||||
|
||||
@PostMapping("/toBlackList")
|
||||
@ResponseBody
|
||||
public Result<Object> toBlackList(@RequestBody RiskBlacklistDTO riskBlacklistDTO) {
|
||||
riskBlacklistService.addData(riskBlacklistDTO);
|
||||
return ResultGenerator.genSuccessResult("操作成功, 关闭" + riskBlacklistDTO.getCount() + "个商户", null);
|
||||
}
|
||||
|
||||
@PostMapping("/batchToBlackList")
|
||||
@ResponseBody
|
||||
public Result<Object> batchToBlackList(@RequestBody RiskBlacklistDTO riskBlacklistDTO) {
|
||||
riskBlacklistService.batchAddData(riskBlacklistDTO);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
@PostMapping("/relieve")
|
||||
@ResponseBody
|
||||
public Result<Object> relieve(Long userId) {
|
||||
final ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
riskBlacklistService.relieve(shiroUser.getId(), userId);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.pluss.platform.controller.device;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceBsjService;
|
||||
import cn.pluss.platform.entity.DeviceBsj;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RequestMapping("/deivceBsj")
|
||||
@Controller
|
||||
public class DeviceBsjController extends BaseModelController<DeviceBsjService, DeviceBsj> {
|
||||
|
||||
@Autowired
|
||||
private DeviceBsjService bsjService;
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceBsj>> page(Page<DeviceBsj> page, DeviceBsj condition, OrderItem orderItem) {
|
||||
orderItem = OrderItem.desc("simExpireTime");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据展示页面
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "device/deviceBsj/list";
|
||||
}
|
||||
|
||||
@PostMapping("/importExpiredTime")
|
||||
@ResponseBody
|
||||
public Result<?> importExpiredTime(@RequestBody MultipartFile file) {
|
||||
try {
|
||||
bsjService.importExpiredTime(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult("操作异常,请稍后重试");
|
||||
}
|
||||
|
||||
return ResultGenerator.genSuccessResult("数据导入成功", null);
|
||||
}
|
||||
|
||||
@PostMapping("/sendExpiredTime")
|
||||
@ResponseBody
|
||||
public Result<?> sendExpiredTime() {
|
||||
bsjService.sendBatchExpiredNotice();
|
||||
return ResultGenerator.genSuccessResult("流量卡到期通知已发送", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package cn.pluss.platform.controller.device;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.device.DeviceService;
|
||||
import cn.pluss.platform.entity.Device;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("device")
|
||||
public class DeviceController extends BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "device/deviceList";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<Device>> page(Page<Device> page, Device device) {
|
||||
Page<Device> pageDate = deviceService.pageDate(page, device);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageDate));
|
||||
}
|
||||
|
||||
//数据回显
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
@ResponseBody
|
||||
public ModelAndView detail(@PathVariable(value = "id", required = false) Integer id) {
|
||||
ModelAndView view = new ModelAndView("device/deviceBaseInfo");
|
||||
if (id != null) {
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam", uploadParam);
|
||||
Device deviceServiceById = deviceService.getDeviceId(id);
|
||||
System.out.println("deviceServiceById=" + deviceServiceById);
|
||||
view.addObject("entity", deviceServiceById);
|
||||
} else {
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam", uploadParam);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
//设备详情
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/particulars/{id}")
|
||||
@ResponseBody
|
||||
public ModelAndView particulars(@PathVariable(value = "id", required = false) Integer id) {
|
||||
ModelAndView view = new ModelAndView("device/particulars");
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam", uploadParam);
|
||||
Device deviceServiceById = deviceService.getDeviceId(id);
|
||||
System.out.println("deviceServiceById=" + deviceServiceById);
|
||||
view.addObject("entity", deviceServiceById);
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody Device device) {
|
||||
if (device.getId() == null) {
|
||||
device.setCreateDt(new Date());
|
||||
deviceService.save(device);
|
||||
} else {
|
||||
deviceService.updateById(device);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Result<Device> delete(@RequestBody Device device) {
|
||||
deviceService.removeById(device.getId());
|
||||
if (StringUtil.isNotEmpty(device.getDeviceLogo())) {
|
||||
OssOperatUtil.deleteFile(device.getDeviceLogo());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("删除成功", device);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.pluss.platform.controller.device;
|
||||
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceGoodTagService;
|
||||
import cn.pluss.platform.entity.DeviceGoodTag;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/deviceGoodTag")
|
||||
public class DeviceGoodTagController extends BaseModelController<DeviceGoodTagService, DeviceGoodTag> {
|
||||
|
||||
@GetMapping("index")
|
||||
public String index() {
|
||||
return "device/tag/list";
|
||||
}
|
||||
|
||||
@GetMapping({"detail/{id}", "detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
DeviceGoodTag entity = baseService.getById(id);
|
||||
request.setAttribute("entity", entity);
|
||||
return "device/tag/detail";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.pluss.platform.controller.device;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceSpecService;
|
||||
import cn.pluss.platform.device.DeviceTransferService;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.entity.DeviceSpec;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import cn.pluss.platform.entity.UserLevel;
|
||||
import cn.pluss.platform.entity.UserRole;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author crystal
|
||||
* @date 2022/4/15 10:58
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("deviceSpec")
|
||||
public class DeviceSpecController extends BaseModelController<DeviceSpecService, DeviceSpec> {
|
||||
|
||||
@Resource
|
||||
private DeviceTypeService deviceTypeService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "device/spec/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
List<DeviceType> typeList = deviceTypeService.list();
|
||||
if (id != null) {
|
||||
DeviceSpec entity = baseService.getById(id);
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
request.setAttribute("codeList", typeList);
|
||||
return "device/spec/detail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceSpec>> page(Page<DeviceSpec> page, DeviceSpec condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id").setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.pluss.platform.controller.device;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@RequestMapping("/deviceType")
|
||||
@Controller
|
||||
public class DeviceTypeController extends BaseModelController<DeviceTypeService, DeviceType> {
|
||||
|
||||
@GetMapping("/index")
|
||||
public String list() {
|
||||
return "device/type/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceType>> page(Page<DeviceType> page, DeviceType condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id").setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
DeviceType entity = baseService.getById(id);
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "device/type/detail";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package cn.pluss.platform.controller.device.order;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.device.MercDeviceRefundImageService;
|
||||
import cn.pluss.platform.device.MercOrderDetailService;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import cn.pluss.platform.entity.MercOrderDetail;
|
||||
import cn.pluss.platform.entity.PhoneConfig;
|
||||
import cn.pluss.platform.entity.PhoneValidateCode;
|
||||
import cn.pluss.platform.mapper.DeviceTypeMapper;
|
||||
import cn.pluss.platform.mapper.PhoneConfigMapper;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@RequestMapping("/mercOrderDetail")
|
||||
@Controller
|
||||
public class MercOrderDetailController extends BaseModelController<MercOrderDetailService, MercOrderDetail> {
|
||||
|
||||
@Resource
|
||||
private PhoneConfigMapper phoneConfigMapper;
|
||||
|
||||
@Resource
|
||||
private MercDeviceRefundImageService mercDeviceRefundImageService;
|
||||
|
||||
@Resource
|
||||
private DeviceTypeMapper deviceTypeMapper;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String list(HttpServletRequest request) {
|
||||
List<String> codeList = deviceTypeMapper.selectListCodeByShowFlag();
|
||||
List<PhoneConfig> phoneList = phoneConfigMapper.selectList(Wrappers.emptyWrapper());
|
||||
request.setAttribute("phoneList", phoneList);
|
||||
request.setAttribute("codeArr", StringUtil.join(codeList,","));
|
||||
return "device/order/detailList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("pageInfo")
|
||||
@ResponseBody
|
||||
public Result<Page<MercOrderDetail>> pageInfo(Page<MercOrderDetail> page, MercOrderDetail condition) {
|
||||
page = baseService.pageInfo(page,condition);
|
||||
List<MercOrderDetail> records = page.getRecords();
|
||||
if(!records.isEmpty()){
|
||||
for (MercOrderDetail detail:records) {
|
||||
List<String> picList = mercDeviceRefundImageService.selectListByDetailId(detail.getId());
|
||||
detail.setPicList(picList);
|
||||
}
|
||||
}
|
||||
return ResultGenerator.genSuccessResult(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核退款
|
||||
* @param orderDetail
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/auditRefund")
|
||||
@ResponseBody
|
||||
public Result<Object> refund(MercOrderDetail orderDetail) {
|
||||
return baseService.auditRefund(orderDetail);
|
||||
}
|
||||
|
||||
@GetMapping("/refundReject/{id}")
|
||||
public String refundRejectPage(@PathVariable("id") Long id, HttpServletRequest request) {
|
||||
final MercOrderDetail existData = baseService.getById(id);
|
||||
request.setAttribute("entity", existData);
|
||||
|
||||
return "device/order/reject";
|
||||
}
|
||||
|
||||
@PostMapping("/refundReject")
|
||||
@ResponseBody
|
||||
public Result<Object> refundReject(MercOrderDetail orderDetail) {
|
||||
baseService.refundReject(orderDetail);
|
||||
return ResultGenerator.genSuccessResult("已驳回退货/退款申请", null);
|
||||
}
|
||||
|
||||
@PostMapping("/refundAgree")
|
||||
@ResponseBody
|
||||
public Result<Object> refundAgree(Long id) {
|
||||
baseService.refundAgree(id);
|
||||
return ResultGenerator.genSuccessResult("已同意退款", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* @param phoneValidateCode
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getVerifyCode")
|
||||
@ResponseBody
|
||||
public Result<Object> getVerifyCode(PhoneValidateCode phoneValidateCode) {
|
||||
return baseService.getVerifyCode(phoneValidateCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送物流信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/print")
|
||||
@ResponseBody
|
||||
public Result<Object> printLogistInfo(@RequestParam("ids[]") List<Long> ids) {
|
||||
return baseService.printLogistInfo(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写快递单号
|
||||
* @param expressNo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inputExpressNo")
|
||||
@ResponseBody
|
||||
public Result<Object> inputExpressNo(Long id,String expressNo) {
|
||||
return baseService.inputExpressNo(id,expressNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.pluss.platform.controller.device.order;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.MercOrderExpressDetailService;
|
||||
import cn.pluss.platform.entity.MercOrderExpressDetail;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@RequestMapping("/mercOrderExpressDetail")
|
||||
@Controller
|
||||
public class MercOrderExpressDetailController extends BaseModelController<MercOrderExpressDetailService, MercOrderExpressDetail> {
|
||||
|
||||
@GetMapping("/index")
|
||||
public String list(HttpServletRequest request,String expressNo) {
|
||||
request.setAttribute("expressNo",expressNo);
|
||||
return "device/express/detailList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MercOrderExpressDetail>> page(Page<MercOrderExpressDetail> page, MercOrderExpressDetail condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id").setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.pluss.platform.controller.device.order;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.MercOrderNewService;
|
||||
import cn.pluss.platform.entity.MercOrderNew;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@RequestMapping("/mercOrderNew")
|
||||
@Controller
|
||||
public class MercOrderNewController extends BaseModelController<MercOrderNewService, MercOrderNew> {
|
||||
|
||||
@GetMapping("/index")
|
||||
public String list() {
|
||||
return "device/order/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MercOrderNew>> page(Page<MercOrderNew> page, MercOrderNew condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime").setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package cn.pluss.platform.controller.deviceDetail;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceSpecService;
|
||||
import cn.pluss.platform.device.DeviceStockGroupService;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.deviceDetail.DeviceDetailService;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* [设备展示表] 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-12
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceDetail")
|
||||
public class DeviceDetailController extends BaseModelController<DeviceDetailService, DeviceDetail> {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DictService dictService;
|
||||
|
||||
@Autowired
|
||||
private DeviceSpecService deviceSpecService;
|
||||
|
||||
@Autowired
|
||||
private DeviceTypeService deviceTypeService;
|
||||
|
||||
@Autowired
|
||||
private DeviceStockGroupService deviceStockGroupService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
List<Dict> deviceType = dictService.getByCode(Collections.singletonList("DEVICE_TYPE"));
|
||||
request.setAttribute("deviceTypeDict", deviceType);
|
||||
return "deviceDetail/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceDetail>> page(Page<DeviceDetail> page, DeviceDetail condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(true).setColumn("seq");
|
||||
condition.setSize(null);
|
||||
Result<Page<DeviceDetail>> pageData = super.page(page, condition, orderItem);
|
||||
|
||||
List<DeviceStockGroup> deviceStockGroupList = deviceStockGroupService.list();
|
||||
List<DeviceType> deviceTypeList = deviceTypeService.list();
|
||||
List<DeviceSpec> deviceSpecList = deviceSpecService.list();
|
||||
|
||||
for (DeviceDetail item : pageData.getData().getRecords()) {
|
||||
for (DeviceStockGroup deviceStockGroup : deviceStockGroupList) {
|
||||
if (deviceStockGroup.getGroupCode().equals(item.getGroupNo())) {
|
||||
item.setGroupNoDesc(deviceStockGroup.getGroupName());
|
||||
}
|
||||
}
|
||||
|
||||
for (DeviceType deviceType : deviceTypeList) {
|
||||
if (deviceType.getCode().equals(item.getCode())) {
|
||||
item.setCodeDesc(deviceType.getName());
|
||||
}
|
||||
}
|
||||
|
||||
for (DeviceSpec deviceSpec : deviceSpecList) {
|
||||
if (deviceSpec.getCode().equals(item.getCode()) && deviceSpec.getSpec().equals(item.getType())) {
|
||||
item.setTypeDesc(deviceSpec.getSpecName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pageData;
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
List<DeviceType> deviceTypeDict = deviceTypeService.list();
|
||||
request.setAttribute("deviceTypeDict",deviceTypeDict);
|
||||
List<DeviceStockGroup> deviceGroupDict = deviceStockGroupService.list();
|
||||
request.setAttribute("deviceGroupDict",deviceGroupDict);
|
||||
if (id != null) {
|
||||
DeviceDetail deviceDetail = this.baseService.getById(id);
|
||||
request.setAttribute("entity",deviceDetail);
|
||||
List<DeviceSpec> subDeviceType = deviceSpecService.listByCode(deviceDetail.getCode());
|
||||
request.setAttribute("subDeviceType",subDeviceType);
|
||||
}
|
||||
|
||||
return "deviceDetail/detail";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDeviceSubVersionType/{dataType}")
|
||||
@ResponseBody
|
||||
public Result<Object> detail(@PathVariable(value = "dataType") String dataType) {
|
||||
List<DeviceSpec> deviceSpecs = deviceSpecService.listByCode(dataType);
|
||||
return ResultGenerator.genSuccessResult("获取成功",deviceSpecs);
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceType/{dataType}")
|
||||
@ResponseBody
|
||||
public Result<Object> getDeviceType(@PathVariable(value = "dataType") String dataType) {
|
||||
return ResultGenerator.genSuccessResult("获取成功",null);
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody DeviceDetail deviceDetail) {
|
||||
if (deviceDetail.getWholesalePrice() == null) {
|
||||
deviceDetail.setWholesalePrice(deviceDetail.getUnitPrice());
|
||||
deviceDetail.setWholesaleMinNum(1);
|
||||
}
|
||||
|
||||
baseService.saveOrUpdate(deviceDetail);
|
||||
|
||||
return ResultGenerator.genSuccessResult("保存成功",null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package cn.pluss.platform.controller.deviceGoods;
|
||||
|
||||
|
||||
import cn.pluss.platform.DeviceGoodsService;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceGoodTagService;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.entity.DeviceGoodTag;
|
||||
import cn.pluss.platform.entity.DeviceGoods;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备商品展示表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-11-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceGoods")
|
||||
public class DeviceGoodsController extends BaseModelController<DeviceGoodsService, DeviceGoods> {
|
||||
|
||||
@Autowired
|
||||
private DeviceTypeService deviceTypeService;
|
||||
|
||||
@Autowired
|
||||
private DeviceGoodTagService deviceGoodTagService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public ModelAndView index() {
|
||||
ModelAndView view = new ModelAndView("deviceGoods/list");
|
||||
List<DeviceType> deviceTypeList = deviceTypeService.list();
|
||||
|
||||
view.addObject("deviceTypeDict", deviceTypeList);
|
||||
view.addObject("deviceTypeJsonDict", JSONObject.toJSONString(deviceTypeList));
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceGoods>> page(Page<DeviceGoods> page, DeviceGoods condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false).setColumn("createTime");
|
||||
Result<Page<DeviceGoods>> data = super.page(page, condition, orderItem);
|
||||
|
||||
List<DeviceGoodTag> tagList = deviceGoodTagService.list();
|
||||
|
||||
for (DeviceGoods item : data.getData().getRecords()) {
|
||||
for (DeviceGoodTag deviceGoodTag : tagList) {
|
||||
if (Objects.equals(item.getTagId(), deviceGoodTag.getId())) {
|
||||
item.setTag(deviceGoodTag.getTag());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据回显
|
||||
*/
|
||||
@GetMapping({"/detail/{id}", "/detail"})
|
||||
public String detail(Model model, @PathVariable(value = "id", required = false) Integer id) {
|
||||
List<DeviceType> deviceTypeList = deviceTypeService.list();
|
||||
model.addAttribute("deviceTypeDict", deviceTypeList);
|
||||
|
||||
List<DeviceGoodTag> list = deviceGoodTagService.list();
|
||||
model.addAttribute("deviceGoodTagList", list);
|
||||
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
model.addAttribute("uploadParam",uploadParam);
|
||||
if (id != null) {
|
||||
DeviceGoods deviceGoods = baseService.getById(id);
|
||||
for (DeviceType deviceType : deviceTypeList) {
|
||||
if (deviceGoods.getCode().equals(deviceType.getCode())) {
|
||||
deviceGoods.setCodeName(deviceType.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
model.addAttribute("entity",deviceGoods);
|
||||
}
|
||||
return "deviceGoods/detail";
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 数据回显
|
||||
// */
|
||||
// @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
// @ResponseBody
|
||||
// public ModelAndView detail(@PathVariable(value = "id", required = false) Integer id) {
|
||||
// ModelAndView view = new ModelAndView("deviceGoods/detail");
|
||||
// List<Dict> deviceType = dictService.getByCode(Collections.singletonList("DEVICE_TYPE"));
|
||||
// view.addObject("deviceTypeDict", deviceType);
|
||||
// if (id != null) {
|
||||
// Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
// view.addObject("uploadParam",uploadParam);
|
||||
// DeviceGoods deviceGoods = baseService.getById(id);
|
||||
//
|
||||
// for (Dict dict : deviceType) {
|
||||
// if (deviceGoods.getCode().equals(dict.getValue())) {
|
||||
// deviceGoods.setCodeName(dict.getName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// view.addObject("entity",deviceGoods);
|
||||
// }else {
|
||||
// Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
// view.addObject("uploadParam",uploadParam);
|
||||
// }
|
||||
// return view;
|
||||
// }
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody DeviceGoods deviceGoods) {
|
||||
baseService.saveOrUpdate(deviceGoods);
|
||||
return ResultGenerator.genSuccessResult("保存成功",null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
package cn.pluss.platform.controller.deviceMerchantBuy;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.deviceMerchantBuy.DeviceMerchantBuyService;
|
||||
import cn.pluss.platform.deviceStock.DeviceStockService;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.DeviceMerchantBuy;
|
||||
import cn.pluss.platform.entity.DeviceStock;
|
||||
import cn.pluss.platform.entity.Dict;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.yt.YtLogistHandler;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("deviceMerchantBuy")
|
||||
public class DeviceMerchantBuyController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DeviceMerchantBuyService deviceMerchantBuyService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DeviceStockService deviceStockService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private DictService dictService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private YtLogistHandler ytLogistHandler;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public ModelAndView index(ModelAndView view) {
|
||||
List<Dict> deviceGroupDict = dictService.getByCode(Collections.singletonList("DEVICE_STOCK_GROUP"));
|
||||
view.addObject("deviceGroupDict", deviceGroupDict);
|
||||
view.setViewName("deviceMerchantBuy/deviceMerchantBuyList");
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyByPage", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Result<Page<DeviceMerchantBuy>> queryDeviceMerchantBuyByPage(Page<DeviceMerchantBuy> page, DeviceMerchantBuy deviceMerchantBuy, String startTime, String endTime) {
|
||||
QueryWrapper<DeviceMerchantBuy> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotBlank(deviceMerchantBuy.getOrderNo()),"dmb.orderNo", deviceMerchantBuy.getOrderNo());
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank(deviceMerchantBuy.getMerchantName()), "merchantCode", deviceMerchantBuy.getMerchantName());
|
||||
|
||||
queryWrapper.like(StringUtils.isNotBlank(deviceMerchantBuy.getAlias()),"mbi.alias", deviceMerchantBuy.getAlias());
|
||||
|
||||
queryWrapper.like(StringUtils.isNotBlank(deviceMerchantBuy.getTransNo()),"dmb.transNo", deviceMerchantBuy.getTransNo());
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank(deviceMerchantBuy.getStatus()),"dmb.status", deviceMerchantBuy.getStatus());
|
||||
|
||||
queryWrapper.gt(deviceMerchantBuy.getStartTime() != null, "dmb.createDt", deviceMerchantBuy.getStartTime());
|
||||
|
||||
queryWrapper.lt(deviceMerchantBuy.getEndTime() != null, "dmb.createDt", deviceMerchantBuy.getEndTime());
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank(deviceMerchantBuy.getUserId()), "doi.userId", deviceMerchantBuy.getUserId());
|
||||
|
||||
queryWrapper.like(StringUtils.isNotBlank(deviceMerchantBuy.getName()),"dg.name",deviceMerchantBuy.getName());
|
||||
|
||||
queryWrapper.like(StringUtils.isNotBlank(deviceMerchantBuy.getLinkName()),"dmb.linkName",deviceMerchantBuy.getLinkName());
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank(deviceMerchantBuy.getLinkPhone()),"dmb.linkPhone",deviceMerchantBuy.getLinkPhone());
|
||||
|
||||
queryWrapper.eq(deviceMerchantBuy.getOrderAmount() != null,"dmb.orderAmount",deviceMerchantBuy.getOrderAmount());
|
||||
|
||||
queryWrapper.orderByDesc("id");
|
||||
|
||||
Boolean admin = verifyUserRole();
|
||||
if (!admin) {
|
||||
ShiroUser queryCurrentShiroUser = queryCurrentShiroUser();
|
||||
queryWrapper.eq("status", "1");
|
||||
queryWrapper.eq("merchantCode", queryCurrentShiroUser.getMerchantCode());
|
||||
}
|
||||
|
||||
Page<DeviceMerchantBuy> result = deviceMerchantBuyService.pageDeviceMerchantBuy(page, queryWrapper);
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetails", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
deviceMerchantBuy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
request.setAttribute("deviceMerchantBuy", deviceMerchantBuy);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceMerchantBuy/deviceMerchantBuyDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyBaseInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
deviceMerchantBuy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
request.setAttribute("deviceMerchantBuy", deviceMerchantBuy);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceMerchantBuy/deviceMerchantBuyBaseInfo";
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ResponseBody
|
||||
public Result<Object> update(@RequestBody DeviceMerchantBuy entity) {
|
||||
deviceMerchantBuyService.updateById(entity);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyExtendsInfo() {
|
||||
|
||||
return "deviceMerchantBuy/deviceMerchantBuyExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyFunctionsInfo() {
|
||||
|
||||
return "deviceMerchantBuy/deviceMerchantBuyFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveDeviceMerchantBuy", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveDeviceMerchantBuy(DeviceMerchantBuy deviceMerchantBuy) {
|
||||
|
||||
if (deviceMerchantBuy.getId() != null && deviceMerchantBuy.getId() != 0) {
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(deviceMerchantBuy);
|
||||
} else {
|
||||
deviceMerchantBuyService.saveDeviceMerchantBuy(deviceMerchantBuy);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateDeviceMerchantBuy", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateDeviceMerchantBuy(Integer id) {
|
||||
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(deviceMerchantBuy);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteDeviceMerchantBuy", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteDeviceMerchantBuy(Integer id) {
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
deviceMerchantBuyService.deleteDeviceMerchantBuy(deviceMerchantBuy);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* expressNo:(填写快递单号). <br/>
|
||||
*
|
||||
* @param deviceMerchantBuy
|
||||
* @return
|
||||
*
|
||||
* @author Administrator
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
@RequestMapping(value = "/expressNo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> expressNo(DeviceMerchantBuy deviceMerchantBuy) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
try {
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(deviceMerchantBuy);
|
||||
result.put("msg", "操作成功");
|
||||
} catch (Exception e) {
|
||||
result.put("msg", "操作失败");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/printYtOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<?> printYtOrder(String ids) {
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
return ResultGenerator.genFailResult("缺失参数");
|
||||
}
|
||||
if(ids.indexOf(",") < 0){
|
||||
DeviceMerchantBuy merchantBy = deviceMerchantBuyService.getById(ids);
|
||||
ytLogistHandler.createYtOrder(merchantBy);
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(merchantBy);
|
||||
return ResultGenerator.genSuccessResult("操作成功!",null);
|
||||
}else{
|
||||
String[] idArr = ids.split(",");
|
||||
QueryWrapper<DeviceMerchantBuy> queryWrapper = new QueryWrapper<DeviceMerchantBuy>().
|
||||
last(" WHERE linkPhone IN ( SELECT linkPhone FROM tb_pluss_device_merchant_buy WHERE id IN ("+ids+") GROUP BY linkPhone HAVING COUNT( linkPhone ) < 2) AND id IN ("+ids+") and status = 1 and expressNo IS NULL");
|
||||
List<DeviceMerchantBuy> list = deviceMerchantBuyService.list(queryWrapper);
|
||||
if(list.isEmpty()){
|
||||
return ResultGenerator.genFailResult("当前选中的订单未满足条件!",null);
|
||||
}
|
||||
int sIndex = idArr.length;
|
||||
int mIndex = list.size();
|
||||
for (DeviceMerchantBuy buy:list) {
|
||||
ytLogistHandler.createYtOrder(buy);
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(buy);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("执行成功个数:"+mIndex+",选中个数:"+sIndex+",重复个数:"+(sIndex-mIndex),null);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/updateSnNo")
|
||||
@ResponseBody
|
||||
public Result updateQrNo(Integer id, String snNo, String groupNo) {
|
||||
try {
|
||||
QueryWrapper<DeviceStock> queryWrapper = new QueryWrapper<DeviceStock>().eq("groupNo",groupNo)
|
||||
.eq("snNo",snNo);
|
||||
List<DeviceStock> list = deviceStockService.list(queryWrapper);
|
||||
if(list.isEmpty()){
|
||||
return ResultGenerator.genFailResult("设备编号和设备类型不一致!",null);
|
||||
}
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
DeviceMerchantBuy buy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
if(buy == null){
|
||||
return ResultGenerator.genFailResult("订单数据不存在!",null);
|
||||
}
|
||||
DeviceStock stock = list.get(0);
|
||||
if(!"1".equals(stock.getStatus())){
|
||||
return ResultGenerator.genFailResult("设备已出售或激活,请更换!",null);
|
||||
}
|
||||
QueryWrapper<MerchantBaseInfo> baseInfoQueryWrapper = new QueryWrapper<MerchantBaseInfo>()
|
||||
.eq("merchantCode",buy.getMerchantCode());
|
||||
List<MerchantBaseInfo> baseInfo = merchantBaseInfoService.list(baseInfoQueryWrapper);
|
||||
if (baseInfo != null && !baseInfo.isEmpty()) {
|
||||
MerchantBaseInfo merchant = baseInfo.get(0);
|
||||
stock.setBuyMercId(String.valueOf(merchant.getId()));
|
||||
stock.setBuyMercName(merchant.getAlias());
|
||||
}
|
||||
buy.setSnNo(snNo);
|
||||
deviceMerchantBuyService.updateDeviceMerchantBuy(buy);
|
||||
stock.setOrderNo(buy.getOrderNo());
|
||||
stock.setStatus("2");
|
||||
|
||||
deviceStockService.updateById(stock);
|
||||
return ResultGenerator.genSuccessResult("操作成功!",null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult("操作异常!",null);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/querydeviceMerchantBuyInfo", method = RequestMethod.GET)
|
||||
public String querydeviceMerchantBuyInfo(Integer id, HttpServletRequest request) {
|
||||
DeviceMerchantBuy deviceMerchantBuy = new DeviceMerchantBuy();
|
||||
deviceMerchantBuy.setId(id);
|
||||
deviceMerchantBuy = deviceMerchantBuyService.queryDeviceMerchantBuy(deviceMerchantBuy);
|
||||
request.setAttribute("deviceMerchantBuy", deviceMerchantBuy);
|
||||
return "deviceMerchantBuy/deviceMerchantBuyBaseInfo";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.deviceMerchantBuyDetail;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.deviceMerchantBuyDetail.DeviceMerchantBuyDetailService;
|
||||
import cn.pluss.platform.entity.DeviceMerchantBuyDetail;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("deviceMerchantBuyDetail")
|
||||
public class DeviceMerchantBuyDetailController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private DeviceMerchantBuyDetailService deviceMerchantBuyDetailService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "deviceMerchantBuyDetail/deviceMerchantBuyDetailList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetailByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryDeviceMerchantBuyDetailByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<DeviceMerchantBuyDetail> deviceMerchantBuyDetailList=deviceMerchantBuyDetailService.queryDeviceMerchantBuyDetailPage(map);
|
||||
Integer count=deviceMerchantBuyDetailService.queryDeviceMerchantBuyDetailPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("deviceMerchantBuyDetailList", deviceMerchantBuyDetailList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetailDetails", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyDetailDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
DeviceMerchantBuyDetail deviceMerchantBuyDetail=new DeviceMerchantBuyDetail();
|
||||
deviceMerchantBuyDetail.setId(id);
|
||||
deviceMerchantBuyDetail=deviceMerchantBuyDetailService.queryDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
request.setAttribute("deviceMerchantBuyDetail", deviceMerchantBuyDetail);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceMerchantBuyDetail/deviceMerchantBuyDetailDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetailBaseInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyDetailBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
DeviceMerchantBuyDetail deviceMerchantBuyDetail=new DeviceMerchantBuyDetail();
|
||||
deviceMerchantBuyDetail.setId(id);
|
||||
deviceMerchantBuyDetail=deviceMerchantBuyDetailService.queryDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
request.setAttribute("deviceMerchantBuyDetail", deviceMerchantBuyDetail);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceMerchantBuyDetail/deviceMerchantBuyDetailBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetailExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyDetailExtendsInfo(){
|
||||
|
||||
return "deviceMerchantBuyDetail/deviceMerchantBuyDetailExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceMerchantBuyDetailFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceMerchantBuyDetailFunctionsInfo(){
|
||||
|
||||
return "deviceMerchantBuyDetail/deviceMerchantBuyDetailFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveDeviceMerchantBuyDetail", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveDeviceMerchantBuyDetail(DeviceMerchantBuyDetail deviceMerchantBuyDetail){
|
||||
|
||||
if(deviceMerchantBuyDetail.getId()!=null&&deviceMerchantBuyDetail.getId()!=0){
|
||||
deviceMerchantBuyDetailService.updateDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
}else{
|
||||
deviceMerchantBuyDetailService.saveDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateDeviceMerchantBuyDetail", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateDeviceMerchantBuyDetail(Integer id){
|
||||
|
||||
DeviceMerchantBuyDetail deviceMerchantBuyDetail=new DeviceMerchantBuyDetail();
|
||||
deviceMerchantBuyDetail.setId(id);
|
||||
deviceMerchantBuyDetailService.updateDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteDeviceMerchantBuyDetail", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteDeviceMerchantBuyDetail(Integer id){
|
||||
DeviceMerchantBuyDetail deviceMerchantBuyDetail=new DeviceMerchantBuyDetail();
|
||||
deviceMerchantBuyDetail.setId(id);
|
||||
deviceMerchantBuyDetailService.deleteDeviceMerchantBuyDetail(deviceMerchantBuyDetail);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.pluss.platform.controller.deviceOperateInfo;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceOperateInfoService;
|
||||
import cn.pluss.platform.entity.DeviceOperateInfo;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.vo.DeviceOperateInfoVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备库存controller
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceOperateInfo")
|
||||
public class DeviceOperateInfoController extends BaseModelController<DeviceOperateInfoService, DeviceOperateInfo> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request,String deviceNo) {
|
||||
if(StringUtil.isNotEmpty(deviceNo)){
|
||||
request.setAttribute("deviceNo",deviceNo);
|
||||
}
|
||||
return "deviceOperateInfo/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("pageData")
|
||||
@ResponseBody
|
||||
public Result<Page<DeviceOperateInfoVO>> page(Page<DeviceOperateInfoVO> page, DeviceOperateInfo condition) {
|
||||
page = baseService.pageInfo(page,condition);
|
||||
return ResultGenerator.genSuccessResult("获取成功",page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package cn.pluss.platform.controller.deviceSignUnbind;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import cn.pluss.platform.entity.DeviceSignUnbind;
|
||||
import cn.pluss.platform.deviceSignUnbind.DeviceSignUnbindService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("deviceSignUnbind")
|
||||
public class DeviceSignUnbindController extends BaseModelController<DeviceSignUnbindService, DeviceSignUnbind> {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private DeviceSignUnbindService deviceSignUnbindService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "deviceSignUnbind/deviceSignUnbindList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceSignUnbindByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryDeviceSignUnbindByPage(Integer currPage, String startTime, String endTime, DeviceSignUnbind deviceSignUnbind) {
|
||||
if (currPage == null) {
|
||||
currPage = 1;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("orderNo", deviceSignUnbind.getOrderNo());
|
||||
map.put("merchantName", deviceSignUnbind.getMerchantName());
|
||||
map.put("status", deviceSignUnbind.getStatus());
|
||||
map.put("startTime", startTime);
|
||||
map.put("endTime", endTime);
|
||||
map.put("userId", deviceSignUnbind.getUserId());
|
||||
List<DeviceSignUnbind> deviceSignUnbindList = deviceSignUnbindService.queryDeviceSignUnbindPage(map);
|
||||
Integer count = deviceSignUnbindService.queryDeviceSignUnbindPageCount(map);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
result.put("deviceSignUnbindList", deviceSignUnbindList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceSignUnbindDetails", method = RequestMethod.GET)
|
||||
public String queryDeviceSignUnbindDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
DeviceSignUnbind deviceSignUnbind = new DeviceSignUnbind();
|
||||
deviceSignUnbind.setId(id);
|
||||
deviceSignUnbind = deviceSignUnbindService.queryDeviceSignUnbind(deviceSignUnbind);
|
||||
request.setAttribute("deviceSignUnbind", deviceSignUnbind);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceSignUnbind/deviceSignUnbindDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceSignUnbindBaseInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceSignUnbindBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
DeviceSignUnbind deviceSignUnbind = new DeviceSignUnbind();
|
||||
deviceSignUnbind.setId(id);
|
||||
deviceSignUnbind = deviceSignUnbindService.queryDeviceSignUnbind(deviceSignUnbind);
|
||||
request.setAttribute("deviceSignUnbind", deviceSignUnbind);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "deviceSignUnbind/deviceSignUnbindBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceSignUnbindExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceSignUnbindExtendsInfo() {
|
||||
return "deviceSignUnbind/deviceSignUnbindExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryDeviceSignUnbindFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryDeviceSignUnbindFunctionsInfo() {
|
||||
return "deviceSignUnbind/deviceSignUnbindFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/saveDeviceSignUnbind", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveDeviceSignUnbind(DeviceSignUnbind deviceSignUnbind) {
|
||||
|
||||
if (deviceSignUnbind.getId() != null && deviceSignUnbind.getId() != 0) {
|
||||
deviceSignUnbindService.updateById(deviceSignUnbind);
|
||||
} else {
|
||||
deviceSignUnbindService.save(deviceSignUnbind);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/deleteDeviceSignUnbind", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteDeviceSignUnbind(Integer id) {
|
||||
deviceSignUnbindService.removeById(id);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateStatus(DeviceSignUnbind deviceSignUnbind) {
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
try {
|
||||
deviceSignUnbindService.updateById(deviceSignUnbind);
|
||||
result.put("msg", "操作成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.put("msg", "操作失败!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
package cn.pluss.platform.controller.deviceStock;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.converter.Converter;
|
||||
import cn.pluss.platform.device.DeviceSpecService;
|
||||
import cn.pluss.platform.device.DeviceStockGroupService;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.deviceDetail.DeviceDetailService;
|
||||
import cn.pluss.platform.deviceStock.DeviceStockService;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.dto.DeviceStockDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.vo.DeviceStockVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备库存controller
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceStock")
|
||||
public class DeviceStockController extends BaseModelController<DeviceStockService, DeviceStock> {
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
|
||||
@Autowired
|
||||
private DeviceDetailService deviceDetailService;
|
||||
|
||||
@Autowired
|
||||
private DeviceStockService dsService;
|
||||
|
||||
@Autowired
|
||||
private UserAppService uaService;
|
||||
|
||||
@Autowired
|
||||
private DeviceTypeService deviceTypeService;
|
||||
|
||||
@Autowired
|
||||
private DeviceStockGroupService deviceStockGroupService;
|
||||
|
||||
@Autowired
|
||||
private DeviceSpecService deviceSpecService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
List<DeviceType> deviceType = deviceTypeService.list();
|
||||
request.setAttribute("deviceTypeDict", deviceType);
|
||||
return "deviceStock/list";
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody DeviceStockDTO deviceStock) {
|
||||
if (deviceStock.getId() != null) {
|
||||
baseService.updateById(Converter.INSTANCE.toEntity(deviceStock));
|
||||
return ResultGenerator.genSuccessResult("保存成功", null);
|
||||
}
|
||||
|
||||
try {
|
||||
if (StringUtils.isEmpty(deviceStock.getSnNo())) {
|
||||
throw new MsgException("设备编号不能为空");
|
||||
}
|
||||
|
||||
QueryWrapper<DeviceDetail> queryWrapper = new QueryWrapper<DeviceDetail>()
|
||||
.eq("groupNo", deviceStock.getGroupNo());
|
||||
List<DeviceDetail> list = deviceDetailService.list(queryWrapper);
|
||||
if (list.isEmpty()) {
|
||||
return ResultGenerator.genFailResult("未查询到该类型的设备,请先添加", null);
|
||||
}
|
||||
deviceStock.setPrice(list.get(0).getUnitPrice());
|
||||
baseService.save(deviceStock);
|
||||
} catch (Exception e) {
|
||||
return ResultGenerator.genFailResult("设备编号重复!", null);
|
||||
}
|
||||
|
||||
return ResultGenerator.genSuccessResult("保存成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定厂家id
|
||||
*
|
||||
* @param deviceStock
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bindDeviceNo")
|
||||
@ResponseBody
|
||||
public Result<String> bindDeviceNo(@RequestBody DeviceStock deviceStock) {
|
||||
if (deviceStock.getId() == null) {
|
||||
throw new MsgException("id不能为空");
|
||||
}
|
||||
|
||||
DeviceStock exist = baseService.getById(deviceStock.getId());
|
||||
if (!exist.getCode().startsWith("MP") && deviceStock.getDeviceNo() == null) {
|
||||
throw new MsgException("非码牌设备,厂家编号不能为空");
|
||||
}
|
||||
|
||||
this.baseService.updateById(deviceStock);
|
||||
return ResultGenerator.genSuccessResult("保存成功", null);
|
||||
}
|
||||
|
||||
@RequestMapping("pageData")
|
||||
@ResponseBody
|
||||
public Result<Page<DeviceStockVO>> pageData(Page<DeviceStockVO> page, DeviceStockDTO dto) {
|
||||
if (Objects.equals(dto.getDeviceNo(), "")) {
|
||||
dto.setDeviceNo(null);
|
||||
}
|
||||
if(StringUtils.isEmpty(dto.getBindStatus())){
|
||||
dto.setBindStatus("-2");
|
||||
}
|
||||
if(StringUtils.isNotEmpty(dto.getNoType())){
|
||||
if("2".equals(dto.getNoType())){
|
||||
if(StringUtils.isNotEmpty(dto.getStartDeviceNo())){
|
||||
dto.setStartSnNo(dto.getStartDeviceNo());
|
||||
dto.setStartDeviceNo(null);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(dto.getEndDeviceNo())){
|
||||
dto.setEndSnNo(dto.getEndDeviceNo());
|
||||
dto.setEndDeviceNo(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Page<DeviceStockVO> result = baseService.pageInfo(page, dto);
|
||||
|
||||
List<DeviceStockVO> resultList = new ArrayList<>();
|
||||
|
||||
List<DeviceStockGroup> deviceStockGroupList = deviceStockGroupService.list();
|
||||
List<DeviceType> deviceTypeList = deviceTypeService.list();
|
||||
List<DeviceSpec> deviceSpecList = deviceSpecService.list();
|
||||
|
||||
for (DeviceStockVO item : result.getRecords()) {
|
||||
for (DeviceStockGroup deviceStockGroup : deviceStockGroupList) {
|
||||
if (deviceStockGroup.getGroupCode().equals(item.getGroupNo())) {
|
||||
item.setGroupNoDesc(deviceStockGroup.getGroupName());
|
||||
}
|
||||
}
|
||||
|
||||
for (DeviceType deviceType : deviceTypeList) {
|
||||
if (deviceType.getCode().equals(item.getCode())) {
|
||||
item.setCodeDesc(deviceType.getName());
|
||||
}
|
||||
}
|
||||
|
||||
for (DeviceSpec deviceSpec : deviceSpecList) {
|
||||
if (deviceSpec.getCode().equals(item.getCode()) && deviceSpec.getSpec().equals(item.getType())) {
|
||||
item.setTypeDesc(deviceSpec.getSpecName());
|
||||
}
|
||||
}
|
||||
resultList.add(item);
|
||||
}
|
||||
result.setRecords(resultList);
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
@PostMapping("batchSaveNo")
|
||||
@ResponseBody
|
||||
public Result<String> batchSaveNo(@RequestBody DeviceStock deviceStock) {
|
||||
if (StringUtils.isEmpty(deviceStock.getStartSnNo())) {
|
||||
return ResultGenerator.genFailResult("开始设备编号不能为空,请重新输入!");
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(deviceStock.getEndSnNo())) {
|
||||
return ResultGenerator.genFailResult("开始设备不能为空,请重新输入!");
|
||||
}
|
||||
try {
|
||||
Long startSnNo = Long.parseLong(deviceStock.getStartSnNo());
|
||||
Long endSnNo = Long.parseLong(deviceStock.getEndSnNo());
|
||||
if (endSnNo.compareTo(startSnNo) < 0) {
|
||||
return ResultGenerator.genFailResult("结束编号范围有误,请重新输入!");
|
||||
}
|
||||
QueryWrapper<DeviceDetail> queryWrapper = new QueryWrapper<DeviceDetail>()
|
||||
.eq("groupNo", deviceStock.getGroupNo());
|
||||
List<DeviceDetail> detail = deviceDetailService.list(queryWrapper);
|
||||
if (detail.isEmpty()) {
|
||||
return ResultGenerator.genFailResult("未查询到该类型的设备,请先添加", null);
|
||||
}
|
||||
deviceStock.setPrice(detail.get(0).getUnitPrice());
|
||||
List<DeviceStock> list = new ArrayList<>();
|
||||
for (long i = startSnNo; i <= endSnNo; i++) {
|
||||
DeviceStock stock = new DeviceStock();
|
||||
stock.setCreateTime(new Date());
|
||||
stock.setSnNo(String.valueOf(i));
|
||||
stock.setPrice(deviceStock.getPrice());
|
||||
stock.setStatus("1");
|
||||
stock.setCode(deviceStock.getCode());
|
||||
stock.setType(deviceStock.getType());
|
||||
stock.setGroupNo(deviceStock.getGroupNo());
|
||||
list.add(stock);
|
||||
}
|
||||
try {
|
||||
this.baseService.saveBatch(list, Integer.parseInt(String.valueOf(endSnNo - startSnNo)));
|
||||
} catch (Exception e) {
|
||||
return ResultGenerator.genFailResult("设备编号重复!", null);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("操作成功!!", null);
|
||||
} catch (Exception e) {
|
||||
throw new MsgException("包含重复的设备编号!");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("bindSave")
|
||||
@ResponseBody
|
||||
public Result<String> bindSave(@RequestBody DeviceStockDTO deviceStock) {
|
||||
MsgException.checkNull(deviceStock.getUserId(), "缺少用户id");
|
||||
UserApp ua = uaService.getOne(new QueryWrapper<UserApp>().eq("userId", deviceStock.getUserId()));
|
||||
MsgException.checkNull(ua, "不存在的用户id");
|
||||
|
||||
if (!Objects.equals("promoter", ua.getUserType())) {
|
||||
throw new MsgException("该用户id不是商户");
|
||||
}
|
||||
|
||||
DeviceStock existData = dsService.getById(deviceStock.getId());
|
||||
dsService.bindPayCode(existData.getSnNo(), ua);
|
||||
|
||||
return ResultGenerator.genSuccessResult("操作成功!!", null);
|
||||
}
|
||||
|
||||
@PostMapping("unBindSave")
|
||||
@ResponseBody
|
||||
public Result<String> unBindSave(@RequestBody DeviceStock deviceStock) {
|
||||
baseService.unbind(deviceStock.getId().longValue());
|
||||
return ResultGenerator.genSuccessResult("操作成功!!", null);
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceVersion")
|
||||
@ResponseBody
|
||||
public Result getDeviceVersion() {
|
||||
QueryWrapper<DeviceStockGroup> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("groupCode", "groupName");
|
||||
List<DeviceStockGroup> list = deviceStockGroupService.list(queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("操作成功!!", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台设备出库
|
||||
* @param ids
|
||||
* @param accpetUserId
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("transfer")
|
||||
@ResponseBody
|
||||
public Result<String> transfer(@RequestParam("ids[]") List<Long> ids,Long accpetUserId,String orderNo) {
|
||||
return baseService.manageTransfer(ids,accpetUserId,orderNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.pluss.platform.controller.deviceVoiceBox;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.deviceVoiceBox.DeviceVoiceBoxService;
|
||||
import cn.pluss.platform.entity.DeviceVoiceBox;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 智能音箱设备信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-04
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceVoiceBox")
|
||||
public class DeviceVoiceBoxController extends BaseModelController<DeviceVoiceBoxService, DeviceVoiceBox> {
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "deviceVoiceBox/list";
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody DeviceVoiceBox deviceVoiceBox) {
|
||||
if (deviceVoiceBox.getId() != null){
|
||||
if(StringUtil.isNotEmpty(deviceVoiceBox.getActMercId()) && StringUtil.isEmpty(deviceVoiceBox.getActMercName())){
|
||||
MerchantBaseInfo byId = merchantBaseInfoService.getById(deviceVoiceBox.getActMercId());
|
||||
if(byId == null){
|
||||
return ResultGenerator.genFailResult("商户ID输入有误!");
|
||||
}
|
||||
deviceVoiceBox.setActMercName(byId.getAlias());
|
||||
}
|
||||
deviceVoiceBox.setUpdateTime(new Date());
|
||||
this.baseService.updateById(deviceVoiceBox);
|
||||
}else {
|
||||
if(StringUtil.isEmpty(deviceVoiceBox.getBoxNo())){
|
||||
return ResultGenerator.genFailResult("设备编号不能为空!");
|
||||
}
|
||||
QueryWrapper<DeviceVoiceBox> queryWrapper = new QueryWrapper<DeviceVoiceBox>()
|
||||
.eq("boxNo",deviceVoiceBox.getBoxNo());
|
||||
List<DeviceVoiceBox> boxList = this.baseService.list(queryWrapper);
|
||||
if(!boxList.isEmpty()){
|
||||
return ResultGenerator.genFailResult("设备编号已存在,请重新添加!");
|
||||
}
|
||||
deviceVoiceBox.setCreateTime(new Date());
|
||||
this.baseService.save(deviceVoiceBox);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功",null);
|
||||
}
|
||||
|
||||
@PostMapping("batchSaveNo")
|
||||
@ResponseBody
|
||||
public Result<String> batchSaveNo(@RequestBody DeviceVoiceBox deviceVoiceBox) {
|
||||
if(StringUtil.isEmpty(deviceVoiceBox.getStartBoxNo())){
|
||||
return ResultGenerator.genFailResult("开始编号不能为空,请重新输入!");
|
||||
}
|
||||
if(StringUtil.isEmpty(deviceVoiceBox.getEndBoxNo())){
|
||||
return ResultGenerator.genFailResult("结束编号不能为空,请重新输入!");
|
||||
}
|
||||
try {
|
||||
Integer startBoxNo = Integer.parseInt(deviceVoiceBox.getStartBoxNo());
|
||||
Integer endBoxNo = Integer.parseInt(deviceVoiceBox.getEndBoxNo());
|
||||
if(endBoxNo.compareTo(startBoxNo) < 0){
|
||||
return ResultGenerator.genFailResult("结束编号范围有误,请重新输入!");
|
||||
}
|
||||
List<DeviceVoiceBox> list = new ArrayList<>();
|
||||
for (int i = startBoxNo;i<= endBoxNo;i++) {
|
||||
DeviceVoiceBox box = new DeviceVoiceBox();
|
||||
box.setCreateTime(new Date());
|
||||
box.setBoxNo(String.valueOf(i));
|
||||
list.add(box);
|
||||
}
|
||||
this.baseService.saveBatch(list);
|
||||
return ResultGenerator.genSuccessResult("操作成功!!",null);
|
||||
}catch (Exception e){
|
||||
throw new MsgException("包含重复的设备编号!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("unBindSave")
|
||||
@ResponseBody
|
||||
public Result<String> unBindSave(@RequestBody DeviceVoiceBox deviceVoiceBox) {
|
||||
if(StringUtil.isEmpty(deviceVoiceBox.getId())){
|
||||
return ResultGenerator.genFailResult("解绑出错");
|
||||
}
|
||||
if(StringUtil.isEmpty(deviceVoiceBox.getStatus())){
|
||||
return ResultGenerator.genFailResult("解绑出错");
|
||||
}
|
||||
if("1".equals(deviceVoiceBox.getStatus())){
|
||||
deviceVoiceBox.setActMercName("");
|
||||
deviceVoiceBox.setActMercId(null);
|
||||
}
|
||||
this.baseService.updateById(deviceVoiceBox);
|
||||
return ResultGenerator.genSuccessResult("操作成功!!",null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.pluss.platform.controller.deviceVoiceBox;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.deviceVoiceBox.DeviceVoiceBoxMsgService;
|
||||
import cn.pluss.platform.entity.DeviceVoiceBoxMsg;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备消息推送记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-04
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/deviceVoiceBoxMsg")
|
||||
public class DeviceVoiceBoxMsgController extends BaseModelController<DeviceVoiceBoxMsgService, DeviceVoiceBoxMsg> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "deviceVoiceBox/msg/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<DeviceVoiceBoxMsg>> page(Page<DeviceVoiceBoxMsg> page, DeviceVoiceBoxMsg condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false);
|
||||
orderItem.setColumn("createTime");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.pluss.platform.controller.dict;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.entity.Dict;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("dict")
|
||||
public class DictController extends BaseModelController<DictService, Dict> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "dict/dict";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detailDict/{id}", "/detailDict"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
Dict dictOne = baseService.getById(id);
|
||||
request.setAttribute("entity", dictOne);
|
||||
}
|
||||
return "dict/detailDict";
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<Dict> saveOrUpdate(@RequestBody Dict dict) {
|
||||
Calendar calendar=Calendar.getInstance();
|
||||
if (dict.getId() != null){
|
||||
dict.setUpdateTime(calendar.getTime());
|
||||
UpdateWrapper<Dict> dictUpdateWrapper=new UpdateWrapper<>();
|
||||
dictUpdateWrapper.eq("id",dict.getId());
|
||||
baseService.update(dict,dictUpdateWrapper);
|
||||
}else {
|
||||
dict.setCreateTime(calendar.getTime());
|
||||
dict.setUpdateTime(calendar.getTime());
|
||||
baseService.save(dict);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功", dict);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Result<Dict> del(@RequestBody Dict dict) {
|
||||
baseService.removeById(dict.getId());
|
||||
return ResultGenerator.genSuccessResult("删除成功", dict);
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@ResponseBody
|
||||
public Result<List<Dict>> tree() {
|
||||
List<Dict> result = baseService.tree();
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
@GetMapping("/getGroup/{code}")
|
||||
@ResponseBody
|
||||
public Result<List<Dict>> getGroupByCode(@PathVariable(name = "code") String code) {
|
||||
Dict dict = new Dict().setCode(code);
|
||||
dict = baseService.getOne(new QueryWrapper<>(dict));
|
||||
|
||||
if (dict == null) {
|
||||
throw new MsgException("对应code的字典项不存在");
|
||||
}
|
||||
|
||||
Dict queryParent = (Dict) new Dict().setPId(dict.getId());
|
||||
QueryWrapper<Dict> queryWrapper = new QueryWrapper<>(queryParent);
|
||||
queryWrapper.orderBy(true,true, "sort");
|
||||
List<Dict> list = baseService.list(queryWrapper);
|
||||
|
||||
return ResultGenerator.genSuccessResult(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.pluss.platform.controller.encrypt;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.encrypt.EncryptKeyService;
|
||||
import cn.pluss.platform.entity.EncryptKey;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商务密钥存储表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2021-10-28
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/encryptKey")
|
||||
public class EncryptKeyController {
|
||||
|
||||
@Autowired
|
||||
private EncryptKeyService encryptKeyService;
|
||||
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "encrypt/index";
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
public String detail() {
|
||||
return "encrypt/detail";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Page<EncryptKey>> page(Page<EncryptKey> page, EncryptKey condition, OrderItem orderItem) {
|
||||
if (orderItem != null) {
|
||||
page.addOrder(orderItem);
|
||||
} else {
|
||||
page.addOrder(OrderItem.desc("version"));
|
||||
page.addOrder(OrderItem.desc("createTime"));
|
||||
}
|
||||
|
||||
page = encryptKeyService.page(page, Wrappers.query(condition));
|
||||
|
||||
return ResultGenerator.genSuccessResult(page);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public Result<Object> save(EncryptKey encryptKey) {
|
||||
encryptKeyService.save(encryptKey);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
@PostMapping("/enable")
|
||||
public Result<Object> enable(String id) {
|
||||
encryptKeyService.enable(id);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
package cn.pluss.platform.controller.fans;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.Fans;
|
||||
import cn.pluss.platform.fans.FansService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.vo.FansConsumVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("fans")
|
||||
public class FansController extends BaseNoModelController {
|
||||
|
||||
private final static Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private FansService fansService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "fans/fansList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryFansByPage(@RequestParam(defaultValue = "1") Integer currPage, String startTime, String endTime, FansConsumVO fansConsumVO) throws Exception {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
Boolean bol = verifyUserRole();
|
||||
if (StringUtil.isNotEmpty(fansConsumVO.getNickName())) {
|
||||
String nickName = URLEncoder.encode(fansConsumVO.getNickName(), "UTF-8");
|
||||
map.put("nickName", nickName);
|
||||
}
|
||||
try {
|
||||
Date startTimeDate = simpleDateFormat.parse(startTime);
|
||||
Date endTimeDate = simpleDateFormat.parse(endTime);
|
||||
map.put("startTime", startTimeDate);
|
||||
map.put("endTime", endTimeDate);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (StringUtil.isNotEmpty(fansConsumVO.getMerchantName())) {
|
||||
map.put("merchantName", fansConsumVO.getMerchantName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(fansConsumVO.getLastMerchantName())) {
|
||||
map.put("lastMerchantName", fansConsumVO.getLastMerchantName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(fansConsumVO.getOrderNumber())) {
|
||||
map.put("orderNumber", fansConsumVO.getOrderNumber());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(fansConsumVO.getLastOrderNumber())) {
|
||||
map.put("lastOrderNumber", fansConsumVO.getLastOrderNumber());
|
||||
}
|
||||
List<FansConsumVO> fansList = null;
|
||||
Integer count = 0;
|
||||
if (!bol) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
} else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
fansList = fansService.queryFansNoConsumPage(map);
|
||||
count = fansService.queryFansNoConsumPageCount(map);
|
||||
}else {
|
||||
fansList = fansService.queryFansConsumPage(map);
|
||||
count = fansService.queryFansConsumPageCount(map);
|
||||
result.put("admin",bol);
|
||||
}
|
||||
for (FansConsumVO f : fansList) {
|
||||
if (StringUtil.isNotEmpty(f.getNickName())) {
|
||||
f.setNickName(URLDecoder.decode(f.getNickName(), "UTF-8"));
|
||||
f.setNickName(URLDecoder.decode(f.getNickName(), "UTF-8"));
|
||||
f.setNickName(URLDecoder.decode(f.getNickName(), "UTF-8"));
|
||||
f.setNickName(URLDecoder.decode(f.getNickName(), "UTF-8"));
|
||||
f.setNickName(URLDecoder.decode(f.getNickName(), "UTF-8"));
|
||||
}
|
||||
}
|
||||
result.put("fansList", fansList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansDetails", method = RequestMethod.GET)
|
||||
public String queryFansDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Fans fans = new Fans();
|
||||
fans.setId(id);
|
||||
fans = fansService.queryFans(fans);
|
||||
request.setAttribute("fans", fans);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "fans/fansDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansBaseInfo", method = RequestMethod.GET)
|
||||
public String queryFansBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Fans fans = new Fans();
|
||||
fans.setId(id);
|
||||
fans = fansService.queryFans(fans);
|
||||
request.setAttribute("fans", fans);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "fans/fansBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryFansExtendsInfo() {
|
||||
|
||||
return "fans/fansExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryFansFunctionsInfo() {
|
||||
|
||||
return "fans/fansFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/saveFans", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveFans(Fans fans) {
|
||||
|
||||
if (fans.getId() != null && fans.getId() != 0) {
|
||||
fansService.updateFans(fans);
|
||||
} else {
|
||||
fansService.saveFans(fans);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/updateFans", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateFans(Integer id) {
|
||||
|
||||
Fans fans = new Fans();
|
||||
fans.setId(id);
|
||||
fansService.updateFans(fans);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/deleteFans", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteFans(Integer id) {
|
||||
Fans fans = new Fans();
|
||||
fans.setId(id);
|
||||
fansService.deleteFans(fans);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package cn.pluss.platform.controller.fansConsumReturn;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.FansConsumReturn;
|
||||
import cn.pluss.platform.fansConsumReturn.FansConsumReturnService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("fansConsumReturn")
|
||||
public class FansConsumReturnController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private FansConsumReturnService fansConsumReturnService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "fansConsumReturn/fansConsumReturnList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansConsumReturnByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryFansConsumReturnByPage(@RequestParam(defaultValue="1") Integer currPage,FansConsumReturn fansConsumReturn){
|
||||
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
if(StringUtil.isNotEmpty(fansConsumReturn.getNickName())) {
|
||||
map.put("nickName", fansConsumReturn.getNickName());
|
||||
}
|
||||
Boolean bol = verifyUserRole();
|
||||
if(!bol) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if(StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}else {
|
||||
map.put("merchantCode", StringUtil.genRandomNum(33));
|
||||
}
|
||||
}
|
||||
List<FansConsumReturn> fansConsumReturnList=fansConsumReturnService.queryFansConsumReturnPage(map);
|
||||
Integer count=fansConsumReturnService.queryFansConsumReturnPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("fansConsumReturnList", fansConsumReturnList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansConsumReturnDetails", method = RequestMethod.GET)
|
||||
public String queryFansConsumReturnDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
FansConsumReturn fansConsumReturn=new FansConsumReturn();
|
||||
fansConsumReturn.setId(id);
|
||||
fansConsumReturn=fansConsumReturnService.queryFansConsumReturn(fansConsumReturn);
|
||||
request.setAttribute("fansConsumReturn", fansConsumReturn);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "fansConsumReturn/fansConsumReturnDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansConsumReturnBaseInfo", method = RequestMethod.GET)
|
||||
public String queryFansConsumReturnBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
FansConsumReturn fansConsumReturn=new FansConsumReturn();
|
||||
fansConsumReturn.setId(id);
|
||||
fansConsumReturn=fansConsumReturnService.queryFansConsumReturn(fansConsumReturn);
|
||||
request.setAttribute("fansConsumReturn", fansConsumReturn);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "fansConsumReturn/fansConsumReturnBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansConsumReturnExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryFansConsumReturnExtendsInfo(){
|
||||
|
||||
return "fansConsumReturn/fansConsumReturnExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryFansConsumReturnFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryFansConsumReturnFunctionsInfo(){
|
||||
|
||||
return "fansConsumReturn/fansConsumReturnFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveFansConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveFansConsumReturn(FansConsumReturn fansConsumReturn){
|
||||
|
||||
if(fansConsumReturn.getId()!=null&&fansConsumReturn.getId()!=0){
|
||||
fansConsumReturnService.updateFansConsumReturn(fansConsumReturn);
|
||||
}else{
|
||||
fansConsumReturnService.saveFansConsumReturn(fansConsumReturn);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateFansConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateFansConsumReturn(Integer id){
|
||||
|
||||
FansConsumReturn fansConsumReturn=new FansConsumReturn();
|
||||
fansConsumReturn.setId(id);
|
||||
fansConsumReturnService.updateFansConsumReturn(fansConsumReturn);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteFansConsumReturn", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteFansConsumReturn(Integer id){
|
||||
FansConsumReturn fansConsumReturn=new FansConsumReturn();
|
||||
fansConsumReturn.setId(id);
|
||||
fansConsumReturnService.deleteFansConsumReturn(fansConsumReturn);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.pluss.platform.controller.guideLabel;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.GuideLabel;
|
||||
import cn.pluss.platform.guideLabel.GuideLabelService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-10-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/guideLabel")
|
||||
public class GuideLabelController extends BaseModelController<GuideLabelService, GuideLabel> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "guideLabel/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
GuideLabel label = new GuideLabel().setId(id);
|
||||
label = baseService.getOne(new QueryWrapper<>(label));
|
||||
request.setAttribute("entity", label);
|
||||
}
|
||||
return "guideLabel/detail";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/save")
|
||||
@Override
|
||||
public Result<String> save(@RequestBody GuideLabel entity) {
|
||||
if(StringUtil.isEmpty(entity.getName())){
|
||||
return ResultGenerator.genFailResult("话术名称不能为空", null);
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getStatus())){
|
||||
return ResultGenerator.genFailResult("状态不能为空", null);
|
||||
}
|
||||
if(!"0".equals(entity.getStatus())){
|
||||
QueryWrapper<GuideLabel> queryWrapper = new QueryWrapper<GuideLabel>();
|
||||
if(StringUtil.isEmpty(entity.getId())){
|
||||
queryWrapper.eq("status",entity.getStatus());
|
||||
}else{
|
||||
queryWrapper.eq("status",entity.getStatus()).ne("id",entity.getId());
|
||||
}
|
||||
List<GuideLabel> list = this.baseService.list(queryWrapper);
|
||||
if(list.size() != 0){
|
||||
return ResultGenerator.genFailResult("选中的数据只能有一条!", null);
|
||||
}
|
||||
}
|
||||
return super.save(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package cn.pluss.platform.controller.helpVideo;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.HelpVideo;
|
||||
import cn.pluss.platform.helpVideo.HelpVideoService;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("helpVideo")
|
||||
public class HelpVideoController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private HelpVideoService helpVideoService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "helpVideo/helpVideoList";
|
||||
}
|
||||
|
||||
@RequestMapping("add")
|
||||
public ModelAndView add() {
|
||||
ModelAndView view = new ModelAndView("helpVideo/helpVideoBaseInfo");
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("uploadParam",uploadParam);
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/queryHelpVideoByPage")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<HelpVideo>> queryHelpVideoByPage(Page<HelpVideo> page) {
|
||||
QueryWrapper<HelpVideo> helpVideoQueryWrapper=new QueryWrapper<HelpVideo>().orderByAsc("sort");
|
||||
page= helpVideoService.page(page, helpVideoQueryWrapper);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(page));
|
||||
}
|
||||
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody HelpVideo helpVideo) {
|
||||
if (StringUtil.isNotEmpty(helpVideo.getId())){
|
||||
helpVideoService.updateById(helpVideo);
|
||||
}else {
|
||||
helpVideo.setCreateDt(new Date());
|
||||
helpVideoService.save(helpVideo);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
|
||||
@GetMapping("/edit/{id}")
|
||||
public ModelAndView edit(@PathVariable Integer id){
|
||||
ModelAndView view = new ModelAndView("helpVideo/helpVideoBaseInfo");
|
||||
HelpVideo helpVideo = helpVideoService.getById(id);
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
view.addObject("helpVideo",helpVideo);
|
||||
view.addObject("uploadParam",uploadParam);
|
||||
//OssOperatUtil.getUploadParam();
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
@ResponseBody
|
||||
public Result<String> delete(@RequestBody HelpVideo helpVideo) {
|
||||
helpVideoService.removeById(helpVideo.getId());
|
||||
if(StringUtil.isNotEmpty(helpVideo.getVideoUrl())){
|
||||
OssOperatUtil.deleteFile(helpVideo.getVideoUrl());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.entity.PlatformData;
|
||||
import cn.pluss.platform.home.HomeService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.platformData.PlatformDataService;
|
||||
import cn.pluss.platform.refundOrder.MerchantRefundOrderService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("platform")
|
||||
public class HomeController extends BaseNoModelController {
|
||||
@Autowired
|
||||
private MerchantOrderService merchantOrderService;
|
||||
@Autowired
|
||||
private HomeService homeService;
|
||||
@Autowired
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Resource
|
||||
private MerchantRefundOrderService merchantRefundOrderService;
|
||||
|
||||
@Resource
|
||||
private MerchantChannelStatusService merchantChannelStatusService;
|
||||
|
||||
@Resource
|
||||
private PlatformDataService platformDataService;
|
||||
|
||||
@GetMapping("/console")
|
||||
public String index() {
|
||||
return "index/index2";
|
||||
}
|
||||
|
||||
@GetMapping("/first")
|
||||
public String first() {
|
||||
return "index/first";
|
||||
}
|
||||
|
||||
@PostMapping("/firstData")
|
||||
@ResponseBody
|
||||
public Result<?> firstData(){
|
||||
Map<String,Object> result = new HashMap<>(20);
|
||||
// //获取首页订单统计数据
|
||||
Map<String,Object> orderData = merchantOrderService.getPlatformOrderData();
|
||||
|
||||
Map<String,String> transData = merchantOrderService.getPlatformTransData();
|
||||
|
||||
// //统计首页退款数据
|
||||
Map<String,Object> refundData = merchantRefundOrderService.getPlatformRefundData();
|
||||
// //统计首页其他数据
|
||||
Map<String,Object> otherData = userAppService.getPlatformData();
|
||||
// //统计累计金额数据
|
||||
Map<String,Object> amtData = merchantOrderService.getPlatformAmtData();
|
||||
|
||||
//获取昨日这个时候的支付金额
|
||||
Date yestNowEndDate = DateUtils.add(Calendar.DAY_OF_MONTH,DateUtils.currentDate(),-1);
|
||||
String date = DateUtils.toString(yestNowEndDate,"yyyy-MM-dd");
|
||||
String yestStartDate = DateUtils.toString(yestNowEndDate,"yyyy-MM-dd") + " 00:00:00";
|
||||
String yestEndDate = DateUtils.toString(yestNowEndDate,"yyyy-MM-dd HH:mm:ss");
|
||||
BigDecimal yestDayNowTransAmt = merchantOrderService.getPlatformAmtYestNowData(date,yestStartDate,yestEndDate);
|
||||
BigDecimal toDayTransCount = orderData.get("toDayTransCount") == null ? BigDecimal.ZERO :BigDecimal.valueOf((double)orderData.get("toDayTransCount"));
|
||||
BigDecimal subtract = toDayTransCount.subtract(yestDayNowTransAmt);
|
||||
BigDecimal scale = subtract.divide(yestDayNowTransAmt,4,BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
result.putAll(orderData);
|
||||
result.putAll(refundData);
|
||||
result.putAll(otherData);
|
||||
result.putAll(amtData);
|
||||
result.putAll(transData);
|
||||
PlatformData yesterDayData = platformDataService.censusPlatformData();
|
||||
result.put("yesterDay",yesterDayData);
|
||||
|
||||
result.put("yestDayNowTransAmt",yestDayNowTransAmt);
|
||||
result.put("scale",scale + "%");
|
||||
result.put("subtract",Math.abs(subtract.doubleValue()));
|
||||
if(scale.doubleValue() < 0){
|
||||
result.put("oTypeName","下降");
|
||||
}else{
|
||||
result.put("oTypeName","上升");
|
||||
}
|
||||
List<Map<String,Object>> chartTransList = platformDataService.getChartTransCountData();
|
||||
List<String> timeList = new ArrayList<>();
|
||||
List<String> payAmtList = new ArrayList<>();
|
||||
List<String> payNumList = new ArrayList<>();
|
||||
for (Map<String,Object> map:chartTransList) {
|
||||
timeList.add((String) map.get("days"));
|
||||
payAmtList.add(map.get("transCountAmt").toString());
|
||||
payNumList.add(map.get("transNum").toString());
|
||||
}
|
||||
List<String> channelList = new ArrayList<>();
|
||||
List<String> channelAmtList = new ArrayList<>();
|
||||
List<String> channelNumList = new ArrayList<>();
|
||||
List<Map<String,Object>> chartChannelMap = platformDataService.getChartChannelCountData();
|
||||
for (Map<String,Object> map:chartChannelMap) {
|
||||
channelList.add((String) map.get("channelName"));
|
||||
channelAmtList.add(map.get("transCountAmt").toString());
|
||||
channelNumList.add(map.get("transNum").toString());
|
||||
}
|
||||
result.put("timeList",timeList);
|
||||
result.put("payAmtList",payAmtList);
|
||||
result.put("payNumList",payNumList);
|
||||
result.put("channelList",channelList);
|
||||
result.put("channelAmtList",channelAmtList);
|
||||
result.put("channelNumList",channelNumList);
|
||||
return ResultGenerator.genSuccessResult("获取成功",result);
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
@ResponseBody
|
||||
public Map<String, Object> login(HttpServletRequest request) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", 2);
|
||||
// 执行认证登陆
|
||||
try {
|
||||
result.put("result", 1);
|
||||
result.put("code", 0);
|
||||
result.put("url", request.getContextPath() + "/login");
|
||||
} catch (Exception uae) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/showAdmin")
|
||||
@ResponseBody
|
||||
public Map<String, Object> showAdmin() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
ShiroUser queryCurrentShiroUser = queryCurrentShiroUser();
|
||||
String loginName = queryCurrentShiroUser.getLoginName();
|
||||
result.put("loginName", loginName);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/getAuditData")
|
||||
@ResponseBody
|
||||
public Result<Object> getAuditData() {
|
||||
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<MerchantChannelStatus>()
|
||||
.eq("status",MerchantChannelStatus.AUDIT_STATUS_EXAMINING)
|
||||
.eq("thirdStatus",MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING)
|
||||
.last(" order by id desc").select("id");
|
||||
int count = merchantChannelStatusService.count(queryWrapper);
|
||||
queryWrapper.last(" order by id desc limit 1");
|
||||
Map<String,Object> map = merchantChannelStatusService.getMap(queryWrapper);
|
||||
Integer maxId = 0;
|
||||
if(map != null){
|
||||
maxId = (Integer) map.get("id");
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject(2);
|
||||
result.put("id",maxId);
|
||||
result.put("count",count);
|
||||
return ResultGenerator.genSuccessResult("获取成功",result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package cn.pluss.platform.controller.home;
|
||||
|
||||
import cn.hutool.crypto.digest.MD5;
|
||||
import cn.pluss.platform.annotation.PassToken;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.ipLocation.IpLocationService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.IpUtils;
|
||||
import cn.pluss.platform.util.JwtUtils;
|
||||
import cn.pluss.platform.wx.WxTalkService;
|
||||
import com.aliyuncs.geoip.model.v20200101.DescribeIpv4LocationResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("login")
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private UserInfoService uiService;
|
||||
|
||||
@Autowired
|
||||
private WxTalkService wxTalkService;
|
||||
|
||||
@Autowired
|
||||
private IpLocationService ipLocationService;
|
||||
|
||||
@PassToken
|
||||
@GetMapping("/auth")
|
||||
@ResponseBody
|
||||
public Result<Object> jwtTest(HttpServletRequest request) {
|
||||
String token = request.getHeader("token");
|
||||
String userId = request.getHeader("userId");
|
||||
|
||||
if (!Objects.equals("244", userId)) {
|
||||
// 此处不能返回401, 不然会形成死循环
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
|
||||
Object tokenUserId = JwtUtils.get("uid", token);
|
||||
if (!Objects.equals(userId, tokenUserId.toString())) {
|
||||
// 此处不能返回401, 不然会形成死循环
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
|
||||
try {
|
||||
boolean verify = JwtUtils.verify(token, userId);
|
||||
if (!verify) {
|
||||
// 此处不能返回401, 不然会形成死循环
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
|
||||
Object expireTime = JwtUtils.get("expire_time", token);
|
||||
if (!(expireTime instanceof Long)) {
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
|
||||
if (((Long) expireTime) < System.currentTimeMillis()) {
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new MsgException("未授权");
|
||||
}
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
/**
|
||||
*引导页
|
||||
*/
|
||||
@PassToken
|
||||
@GetMapping
|
||||
public String index(HttpServletRequest request) {
|
||||
String contextPath = request.getContextPath();
|
||||
switch (contextPath) {
|
||||
case "/merchant":
|
||||
return "index/loginMerchant";
|
||||
case "/service":
|
||||
return "index/loginService";
|
||||
default:
|
||||
return "index/login";
|
||||
}
|
||||
}
|
||||
|
||||
@PassToken
|
||||
@PostMapping("/doLogin")
|
||||
@ResponseBody
|
||||
public Map<String,Object> login(HttpServletRequest request, @RequestParam("loginName") String username, @RequestParam("password") String password) {
|
||||
Map<String,Object> result= new HashMap<>();
|
||||
result.put("result", 2);
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setLoginName(username);
|
||||
userInfo = uiService.getOne(new QueryWrapper<>(userInfo));
|
||||
|
||||
String ipAddr = IpUtils.getIpAddr(request);
|
||||
DescribeIpv4LocationResponse clientLocation = ipLocationService.getLocation(ipAddr);
|
||||
String location = clientLocation.getCountry()
|
||||
+ "," + clientLocation.getProvince()
|
||||
+ "," + clientLocation.getCity()
|
||||
+ "," + clientLocation.getCounty();
|
||||
if (userInfo == null) {
|
||||
wxTalkService.sendManageLoginInfo(username, password, ipAddr, clientLocation.getIsp(), location, false);
|
||||
result.put("message", "用户名或者密码错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!userInfo.getPassword().equals(MD5.create().digestHex(password, StandardCharsets.UTF_8))) {
|
||||
wxTalkService.sendManageLoginInfo(username, password, ipAddr, clientLocation.getIsp(), location, false);
|
||||
result.put("message", "用户名或者密码错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
result.put("result", 1);
|
||||
result.put("redirectUri", "/manage/platform/console");
|
||||
result.put("token", JwtUtils.getToken(userInfo));
|
||||
result.put("userId", userInfo.getId());
|
||||
|
||||
wxTalkService.sendManageLoginInfo(username, password, ipAddr, clientLocation.getIsp(), location, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.pluss.platform.controller.inviteRate;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.dict.DictService;
|
||||
import cn.pluss.platform.entity.Dict;
|
||||
import cn.pluss.platform.entity.InviteRate;
|
||||
import cn.pluss.platform.entity.OfficialActivity;
|
||||
import cn.pluss.platform.inviteRate.InviteRateService;
|
||||
import cn.pluss.platform.officialActivity.OfficialActivityService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 邀请商户费率阶梯表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2020-11-20
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/inviteRate")
|
||||
public class InviteRateController extends BaseModelController<InviteRateService, InviteRate> {
|
||||
|
||||
@Autowired
|
||||
private InviteRateService inviteRateService;
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
|
||||
@Autowired
|
||||
private OfficialActivityService officialActivityService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
List<Dict> dictList = dictService.getByCode(Collections.singletonList("SERVICE_PROVIDER_TYPE"));
|
||||
request.setAttribute("dictList", JSONObject.toJSONString(dictList));
|
||||
return "inviteRate/inviteRateList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<InviteRate>> page(Page<InviteRate> page, InviteRate condition, OrderItem orderItem) {
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
List<Dict> typeList = dictService.getByCode(Collections.singletonList("SERVICE_PROVIDER_TYPE"));
|
||||
if (id != null) {
|
||||
InviteRate inviteRate = inviteRateService.getById(id);
|
||||
String type = inviteRate.getType();
|
||||
QueryWrapper<OfficialActivity> queryWrapper = new QueryWrapper<OfficialActivity>().eq("activityGroupNo",type);
|
||||
List<OfficialActivity> list = officialActivityService.list(queryWrapper);
|
||||
/*String format = "yyyy-MM-dd HH:mm:ss";
|
||||
inviteRate.setStartTimeStr(DateFormatUtils.format(inviteRate.getStartTime(), format));
|
||||
inviteRate.setEndTimeStr(DateFormatUtils.format(inviteRate.getEndTime(), format));*/
|
||||
request.setAttribute("entity", inviteRate);
|
||||
request.setAttribute("actList", list);
|
||||
}
|
||||
request.setAttribute("typeList", typeList);
|
||||
return "inviteRate/detail";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/getActType/{type}")
|
||||
@ResponseBody
|
||||
public Result getActType(@PathVariable(value = "type") String type){
|
||||
QueryWrapper<OfficialActivity> queryWrapper = new QueryWrapper<OfficialActivity>()
|
||||
.eq("status","2").eq("activityGroupNo",type);
|
||||
List<OfficialActivity> list = officialActivityService.list(queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("查询成功",list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> save(@RequestBody InviteRate entity) {
|
||||
OfficialActivity act = officialActivityService.getById(entity.getActId());
|
||||
if(act == null){
|
||||
return ResultGenerator.genFailResult("活动不存在");
|
||||
}
|
||||
if (entity.getId() == null){
|
||||
entity.setActName(act.getOfficName());
|
||||
entity.setStartTime(act.getStartTime());
|
||||
entity.setEndTime(act.getEndTime());
|
||||
entity.setCreateTime(DateUtils.formatDateDefault(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
||||
}else{
|
||||
entity.setUpdateTime(DateUtils.formatDateDefault(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@DeleteMapping("/del")
|
||||
public Result<String> delete(@RequestBody InviteRate inviteRate) {
|
||||
inviteRateService.removeById(inviteRate.getId());
|
||||
return ResultGenerator.genSuccessResult("删除成功", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.RewardConfig;
|
||||
import cn.pluss.platform.entity.UserRole;
|
||||
import cn.pluss.platform.jft.JftBankCardService;
|
||||
import cn.pluss.platform.rewardConfig.RewardConfigService;
|
||||
import cn.pluss.platform.user.UserRoleService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通银行卡 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftBankCard")
|
||||
public class JftBankCardController extends BaseModelController<JftBankCardService, JftBankCard> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/bankList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftBankCard entity = baseService.getOne(new QueryWrapper<JftBankCard>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/bankDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftBankCard>> page(Page<JftBankCard> page, JftBankCard condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.JftMercBaseInfo;
|
||||
import cn.pluss.platform.jft.JftBankCardService;
|
||||
import cn.pluss.platform.jft.JftMercBaseInfoService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通商户信息 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftMercInfo")
|
||||
public class JftMercBaseInfoController extends BaseModelController<JftMercBaseInfoService, JftMercBaseInfo> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/mercList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftMercBaseInfo entity = baseService.getOne(new QueryWrapper<JftMercBaseInfo>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/mercDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftMercBaseInfo>> page(Page<JftMercBaseInfo> page, JftMercBaseInfo condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchant.JftMercPaymentChannelService;
|
||||
import cn.pluss.platform.notice.NoticeService;
|
||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||
import cn.pluss.platform.yinsheng.v20210929.ReqMethod;
|
||||
import cn.pluss.platform.ys.impl.v20210929.YsConfigV2;
|
||||
import cn.pluss.platform.ysExtension.v20220615.YsServiceV2;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通进件信息 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftPaymentChannel")
|
||||
public class JftMercPaymentChannelController extends BaseModelController<JftMercPaymentChannelService, JftMercPaymentChannel> {
|
||||
|
||||
@Autowired
|
||||
private YsServiceV2 ysServiceV2;
|
||||
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private GeneralPushUtil generalPushUtil;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/channelList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftMercPaymentChannel entity = baseService.getOne(new QueryWrapper<JftMercPaymentChannel>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/channelDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftMercPaymentChannel>> page(Page<JftMercPaymentChannel> page, JftMercPaymentChannel condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@PostMapping("/sendMsg")
|
||||
@ResponseBody
|
||||
public Result<?> sendMsg(String userId) {
|
||||
JftMercPaymentChannel jpc = baseService.getByUserId(userId);
|
||||
if (jpc.getStatus().equals(MerchantChannelStatus.AUDIT_STATUS_SUCCESS)) {
|
||||
throw new MsgException("已完成进件!");
|
||||
}
|
||||
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("sysFlowId", jpc.getApplicationId());
|
||||
data.put("isSendMsg", "N");
|
||||
JSONObject respResult = ysServiceV2.req(YsConfigV2.MER_PROTOCOL_MSG, ReqMethod.MERCHANT_SEND_MSG, data);
|
||||
|
||||
if ("00".equals(respResult.getString("code"))) {
|
||||
jpc.getExtra().put("sysSignFlowId", respResult.getString("sysSignFlowId"));
|
||||
jpc.getExtra().put("signUrl", respResult.getString("signUrl"));
|
||||
|
||||
Notice notice = new Notice(1, -1, userId);
|
||||
String uniqueKey = "YS_QY" + System.currentTimeMillis();
|
||||
String title = "电子协议签约通知";
|
||||
String content = "尊敬的客户您好,请点此通知完成签约意愿授权。请注意,同意授权后,支付通道才会进行商户资料审核,否则会一直等待审核。";
|
||||
String url = respResult.getString("signUrl");
|
||||
notice.setUniqueKey(uniqueKey);
|
||||
notice.setNoticeCode(uniqueKey);
|
||||
notice.setTitle(title);
|
||||
notice.setUrl(url);
|
||||
notice.setDesc(content);
|
||||
noticeService.save(notice);
|
||||
|
||||
generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, content, "1");
|
||||
|
||||
jpc.setStatus(MerchantChannelStatus.AUDIT_STATUS_WAITING_SIGN);
|
||||
baseService.updateById(jpc);
|
||||
}
|
||||
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.JftMerchantRate;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.UserLevel;
|
||||
import cn.pluss.platform.jft.JftMerchantRateService;
|
||||
import cn.pluss.platform.user.UserLevelService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通银行卡 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftMercRate")
|
||||
public class JftMerchantRateController extends BaseModelController<JftMerchantRateService, JftMerchantRate> {
|
||||
|
||||
@Resource
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Resource
|
||||
private UserLevelService userLevelService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/rateList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftMerchantRate entity = baseService.getOne(new QueryWrapper<JftMerchantRate>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/rateDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftMerchantRate>> page(Page<JftMerchantRate> page, JftMerchantRate condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
Result<Page<JftMerchantRate>> result = super.page(page, condition, orderItem);
|
||||
Page<JftMerchantRate> pageRecords = result.getData();
|
||||
List<JftMerchantRate> records = pageRecords.getRecords();
|
||||
for (JftMerchantRate rate :records) {
|
||||
UserApp userApp = userAppService.getUserAppByUserId(rate.getUserId());
|
||||
rate.setLevelCode(userApp.getLevelCode());
|
||||
UserLevel level = userLevelService.getLevelInfoByRoleLevel(userApp.getRoleCode(), userApp.getLevelCode());
|
||||
if(level != null){
|
||||
rate.setConsultRate(level.getJftRate());
|
||||
}else{
|
||||
rate.setConsultRate(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.JftMerchantRateRecord;
|
||||
import cn.pluss.platform.jft.JftMerchantRateRecordService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通费率变更记录 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftRateRecord")
|
||||
public class JftMerchantRateRecordController extends BaseModelController<JftMerchantRateRecordService, JftMerchantRateRecord> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/rateRecordList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftMerchantRateRecord>> page(Page<JftMerchantRateRecord> page, JftMerchantRateRecord condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.JftPaymentInfo;
|
||||
import cn.pluss.platform.jft.JftPaymentInfoService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通银行卡 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftPaymentInfo")
|
||||
public class JftPaymentInfoController extends BaseModelController<JftPaymentInfoService, JftPaymentInfo> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/paymentlist";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftPaymentInfo entity = baseService.getOne(new QueryWrapper<JftPaymentInfo>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/paymentDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftPaymentInfo>> page(Page<JftPaymentInfo> page, JftPaymentInfo condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftBankCard;
|
||||
import cn.pluss.platform.entity.JftReceiptInfo;
|
||||
import cn.pluss.platform.jft.JftReceiptInfoService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通银行卡 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jfReceiptInfo")
|
||||
public class JftReceiptInfoController extends BaseModelController<JftReceiptInfoService, JftReceiptInfo> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/receiptList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftReceiptInfo>> page(Page<JftReceiptInfo> page, JftReceiptInfo condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftReceiptOrder;
|
||||
import cn.pluss.platform.jft.JftReceiptOrderService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通银行卡 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-02-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftOrder")
|
||||
public class JftReceiptOrderController extends BaseModelController<JftReceiptOrderService, JftReceiptOrder> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/orderList";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftReceiptOrder>> page(Page<JftReceiptOrder> page, JftReceiptOrder condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.pluss.platform.controller.jft;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.JftReceiptOrder;
|
||||
import cn.pluss.platform.entity.JftSmallClass;
|
||||
import cn.pluss.platform.jft.JftSmallClassService;
|
||||
import cn.pluss.platform.util.Base64Util;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缴费通小课堂信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2022-07-06
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jftSmallClass")
|
||||
public class JftSmallClassController extends BaseModelController<JftSmallClassService, JftSmallClass> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "jft/classList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
JftSmallClass entity = baseService.getOne(new QueryWrapper<JftSmallClass>().eq("id",id));
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
return "jft/classDetail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<JftSmallClass>> page(Page<JftSmallClass> page, JftSmallClass condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("sort");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package cn.pluss.platform.controller.level;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import cn.pluss.platform.entity.Level;
|
||||
import cn.pluss.platform.level.LevelService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("level")
|
||||
public class LevelController extends BaseModelController<LevelService, Level> {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index(Integer pageIndex) {
|
||||
|
||||
return "level/levelList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryLevelByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryLevelByPage(Integer currPage, Integer id) {
|
||||
|
||||
if (currPage == null) {
|
||||
currPage = 1;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<Level> levelList = baseService.queryLevelPage(map);
|
||||
Integer count = baseService.queryLevelPageCount(map);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("levelList", levelList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryLevelDetails", method = RequestMethod.GET)
|
||||
public String queryLevelDetails(HttpServletRequest request, Long id, Long pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Level level = new Level();
|
||||
level.setId(id);
|
||||
level = baseService.queryLevel(level);
|
||||
request.setAttribute("level", level);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "level/levelDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryLevelBaseInfo", method = RequestMethod.GET)
|
||||
public String queryLevelBaseInfo(HttpServletRequest request, Long id, Long pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
Level level = new Level();
|
||||
level.setId(id);
|
||||
level = baseService.queryLevel(level);
|
||||
BigDecimal rate = BigDecimal.valueOf(level.getRate());
|
||||
|
||||
request.setAttribute("rate", rate);
|
||||
request.setAttribute("level", level);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "level/levelBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryLevelExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryLevelExtendsInfo() {
|
||||
|
||||
return "level/levelExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryLevelFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryLevelFunctionsInfo() {
|
||||
|
||||
return "level/levelFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws ParseException
|
||||
*/
|
||||
@RequestMapping(value = "/saveLevel", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveLevel(Level level) throws ParseException {
|
||||
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String createDtSTR = level.getCreateDtSTR();
|
||||
if (!StringUtil.isEmpty(createDtSTR)) {
|
||||
Date date2 = date.parse(createDtSTR);
|
||||
level.setCreateDt(date2);
|
||||
}
|
||||
if (level.getId() != null && level.getId() != 0) {
|
||||
baseService.updateLevel(level);
|
||||
} else {
|
||||
baseService.saveLevel(level);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/updateLevel", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateLevel(Long id) {
|
||||
|
||||
Level level = new Level();
|
||||
level.setId(id);
|
||||
baseService.updateLevel(level);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package cn.pluss.platform.controller.memberOrder;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MemberOrder;
|
||||
import cn.pluss.platform.memberOrder.MemberOrderService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("memberOrder")
|
||||
public class MemberOrderController extends BaseNoModelController {
|
||||
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private MemberOrderService memberOrderService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "memberOrder/memberOrderList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberOrderByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMemberOrderByPage(Integer currPage, Integer id) {
|
||||
|
||||
if (currPage == null) {
|
||||
currPage = 1;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MemberOrder> memberOrderList = memberOrderService.queryMemberOrderPage(map);
|
||||
Integer count = memberOrderService.queryMemberOrderPageCount(map);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("memberOrderList", memberOrderList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberOrderDetails", method = RequestMethod.GET)
|
||||
public String queryMemberOrderDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MemberOrder memberOrder = new MemberOrder();
|
||||
memberOrder.setId(id);
|
||||
memberOrder = memberOrderService.queryMemberOrder(memberOrder);
|
||||
request.setAttribute("memberOrder", memberOrder);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "memberOrder/memberOrderDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberOrderBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMemberOrderBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MemberOrder memberOrder = new MemberOrder();
|
||||
memberOrder.setId(id);
|
||||
memberOrder = memberOrderService.queryMemberOrder(memberOrder);
|
||||
request.setAttribute("memberOrder", memberOrder);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "memberOrder/memberOrderBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberOrderExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMemberOrderExtendsInfo() {
|
||||
|
||||
return "memberOrder/memberOrderExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberOrderFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMemberOrderFunctionsInfo() {
|
||||
|
||||
return "memberOrder/memberOrderFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMemberOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMemberOrder(MemberOrder memberOrder) {
|
||||
|
||||
if (memberOrder.getId() != null && memberOrder.getId() != 0) {
|
||||
memberOrderService.updateMemberOrder(memberOrder);
|
||||
} else {
|
||||
memberOrderService.saveMemberOrder(memberOrder);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMemberOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMemberOrder(Integer id) {
|
||||
|
||||
MemberOrder memberOrder = new MemberOrder();
|
||||
memberOrder.setId(id);
|
||||
memberOrderService.updateMemberOrder(memberOrder);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMemberOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMemberOrder(Integer id) {
|
||||
MemberOrder memberOrder = new MemberOrder();
|
||||
memberOrder.setId(id);
|
||||
memberOrderService.deleteMemberOrder(memberOrder);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.memberSetting;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MemberSetting;
|
||||
import cn.pluss.platform.memberSetting.MemberSettingService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("memberSetting")
|
||||
public class MemberSettingController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MemberSettingService memberSettingService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "memberSetting/memberSettingList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberSettingByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMemberSettingByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MemberSetting> memberSettingList=memberSettingService.queryMemberSettingPage(map);
|
||||
Integer count=memberSettingService.queryMemberSettingPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("memberSettingList", memberSettingList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberSettingDetails", method = RequestMethod.GET)
|
||||
public String queryMemberSettingDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MemberSetting memberSetting=new MemberSetting();
|
||||
memberSetting.setId(id);
|
||||
memberSetting=memberSettingService.queryMemberSetting(memberSetting);
|
||||
request.setAttribute("memberSetting", memberSetting);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "memberSetting/memberSettingDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberSettingBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMemberSettingBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MemberSetting memberSetting=new MemberSetting();
|
||||
memberSetting.setId(id);
|
||||
memberSetting=memberSettingService.queryMemberSetting(memberSetting);
|
||||
request.setAttribute("memberSetting", memberSetting);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "memberSetting/memberSettingBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberSettingExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMemberSettingExtendsInfo(){
|
||||
|
||||
return "memberSetting/memberSettingExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMemberSettingFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMemberSettingFunctionsInfo(){
|
||||
|
||||
return "memberSetting/memberSettingFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMemberSetting", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMemberSetting(MemberSetting memberSetting){
|
||||
|
||||
if(memberSetting.getId()!=null&&memberSetting.getId()!=0){
|
||||
memberSettingService.updateMemberSetting(memberSetting);
|
||||
}else{
|
||||
memberSettingService.saveMemberSetting(memberSetting);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMemberSetting", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMemberSetting(Integer id){
|
||||
|
||||
MemberSetting memberSetting=new MemberSetting();
|
||||
memberSetting.setId(id);
|
||||
memberSettingService.updateMemberSetting(memberSetting);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMemberSetting", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMemberSetting(Integer id){
|
||||
MemberSetting memberSetting=new MemberSetting();
|
||||
memberSetting.setId(id);
|
||||
memberSettingService.deleteMemberSetting(memberSetting);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
package cn.pluss.platform.controller.menuInfo;
|
||||
|
||||
import cn.jiguang.common.utils.StringUtils;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MenuInfo;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import cn.pluss.platform.menuInfo.MenuInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("menuInfo")
|
||||
public class MenuInfoController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private MenuInfoService menuInfoService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public String index() {
|
||||
return "auth/menu/menu_v2";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单
|
||||
*
|
||||
*/
|
||||
@GetMapping("/getMenuTree")
|
||||
@ResponseBody
|
||||
public Result<List<MenuInfo>> getMenuTree(MenuInfo menuInfo) {
|
||||
List<MenuInfo> menuTree = menuInfoService.getMenuTree(menuInfo);
|
||||
return ResultGenerator.genSuccessResult(menuTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色配置菜单
|
||||
*
|
||||
*/
|
||||
@GetMapping("/getRoleConfigMenuTree")
|
||||
@ResponseBody
|
||||
public Result<List<MenuInfo>> getRoleConfigMenuTree(MenuInfo menuInfo, String roleId) {
|
||||
List<MenuInfo> menuTree = menuInfoService.getRoleConfigMenuTree(menuInfo, roleId);
|
||||
return ResultGenerator.genSuccessResult(menuTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/getSubMenus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<MenuInfo> getSubMenus(String parentId) throws IOException {
|
||||
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
if (!StringUtil.isEmpty(parentId)) {
|
||||
menuInfo.setParentId(Integer.valueOf(parentId));
|
||||
}
|
||||
List<MenuInfo> menuList = menuInfoService.queryMenuInfoList(menuInfo);
|
||||
String json = JSONObject.toJSONString(menuList);
|
||||
return menuList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMenu", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public MenuInfo saveMenu(MenuInfo menu) throws IOException {
|
||||
menu.setVisible(0);
|
||||
if (!StringUtil.isEmpty(menu.getIsVisible())) {
|
||||
|
||||
if ("on".equals(menu.getIsVisible())) {
|
||||
menu.setVisible(1);
|
||||
} else {
|
||||
menu.setVisible(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String userId = request.getHeader("userId");
|
||||
UserInfo userInfo = uiService.getById(userId);
|
||||
|
||||
if (menu.getCreator() == null) {
|
||||
menu.setCreator(userInfo.getId() + "");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(menu.getId())) {
|
||||
menuInfoService.updateMenuInfo(menu);
|
||||
} else {
|
||||
Integer id = menuInfoService.saveMenuInfo(menu);
|
||||
MenuInfo menu2 = new MenuInfo();
|
||||
List<MenuInfo> menuList = menuInfoService.queryMenuInfoListOrderById(menu2);
|
||||
menu.setId(menuList.get(0).getId());
|
||||
}
|
||||
String json = JSONObject.toJSONString(menu);
|
||||
System.out.println(json);
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前用户可用的菜单
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/permitSubMenus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<MenuInfo> permitSubMenus(String parentId) throws IOException {
|
||||
Integer pid = null;
|
||||
if (!StringUtil.isEmpty(parentId)) {
|
||||
pid = Integer.valueOf(parentId);
|
||||
}
|
||||
|
||||
String userId = request.getHeader("userId");
|
||||
UserInfo userInfo = uiService.getById(userId);
|
||||
|
||||
if ("admin".equals(userInfo.getLoginName())) {
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
|
||||
if (!StringUtil.isEmpty(parentId)) {
|
||||
menuInfo.setParentId(pid);
|
||||
}
|
||||
return menuInfoService.queryMenuInfoList(menuInfo);
|
||||
}
|
||||
Map<String, Object> menuparam = new HashMap<>();
|
||||
menuparam.put("id", userInfo.getId());
|
||||
menuparam.put("parentId", pid);
|
||||
return menuInfoService.queryPermitMenuInfoById(menuparam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMenuInfoByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMenuInfoByPage(Integer currPage, Integer id) {
|
||||
|
||||
if (currPage == null) {
|
||||
currPage = 1;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MenuInfo> menuInfoList = menuInfoService.queryMenuInfoPage(map);
|
||||
Integer count = menuInfoService.queryMenuInfoPageCount(map);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("menuInfoList", menuInfoList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMenuInfoDetails", method = RequestMethod.GET)
|
||||
public String queryMenuInfoDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
menuInfo.setId(id + "");
|
||||
menuInfo = menuInfoService.queryMenuInfo(menuInfo);
|
||||
request.setAttribute("menuInfo", menuInfo);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "menuInfo/menuInfoDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMenuInfoBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMenuInfoBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
menuInfo.setId(id + "");
|
||||
menuInfo = menuInfoService.queryMenuInfo(menuInfo);
|
||||
request.setAttribute("menuInfo", menuInfo);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "menuInfo/menuInfoBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMenuInfoExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMenuInfoExtendsInfo() {
|
||||
|
||||
return "menuInfo/menuInfoExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMenuInfoFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMenuInfoFunctionsInfo() {
|
||||
|
||||
return "menuInfo/menuInfoFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMenuInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> saveMenuInfo(MenuInfo menuInfo) {
|
||||
if (StringUtils.isNotEmpty(menuInfo.getId())) {
|
||||
menuInfoService.updateMenuInfo(menuInfo);
|
||||
} else {
|
||||
menuInfoService.saveMenuInfo(menuInfo);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功!", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMenuInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMenuInfo(Integer id) {
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
menuInfo.setId(id + "");
|
||||
menuInfoService.updateMenuInfo(menuInfo);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMenuInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMenuInfo(Integer id) {
|
||||
MenuInfo menuInfo = new MenuInfo();
|
||||
menuInfo.setId(id + "");
|
||||
menuInfoService.deleteMenuInfo(menuInfo);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.pluss.platform.controller.mercOrderSplit;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.merchantOrderSplit.MerchantOrderSplitDetailService;
|
||||
import cn.pluss.platform.merchantOrderSplit.MerchantOrderSplitService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
*@description: 分账订单
|
||||
*@author: bzg
|
||||
*@time: 2021/11/26 14:27
|
||||
*/
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/mercOrderSplit")
|
||||
public class MerchantOrderSplitController extends BaseModelController<MerchantOrderSplitService, MerchantOrderSplit> {
|
||||
|
||||
|
||||
@Resource
|
||||
private MerchantOrderSplitDetailService merchantOrderSplitDetailService;
|
||||
|
||||
@GetMapping(value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
return "mercOrderSplit/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantOrderSplit>> page(Page<MerchantOrderSplit> page, MerchantOrderSplit condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false);
|
||||
orderItem.setColumn("id");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/detail/{orderNumeber}")
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "orderNumeber") String orderNumeber) {
|
||||
request.setAttribute("orderNumber",orderNumeber);
|
||||
return "mercOrderSplit/detailList";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/detailOrder/{id}")
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id",required = false) Integer id) {
|
||||
if(id != null){
|
||||
MerchantOrderSplitDetail entity = merchantOrderSplitDetailService.getById(id);
|
||||
request.setAttribute("entity",entity);
|
||||
}
|
||||
return "mercOrderSplit/detailOrder";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/detailPage")
|
||||
@ResponseBody
|
||||
public Result<Page<MerchantOrderSplitDetail>> detailPage(Page<MerchantOrderSplitDetail> page, MerchantOrderSplitDetail entity) {
|
||||
QueryWrapper<MerchantOrderSplitDetail> queryWrapper = new QueryWrapper<>(entity);
|
||||
queryWrapper.last(" order by id desc ");
|
||||
page = merchantOrderSplitDetailService.page(page, queryWrapper);
|
||||
return ResultGenerator.genSuccessResult("获取成功",page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.pluss.platform.controller.mercSplitSetting;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.entity.MerchantSplitSetting;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mercSplitSetting.MerchantSplitSettingService;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.vo.MerchantSplitSettingVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
*@description:
|
||||
*@author: bzg
|
||||
*@time: 2021/11/26 14:27
|
||||
*/
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/mercSplitSetting")
|
||||
public class MerchantSplitSettingController extends BaseModelController<MerchantSplitSettingService, MerchantSplitSetting> {
|
||||
|
||||
|
||||
@Resource
|
||||
private MerchantChannelStatusService merchantChannelStatusService;
|
||||
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@GetMapping(value = "/index/{csId}")
|
||||
public String index(HttpServletRequest request,@PathVariable("csId") Integer csId) {
|
||||
request.setAttribute("csId",csId);
|
||||
return "merchantStore/mercSplitSettingList";
|
||||
}
|
||||
|
||||
@GetMapping("selectPage")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<MerchantSplitSettingVO>> selectPage(Page<MerchantSplitSettingVO> page, MerchantSplitSettingVO vo) {
|
||||
Page<MerchantSplitSettingVO> pageData = baseService.pageData(page,vo);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{csId}/{id}", "/detail/{csId}"})
|
||||
public String detail(HttpServletRequest request,@PathVariable(value = "csId") Integer csId,
|
||||
@PathVariable(value = "id", required = false) Integer id) {
|
||||
MerchantChannelStatus channel = merchantChannelStatusService.getById(csId);
|
||||
MerchantBaseInfo merchant = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(channel.getMerchantCode());
|
||||
if (id != null) {
|
||||
MerchantSplitSetting entity = baseService.getById(id);
|
||||
request.setAttribute("entity", entity);
|
||||
}
|
||||
request.setAttribute("channel", channel);
|
||||
request.setAttribute("merchant", merchant);
|
||||
return "merchantStore/mercSplitSettingDetail";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/save")
|
||||
@Override
|
||||
public Result<String> save(@RequestBody MerchantSplitSetting setting) {
|
||||
|
||||
MerchantChannelStatus channel = merchantChannelStatusService.getByMerchantCode(setting.getDiviMerchantCode(), 4);
|
||||
MsgException.checkNull(channel,"商户编有误或该商户还未进件银盛通道!");
|
||||
setting.setDiviMerchantId(channel.getMerchantId());
|
||||
return super.save(setting);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.channel.MerchantAuditService;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.vo.AuditResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/**
|
||||
* 这里作为进件接口的入口,
|
||||
* 由于进件接口的复杂性,以及耗时操作,将进件的流程分多个接口
|
||||
*
|
||||
* @author djh
|
||||
*/
|
||||
@RequestMapping("/merAudit")
|
||||
@RestController
|
||||
public class MerchAuditController {
|
||||
|
||||
@Autowired
|
||||
private MerchantAuditService ysAuditServiceV2;
|
||||
|
||||
@Autowired
|
||||
private MerchantChannelStatusService mcsService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService mbiService;
|
||||
|
||||
@Autowired
|
||||
private ExecutorService executorService;
|
||||
|
||||
/**
|
||||
* 通用进件接口
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param channel 通道id
|
||||
* @return Result
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<Object> merchAudit(String userId, String channel) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
|
||||
if (mcs == null) {
|
||||
throw new MsgException("商户尚未发起进件");
|
||||
}
|
||||
|
||||
if (!Objects.equals(mcs.getStatus(), MerchantChannelStatus.AUDIT_STATUS_EXAMINING)
|
||||
|| !(Objects.equals(mcs.getThirdStatus(), MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING))) {
|
||||
throw new MsgException("当前状态不允许进件");
|
||||
}
|
||||
|
||||
if ("4".equals(channel)) {
|
||||
ysAuditServiceV2.merchantAudit(userId, false);
|
||||
}
|
||||
AuditResult auditResult = new AuditResult("发起进件成功, 稍后查看进件状态", null, null);
|
||||
return ResultGenerator.genSuccessResult(auditResult);
|
||||
}
|
||||
|
||||
@PostMapping("/ys/v1")
|
||||
public Result<Object> auditYs(String userId) {
|
||||
|
||||
return ResultGenerator.genSuccessResult("进件成功", null);
|
||||
}
|
||||
|
||||
// @PostMapping("/ys/v2/step1")
|
||||
// public Result<Object> auditYsV2Step1(String userId) {
|
||||
// ((YsAuditServiceImpl) ysAuditServiceV2).step1(userId);
|
||||
// AuditResult auditResult = new AuditResult("基础资料提交成功", "/merAudit/ys/v2/step2", "开始上传图片");
|
||||
// return ResultGenerator.genSuccessResult(auditResult);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/ys/v2/step2")
|
||||
// public Result<Object> auditYsV2Step2(String userId) {
|
||||
// ((YsAuditServiceImpl) ysAuditServiceV2).step2(userId);
|
||||
// AuditResult auditResult = new AuditResult("图片上传完成", "/merAudit/ys/v2/step3", "准备进件提交");
|
||||
// return ResultGenerator.genSuccessResult(auditResult);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/ys/v2/step3")
|
||||
// public Result<Object> auditYsV2Step3(String userId) {
|
||||
// ((YsAuditServiceImpl) ysAuditServiceV2).step3(userId);
|
||||
// AuditResult auditResult = new AuditResult("银盛通道进件完成", null, null);
|
||||
// return ResultGenerator.genSuccessResult(auditResult);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.channel.MerchantAuditService;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.ys.impl.v20210929.YsAuditServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author djh
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/channelStatus")
|
||||
public class MerchantChannelStatusController {
|
||||
|
||||
@Autowired
|
||||
private MerchantChannelStatusService mcsService;
|
||||
|
||||
@Autowired
|
||||
private MerchantAuditService ysAuditServiceV2;
|
||||
|
||||
/**
|
||||
* 清理进件驳回信息中的通道数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/clearRejectedChannel")
|
||||
@ResponseBody
|
||||
public Result<Object> clearRejectedChannel(String merchantCode) {
|
||||
mcsService.clearRejectedChannel(merchantCode);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送签约短信
|
||||
*
|
||||
*/
|
||||
@PostMapping("/sendSignMsg")
|
||||
@ResponseBody
|
||||
public Result<Object> sendSignMsg(String merchantCode) {
|
||||
mcsService.sendSignMsg(merchantCode);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开通D0
|
||||
*/
|
||||
@PostMapping("/openOnlinePay")
|
||||
@ResponseBody
|
||||
public Result<Object> openOnlinePay(String merchantCode) {
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(merchantCode, 4);
|
||||
((YsAuditServiceImpl) ysAuditServiceV2).openOnlinePay(mcs);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
@PostMapping("/createNewAuditData")
|
||||
@ResponseBody
|
||||
public Result<Object> createNewAuditData(String merchantCode) {
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode)
|
||||
.eq(MerchantChannelStatus::getStatus, MerchantChannelStatus.AUDIT_STATUS_EXAMINING)
|
||||
.eq(MerchantChannelStatus::getThirdStatus, MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
|
||||
MerchantChannelStatus one = mcsService.getOne(qWrapper);
|
||||
MsgException.checkNonNull(one, "当前已存在待审核信息");
|
||||
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper2 = Wrappers.lambdaQuery();
|
||||
qWrapper2.eq(MerchantChannelStatus::getMerchantCode, merchantCode)
|
||||
.eq(MerchantChannelStatus::getChannel, 1)
|
||||
.ne(MerchantChannelStatus::getStatus, 3);
|
||||
|
||||
one = mcsService.getOne(qWrapper2);
|
||||
MsgException.checkNonNull(one, "当前D1通道存在未完成进件数据");
|
||||
|
||||
qWrapper.clear();
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode)
|
||||
.ne(MerchantChannelStatus::getStatus, MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
|
||||
int auditSize = mcsService.count(qWrapper);
|
||||
|
||||
MsgException.check(auditSize >= 2, "当前已进件两个通道");
|
||||
|
||||
MerchantChannelStatus mcs = new MerchantChannelStatus();
|
||||
mcs.setMerchantCode(merchantCode);
|
||||
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
mcs.setThirdStatus(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
mcsService.save(mcs);
|
||||
|
||||
return ResultGenerator.genSuccessResult("进件申请已生成");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.dto.MercActiveDataDTO;
|
||||
import cn.pluss.platform.dto.MercOrderDataDTO;
|
||||
import cn.pluss.platform.dto.MercTradeDataDTO;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 商户交易数据统计
|
||||
*
|
||||
* @author: bzg
|
||||
* @time: 2021/12/30 17:36
|
||||
*/
|
||||
@RequestMapping("/mercData")
|
||||
@Controller
|
||||
public class MerchantCountDataController {
|
||||
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Resource
|
||||
private HttpServletRequest request;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/chain")
|
||||
public String index() {
|
||||
return "countData/mercChainList";
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<MercOrderDataDTO>> page(Page<MercOrderDataDTO> page, MercOrderDataDTO dto) {
|
||||
Page<MercOrderDataDTO> pageData = merchantBaseInfoService.pageData(page, dto);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/trade")
|
||||
public String tradeIndex() {
|
||||
return "countData/mercTradeList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户交易信息统计
|
||||
*
|
||||
* @param page:
|
||||
* @param dto:
|
||||
* @return cn.pluss.platform.api.Result<cn.pluss.platform.api.PageInfo < cn.pluss.platform.dto.MercTradeData>>
|
||||
* @date: 2021/12/31 13:43
|
||||
*/
|
||||
@GetMapping("tradePage")
|
||||
@ResponseBody
|
||||
public Result<Page<MercTradeDataDTO>> tradePage(Page<MercTradeDataDTO> page, MercTradeDataDTO dto, OrderItem orderItem) {
|
||||
if (StringUtil.isEmpty(dto.getField())) {
|
||||
dto.setField("tradeSumAmt");
|
||||
dto.setOrder("desc");
|
||||
}
|
||||
|
||||
Page<MercTradeDataDTO> pageData;
|
||||
pageData = merchantBaseInfoService.pageTradeData(page, dto);
|
||||
|
||||
return ResultGenerator.genSuccessResult(pageData);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/active")
|
||||
public String silentIndex() {
|
||||
return "countData/mercActiveList";
|
||||
}
|
||||
|
||||
@GetMapping("activePage")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<MercActiveDataDTO>> activePage(Page<MercActiveDataDTO> page, MercActiveDataDTO dto) {
|
||||
Page<MercActiveDataDTO> pageData = merchantBaseInfoService.pageActiveData(page, dto);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(pageData));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.dto.SubMerchantDTO;
|
||||
import cn.pluss.platform.subMerchant.SubMerchantService;
|
||||
import cn.pluss.platform.vo.SubMerchantVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* @author SSS
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("subMerchant")
|
||||
public class SubMerchantController {
|
||||
|
||||
@Autowired
|
||||
private SubMerchantService smService;
|
||||
|
||||
@GetMapping("/toList")
|
||||
public String toList() {
|
||||
return "subMerchant/list";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Page<SubMerchantVO>> page(SubMerchantDTO condition, OrderItem orderItem, Page<SubMerchantVO> page) {
|
||||
if (orderItem == null) {
|
||||
orderItem = OrderItem.desc("sm.createTime");
|
||||
}
|
||||
|
||||
QueryWrapper<SubMerchantDTO> qWrapper = Wrappers.query();
|
||||
qWrapper.likeRight(StringUtils.isNotEmpty(condition.getMerchantCode()), "mbi.merchantCode", condition.getMerchantCode());
|
||||
qWrapper.eq(StringUtils.isNotEmpty(condition.getUserId()), "mbi.userId", condition.getUserId());
|
||||
qWrapper.likeRight(StringUtils.isNotEmpty(condition.getMerchantId()), "mcs.merchantId", condition.getMerchantId());
|
||||
qWrapper.likeRight(StringUtils.isNotEmpty(condition.getLoginName()), "ui.loginName", condition.getLoginName());
|
||||
qWrapper.orderBy(true, orderItem.isAsc(), orderItem.getColumn());
|
||||
page = smService.pageVO(page, qWrapper);
|
||||
|
||||
return ResultGenerator.genSuccessResult(page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.pluss.platform.controller.merchant.move;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantMoveRecords;
|
||||
import cn.pluss.platform.merchant.move.MerchantMoveRecordsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户动态码生成记录 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantMoveRecords")
|
||||
public class MerchantMoveRecordsController extends BaseModelController<MerchantMoveRecordsService, MerchantMoveRecords> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantMoveRecords/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantMoveRecords>> page(Page<MerchantMoveRecords> page, MerchantMoveRecords condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.pluss.platform.controller.merchant.move;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantMoveSetting;
|
||||
import cn.pluss.platform.merchant.move.MerchantMoveSettingService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户动态码基本配置 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantMoveSetting")
|
||||
public class MerchantMoveSettingController extends BaseModelController<MerchantMoveSettingService, MerchantMoveSetting> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantMoveSetting/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
MerchantMoveSetting setting = new MerchantMoveSetting().setId(id);
|
||||
setting = baseService.getOne(new QueryWrapper<>(setting));
|
||||
request.setAttribute("entity", setting);
|
||||
}
|
||||
return "merchantMoveSetting/detail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantMoveSetting>> page(Page<MerchantMoveSetting> page, MerchantMoveSetting condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.pluss.platform.controller.merchant.rate;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.merchant.MerchantRateNewRecordService;
|
||||
import cn.pluss.platform.merchant.MerchantRateNewService;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.val;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantRate")
|
||||
public class MerchantRateController {
|
||||
|
||||
@Autowired
|
||||
private MerchantRateNewService merchantRateNewService;
|
||||
|
||||
@Autowired
|
||||
private MerchantRateNewRecordService rateNewRecordService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public String list() {
|
||||
return "/merchantRate/rate_list";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Page<Map<String, Object>>> page(Page<Object> page, @RequestParam Map<String, Object> condition) {
|
||||
page.orders().add(new OrderItem().setAsc(false).setColumn("mrnr.createTime"));
|
||||
page.orders().add(new OrderItem().setAsc(false).setColumn("mcs.updateTime"));
|
||||
val result = merchantRateNewService.pageData(page, condition);
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
@PostMapping("/pass")
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result<Object> pass(String merchantId) {
|
||||
merchantRateNewService.passD0(merchantId);
|
||||
return ResultGenerator.genSuccessResult("D0费率修改已通过", null);
|
||||
}
|
||||
|
||||
@PostMapping("/batchPass")
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result<Object> batchPass(@RequestParam("merchantId[]") String[] merchantIds) {
|
||||
// System.out.println(merchantIds);
|
||||
merchantRateNewService.passD0(Arrays.asList(merchantIds));
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.pluss.platform.controller.merchantAccount;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.dto.AccountDTO;
|
||||
import cn.pluss.platform.entity.Account;
|
||||
import cn.pluss.platform.entity.BankCard;
|
||||
import cn.pluss.platform.merchant.AccountService;
|
||||
import cn.pluss.platform.vo.AccountVO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author djh
|
||||
*
|
||||
* 商户结算信息修改表
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("merchantAccount")
|
||||
public class MerchantAccountController {
|
||||
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
/**
|
||||
* 商户结算信息修改中的列表
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "merchantAccount/edit_list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页信息
|
||||
* @param page 分页信息
|
||||
* @param entity 结算信息
|
||||
* @param orderItem 排序信息
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Page<AccountDTO>> page(Page<AccountDTO> page, Account entity, OrderItem orderItem) {
|
||||
AccountVO account = new AccountVO();
|
||||
BankCard bankCard = new BankCard();
|
||||
bankCard.setUserId("12345");
|
||||
bankCard.setBankCardNo("12345");
|
||||
bankCard.setBankName("建设银行");
|
||||
bankCard.setBranchName("建设银行湖北分行");
|
||||
account.setBankCard(bankCard);
|
||||
|
||||
BankCard newBankCard = new BankCard();
|
||||
newBankCard.setUserId("12345");
|
||||
newBankCard.setBankCardNo("12345");
|
||||
newBankCard.setBankName("招商银行");
|
||||
newBankCard.setBranchName("招商银行湖北分行");
|
||||
newBankCard.setImgUrl("https://wwsdsd//sd");
|
||||
account.setBak((JSONObject) JSONObject.toJSON(newBankCard));
|
||||
account.setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
account.setMerchantId("87551231131");
|
||||
|
||||
page.setCurrent(1);
|
||||
page.setSize(10);
|
||||
page.setTotal(1);
|
||||
page.setRecords(new ArrayList<AccountDTO>() {{ add(account); }});
|
||||
|
||||
return ResultGenerator.genSuccessResult(page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantAddress;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantAddress;
|
||||
import cn.pluss.platform.merchantAddress.MerchantAddressService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantAddress")
|
||||
public class MerchantAddressController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantAddressService merchantAddressService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantAddress/merchantAddressList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantAddressByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantAddressByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantAddress> merchantAddressList=merchantAddressService.queryMerchantAddressPage(map);
|
||||
Integer count=merchantAddressService.queryMerchantAddressPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantAddressList", merchantAddressList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantAddressDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantAddressDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantAddress merchantAddress=new MerchantAddress();
|
||||
merchantAddress.setId(id);
|
||||
merchantAddress=merchantAddressService.queryMerchantAddress(merchantAddress);
|
||||
request.setAttribute("merchantAddress", merchantAddress);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantAddress/merchantAddressDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantAddressBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantAddressBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantAddress merchantAddress=new MerchantAddress();
|
||||
merchantAddress.setId(id);
|
||||
merchantAddress=merchantAddressService.queryMerchantAddress(merchantAddress);
|
||||
request.setAttribute("merchantAddress", merchantAddress);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantAddress/merchantAddressBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantAddressExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantAddressExtendsInfo(){
|
||||
|
||||
return "merchantAddress/merchantAddressExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantAddressFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantAddressFunctionsInfo(){
|
||||
|
||||
return "merchantAddress/merchantAddressFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantAddress", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantAddress(MerchantAddress merchantAddress){
|
||||
|
||||
if(merchantAddress.getId()!=null&&merchantAddress.getId()!=0){
|
||||
merchantAddressService.updateMerchantAddress(merchantAddress);
|
||||
}else{
|
||||
merchantAddressService.saveMerchantAddress(merchantAddress);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantAddress", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantAddress(Integer id){
|
||||
|
||||
MerchantAddress merchantAddress=new MerchantAddress();
|
||||
merchantAddress.setId(id);
|
||||
merchantAddressService.updateMerchantAddress(merchantAddress);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantAddress", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantAddress(Integer id){
|
||||
MerchantAddress merchantAddress=new MerchantAddress();
|
||||
merchantAddress.setId(id);
|
||||
merchantAddressService.deleteMerchantAddress(merchantAddress);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.pluss.platform.controller.merchantBaseInfo;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.vo.MerchantBaseNewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantBaseInfo")
|
||||
public class MerchantBaseInfoController extends BaseNoModelController {
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService mbiService;
|
||||
|
||||
@Autowired
|
||||
private MerchantChannelStatusService chsService;
|
||||
|
||||
@GetMapping("/{userId}")
|
||||
@ResponseBody
|
||||
public Result<Object> detail(@PathVariable("userId") String userId) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
return ResultGenerator.genSuccessResult(mbi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "merchantBaseInfo/merchantBaseInfoList";
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/queryMerchantBaseInfoPage")
|
||||
@ResponseBody
|
||||
public Map<String, Object> listMerchantBaseInfoPage(@RequestParam(defaultValue = "1") Integer currPage, Integer size,
|
||||
String column, Boolean asc, MerchantBaseNewVO merchantBaseNewVO) {
|
||||
return mbiService.listMerchantBaseInfoPage(currPage, size, column, asc, merchantBaseNewVO);
|
||||
}
|
||||
|
||||
@RequestMapping("/updateInfo")
|
||||
@ResponseBody
|
||||
public Result<Object> updateInfo(MerchantBaseInfo baseInfo) {
|
||||
mbiService.updateById(baseInfo);
|
||||
return ResultGenerator.genSuccessResult("操作成功",null);
|
||||
}
|
||||
|
||||
@RequestMapping("/updateSettleType")
|
||||
@ResponseBody
|
||||
public Result<Object> updateSettleType(MerchantChannelStatus channel) {
|
||||
chsService.updateById(channel);
|
||||
return ResultGenerator.genSuccessResult("操作成功",null);
|
||||
}
|
||||
|
||||
@RequestMapping("/createKey")
|
||||
@ResponseBody
|
||||
public Result<Object> createKey() {
|
||||
String uuid = UUID.randomUUID().toString().replace("-","");
|
||||
return ResultGenerator.genSuccessResult("操作成功",uuid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.pluss.platform.controller.merchantComplaintRecord;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantComplaintRecord;
|
||||
import cn.pluss.platform.merchantComplaintRecord.MerchantComplaintRecordService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户投诉控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2021-09-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantComplaintRecord")
|
||||
public class MerchantComplaintRecordController extends BaseModelController<MerchantComplaintRecordService, MerchantComplaintRecord> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantComplaintRecord/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:分页查询
|
||||
* @date: 2021/9/15 13:39
|
||||
* @param page:
|
||||
* @param record:
|
||||
* @return cn.pluss.platform.api.Result<cn.pluss.platform.api.PageInfo<cn.pluss.platform.entity.MerchantComplaintRecord>>
|
||||
*/
|
||||
@GetMapping("pageData")
|
||||
@ResponseBody
|
||||
public Result<Page<MerchantComplaintRecord>> pageData(Page<MerchantComplaintRecord> page, MerchantComplaintRecord record) {
|
||||
Page<MerchantComplaintRecord> pageData = baseService.pageData(page,record);
|
||||
return ResultGenerator.genSuccessResult(pageData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
package cn.pluss.platform.controller.merchantDevice;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantDevice;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantDevice.MerchantDeviceService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.vo.DeviceVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantDevice")
|
||||
public class MerchantDeviceController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantDeviceService merchantDeviceService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "merchantDevice/merchantDeviceList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantDeviceByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMerchantDeviceByPage(@RequestParam(defaultValue = "1") Integer currPage, MerchantDevice merchantDevice) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
if (StringUtil.isNotEmpty(merchantDevice.getName())) {
|
||||
map.put("name", merchantDevice.getName());
|
||||
}
|
||||
Boolean bol = verifyUserRole();
|
||||
if (bol) {
|
||||
result.put("admin", "admin");
|
||||
} else {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getUserType())) {
|
||||
result.put("userType", shiroUser.getUserType());
|
||||
}
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantDevice.getMerchantName())) {
|
||||
map.put("merchantName", merchantDevice.getMerchantName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantDevice.getAlias())) {
|
||||
map.put("alias", merchantDevice.getAlias());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantDevice.getUserId())) {
|
||||
map.put("userId", merchantDevice.getUserId());
|
||||
}
|
||||
List<DeviceVO> merchantDeviceList = merchantDeviceService.showMerchantDevicePage(map);
|
||||
Integer count = merchantDeviceService.showMerchantDevicePageCount(map);
|
||||
result.put("merchantDeviceList", merchantDeviceList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantDeviceDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantDeviceDetails(HttpServletRequest request, Long id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantDevice merchantDevice = new MerchantDevice();
|
||||
merchantDevice.setId(id);
|
||||
merchantDevice = merchantDeviceService.getOne(new QueryWrapper<>(merchantDevice));
|
||||
request.setAttribute("merchantDevice", merchantDevice);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantDevice/merchantDeviceDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantDeviceBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantDeviceBaseInfo(HttpServletRequest request, Long id, Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
MerchantDevice merchantDevice = new MerchantDevice();
|
||||
merchantDevice.setId(id);
|
||||
merchantDevice = merchantDeviceService.getOne(new QueryWrapper<>(merchantDevice));
|
||||
request.setAttribute("merchantDevice", merchantDevice);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
getRole();
|
||||
getPermission();
|
||||
getMerchant();
|
||||
return "merchantDevice/merchantDeviceBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantDeviceExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantDeviceExtendsInfo() {
|
||||
return "merchantDevice/merchantDeviceExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantDeviceFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantDeviceFunctionsInfo() {
|
||||
return "merchantDevice/merchantDeviceFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantDevice", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMerchantDevice(MerchantDevice merchantDevice) {
|
||||
|
||||
if (merchantDevice.getId() != null && merchantDevice.getId() != 0) {
|
||||
merchantDeviceService.updateById(merchantDevice);
|
||||
} else {
|
||||
Boolean bol = verifyUserRole();
|
||||
if (!bol) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser)) {
|
||||
merchantDevice.setMerchantCode(shiroUser.getMerchantCode());
|
||||
}
|
||||
}
|
||||
merchantDeviceService.save(merchantDevice);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantDevice", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMerchantDevice(Long id) {
|
||||
|
||||
MerchantDevice merchantDevice = new MerchantDevice();
|
||||
merchantDevice.setId(id);
|
||||
merchantDeviceService.updateById(merchantDevice);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantDevice", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMerchantDevice(Long id) {
|
||||
MerchantDevice merchantDevice = new MerchantDevice();
|
||||
merchantDevice.setId(id);
|
||||
merchantDeviceService.removeById(id);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员权限标识
|
||||
*/
|
||||
public void getRole() {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
|
||||
/**
|
||||
* 不是管理员 获取的权限
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
request.setAttribute("userType", user.getUserType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package cn.pluss.platform.controller.merchantGuide;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantGuide;
|
||||
import cn.pluss.platform.entity.MerchantQrcode;
|
||||
import cn.pluss.platform.merchantGuide.MerchantGuideService;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-10-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantGuide")
|
||||
public class MerchantGuideController extends BaseModelController<MerchantGuideService, MerchantGuide> {
|
||||
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantGuide/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
MerchantGuide qrcode = new MerchantGuide().setId(id);
|
||||
qrcode = baseService.getOne(new QueryWrapper<>(qrcode));
|
||||
request.setAttribute("entity", qrcode);
|
||||
}
|
||||
return "merchantGuide/detail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantGuide>> page(Page<MerchantGuide> page, MerchantGuide condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false).setColumn("id");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/save")
|
||||
@Override
|
||||
public Result<String> save(@RequestBody MerchantGuide entity) {
|
||||
if(StringUtil.isEmpty(entity.getMerchantCode())){
|
||||
return ResultGenerator.genFailResult("商户编号不能为空", null);
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getMerchantName())){
|
||||
return ResultGenerator.genFailResult("商户名称不能为空", null);
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getName())){
|
||||
return ResultGenerator.genFailResult("引导话术不能为空", null);
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getStatus())){
|
||||
return ResultGenerator.genFailResult("状态不能为空", null);
|
||||
}
|
||||
if(!"0".equals(entity.getStatus()) && StringUtil.isNotEmpty(entity.getId())){
|
||||
QueryWrapper<MerchantGuide> queryWrapper = new QueryWrapper<MerchantGuide>().eq("merchantCode",entity.getMerchantCode())
|
||||
.eq("status",entity.getStatus())
|
||||
.ne("id",entity.getId());
|
||||
List<MerchantGuide> list = this.baseService.list(queryWrapper);
|
||||
if(list.size() != 0){
|
||||
return ResultGenerator.genFailResult("只允许有一条选中的话术!", null);
|
||||
}
|
||||
}
|
||||
return super.save(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package cn.pluss.platform.controller.merchantImage;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantImage;
|
||||
import cn.pluss.platform.merchantImage.MerchantImageService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantImage")
|
||||
public class MerchantImageController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private MerchantImageService merchantImageService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantImage/merchantImageList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantImageByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMerchantImageByPage(Integer currPage, Integer id) {
|
||||
|
||||
if (currPage == null) {
|
||||
currPage = 1;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantImage> merchantImageList = merchantImageService.queryMerchantImagePage(map);
|
||||
Integer count = merchantImageService.queryMerchantImagePageCount(map);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("merchantImageList", merchantImageList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantImageDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantImageDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantImage merchantImage = new MerchantImage();
|
||||
merchantImage.setId(id);
|
||||
merchantImage = merchantImageService.queryMerchantImage(merchantImage);
|
||||
request.setAttribute("merchantImage", merchantImage);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantImage/merchantImageDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantImageBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantImageBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantImage merchantImage = new MerchantImage();
|
||||
merchantImage.setId(id);
|
||||
merchantImage = merchantImageService.queryMerchantImage(merchantImage);
|
||||
request.setAttribute("merchantImage", merchantImage);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantImage/merchantImageBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantImageExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantImageExtendsInfo() {
|
||||
|
||||
return "merchantImage/merchantImageExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantImageFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantImageFunctionsInfo() {
|
||||
|
||||
return "merchantImage/merchantImageFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantImage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMerchantImage(MerchantImage merchantImage) {
|
||||
|
||||
if (merchantImage.getId() != null && merchantImage.getId() != 0) {
|
||||
merchantImageService.updateById(merchantImage);
|
||||
} else {
|
||||
merchantImageService.save(merchantImage);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantImage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMerchantImage(Integer id) {
|
||||
merchantImageService.removeById(id);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantIncome;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantIncome;
|
||||
import cn.pluss.platform.merchantIncome.MerchantIncomeService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantIncome")
|
||||
public class MerchantIncomeController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantIncomeService merchantIncomeService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantIncome/merchantIncomeList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantIncomeByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantIncomeByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantIncome> merchantIncomeList=merchantIncomeService.queryMerchantIncomePage(map);
|
||||
Integer count=merchantIncomeService.queryMerchantIncomePageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantIncomeList", merchantIncomeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantIncomeDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantIncomeDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantIncome merchantIncome=new MerchantIncome();
|
||||
merchantIncome.setId(id);
|
||||
merchantIncome=merchantIncomeService.queryMerchantIncome(merchantIncome);
|
||||
request.setAttribute("merchantIncome", merchantIncome);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantIncome/merchantIncomeDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantIncomeBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantIncomeBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantIncome merchantIncome=new MerchantIncome();
|
||||
merchantIncome.setId(id);
|
||||
merchantIncome=merchantIncomeService.queryMerchantIncome(merchantIncome);
|
||||
request.setAttribute("merchantIncome", merchantIncome);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantIncome/merchantIncomeBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantIncomeExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantIncomeExtendsInfo(){
|
||||
|
||||
return "merchantIncome/merchantIncomeExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantIncomeFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantIncomeFunctionsInfo(){
|
||||
|
||||
return "merchantIncome/merchantIncomeFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantIncome", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantIncome(MerchantIncome merchantIncome){
|
||||
|
||||
if(merchantIncome.getId()!=null&&merchantIncome.getId()!=0){
|
||||
merchantIncomeService.updateMerchantIncome(merchantIncome);
|
||||
}else{
|
||||
merchantIncomeService.saveMerchantIncome(merchantIncome);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantIncome", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantIncome(Integer id){
|
||||
|
||||
MerchantIncome merchantIncome=new MerchantIncome();
|
||||
merchantIncome.setId(id);
|
||||
merchantIncomeService.updateMerchantIncome(merchantIncome);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantIncome", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantIncome(Integer id){
|
||||
MerchantIncome merchantIncome=new MerchantIncome();
|
||||
merchantIncome.setId(id);
|
||||
merchantIncomeService.deleteMerchantIncome(merchantIncome);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.pluss.platform.controller.merchantMarket;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantMarket;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.merchantMarket.MerchantMarketService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户奖励金记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantMarket")
|
||||
public class MerchantMarketController extends BaseModelController<MerchantMarketService, MerchantMarket> {
|
||||
|
||||
@Autowired
|
||||
private UserAppService userAppService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantMarket/list";
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
MerchantMarket market = new MerchantMarket().setId(id);
|
||||
market = baseService.getOne(new QueryWrapper<>(market));
|
||||
request.setAttribute("entity", market);
|
||||
}
|
||||
return "merchantMarket/detail";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantMarket>> page(Page<MerchantMarket> page, MerchantMarket condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("createTime");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/save")
|
||||
@Override
|
||||
public Result<String> save(@RequestBody MerchantMarket entity) {
|
||||
if(StringUtil.isEmpty(entity.getUserId())){
|
||||
return ResultGenerator.genFailResult("用户ID不能为空");
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getSource())){
|
||||
return ResultGenerator.genFailResult("来源不能为空");
|
||||
}
|
||||
if(StringUtil.isEmpty(entity.getMarketAmt())){
|
||||
return ResultGenerator.genFailResult("积分不能为空");
|
||||
}
|
||||
QueryWrapper<UserApp> queryWrapper = new QueryWrapper<UserApp>().
|
||||
eq("userId",entity.getUserId());
|
||||
UserApp app = userAppService.getOne(queryWrapper);
|
||||
if(app == null){
|
||||
return ResultGenerator.genFailResult("请输入正确的用户ID");
|
||||
}
|
||||
if(StringUtil.isEmpty(app.getMerchantCode())){
|
||||
return ResultGenerator.genFailResult("当前用户不支持增加积分");
|
||||
}
|
||||
entity.setUserName(app.getUserName());
|
||||
entity.setCreateTime(new Date());
|
||||
return super.save(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
package cn.pluss.platform.controller.merchantMenber;
|
||||
|
||||
import cn.jiguang.common.utils.StringUtils;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantMenber.MerchantMenberService;
|
||||
import cn.pluss.platform.merchantMenberComsume.MerchantMenberComsumeService;
|
||||
import cn.pluss.platform.merchantMenberRecharge.MerchantMenberRechargeService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantMenber")
|
||||
public class MerchantMenberController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Resource
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberService merchantMenberService;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberRechargeService merchantMenberRechargeService;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberComsumeService merchantMenberComsumeService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
public String index() {
|
||||
return "merchantMenber/merchantMenberList";
|
||||
}
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/market")
|
||||
public String market() {
|
||||
return "merchantMenber/memberMarket";
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMerchantMenberByPage(@RequestParam(defaultValue = "1") Integer currPage,MerchantMenber merchantMenber) {
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
// 是否是管理员
|
||||
Boolean bol = verifyUserRole();
|
||||
if(StringUtil.isNotEmpty(merchantMenber.getMemberName())) {
|
||||
map.put("nickName", merchantMenber.getMemberName());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(merchantMenber.getPhone())) {
|
||||
map.put("phone", merchantMenber.getPhone());
|
||||
}
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
// 如果不是管理员通过当前用户的merchantCode进行筛选数据
|
||||
if (!bol) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
//通过进行权限控制
|
||||
if(StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
result.put("merchant", "merchant");
|
||||
}
|
||||
}else {
|
||||
//通过admin是不是管理员进行操作权限控制
|
||||
result.put("admin", "admin");
|
||||
}
|
||||
if(StringUtil.isNotEmpty(merchantMenber.getId())) {
|
||||
map.put("id",merchantMenber.getId());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(merchantMenber.getUserId())) {
|
||||
map.put("userId",merchantMenber.getUserId());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(merchantMenber.getMemberName())) {
|
||||
map.put("memberName",merchantMenber.getMemberName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(merchantMenber.getAlias())) {
|
||||
map.put("alias",merchantMenber.getAlias());
|
||||
}
|
||||
List<MerchantMenber> merchantMenberList = null ;
|
||||
Integer count=0;
|
||||
//管理员查看的数据
|
||||
if (bol){
|
||||
merchantMenberList = merchantMenberService.manageQueryMerchantMenberPage(map);
|
||||
count = merchantMenberService.manageQueryMerchantMenberPageCount(map);
|
||||
}else {
|
||||
merchantMenberList = merchantMenberService.manageQueryMerchantNoMenberPage(map);
|
||||
count = merchantMenberService.manageQueryMerchantNoMenberPageCount(map);
|
||||
}
|
||||
result.put("merchantMenberList", merchantMenberList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
merchantMenber.setId(id);
|
||||
merchantMenber = merchantMenberService.queryMerchantMenber(merchantMenber);
|
||||
request.setAttribute("merchantMenber", merchantMenber);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenber/merchantMenberDetails";
|
||||
}
|
||||
//其它用户查看详情
|
||||
@RequestMapping(value="/otherMerchantMenberDetails",method = RequestMethod.GET)
|
||||
public String otherMerchantMenberDetails(Integer id,HttpServletRequest request,Integer pageIndex) {
|
||||
if (id != null && id != 0) {
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
merchantMenber.setId(id);
|
||||
merchantMenber = merchantMenberService.queryMerchantMenber(merchantMenber);
|
||||
request.setAttribute("merchantMenber", merchantMenber);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenber/otherMerchantMenberDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
if (id != null && id != 0) {
|
||||
merchantMenber.setId(id);
|
||||
merchantMenber = merchantMenberService.queryMerchantMenber(merchantMenber);
|
||||
request.setAttribute("merchantMenber", merchantMenber);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenber/merchantMenberBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberExtendsInfo() {
|
||||
return "merchantMenber/merchantMenberExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberFunctionsInfo() {
|
||||
|
||||
return "merchantMenber/merchantMenberFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantMenber", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMerchantMenber(MerchantMenber merchantMenber) {
|
||||
//通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo=new MerchantBaseInfo();
|
||||
merchantBaseInfo.setMerchantCode(merchantMenber.getMerchantCode());
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if(merchantBaseInfoList!=null&&merchantBaseInfoList.size()>0) {
|
||||
merchantMenber.setMerchantName(merchantBaseInfoList.get(0).getMerchantName());
|
||||
}
|
||||
//通过StoreId查门店信息
|
||||
MerchantStore merchantStore=new MerchantStore();
|
||||
merchantStore.setStoreId(merchantMenber.getStoreId());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
if(merchantStoreList!=null&&merchantStoreList.size()>0) {
|
||||
merchantMenber.setStoreName(merchantStoreList.get(0).getStoreName());
|
||||
}
|
||||
if (merchantMenber.getId() != null && merchantMenber.getId() != 0) {
|
||||
merchantMenberService.updateMerchantMenber(merchantMenber);
|
||||
} else {
|
||||
//生成会员编码
|
||||
merchantMenber.setMemberCode(StringUtil.getBillno());
|
||||
if(StringUtil.isEmpty(merchantMenber.getProfitMoney())) {
|
||||
merchantMenber.setProfitMoney(0d);
|
||||
}
|
||||
if(StringUtil.isEmpty(merchantMenber.getComsumeMoney())) {
|
||||
merchantMenber.setComsumeMoney(0d);
|
||||
}
|
||||
merchantMenberService.saveMerchantMenber(merchantMenber);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantMenber", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMerchantMenber(Integer id) {
|
||||
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
merchantMenber.setId(id);
|
||||
merchantMenberService.updateMerchantMenber(merchantMenber);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantMenber", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMerchantMenber(Integer id) {
|
||||
MerchantMenber merchantMenber = new MerchantMenber();
|
||||
merchantMenber.setId(id);
|
||||
merchantMenberService.deleteMerchantMenber(merchantMenber);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 到充值
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/showRechargeDetails", method = RequestMethod.GET)
|
||||
public String showRechargeDetails() {
|
||||
String memberCode = request.getParameter("memberCode");
|
||||
request.setAttribute("memberCode", memberCode);
|
||||
return "merchantMenber/showRechargeDetails";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/rechargeDetails", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> rechargeDetails(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
MerchantMenberRecharge menberRecharge) {
|
||||
Boolean bol = verifyUserRole();
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
String memberCode = request.getParameter("memberCode");
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("memberCode", memberCode);
|
||||
if (StringUtil.isNotEmpty(menberRecharge.getNickName())) {
|
||||
map.put("nickName", menberRecharge.getNickName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(menberRecharge.getPhone())) {
|
||||
map.put("phone", menberRecharge.getPhone());
|
||||
}
|
||||
//如果不是管理员
|
||||
if (!bol) {
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberRecharge.getId())) {
|
||||
map.put("id",menberRecharge.getId());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberRecharge.getMerchantName())) {
|
||||
map.put("merchantName",menberRecharge.getMerchantName() );
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberRecharge.getOrderNumber())) {
|
||||
map.put("orderNumber",menberRecharge.getOrderNumber());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberRecharge.getAlias())) {
|
||||
map.put("alias", menberRecharge.getAlias());
|
||||
}
|
||||
List<MerchantMenberRecharge> merchantMenberRechargeList = merchantMenberRechargeService
|
||||
.queryMerchantMenberRechargePage(map);
|
||||
Integer count = merchantMenberRechargeService.queryMerchantMenberRechargePageCount(map);
|
||||
result.put("merchantMenberRechargeList", merchantMenberRechargeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 到消费
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/showConsumptionDetails", method = RequestMethod.GET)
|
||||
public String showConsumptionDetails() {
|
||||
String memberCode = request.getParameter("memberCode");
|
||||
request.setAttribute("memberCode", memberCode);
|
||||
return "merchantMenber/showConsumptionDetails";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/consumptionDetails", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> consumptionDetails(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
MerchantMenberComsume menberComsume) {
|
||||
Boolean bol = verifyUserRole();
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
String memberCode = request.getParameter("memberCode");
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("memberCode", memberCode);
|
||||
if (StringUtil.isNotEmpty(menberComsume.getNickName())) {
|
||||
map.put("nickName", menberComsume.getNickName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(menberComsume.getPhone())) {
|
||||
map.put("phone", menberComsume.getPhone());
|
||||
}
|
||||
//如果不是管理员
|
||||
if (!bol) {
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberComsume.getOrderNumber())) {
|
||||
map.put("orderNumber",menberComsume.getOrderNumber());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberComsume.getMerchantName())) {
|
||||
map.put("merchantName",menberComsume.getMerchantName());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(menberComsume.getAlias())) {
|
||||
map.put("alias",menberComsume.getAlias());
|
||||
}
|
||||
List<MerchantMenberComsume> merchantMenberComsumeList = merchantMenberComsumeService
|
||||
.queryMerchantMenberComsumePage(map);
|
||||
Integer count = merchantMenberComsumeService.queryMerchantMenberComsumePageCount(map);
|
||||
result.put("merchantMenberComsumeList", merchantMenberComsumeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是管理员
|
||||
*/
|
||||
public void getRole() {
|
||||
Boolean bol = verifyUserRole();
|
||||
if(bol) {
|
||||
request.setAttribute("admin", "admin");
|
||||
}
|
||||
}
|
||||
/**
|
||||
*不是管理员 获取的权限 是商户
|
||||
*/
|
||||
public void getPermission() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if(StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
request.setAttribute("merchant", "merchant");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取所有商户信息
|
||||
*/
|
||||
public void getMerchant() {
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
}
|
||||
/**
|
||||
* 根据选择的商户code获取下面的门店
|
||||
*/
|
||||
@RequestMapping(value="/getStoreByMerchantCode",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> getStoreByMerchantCode(MerchantStore merchantStore) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
result.put("merchantStoreList", merchantStoreList);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantMenberComsume;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantMenberComsume;
|
||||
import cn.pluss.platform.merchantMenberComsume.MerchantMenberComsumeService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantMenberComsume")
|
||||
public class MerchantMenberComsumeController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberComsumeService merchantMenberComsumeService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantMenberComsume/merchantMenberComsumeList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberComsumeByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantMenberComsumeByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantMenberComsume> merchantMenberComsumeList=merchantMenberComsumeService.queryMerchantMenberComsumePage(map);
|
||||
Integer count=merchantMenberComsumeService.queryMerchantMenberComsumePageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantMenberComsumeList", merchantMenberComsumeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberComsumeDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberComsumeDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantMenberComsume merchantMenberComsume=new MerchantMenberComsume();
|
||||
merchantMenberComsume.setId(id);
|
||||
merchantMenberComsume=merchantMenberComsumeService.queryMerchantMenberComsume(merchantMenberComsume);
|
||||
request.setAttribute("merchantMenberComsume", merchantMenberComsume);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenberComsume/merchantMenberComsumeDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberComsumeBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberComsumeBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantMenberComsume merchantMenberComsume=new MerchantMenberComsume();
|
||||
merchantMenberComsume.setId(id);
|
||||
merchantMenberComsume=merchantMenberComsumeService.queryMerchantMenberComsume(merchantMenberComsume);
|
||||
request.setAttribute("merchantMenberComsume", merchantMenberComsume);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenberComsume/merchantMenberComsumeBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberComsumeExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberComsumeExtendsInfo(){
|
||||
|
||||
return "merchantMenberComsume/merchantMenberComsumeExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberComsumeFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberComsumeFunctionsInfo(){
|
||||
|
||||
return "merchantMenberComsume/merchantMenberComsumeFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantMenberComsume", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantMenberComsume(MerchantMenberComsume merchantMenberComsume){
|
||||
|
||||
if(merchantMenberComsume.getId()!=null&&merchantMenberComsume.getId()!=0){
|
||||
merchantMenberComsumeService.updateMerchantMenberComsume(merchantMenberComsume);
|
||||
}else{
|
||||
merchantMenberComsumeService.saveMerchantMenberComsume(merchantMenberComsume);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantMenberComsume", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantMenberComsume(Integer id){
|
||||
|
||||
MerchantMenberComsume merchantMenberComsume=new MerchantMenberComsume();
|
||||
merchantMenberComsume.setId(id);
|
||||
merchantMenberComsumeService.updateMerchantMenberComsume(merchantMenberComsume);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantMenberComsume", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantMenberComsume(Integer id){
|
||||
MerchantMenberComsume merchantMenberComsume=new MerchantMenberComsume();
|
||||
merchantMenberComsume.setId(id);
|
||||
merchantMenberComsumeService.deleteMerchantMenberComsume(merchantMenberComsume);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantMenberRecharge;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantMenberRecharge;
|
||||
import cn.pluss.platform.merchantMenberRecharge.MerchantMenberRechargeService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantMenberRecharge")
|
||||
public class MerchantMenberRechargeController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantMenberRechargeService merchantMenberRechargeService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantMenberRecharge/merchantMenberRechargeList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberRechargeByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantMenberRechargeByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantMenberRecharge> merchantMenberRechargeList=merchantMenberRechargeService.queryMerchantMenberRechargePage(map);
|
||||
Integer count=merchantMenberRechargeService.queryMerchantMenberRechargePageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantMenberRechargeList", merchantMenberRechargeList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberRechargeDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberRechargeDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantMenberRecharge merchantMenberRecharge=new MerchantMenberRecharge();
|
||||
merchantMenberRecharge.setId(id);
|
||||
merchantMenberRecharge=merchantMenberRechargeService.queryMerchantMenberRecharge(merchantMenberRecharge);
|
||||
request.setAttribute("merchantMenberRecharge", merchantMenberRecharge);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenberRecharge/merchantMenberRechargeDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberRechargeBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberRechargeBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantMenberRecharge merchantMenberRecharge=new MerchantMenberRecharge();
|
||||
merchantMenberRecharge.setId(id);
|
||||
merchantMenberRecharge=merchantMenberRechargeService.queryMerchantMenberRecharge(merchantMenberRecharge);
|
||||
request.setAttribute("merchantMenberRecharge", merchantMenberRecharge);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantMenberRecharge/merchantMenberRechargeBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberRechargeExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberRechargeExtendsInfo(){
|
||||
|
||||
return "merchantMenberRecharge/merchantMenberRechargeExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantMenberRechargeFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantMenberRechargeFunctionsInfo(){
|
||||
|
||||
return "merchantMenberRecharge/merchantMenberRechargeFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantMenberRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantMenberRecharge(MerchantMenberRecharge merchantMenberRecharge){
|
||||
|
||||
if(merchantMenberRecharge.getId()!=null&&merchantMenberRecharge.getId()!=0){
|
||||
merchantMenberRechargeService.updateMerchantMenberRecharge(merchantMenberRecharge);
|
||||
}else{
|
||||
merchantMenberRechargeService.saveMerchantMenberRecharge(merchantMenberRecharge);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantMenberRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantMenberRecharge(Integer id){
|
||||
|
||||
MerchantMenberRecharge merchantMenberRecharge=new MerchantMenberRecharge();
|
||||
merchantMenberRecharge.setId(id);
|
||||
merchantMenberRechargeService.updateMerchantMenberRecharge(merchantMenberRecharge);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantMenberRecharge", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantMenberRecharge(Integer id){
|
||||
MerchantMenberRecharge merchantMenberRecharge=new MerchantMenberRecharge();
|
||||
merchantMenberRecharge.setId(id);
|
||||
merchantMenberRechargeService.deleteMerchantMenberRecharge(merchantMenberRecharge);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,797 @@
|
||||
package cn.pluss.platform.controller.merchantOrder;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.dto.SummaryOfWaterDTO;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.MerchantChannel;
|
||||
import cn.pluss.platform.entity.MerchantOrder;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchantChannel.MerchantChannelService;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.refundOrder.MerchantRefundOrderService;
|
||||
import cn.pluss.platform.ryx.RyxService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.ExcelUtil;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.vo.*;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantOrder")
|
||||
public class MerchantOrderController extends BaseNoModelController {
|
||||
|
||||
|
||||
private Integer PAGE_SIZE = 12;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private MerchantOrderService merchantOrderService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Autowired
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Autowired
|
||||
private MerchantProfitService merchantProfitService;
|
||||
|
||||
@Autowired
|
||||
private RyxService ryxService;
|
||||
|
||||
@Resource
|
||||
private MerchantChannelService merchantChannelService;
|
||||
|
||||
@Resource
|
||||
private MerchantRefundOrderService merchantRefundOrderService;
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String initIndex() {
|
||||
List<MerchantChannel> channelList = merchantChannelService.getValidChannelList();
|
||||
request.setAttribute("channelList", channelList);
|
||||
return "merchantOrder/merchantOrderList";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/queryMerchantOrderByPage", method = RequestMethod.GET)
|
||||
public Map<String, Object> querPage(@RequestParam(name = "currPage") Integer currPage, MerchantOrder merchantOrder, @RequestParam(name = "size") Integer size, HttpServletRequest request) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("pageSize", size);
|
||||
map.put("offset", (currPage - 1) * size);
|
||||
Boolean bol = verifyUserRole();
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (!bol) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}
|
||||
map.put("userId", merchantOrder.getUserId());
|
||||
map.put("merchantCode", merchantOrder.getMerchantCode());
|
||||
map.put("orderNumber", merchantOrder.getOrderNumber());// 订单号
|
||||
map.put("storeName", merchantOrder.getStoreName());// 门店名称
|
||||
if (StringUtil.isNotEmpty(merchantOrder.getPayTypeCode())) {
|
||||
String[] payTypeCodeArr = merchantOrder.getPayTypeCode().split("\\|");
|
||||
map.put("payTypeCode", payTypeCodeArr);//支付方式
|
||||
}
|
||||
map.put("alias", merchantOrder.getAlias());// 商家名称
|
||||
map.put("status", merchantOrder.getStatus());// 交易状态
|
||||
map.put("aisleSwitch", merchantOrder.getAisleSwitch());
|
||||
if (StringUtil.isNotEmpty(merchantOrder.getSettlementType())) {
|
||||
map.put("settlementType", merchantOrder.getSettlementType());// 结算类型
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantOrder.getPayTypeName())) {
|
||||
switch (merchantOrder.getPayTypeName()) {// 支付方式
|
||||
case "1":
|
||||
map.put("payTypeName", "微信");
|
||||
break;
|
||||
case "2":
|
||||
map.put("payTypeName", "支付宝");
|
||||
break;
|
||||
case "3":
|
||||
map.put("payTypeName", "随行支付宝支付");
|
||||
break;
|
||||
case "4":
|
||||
map.put("payTypeName", "随行微信支付");
|
||||
break;
|
||||
case "5":
|
||||
map.put("payTypeName", "随行刷卡支付");
|
||||
break;
|
||||
case "6":
|
||||
map.put("payTypeName", "随行云闪付支付");
|
||||
}
|
||||
}
|
||||
map.put("orderType", merchantOrder.getOrderType());
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (StringUtil.isNotEmpty(merchantOrder.getStartTime())) {
|
||||
String startTime = simpleDateFormat.format(merchantOrder.getStartTime());
|
||||
System.out.println("获取的开始时间startTime为:" + startTime);
|
||||
map.put("startTime", startTime);// 开始时间
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantOrder.getEndTime())) {
|
||||
String endTime = simpleDateFormat.format(merchantOrder.getEndTime());
|
||||
System.out.println("获取的结束时间endTime为:" + endTime);
|
||||
map.put("endTime", endTime);// 结束时间
|
||||
}
|
||||
List<MerchantMangeOrderVO> merchantOrderList = null;
|
||||
Integer count = 0;
|
||||
// if (bol) {
|
||||
merchantOrderList = merchantOrderService.queryMerchantOrderPageShuju(map);
|
||||
count = merchantOrderService.queryMerchantOrderPageCountShuju(map);
|
||||
// } else {
|
||||
// merchantOrderList = merchantOrderService.queryMerchantOrderNoPageShuju(map);
|
||||
// count = merchantOrderService.queryMerchantOrderNoPageCountShuju(map);
|
||||
// }
|
||||
Boolean flag = false;
|
||||
for(String key:map.keySet()){//keySet获取map集合key的集合 然后在遍历key即可
|
||||
if("pageSize".equals(key) || "offset".equals(key)){
|
||||
continue;
|
||||
}
|
||||
if(map.get(key) != null && StringUtil.isNotEmpty(map.get(key).toString())){
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
map.put("createDate",DateUtils.toString(DateUtils.currentDate(),"yyyy-MM-dd"));
|
||||
}
|
||||
Map<String, Object> resultData = merchantOrderService.getOrderCountData(map);
|
||||
Map<String, Object> result = new HashMap<>(9);
|
||||
if (count == 0) {
|
||||
result.put("resultData", null);
|
||||
} else {
|
||||
result.put("resultData", resultData);
|
||||
}
|
||||
result.put("merchantOrderList", merchantOrderList);
|
||||
result.put("count", count);
|
||||
result.put("code", 200);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
// if(resultData != null){
|
||||
// result.putAll(resultData);
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单推广分润明细
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/profit/page2")
|
||||
@ResponseBody
|
||||
public Result<Map<String, Object>> orderProfitPage2(Page<MerchantOrderProfitVO> page, MerchantOrderVO condition, OrderItem orderItem) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
map.put("pageSize", page.getSize());
|
||||
map.put("offset", (page.getSize() - 1) * PAGE_SIZE);
|
||||
map.put("profitCount", "all");
|
||||
if (StringUtil.isNotEmpty(condition.getUserId())) {
|
||||
map.put("userId", condition.getUserId());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(condition.getAlias())) {
|
||||
map.put("merchantName", condition.getAlias());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(condition.getOrderNumber())) {
|
||||
map.put("orderNumber", condition.getOrderNumber());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(condition.getUserId())) {
|
||||
Map<String, Object> profitMap = merchantProfitService.getProfitCount(map);
|
||||
if (profitMap != null && profitMap.size() > 0) {
|
||||
result.put("transAmountCount", profitMap.get("transAmountCount"));
|
||||
result.put("shareAmountCount", profitMap.get("shareAmountCount"));
|
||||
} else {
|
||||
result.put("transAmountCount", "0.00");
|
||||
result.put("shareAmountCount", "0.00");
|
||||
}
|
||||
map.put("profitCount", "part");
|
||||
}
|
||||
List<MerchantOrderProfitVO> pageData = merchantOrderService.pageData(map);
|
||||
Integer count = merchantOrderService.pageDataCount(map);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", page.getCurrent());
|
||||
|
||||
page.setRecords(pageData);
|
||||
page.setTotal(count);
|
||||
|
||||
result.put("pageData", page);
|
||||
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单推广分润明细
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/profit/page", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> orderProfitPage(@RequestParam(defaultValue = "1") Integer currPage, MerchantOrder order) {
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("profitCount", "all");
|
||||
if (StringUtil.isNotEmpty(order.getUserId())) {
|
||||
map.put("userId", order.getUserId());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(order.getAlias())) {
|
||||
map.put("merchantName", order.getAlias());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(order.getOrderNumber())) {
|
||||
map.put("orderNumber", order.getOrderNumber());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(order.getUserId())) {
|
||||
Map<String, Object> profitMap = merchantProfitService.getProfitCount(map);
|
||||
if (profitMap != null && profitMap.size() > 0) {
|
||||
result.put("transAmountCount", profitMap.get("transAmountCount"));
|
||||
result.put("shareAmountCount", profitMap.get("shareAmountCount"));
|
||||
} else {
|
||||
result.put("transAmountCount", "0.00");
|
||||
result.put("shareAmountCount", "0.00");
|
||||
}
|
||||
map.put("profitCount", "part");
|
||||
}
|
||||
List<MerchantOrderProfitVO> pageData = merchantOrderService.pageData(map);
|
||||
Integer count = merchantOrderService.pageDataCount(map);
|
||||
result.put("orderProfitList", pageData);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/profit", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "merchantOrder/orderProfitList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
// @RequestMapping(value = "/queryMerchantOrderByPage", method = RequestMethod.POST)
|
||||
// @ResponseBody
|
||||
// public Map<String, Object> queryMerchantOrderByPage(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
// MerchantOrder merchantOrder) {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantOrderDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantOrderDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrder = merchantOrderService.queryMerchantOrder(merchantOrder);
|
||||
request.setAttribute("merchantOrder", merchantOrder);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantOrder/merchantOrderDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantOrderBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantOrderBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrder = merchantOrderService.queryMerchantOrder(merchantOrder);
|
||||
request.setAttribute("merchantOrder", merchantOrder);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantOrder/merchantOrderBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantOrderExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantOrderExtendsInfo() {
|
||||
|
||||
return "merchantOrder/merchantOrderExtendsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantOrderFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantOrderFunctionsInfo() {
|
||||
|
||||
return "merchantOrder/merchantOrderFunctionsInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMerchantOrder(MerchantOrder merchantOrder) {
|
||||
|
||||
if (merchantOrder.getId() != null && merchantOrder.getId() != 0) {
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
} else {
|
||||
merchantOrderService.save(merchantOrder);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMerchantOrder(Integer id) {
|
||||
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMerchantOrder(Integer id) {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrderService.removeById(merchantOrder.getId());
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转汇总流水
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/summaryOfWater", method = RequestMethod.GET)
|
||||
public String summaryOfWater() {
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
// user.setMerchantCode("M800201909246546966");
|
||||
if (StringUtil.isNotEmpty(user)) {
|
||||
request.setAttribute("merchantCode", user.getMerchantCode());
|
||||
if (StringUtil.isNotEmpty(user.getMerchantCode())) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
List<MerchantStore> merchantStoreList = merchantStoreService.queryMerchantStoreList(merchantStore);
|
||||
// 得到门店集合
|
||||
request.setAttribute("merchantStoreList", merchantStoreList);
|
||||
UserApp userApp = new UserApp();
|
||||
userApp.setUserType("staff");
|
||||
userApp.setMerchantCode(user.getMerchantCode());
|
||||
List<UserApp> userAppList = userAppService.queryUserAppList(userApp);
|
||||
// 得到员工集合
|
||||
request.setAttribute("userAppList", userAppList);
|
||||
}
|
||||
}
|
||||
return "merchantOrder/summaryOfWater";
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX请求查询汇总流水数据
|
||||
*/
|
||||
@RequestMapping(value = "/querySummaryOfWater", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> querySummaryOfWater(SummaryOfWaterDTO summaryOfWaterDTO) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getPayTypeCodeList())) {
|
||||
map.put("payTypeCodeList", Arrays.asList(summaryOfWaterDTO.getPayTypeCodeList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getStaffCodeList())) {
|
||||
map.put("staffCodeList", Arrays.asList(summaryOfWaterDTO.getStaffCodeList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getStoreIdList())) {
|
||||
map.put("storeIdList", Arrays.asList(summaryOfWaterDTO.getStoreIdList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getTimeStatus())) {
|
||||
map.put("timeStatus", summaryOfWaterDTO.getTimeStatus());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getMerchantCode())) {
|
||||
map.put("merchantCode", summaryOfWaterDTO.getMerchantCode());
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
SummaryOfWaterVO summaryOfWaterVO = merchantOrderService.querySummaryOfWater(map);
|
||||
result.put("summaryOfWaterVO", summaryOfWaterVO);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单退款跳转页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/orderRefund")
|
||||
public String orderRefund() {
|
||||
return "merchantOrder/orderRefund";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/queryOrderRefund", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryOrderRefund(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
SummaryOfWaterDTO summaryOfWaterDTO) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
Map<String, Object> map = new HashMap<String, Object>(16);
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
map.put("merchantCode", shiroUser.getMerchantCode());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getOrderType())) {
|
||||
map.put("orderType", summaryOfWaterDTO.getOrderType());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getPayTypeCodeList())) {
|
||||
map.put("payTypeCodeList", Arrays.asList(summaryOfWaterDTO.getPayTypeCodeList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getStaffCodeList())) {
|
||||
map.put("staffCodeList", Arrays.asList(summaryOfWaterDTO.getStaffCodeList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getStoreIdList())) {
|
||||
map.put("storeIdList", Arrays.asList(summaryOfWaterDTO.getStoreIdList().split(",")));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(summaryOfWaterDTO.getTimeStatus())) {
|
||||
map.put("timeStatus", summaryOfWaterDTO.getTimeStatus());
|
||||
}
|
||||
map.put("pageSize", PAGE_SIZE);
|
||||
map.put("offset", (currPage - 1) * PAGE_SIZE);
|
||||
map.put("status", "2");
|
||||
List<MerchantOrder> merchantOrderList = merchantOrderService.queryMerchantOrderRefundPage(map);
|
||||
Integer count = merchantOrderService.queryMerchantOrderRefundPageCount(map);
|
||||
result.put("merchantOrderList", merchantOrderList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店长审核通过
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/buinourPass", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> buinourPass(Integer id) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
try {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setStatus("2");
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
result.put("data", "1");
|
||||
} catch (Exception e) {
|
||||
result.put("data", "0");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店长审核拒绝
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/buinourRefuse", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> buinourRefuse(Integer id) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
try {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrder.setStatus("3");
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
result.put("data", "1");
|
||||
} catch (Exception e) {
|
||||
result.put("data", "0");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店长退款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/buinourRefund", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> buinourRefund(Integer id) {
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
try {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setStatus("2");
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
result.put("data", "1");
|
||||
} catch (Exception e) {
|
||||
result.put("data", "0");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店员发起退款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/clerkSponsorRefund", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> clerkSponsorRefund(Integer id) {
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
try {
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setStatus("4");
|
||||
merchantOrder.setId(id.longValue());
|
||||
merchantOrderService.updateById(merchantOrder);
|
||||
result.put("data", "1");
|
||||
} catch (Exception e) {
|
||||
result.put("data", "0");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/dowloadExcel", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public void dow(HttpServletResponse response) throws IOException {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Boolean isAdmin = verifyUserRole();
|
||||
if (isAdmin) {
|
||||
String[] title = new String[]{"订单号", "商家名称", "门店名称", "支付方式名称", "消费金额", "交易时间", "交易状态"};
|
||||
List<MerchantOrder> merchantOrder = merchantOrderService.list();
|
||||
List<MerchantOrderDVO> mVos = new ArrayList<MerchantOrderDVO>();
|
||||
for (MerchantOrder merchantOrder2 : merchantOrder) {
|
||||
mVos.add(new MerchantOrderDVO(merchantOrder2));
|
||||
}
|
||||
HSSFWorkbook workbook = ExcelUtil.getHSSFWorkbook("管理员", title, mVos);
|
||||
String fileName = "交易查询.xls";
|
||||
download(response, fileName, workbook);
|
||||
} else {
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
String[] title = new String[]{"订单号", "商家名称", "门店名称", "支付方式名称", "消费金额", "交易时间", "交易状态"};
|
||||
MerchantOrder m = new MerchantOrder();
|
||||
m.setMerchantCode(shiroUser.getMerchantCode());
|
||||
List<MerchantOrder> merchantOrder = merchantOrderService.list(new QueryWrapper<>(m));
|
||||
List<MerchantOrderDVO> mVos = new ArrayList<MerchantOrderDVO>();
|
||||
for (MerchantOrder merchantOrder2 : merchantOrder) {
|
||||
mVos.add(new MerchantOrderDVO(merchantOrder2));
|
||||
}
|
||||
HSSFWorkbook workbook = ExcelUtil.getHSSFWorkbook("管理员", title, mVos);
|
||||
String fileName = "交易查询.xls";
|
||||
download(response, fileName, workbook);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void download(HttpServletResponse response, String fileName, HSSFWorkbook workbook) throws IOException {
|
||||
// 文件下载
|
||||
String downName = new String(fileName.getBytes("utf-8"), "iso-8859-1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + downName);
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/dowOrderRefundExcel", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public void dowOrderRefund(HttpServletResponse response) throws IOException {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Boolean isAdmin = verifyUserRole();
|
||||
if (isAdmin) {
|
||||
String[] title = new String[]{"订单号", "商家名称", "门店名称", "支付方式名称", "消费金额", "交易流水号", "交易时间", "交易状态"};
|
||||
List<MerchantOrder> merchantOrders = merchantOrderService.list();
|
||||
List<MerchantOrderDVO> mVos = new ArrayList<MerchantOrderDVO>();
|
||||
for (MerchantOrder merchantOrder2 : merchantOrders) {
|
||||
mVos.add(new MerchantOrderDVO(merchantOrder2));
|
||||
}
|
||||
HSSFWorkbook workbook = ExcelUtil.getHSSFWorkbook("管理员", title, mVos);
|
||||
String fileName = "退款订单.xls";
|
||||
download(response, fileName, workbook);
|
||||
} else {
|
||||
if (StringUtil.isNotEmpty(shiroUser.getMerchantCode())) {
|
||||
String[] title = new String[]{"订单号", "商家名称", "门店名称", "支付方式名称", "消费金额", "交易流水号", "交易时间", "交易状态"};
|
||||
MerchantOrder merchantOrder = new MerchantOrder();
|
||||
merchantOrder.setMerchantCode(shiroUser.getMerchantCode());
|
||||
List<MerchantOrder> merchantOrders = merchantOrderService.list(new QueryWrapper<>(merchantOrder));
|
||||
List<MerchantOrderDVO> mVos = new ArrayList<MerchantOrderDVO>();
|
||||
for (MerchantOrder merchantOrder2 : merchantOrders) {
|
||||
mVos.add(new MerchantOrderDVO(merchantOrder2));
|
||||
}
|
||||
HSSFWorkbook workbook = ExcelUtil.getHSSFWorkbook("管理员", title, mVos);
|
||||
String fileName = "退款订单.xls";
|
||||
download(response, fileName, workbook);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* querySumEarnings:(查询平台/商家总的收益). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
// @PostMapping(value="/querySumEarnings")
|
||||
// @ResponseBody
|
||||
// public Map<String, Object> querySumEarnings(@RequestParam Map<String,Object> params) {
|
||||
// Map<String, Object> resultMap=new HashMap<String, Object>(16);
|
||||
//
|
||||
// Map<String,Object> result = merchantOrderService.querySumCount(params);
|
||||
//
|
||||
// //Map<String, Object> map=new HashMap<String, Object>(16);
|
||||
// /*Double shareoneySum1=merchantProfitService.queryMerchantProfitSumPrice(null);
|
||||
// System.out.println("总收益"+shareoneySum1);
|
||||
// //粉丝奖励总额
|
||||
// List<Fans> fansList= fansService.queryFansList(null);
|
||||
// Double fansShareMoneySum1=0.0;
|
||||
// for(Fans li:fansList) {
|
||||
// String money=li.getShareMoney();
|
||||
// if(money!=null) {
|
||||
// Double d=Double.parseDouble(money);
|
||||
// fansShareMoneySum1+=d;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //交易总额
|
||||
// Map<String, Object> orderMap = new HashMap<String, Object>();
|
||||
// orderMap.put("status",1);
|
||||
// orderMap.put("limit",1000000000);
|
||||
// orderMap.put("offset",0);
|
||||
// Double orderFeeSum1=0.0;
|
||||
//
|
||||
// List<MerchantOrder> merchantOrderList = merchantOrderService.queryMerchantOrderPage(orderMap);
|
||||
// for(MerchantOrder li:merchantOrderList) {
|
||||
// Double money=li.getConsumeFee();
|
||||
// if(money!=null) {
|
||||
// orderFeeSum1+=money;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// *//*
|
||||
// * map.put("startTime", startTime); map.put("endTime", endTime); Boolean isAdmin
|
||||
// * = verifyUserRole(); ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
// * MerchantMangeOrderVO merchantMangeOrderVO =new MerchantMangeOrderVO();
|
||||
// * if(isAdmin) { merchantMangeOrderVO =
|
||||
// * merchantOrderService.querySumEarnings(map); resultMap.put("isAdmin", "1");
|
||||
// * }else { String merchantCode = shiroUser.getMerchantCode();
|
||||
// * if(StringUtil.isEmpty(merchantCode)) { map.put("merchantCode",
|
||||
// * StringUtil.genRandomNum(33)); }else { map.put("merchantCode", merchantCode);
|
||||
// * } merchantMangeOrderVO=merchantOrderService.querySumEarnings(map);
|
||||
// * resultMap.put("isAdmin", "0"); }
|
||||
// *//*
|
||||
//
|
||||
// //resultMap.put("merchantMangeOrderVO", merchantMangeOrderVO);
|
||||
//
|
||||
// Double shareoneySum=StringUtil.bigDecimal(shareoneySum1);
|
||||
// Double fansShareMoneySum=StringUtil.bigDecimal(fansShareMoneySum1);//粉丝奖励金额
|
||||
// Double orderFeeSum=StringUtil.bigDecimal(orderFeeSum1);
|
||||
// Double sum1=fansShareMoneySum+shareoneySum1;//总收益
|
||||
// Double sum=StringUtil.bigDecimal(sum1);
|
||||
// resultMap.put("shareoneySum", shareoneySum);//推广分润
|
||||
// resultMap.put("fansShareMoneySum", fansShareMoneySum);//粉丝奖励总额
|
||||
// resultMap.put("orderFeeSum", orderFeeSum);//实际收益
|
||||
// resultMap.put("sum", sum);//总收益*/
|
||||
// if(result == null){
|
||||
// result = new HashMap<>();
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 订单补单参数
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/suppleOrder/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result suppleOrder(@PathVariable("id") Integer id) {
|
||||
try {
|
||||
return merchantOrderService.suppleOrder(id);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MsgException.throwException(e.getMessage());
|
||||
}
|
||||
return ResultGenerator.genFailResult("补单失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据同步
|
||||
*/
|
||||
@RequestMapping(value = "/syncPluginOrder", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result syncPluginOrder(Date startDate, Date endDate) {
|
||||
int i = DateUtils.differentDaysByMillisecond(startDate, endDate);
|
||||
if (i > 0) {
|
||||
return ResultGenerator.genFailResult("日期相差超过一天");
|
||||
}
|
||||
String date = DateUtils.formatDateDefault(startDate, "yyyyMMdd");
|
||||
String nowDate = DateUtils.formatDateDefault(new Date(), "yyyyMMdd");
|
||||
if (Integer.parseInt(nowDate) - Integer.parseInt(date) < 1) {
|
||||
return ResultGenerator.genFailResult("同步数据的日期不能选择当天的日期!");
|
||||
}
|
||||
try {
|
||||
JSONObject result = ryxService.downloadFtpFile(date);
|
||||
if (result == null) {
|
||||
return ResultGenerator.genFailResult("文件下载失败");
|
||||
}
|
||||
String uploadPath = result.getString("uploadPath");
|
||||
String filePath = result.getString("filePath");
|
||||
//读取文件
|
||||
merchantOrderService.readCSV(filePath);
|
||||
//删除文件
|
||||
FileUtil.del(uploadPath);
|
||||
return ResultGenerator.genSuccessResult("数据同步成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MsgException.throwException(e.getMessage());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("数据同步失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通道对账文件下载地址
|
||||
* @param
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getChannelFileUrl", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<Object> getChannelFileUrl(String accountDate,Integer channel,Integer type) {
|
||||
return merchantOrderService.getChannelFileUrl(accountDate,channel,type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.pluss.platform.controller.merchantProfit;
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantProfit;
|
||||
import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 商户订单分润表
|
||||
* @author Administrator
|
||||
* @date: 2022/2/9 18:18
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("merchantProfit")
|
||||
public class MerchantProfitController extends BaseModelController<MerchantProfitService, MerchantProfit> {
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
return "merchantProfit/list";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantProfit>> page(Page<MerchantProfit> page, MerchantProfit condition, OrderItem orderItem) {
|
||||
orderItem.setColumn("id");
|
||||
orderItem.setAsc(false);
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "countData")
|
||||
@ResponseBody
|
||||
public Result<Object> countData(MerchantProfit condition){
|
||||
Map<String, BigDecimal> count = baseService.getProfitAmtCount(condition);
|
||||
return ResultGenerator.genSuccessResult("获取成功",count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.pluss.platform.controller.merchantQrcode;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.MerchantQrcode;
|
||||
import cn.pluss.platform.merchantQrcode.MerchantQrcodeService;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Djh
|
||||
* @since 2020-10-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantQrcode")
|
||||
public class MerchantQrcodeController{
|
||||
|
||||
@Autowired
|
||||
private MerchantQrcodeService merchantQrcodeService;
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index() {
|
||||
return "merchantQrcode/list";
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ResponseBody
|
||||
public Result<Page<MerchantQrcode>> queryMerchantQrcodePage(Page<MerchantQrcode> page, MerchantQrcode merchantQrcode) {
|
||||
QueryWrapper<MerchantQrcode> wrapper = new QueryWrapper<>();
|
||||
if (StringUtil.isNotEmpty(merchantQrcode.getUserId())) {
|
||||
wrapper.eq("userId", merchantQrcode.getUserId());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantQrcode.getMerchantName())) {
|
||||
wrapper.eq("merchantName", merchantQrcode.getMerchantName());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantQrcode.getName())) {
|
||||
wrapper.like("userId", merchantQrcode.getName());
|
||||
}
|
||||
wrapper.orderByDesc( "id");
|
||||
Page<MerchantQrcode> result = merchantQrcodeService.page(page, wrapper);
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = {"/detail/{id}", "/detail"})
|
||||
public String detail(HttpServletRequest request, @PathVariable(value = "id", required = false) Integer id) {
|
||||
if (id != null) {
|
||||
MerchantQrcode qrcode = new MerchantQrcode().setId(id);
|
||||
qrcode = merchantQrcodeService.getOne(new QueryWrapper<>(qrcode));
|
||||
request.setAttribute("entity", qrcode);
|
||||
}
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
request.setAttribute("uploadParam",uploadParam);
|
||||
return "merchantQrcode/detail";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantRegistAuditRecord;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantRegistAuditRecord;
|
||||
import cn.pluss.platform.merchantRegistAuditRecord.MerchantRegistAuditRecordService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantRegistAuditRecord")
|
||||
public class MerchantRegistAuditRecordController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantRegistAuditRecordService merchantRegistAuditRecordService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantRegistAuditRecord/merchantRegistAuditRecordList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistAuditRecordByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantRegistAuditRecordByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantRegistAuditRecord> merchantRegistAuditRecordList=merchantRegistAuditRecordService.queryMerchantRegistAuditRecordPage(map);
|
||||
Integer count=merchantRegistAuditRecordService.queryMerchantRegistAuditRecordPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantRegistAuditRecordList", merchantRegistAuditRecordList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistAuditRecordDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistAuditRecordDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantRegistAuditRecord merchantRegistAuditRecord=new MerchantRegistAuditRecord();
|
||||
merchantRegistAuditRecord.setId(id);
|
||||
merchantRegistAuditRecord=merchantRegistAuditRecordService.queryMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
request.setAttribute("merchantRegistAuditRecord", merchantRegistAuditRecord);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantRegistAuditRecord/merchantRegistAuditRecordDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistAuditRecordBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistAuditRecordBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantRegistAuditRecord merchantRegistAuditRecord=new MerchantRegistAuditRecord();
|
||||
merchantRegistAuditRecord.setId(id);
|
||||
merchantRegistAuditRecord=merchantRegistAuditRecordService.queryMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
request.setAttribute("merchantRegistAuditRecord", merchantRegistAuditRecord);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantRegistAuditRecord/merchantRegistAuditRecordBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistAuditRecordExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistAuditRecordExtendsInfo(){
|
||||
|
||||
return "merchantRegistAuditRecord/merchantRegistAuditRecordExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistAuditRecordFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistAuditRecordFunctionsInfo(){
|
||||
|
||||
return "merchantRegistAuditRecord/merchantRegistAuditRecordFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantRegistAuditRecord", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantRegistAuditRecord(MerchantRegistAuditRecord merchantRegistAuditRecord){
|
||||
|
||||
if(merchantRegistAuditRecord.getId()!=null&&merchantRegistAuditRecord.getId()!=0){
|
||||
merchantRegistAuditRecordService.updateMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
}else{
|
||||
merchantRegistAuditRecordService.saveMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantRegistAuditRecord", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantRegistAuditRecord(Integer id){
|
||||
|
||||
MerchantRegistAuditRecord merchantRegistAuditRecord=new MerchantRegistAuditRecord();
|
||||
merchantRegistAuditRecord.setId(id);
|
||||
merchantRegistAuditRecordService.updateMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantRegistAuditRecord", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantRegistAuditRecord(Integer id){
|
||||
MerchantRegistAuditRecord merchantRegistAuditRecord=new MerchantRegistAuditRecord();
|
||||
merchantRegistAuditRecord.setId(id);
|
||||
merchantRegistAuditRecordService.deleteMerchantRegistAuditRecord(merchantRegistAuditRecord);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.merchantRegistLog;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantRegistLog;
|
||||
import cn.pluss.platform.merchantRegistLog.MerchantRegistLogService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("merchantRegistLog")
|
||||
public class MerchantRegistLogController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private MerchantRegistLogService merchantRegistLogService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "merchantRegistLog/merchantRegistLogList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistLogByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryMerchantRegistLogByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<MerchantRegistLog> merchantRegistLogList=merchantRegistLogService.queryMerchantRegistLogPage(map);
|
||||
Integer count=merchantRegistLogService.queryMerchantRegistLogPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("merchantRegistLogList", merchantRegistLogList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistLogDetails", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistLogDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantRegistLog merchantRegistLog=new MerchantRegistLog();
|
||||
merchantRegistLog.setId(id);
|
||||
merchantRegistLog=merchantRegistLogService.queryMerchantRegistLog(merchantRegistLog);
|
||||
request.setAttribute("merchantRegistLog", merchantRegistLog);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantRegistLog/merchantRegistLogDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistLogBaseInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistLogBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
MerchantRegistLog merchantRegistLog=new MerchantRegistLog();
|
||||
merchantRegistLog.setId(id);
|
||||
merchantRegistLog=merchantRegistLogService.queryMerchantRegistLog(merchantRegistLog);
|
||||
request.setAttribute("merchantRegistLog", merchantRegistLog);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantRegistLog/merchantRegistLogBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistLogExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistLogExtendsInfo(){
|
||||
|
||||
return "merchantRegistLog/merchantRegistLogExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantRegistLogFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryMerchantRegistLogFunctionsInfo(){
|
||||
|
||||
return "merchantRegistLog/merchantRegistLogFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveMerchantRegistLog", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveMerchantRegistLog(MerchantRegistLog merchantRegistLog){
|
||||
|
||||
if(merchantRegistLog.getId()!=null&&merchantRegistLog.getId()!=0){
|
||||
merchantRegistLogService.updateMerchantRegistLog(merchantRegistLog);
|
||||
}else{
|
||||
merchantRegistLogService.saveMerchantRegistLog(merchantRegistLog);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateMerchantRegistLog", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateMerchantRegistLog(Integer id){
|
||||
|
||||
MerchantRegistLog merchantRegistLog=new MerchantRegistLog();
|
||||
merchantRegistLog.setId(id);
|
||||
merchantRegistLogService.updateMerchantRegistLog(merchantRegistLog);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMerchantRegistLog", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteMerchantRegistLog(Integer id){
|
||||
MerchantRegistLog merchantRegistLog=new MerchantRegistLog();
|
||||
merchantRegistLog.setId(id);
|
||||
merchantRegistLogService.deleteMerchantRegistLog(merchantRegistLog);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.pluss.platform.controller.merchantRejectDesc;
|
||||
|
||||
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.entity.MerchantRejectDesc;
|
||||
import cn.pluss.platform.merchantRejectDesc.MerchantRejectDescService;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bzg
|
||||
* @since 2021-01-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/merchantRejectDesc")
|
||||
public class MerchantRejectDescController extends BaseModelController<MerchantRejectDescService, MerchantRejectDesc> {
|
||||
|
||||
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/index")
|
||||
public String index(HttpServletRequest request) {
|
||||
Integer sort = this.baseService.getMaxSort();
|
||||
request.setAttribute("sort",sort);
|
||||
return "merchantRejectDesc/list";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<Page<MerchantRejectDesc>> page(Page<MerchantRejectDesc> page, MerchantRejectDesc condition, OrderItem orderItem) {
|
||||
orderItem.setAsc(false).setColumn("sort");
|
||||
return super.page(page, condition, orderItem);
|
||||
}
|
||||
|
||||
@PostMapping("saveOrUpdate")
|
||||
@ResponseBody
|
||||
public Result<String> saveOrUpdate(@RequestBody MerchantRejectDesc merchantRejectDesc) {
|
||||
if (merchantRejectDesc.getId() != null){
|
||||
this.baseService.updateById(merchantRejectDesc);
|
||||
}else {
|
||||
this.baseService.save(merchantRejectDesc);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult("保存成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,725 @@
|
||||
package cn.pluss.platform.controller.merchantStore;
|
||||
|
||||
import cn.pluss.platform.annotation.PassToken;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.channel.MerchantAuditService;
|
||||
import cn.pluss.platform.common.CommonRemarkService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.mapper.MerchantChannelStatusMapper;
|
||||
import cn.pluss.platform.mapper.OperationRecordMapper;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchant.MerchantPluginService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
import cn.pluss.platform.merchantImage.MerchantImageService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.operationRecord.OperationRecordService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.*;
|
||||
import cn.pluss.platform.vo.StoreInfoVO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("merchantStore")
|
||||
public class MerchantStoreController extends BaseNoModelController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private OperationRecordService operationRecordService;
|
||||
|
||||
@Resource
|
||||
private OperationRecordMapper opRecordMapper;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantChannelStatusService mcsService;
|
||||
|
||||
@Autowired
|
||||
private MerchantChannelStatusMapper mcsMapper;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private UserAppService userAppService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private MerchantPluginService merchantPluginService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Lazy})
|
||||
private MerchantImageService merchantImageService;
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Lazy})
|
||||
private CommonRemarkService remarkService;
|
||||
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Qualifier("ysAuditServiceV2")})
|
||||
private MerchantAuditService ysAuditServiceV2;
|
||||
|
||||
|
||||
/**
|
||||
* 引导页
|
||||
*/
|
||||
@GetMapping(value = "/index")
|
||||
public String index() {
|
||||
return "merchantStore/merchantStoreList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryMerchantStoreByPage", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMerchantStoreByPage(@RequestParam(defaultValue = "1") Integer currPage,
|
||||
Integer size, MerchantStore merchantStore, MerchantBaseInfo merchantBaseInfo, String merchantType, String userId) {
|
||||
return merchantStoreService.queryMerchantStoreByPage(currPage, size, merchantStore, merchantBaseInfo, merchantType, userId);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/merchantStoreForbidden")
|
||||
public ModelAndView forbidden(@RequestParam(value = "id") Integer id, String resultValue, ModelAndView view) {
|
||||
view.setViewName("merchantStore/merchantStoreForbidden");
|
||||
view.addObject("resultValue", resultValue);
|
||||
view.addObject("id", id);
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/disableMerchantStore")
|
||||
@ResponseBody
|
||||
public Map<String, Object> disableMerchantStore(Integer id, String resultValue, String remark) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
OperationRecord operationRecord = new OperationRecord();
|
||||
operationRecord.setOperator(String.valueOf(shiroUser.getId()));
|
||||
//封装被操作人ID
|
||||
operationRecord.setUserId(String.valueOf(id));
|
||||
operationRecord.setCreateTime(new Date());
|
||||
operationRecord.setRemark(remark);
|
||||
|
||||
if ("2".equals(resultValue)) {
|
||||
merchantStoreService.enableMerchantStore(shiroUser.getId(), id.longValue(), remark);
|
||||
} else if ("1".equals(resultValue)) {
|
||||
merchantStoreService.disableMerchantStore(shiroUser.getId(), id.longValue(), remark);
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("msg", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/merchantStorePath")
|
||||
public String merchantStorePath() {
|
||||
String ids = request.getParameter("id");
|
||||
Integer id = Integer.valueOf(ids);
|
||||
System.out.println("id=" + id);
|
||||
request.setAttribute("id", id);
|
||||
return "merchantStore/merchantStoreParticulars";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/queryMerchantStoreParticulars")
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryMerchantStoreParticulars(@RequestParam(defaultValue = "1") Integer currPage, @RequestParam Integer id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
int pageSize = 12;
|
||||
map.put("pageSize", pageSize);
|
||||
map.put("offset", (currPage - 1) * pageSize);
|
||||
map.put("id", id);
|
||||
List<OperationRecord> operationRecordList = operationRecordService.selectOne(map);
|
||||
Integer count = operationRecordService.selectParticularsCount(map);
|
||||
boolean admin = verifyUserRole();
|
||||
result.put("admin", admin);
|
||||
result.put("operationRecordList", operationRecordList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount", StringUtil.getPageCount(count, pageSize));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/merchantStorePayEcdemicSwitch")
|
||||
@ResponseBody
|
||||
public Map<String, Object> selectPayEcdemicSwitch(@RequestParam(value = "id") Integer id) {
|
||||
StoreInfoVO storeInfoVO = merchantStoreService.selectParticulars(id);
|
||||
if (storeInfoVO == null) {
|
||||
storeInfoVO = new StoreInfoVO();
|
||||
}
|
||||
|
||||
String payEcdemicSwitch = storeInfoVO.getPayEcdemicSwitch();
|
||||
if (payEcdemicSwitch == null) {
|
||||
payEcdemicSwitch = "0";
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("payEcdemicSwitch", payEcdemicSwitch);
|
||||
result.put("resultCode", "1");
|
||||
result.put("msg", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/updateChannelStatus")
|
||||
@ResponseBody
|
||||
public Result<?> updateChannelStatus(@RequestParam(value = "csId") Integer csId, @RequestParam(value = "status") String status) {
|
||||
MerchantChannelStatus channelStatus = new MerchantChannelStatus();
|
||||
channelStatus.setId(csId);
|
||||
channelStatus = mcsService.getByIdLock(csId);
|
||||
merchantStoreService.updateChannelStatusAndWxCert(channelStatus, status);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/merchantStoreThoroughfare")
|
||||
public ModelAndView thoroughfare(Integer id, String payEcdemicSwitch, ModelAndView view) {
|
||||
view.setViewName("merchantStore/merchantStoreTthoroughfare");
|
||||
view.addObject("payEcdemicSwitch", payEcdemicSwitch);
|
||||
view.addObject("id", id);
|
||||
return view;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/payEcdemicSwitchMerchantStore")
|
||||
@ResponseBody
|
||||
public Map<String, Object> payEcdemicSwitchMerchantStore(@RequestParam(value = "id") Integer id, String payEcdemicSwitch, String remark) {
|
||||
ShiroUser shiroUser = queryCurrentShiroUser();
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
OperationRecord operationRecord = new OperationRecord();
|
||||
operationRecord.setOperator(String.valueOf(shiroUser.getId()));
|
||||
//封装被操作人ID
|
||||
operationRecord.setUserId(String.valueOf(id));
|
||||
operationRecord.setCreateTime(new Date());
|
||||
operationRecord.setRemark(remark);
|
||||
if ("1".equals(payEcdemicSwitch)) {
|
||||
payEcdemicSwitch = "0";
|
||||
operationRecord.setDictValue("GBGRDZWL");
|
||||
} else if ("0".equals(payEcdemicSwitch)) {
|
||||
payEcdemicSwitch = "1";
|
||||
operationRecord.setDictValue("KTGRDZWL");
|
||||
}
|
||||
opRecordMapper.insert(operationRecord);
|
||||
params.put("id", id);
|
||||
params.put("payEcdemicSwitch", payEcdemicSwitch);
|
||||
merchantStoreService.pesUpdateMerchantStore(params);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("msg", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/operatMarket")
|
||||
@ResponseBody
|
||||
public Map<String, Object> operateMarket(@RequestParam(value = "ids[]") Integer[] ids, String isMarker) {
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
params.put("ids", ids);
|
||||
params.put("isMarker", isMarker);
|
||||
merchantStoreService.operatMarketMerchantStore(params);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("msg", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/queryStatus")
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryStatus(@RequestParam(value = "id") Integer id) {
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
params.put("id", id);
|
||||
StoreInfoVO storeInfoVO = merchantStoreService.selectStatus(params);
|
||||
int resultValue;
|
||||
if ("2".equals(storeInfoVO.getStatus())) {
|
||||
resultValue = 2;
|
||||
} else {
|
||||
resultValue = 1;
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultValue", resultValue);
|
||||
result.put("msg", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@GetMapping("/queryMerchantStoreDetails")
|
||||
public String queryMerchantStoreDetails(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
|
||||
if (id != null && id != 0) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setId(id);
|
||||
merchantStore = merchantStoreService.queryMerchantStore(merchantStore);
|
||||
request.setAttribute("merchantStore", merchantStore);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "merchantStore/merchantStoreDetails";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@GetMapping("/showMerchantStoreReceipt")
|
||||
@ResponseBody
|
||||
public Map<String, Object> showMerchantStoreReceipt(Integer userId, Integer channel) {
|
||||
Map<String, Object> result = new HashMap<>(3);
|
||||
if (userId != null && userId != 0) {
|
||||
StoreInfoVO queryStoreInfoVO = merchantStoreService.showMerchantStoreReceipt(userId);
|
||||
String url = ParametersUtil.domain + "/wap/merchant/authPay?userAppId=" + queryStoreInfoVO.getUserId() + "&channel=" + channel;
|
||||
result.put("url", url);
|
||||
result.put("storeName", queryStoreInfoVO.getStoreName());
|
||||
result.put("code", "1");
|
||||
result.put("msg", "获取成功!");
|
||||
return result;
|
||||
}
|
||||
result.put("code", "0");
|
||||
result.put("msg", "获取失败!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@GetMapping("/queryMerchantStoreBaseInfo")
|
||||
public String queryMerchantStoreBaseInfo(HttpServletRequest request, Integer id, Integer pageIndex) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
ShiroUser user = queryCurrentShiroUser();
|
||||
if (id != null && id != 0) {
|
||||
merchantStore.setId(id);
|
||||
merchantStore = merchantStoreService.queryMerchantStore(merchantStore);
|
||||
request.setAttribute("merchantStore", merchantStore);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
} else {
|
||||
//添加时存入MerchantCode商户编码 前台根据有无判断是否有资格添加门店
|
||||
merchantStore.setMerchantCode(user.getMerchantCode());
|
||||
request.setAttribute("merchantStore", merchantStore);
|
||||
}
|
||||
getRole();
|
||||
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
|
||||
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
|
||||
return "merchantStore/merchantStoreBaseInfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存对象
|
||||
*/
|
||||
@PostMapping("/saveMerchantStore")
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMerchantStore(MerchantStore merchantStore) {
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
|
||||
if (merchantStore.getId() != null && merchantStore.getId() != 0) {
|
||||
List<MerchantBaseInfo> queryMerchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (queryMerchantBaseInfoList != null && !queryMerchantBaseInfoList.isEmpty()) {
|
||||
merchantBaseInfo = queryMerchantBaseInfoList.get(0);
|
||||
merchantStore.setEmail(merchantBaseInfo.getEmail());
|
||||
merchantStore.setMerchantName(merchantBaseInfo.getMerchantName());
|
||||
}
|
||||
} else {
|
||||
//不管是不是管理员的增加
|
||||
merchantStore.setStoreId(StringUtil.genRandomNum(5));
|
||||
List<MerchantBaseInfo> queryMerchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(merchantBaseInfo);
|
||||
if (queryMerchantBaseInfoList != null && !queryMerchantBaseInfoList.isEmpty()) {
|
||||
merchantBaseInfo = queryMerchantBaseInfoList.get(0);
|
||||
merchantStore.setEmail(merchantBaseInfo.getEmail());
|
||||
merchantStore.setMerchantName(merchantBaseInfo.getMerchantName());
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
//判断是否是管理员
|
||||
if (merchantStore.getId() != null && merchantStore.getId() != 0) {
|
||||
merchantStoreService.updateMerchantStore(merchantStore);
|
||||
} else {
|
||||
merchantStoreService.saveMerchantStore(merchantStore);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对象
|
||||
*/
|
||||
@PostMapping("/updateMerchantStore")
|
||||
@ResponseBody
|
||||
public Map<String, Object> updateMerchantStore(Integer id) {
|
||||
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setId(id);
|
||||
merchantStoreService.updateMerchantStore(merchantStore);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
*/
|
||||
@PostMapping("/deleteMerchantStore")
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteMerchantStore(Integer id) {
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setId(id);
|
||||
merchantStoreService.deleteMerchantStore(merchantStore);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手动后台发起进件
|
||||
*/
|
||||
@PassToken
|
||||
@GetMapping(value = "/manualMerchantIncom/{userId}/{id}/{merchantCode}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> manualMerchantIncome(@PathVariable("userId") Integer userId, @PathVariable("id") String id, @PathVariable("merchantCode") String merchantCode) {
|
||||
JSONObject params = new JSONObject();
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
params.put("userId", userId + "");
|
||||
try {
|
||||
if (StringUtils.isEmpty(id) || "undefined".equals(id)) {
|
||||
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<MerchantChannelStatus>().eq("merchantCode", merchantCode);
|
||||
MerchantChannelStatus one = mcsService.getOne(queryWrapper);
|
||||
one.setStatus(MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
one.setThirdStatus(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
mcsService.updateById(one);
|
||||
id = String.valueOf(one.getChannel());
|
||||
}
|
||||
|
||||
userAppService.merchantAudit(params, id);
|
||||
|
||||
result.put("code", "1");
|
||||
result.put("msg", "发起进件成功,等待审核中!");
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动后台发起进件
|
||||
*/
|
||||
@PostMapping(value = "/reAuditYs/{merchantCode}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> reAuditYs(@PathVariable("merchantCode") String merchantCode) {
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(merchantCode, 4);
|
||||
UserApp ua = new UserApp();
|
||||
ua.setMerchantCode(merchantCode);
|
||||
ua.setUserType("promoter");
|
||||
ua = userAppService.getOne(new QueryWrapper<>(ua));
|
||||
if (mcs == null) {
|
||||
mcs = new MerchantChannelStatus();
|
||||
} else {
|
||||
if (mcs.getStatus().equals(MerchantChannelStatus.AUDIT_STATUS_EXAMINING) && !mcs.getThirdStatus().equals(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING)) {
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
result.put("code", "0");
|
||||
result.put("msg", "该商户进件正在审核中");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
mcs.setMerchantCode(merchantCode);
|
||||
mcs.setThirdStatus(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
mcs.setAuthorizationStatus(MerchantChannelStatus.AUTHORIZATION_STATUS_UNAUTHORIZED);
|
||||
mcs.setValid(0);
|
||||
|
||||
if (mcs.getId() == null) {
|
||||
mcsMapper.insert(mcs);
|
||||
} else {
|
||||
mcsMapper.updateById(mcs);
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
try {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("userId", ua.getUserId() + "");
|
||||
ysAuditServiceV2.merchantAudit(ua.getUserId() + "", false);
|
||||
// userAppService.merchantAudit(params, "4");
|
||||
result.put("code", "1");
|
||||
result.put("msg", "发起进件成功, 稍后查看进件状态");
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 进件审核驳回
|
||||
*/
|
||||
@PassToken
|
||||
@GetMapping(value = "/rejectAudit/{userId}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> rejectAudit(@PathVariable("userId") Integer userId, String errMsg) {
|
||||
UserApp userApp = new UserApp().setUserId(userId.longValue()).setUserType("promoter");
|
||||
userApp = userAppService.queryUserApp(userApp);
|
||||
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
try {
|
||||
mcsService.rejectAudit(userApp.getMerchantCode(), errMsg);
|
||||
result.put("code", "1");
|
||||
result.put("msg", "处理成功");
|
||||
} catch (Exception e) {
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 进件审核驳回
|
||||
*/
|
||||
@PostMapping(value = "/canAudit")
|
||||
@ResponseBody
|
||||
public Map<String, Object> rejectAudit(@RequestParam Integer userId) {
|
||||
LambdaQueryWrapper<CommonRemark> qWrapper = new LambdaQueryWrapper<>();
|
||||
qWrapper.eq(CommonRemark::getCode, "CAN_AUDIT")
|
||||
.eq(CommonRemark::getUserId, userId);
|
||||
|
||||
remarkService.remove(qWrapper);
|
||||
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
result.put("code", "1");
|
||||
result.put("msg", "处理成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 进件审核驳回
|
||||
*/
|
||||
@GetMapping(value = "/rejectAudit2/{userId}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> rejectAudit2(@PathVariable("userId") Integer userId, String errMsg) {
|
||||
UserApp userApp = new UserApp().setUserId(userId.longValue()).setUserType("promoter");
|
||||
userApp = userAppService.queryUserApp(userApp);
|
||||
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
try {
|
||||
CommonRemark commonRemark = new CommonRemark()
|
||||
.setRemark("-1")
|
||||
.setUserId(userId)
|
||||
.setCode("CAN_AUDIT");
|
||||
remarkService.save(commonRemark);
|
||||
mcsService.rejectAudit(userApp.getMerchantCode(), errMsg);
|
||||
result.put("code", "1");
|
||||
result.put("msg", "处理成功");
|
||||
} catch (Exception e) {
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 进件审核驳回
|
||||
*/
|
||||
@GetMapping(value = "/rejectPluginAudit/{userId}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> rejectPluginAudit(@PathVariable("userId") Integer userId, String errMsg) {
|
||||
UserApp userApp = new UserApp().setUserId(userId.longValue());
|
||||
userApp = userAppService.queryUserApp(userApp);
|
||||
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
try {
|
||||
merchantPluginService.refuse(userApp.getUserId().toString(), errMsg);
|
||||
result.put("code", "1");
|
||||
result.put("msg", "处理成功");
|
||||
} catch (Exception e) {
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动后台批量发起进件
|
||||
*/
|
||||
@GetMapping(value = "/batchMerchantIncom")
|
||||
@ResponseBody
|
||||
public Map<String, Object> manualMerchantIncom() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
merchantStoreService.manualMerchantIncom();
|
||||
result.put("code", "1");
|
||||
result.put("msg", "进件任务执行中...");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件审核
|
||||
*/
|
||||
@PassToken
|
||||
@GetMapping(value = "/audit/{userId}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> audit(@PathVariable("userId") Integer userId) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
merchantPluginService.audit(String.valueOf(userId));
|
||||
result.put("code", "200");
|
||||
result.put("msg", "进件任务执行中...");
|
||||
} catch (Exception e) {
|
||||
result.put("code", "0");
|
||||
result.put("msg", e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file:
|
||||
* @return cn.pluss.platform.api.Result<?>
|
||||
* @description:批量导入d0excel开通文件
|
||||
* @date: 2021/8/4 11:46
|
||||
*/
|
||||
@RequestMapping(value = "/exportD0Excel")
|
||||
@ResponseBody
|
||||
public Result<?> exportD0Excel(@RequestParam("file") MultipartFile file) {
|
||||
return merchantStoreService.exportD0Excel(file);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/dowloadD0QuicklyExcel")
|
||||
@ResponseBody
|
||||
public void dowloadD0QuicklyExcel(HttpServletResponse response, String startTime, String endTime) throws IOException {
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isEmpty(endTime)) {
|
||||
return;
|
||||
}
|
||||
String suffix = ".zip";
|
||||
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<MerchantChannelStatus>()
|
||||
.in("status", MerchantChannelStatus.AUDIT_STATUS_QUICK_CASH, MerchantChannelStatus.AUDIT_STATUS_EXAMINING)
|
||||
.eq("channel", 4)
|
||||
.ne("thirdStatus", MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING)
|
||||
.between("createTime", startTime, endTime);
|
||||
List<MerchantChannelStatus> list = mcsService.list(queryWrapper);
|
||||
if (list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String tempName = DateUtils.formatDateDefault(DateUtils.parse(startTime, "yyyy-MM-dd HH:mm:ss"), "yyyyMMddHHmm") + "快付审核";
|
||||
String uploadTempPath = "/home/syb/resources/d0/temp";
|
||||
Properties prop = System.getProperties();
|
||||
String os = prop.getProperty("os.name");
|
||||
if (os.startsWith("win") || os.startsWith("Win")) {
|
||||
uploadTempPath = "E:/crystal/temp";// 测试 // windows目录
|
||||
}
|
||||
String tempPath = uploadTempPath + File.separator + tempName;
|
||||
File file = new File(tempPath);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
for (MerchantChannelStatus channelStatus : list) {
|
||||
MerchantBaseInfo merchant = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(channelStatus.getMerchantCode());
|
||||
if (merchant != null) {
|
||||
File f1 = new File(tempPath + File.separator + merchant.getAlias());
|
||||
if (!f1.exists()) {
|
||||
f1.mkdirs();
|
||||
}
|
||||
QueryWrapper<MerchantImage> imageQuery = new QueryWrapper<MerchantImage>().eq("merchantCode", merchant.getMerchantCode())
|
||||
.in("photoType", "06", "08", "09");
|
||||
List<MerchantImage> imageList = merchantImageService.list(imageQuery);
|
||||
String savePath = tempPath + File.separator + merchant.getAlias();
|
||||
if (!imageList.isEmpty()) {
|
||||
for (MerchantImage image : imageList) {
|
||||
try {
|
||||
String fileName = UUID.randomUUID().toString() + ".jpg";
|
||||
FileUtil.downloadFile(image.getPicUrl(), savePath + File.separator + fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FileOutputStream fos1 = new FileOutputStream(new File(uploadTempPath + File.separator + tempName + suffix));
|
||||
ZipUtil.toZip(tempPath, fos1, true);
|
||||
FileUtil.downLoad(response, tempName + suffix, tempPath + suffix);
|
||||
FileUtil.deleteDir(new File(uploadTempPath));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭通道支付权限
|
||||
* @param channelId 通道id
|
||||
* @param merchantCode 商编
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/banChannelValid")
|
||||
public Result<String> banChannelValid(int channelId, String merchantCode, String remark) {
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getChannel, channelId);
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
||||
|
||||
MerchantChannelStatus mcs = mcsService.getOne(qWrapper);
|
||||
|
||||
LambdaUpdateWrapper<MerchantChannelStatus> uWrapper = Wrappers.lambdaUpdate();
|
||||
uWrapper.eq(MerchantChannelStatus::getId, mcs.getId());
|
||||
uWrapper.set(MerchantChannelStatus::getValid, MerchantChannelStatus.VALID_STATUS_BAN)
|
||||
.set(MerchantChannelStatus::getUpdateTime, mcs.getUpdateTime())
|
||||
.set(MerchantChannelStatus::getRemark, remark);
|
||||
mcsService.update(uWrapper);
|
||||
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭通道支付权限
|
||||
* @param channelId 通道id
|
||||
* @param merchantCode 商编
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/openChannelValid")
|
||||
public Result<String> openChannelValid(int channelId, String merchantCode) {
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getChannel, channelId);
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
||||
|
||||
MerchantChannelStatus mcs = mcsService.getOne(qWrapper);
|
||||
|
||||
LambdaUpdateWrapper<MerchantChannelStatus> uWrapper = Wrappers.lambdaUpdate();
|
||||
uWrapper.eq(MerchantChannelStatus::getId, mcs.getId());
|
||||
uWrapper.set(MerchantChannelStatus::getValid, MerchantChannelStatus.VALID_STATUS_NORMAL)
|
||||
.set(MerchantChannelStatus::getUpdateTime, mcs.getUpdateTime());
|
||||
mcsService.update(uWrapper);
|
||||
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.pluss.platform.controller.merchantTranfer;
|
||||
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.MerchantTransfer;
|
||||
import cn.pluss.platform.transfer.MerchantTransferService;
|
||||
import cn.pluss.platform.util.PageUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("merchantTransfer")
|
||||
public class MerchantTransferController extends BaseNoModelController {
|
||||
|
||||
private final MerchantTransferService merchantTransferService;
|
||||
|
||||
@GetMapping("index")
|
||||
public String index() {
|
||||
return "merchantTransfer/list";
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ResponseBody
|
||||
public Result<PageInfo<MerchantTransfer>> page(Page<MerchantTransfer> page,MerchantTransfer transfer) {
|
||||
QueryWrapper<MerchantTransfer> queryWrapper = new QueryWrapper<MerchantTransfer>().orderByDesc("createDt");
|
||||
if(StringUtil.isNotEmpty(transfer.getAlias())){
|
||||
queryWrapper.like("alias",transfer.getAlias());
|
||||
}
|
||||
if(StringUtil.isNotEmpty(transfer.getOrderNo())){
|
||||
queryWrapper.eq("orderNo",transfer.getOrderNo());
|
||||
}
|
||||
page = merchantTransferService.page(page, queryWrapper);
|
||||
return ResultGenerator.genSuccessResult(PageUtils.page(page));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package cn.pluss.platform.controller.newArea;
|
||||
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entity.NewArea;
|
||||
import cn.pluss.platform.newArea.NewAreaService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("newArea")
|
||||
public class NewAreaController extends BaseNoModelController {
|
||||
|
||||
private Integer PAGE_SIZE=12;
|
||||
|
||||
@Autowired
|
||||
private NewAreaService newAreaService;
|
||||
|
||||
/**
|
||||
*引导页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||
public String index() {
|
||||
|
||||
return "newArea/newAreaList";
|
||||
}
|
||||
|
||||
/**
|
||||
*分页查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryNewAreaByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> queryNewAreaByPage(Integer currPage,Integer id){
|
||||
|
||||
if(currPage==null) {
|
||||
currPage=1;
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String, Object>();
|
||||
map.put("pageSize",PAGE_SIZE);
|
||||
map.put("offset", (currPage-1)*PAGE_SIZE);
|
||||
map.put("id", id);
|
||||
List<NewArea> newAreaList=newAreaService.queryNewAreaPage(map);
|
||||
Integer count=newAreaService.queryNewAreaPageCount(map);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("newAreaList", newAreaList);
|
||||
result.put("count", count);
|
||||
result.put("pageCount",StringUtil.getPageCount(count,PAGE_SIZE));
|
||||
result.put("currPage", currPage);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryNewAreaDetails", method = RequestMethod.GET)
|
||||
public String queryNewAreaDetails(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
NewArea newArea=new NewArea();
|
||||
newArea.setId(id);
|
||||
newArea=newAreaService.queryNewArea(newArea);
|
||||
request.setAttribute("newArea", newArea);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "newArea/newAreaDetails";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryNewAreaBaseInfo", method = RequestMethod.GET)
|
||||
public String queryNewAreaBaseInfo(HttpServletRequest request,Integer id,Integer pageIndex){
|
||||
|
||||
if(id!=null&&id!=0) {
|
||||
NewArea newArea=new NewArea();
|
||||
newArea.setId(id);
|
||||
newArea=newAreaService.queryNewArea(newArea);
|
||||
request.setAttribute("newArea", newArea);
|
||||
request.setAttribute("pageIndex", pageIndex);
|
||||
}
|
||||
return "newArea/newAreaBaseInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryNewAreaExtendsInfo", method = RequestMethod.GET)
|
||||
public String queryNewAreaExtendsInfo(){
|
||||
|
||||
return "newArea/newAreaExtendsInfo";
|
||||
}
|
||||
/**
|
||||
*查询详情
|
||||
*/
|
||||
@RequestMapping(value = "/queryNewAreaFunctionsInfo", method = RequestMethod.GET)
|
||||
public String queryNewAreaFunctionsInfo(){
|
||||
|
||||
return "newArea/newAreaFunctionsInfo";
|
||||
}
|
||||
/**
|
||||
*保存对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/saveNewArea", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> saveNewArea(NewArea newArea){
|
||||
|
||||
if(newArea.getId()!=null&&newArea.getId()!=0){
|
||||
newAreaService.updateNewArea(newArea);
|
||||
}else{
|
||||
newAreaService.saveNewArea(newArea);
|
||||
}
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*修改对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/updateNewArea", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateNewArea(Integer id){
|
||||
|
||||
NewArea newArea=new NewArea();
|
||||
newArea.setId(id);
|
||||
newAreaService.updateNewArea(newArea);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*删除对象
|
||||
*@throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/deleteNewArea", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteNewArea(Integer id){
|
||||
NewArea newArea=new NewArea();
|
||||
newArea.setId(id);
|
||||
newAreaService.deleteNewArea(newArea);
|
||||
Map<String,Object> result=new HashMap<String,Object>();
|
||||
result.put("resultCode", "1");
|
||||
result.put("resultMessage", "保存成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user