初始项目

This commit is contained in:
liupopo
2023-02-11 12:55:02 +08:00
parent 1748bda84a
commit 0b89e36064
3363 changed files with 506201 additions and 1 deletions

256
mallplus-admin/pom.xml Normal file
View File

@@ -0,0 +1,256 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zscat.mallplus</groupId>
<artifactId>mallplus-admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mallplus-admin</name>
<description>mallplus-admin project for mall</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--<version>2.1.3.RELEASE</version>-->
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<repositories>
<repository>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
<repository>
<id>aliyun_thirdparty</id>
<url>http://maven.aliyun.com/nexus/content/repositories/thirdparty/</url>
</repository>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<j2cache.version>2.7.2-release</j2cache.version>
<skipTests>true</skipTests>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.geccocrawler</groupId>
<artifactId>gecco</artifactId>
<version>1.0.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.59</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.10</version>
</dependency>
<!--模板引擎-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- 定时任务 -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<exclusions>
<exclusion>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.zscat.mallplus</groupId>
<artifactId>mallplus-mbg</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--redis依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<!--JWT(Json Web Token)登录支持-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.5.0</version>
</dependency>
<!--集成logstash-->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.8</version>
</dependency>
<!--redis依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<!--lombok依赖-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.ftl</include>
<include>**/*.properties</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.ftl</include>
<include>**/*.properties</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--<plugin>-->
<!--<groupId>com.spotify</groupId>-->
<!--<artifactId>docker-maven-plugin</artifactId>-->
<!--<version>1.1.0</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>build-image</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>build</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<imageName>mall/${project.artifactId}:${project.version}</imageName>-->
<!--<dockerHost>http://39.98.190.128:2375</dockerHost>-->
<!--<baseImage>java:8</baseImage>-->
<!--<entryPoint>["java", "-jar", "-Dspring.profiles.active=prod","/${project.build.finalName}.jar"]</entryPoint>-->
<!--<resources>-->
<!--<resource>-->
<!--<targetPath>/</targetPath>-->
<!--<directory>${project.build.directory}</directory>-->
<!--<include>${project.build.finalName}.jar</include>-->
<!--</resource>-->
<!--</resources>-->
<!--</configuration>-->
<!--</plugin>-->
</plugins>
</build>
</project>

View File

@@ -0,0 +1,36 @@
package com.zscat.mallplus;
import com.zscat.mallplus.sys.mapper.GeneratorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
/**
* @author lnj
* createTime 2018-11-07 22:25
**/
@Component
public class CommandLineRunnerImpl implements CommandLineRunner {
@Autowired
GeneratorMapper generatorMapper;
public static void main(String[] args) {
System.out.println("http://localhost:8083/cms/CmsSubjectCategory/list".replace("//", "a").indexOf("/") + 1);
}
@Override
public void run(String... args) throws Exception {
/*List<Map<String, Object>> tables = generatorMapper.list();
for (Map<String, Object> map : tables) {
List<Map<String, String>> colus = generatorMapper.listColumns(map.get("tableName").toString());
for (Map<String, String> mapc : colus) {
if (mapc.get("columnName").equals("store_id")) {
Constant.Tables.put(map.get("tableName").toString(), "1");
}
}
}*/
}
}

View File

@@ -0,0 +1,27 @@
package com.zscat.mallplus;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ExportGoods {
@Excel(name = "", width = 10)
private String username;
@Excel(name = "去去", width = 10)
private String img;
@Excel(name = "去去去", width = 10)
private String detail;
@Excel(name = "去去去去", width = 10)
private String price;
@Excel(name = "去去去去去", width = 10)
private String originprice;
@Excel(name = "去去去去去去", width = 10)
private String detail1;
}

View File

@@ -0,0 +1,21 @@
package com.zscat.mallplus;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ExportSubject {
@Excel(name = "", width = 10)
private String title;
@Excel(name = "去去", width = 10)
private String pic;
@Excel(name = "去去去", width = 10)
private String content;
}

View File

@@ -0,0 +1,22 @@
package com.zscat.mallplus;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ExportUser {
@Excel(name = "用户名", width = 10)
private String username;
@Excel(name = "创建时间", format = "yyyy-MM-dd", width = 15)
private Date createTime;
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* 应用启动入口
* https://github.com/shenzhuan/mallplus on 2018/4/26.
*/
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@MapperScan({"com.zscat.mallplus.mapper", "com.zscat.mallplus.ums.mapper", "com.zscat.mallplus.sms.mapper", "com.zscat.mallplus.cms.mapper", "com.zscat.mallplus.sys.mapper", "com.zscat.mallplus.oms.mapper", "com.zscat.mallplus.pms.mapper"})
@EnableTransactionManagement
public class MallAdminApplication {
public static void main(String[] args) {
SpringApplication.run(MallAdminApplication.class, args);
}
}

View File

@@ -0,0 +1,52 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillAftersales;
import com.zscat.mallplus.bill.service.IBillAftersalesService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 退货单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billAftersales")
public class BillAftersalesController {
@Resource
private IBillAftersalesService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有退货单表")
@ApiOperation("根据条件查询所有退货单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillAftersales entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillAftersales>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,51 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillDelivery;
import com.zscat.mallplus.bill.service.IBillDeliveryService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 发货单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billDelivery")
public class BillDeliveryController {
@Resource
private IBillDeliveryService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有发货单表")
@ApiOperation("根据条件查询所有发货单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillDelivery entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillDelivery>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,50 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillLading;
import com.zscat.mallplus.bill.service.IBillLadingService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 提货单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billLading")
public class BillLadingController {
@Resource
private IBillLadingService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有提货单表")
@ApiOperation("根据条件查询提货单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillLading entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillLading>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,50 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillPayments;
import com.zscat.mallplus.bill.service.IBillPaymentsService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 支付单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billPayments")
public class BillPaymentsController {
@Resource
private IBillPaymentsService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有支付单表")
@ApiOperation("根据条件查询所有支付单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillPayments entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillPayments>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,50 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillRefund;
import com.zscat.mallplus.bill.service.IBillRefundService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 退款单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billRefund")
public class BillRefundController {
@Resource
private IBillRefundService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有退款单表")
@ApiOperation("根据条件查询所有退款单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillRefund entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillRefund>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,50 @@
package com.zscat.mallplus.bill.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.bill.entity.BillReship;
import com.zscat.mallplus.bill.service.IBillReshipService;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 退货单表 前端控制器
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Slf4j
@RestController
@RequestMapping("/bill/billReship")
public class BillReshipController {
@Resource
private IBillReshipService billAftersalesService;
@SysLog(MODULE = "bill", REMARK = "根据条件查询所有退货单表表")
@ApiOperation("根据条件查询所有退货单表")
@GetMapping(value = "/list")
public Object getCmsHelpByPage(BillReship entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(billAftersalesService.page(new Page<BillReship>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有退货单表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BakCategory;
/**
* <p>
* 类目表 服务类
* </p>
*
* @author zscat
* @since 2019-09-17
*/
public interface IBakCategoryService extends IService<BakCategory> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BakGoods;
/**
* <p>
* 商品基本信息表 服务类
* </p>
*
* @author zscat
* @since 2019-09-17
*/
public interface IBakGoodsService extends IService<BakGoods> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillAftersalesItems;
/**
* <p>
* 售后单明细表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillAftersalesItemsService extends IService<BillAftersalesItems> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillAftersales;
/**
* <p>
* 退货单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillAftersalesService extends IService<BillAftersales> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillDeliveryItems;
/**
* <p>
* 发货单详情表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillDeliveryItemsService extends IService<BillDeliveryItems> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillDelivery;
/**
* <p>
* 发货单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillDeliveryService extends IService<BillDelivery> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillLading;
/**
* <p>
* 提货单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillLadingService extends IService<BillLading> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillPaymentsRel;
/**
* <p>
* 支付单明细表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillPaymentsRelService extends IService<BillPaymentsRel> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillPayments;
/**
* <p>
* 支付单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillPaymentsService extends IService<BillPayments> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillRefund;
/**
* <p>
* 退款单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillRefundService extends IService<BillRefund> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillReshipItems;
/**
* <p>
* 退货单明细表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillReshipItemsService extends IService<BillReshipItems> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.bill.entity.BillReship;
/**
* <p>
* 退货单表 服务类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
public interface IBillReshipService extends IService<BillReship> {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BakCategory;
import com.zscat.mallplus.bill.mapper.BakCategoryMapper;
import com.zscat.mallplus.bill.service.IBakCategoryService;
import org.springframework.stereotype.Service;
/**
* <p>
* 类目表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-17
*/
@Service
public class BakCategoryServiceImpl extends ServiceImpl<BakCategoryMapper, BakCategory> implements IBakCategoryService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BakGoods;
import com.zscat.mallplus.bill.mapper.BakGoodsMapper;
import com.zscat.mallplus.bill.service.IBakGoodsService;
import org.springframework.stereotype.Service;
/**
* <p>
* 商品基本信息表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-17
*/
@Service
public class BakGoodsServiceImpl extends ServiceImpl<BakGoodsMapper, BakGoods> implements IBakGoodsService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillAftersalesItems;
import com.zscat.mallplus.bill.mapper.BillAftersalesItemsMapper;
import com.zscat.mallplus.bill.service.IBillAftersalesItemsService;
import org.springframework.stereotype.Service;
/**
* <p>
* 售后单明细表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillAftersalesItemsServiceImpl extends ServiceImpl<BillAftersalesItemsMapper, BillAftersalesItems> implements IBillAftersalesItemsService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillAftersales;
import com.zscat.mallplus.bill.mapper.BillAftersalesMapper;
import com.zscat.mallplus.bill.service.IBillAftersalesService;
import org.springframework.stereotype.Service;
/**
* <p>
* 退货单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillAftersalesServiceImpl extends ServiceImpl<BillAftersalesMapper, BillAftersales> implements IBillAftersalesService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillDeliveryItems;
import com.zscat.mallplus.bill.mapper.BillDeliveryItemsMapper;
import com.zscat.mallplus.bill.service.IBillDeliveryItemsService;
import org.springframework.stereotype.Service;
/**
* <p>
* 发货单详情表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillDeliveryItemsServiceImpl extends ServiceImpl<BillDeliveryItemsMapper, BillDeliveryItems> implements IBillDeliveryItemsService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillDelivery;
import com.zscat.mallplus.bill.mapper.BillDeliveryMapper;
import com.zscat.mallplus.bill.service.IBillDeliveryService;
import org.springframework.stereotype.Service;
/**
* <p>
* 发货单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillDeliveryServiceImpl extends ServiceImpl<BillDeliveryMapper, BillDelivery> implements IBillDeliveryService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillLading;
import com.zscat.mallplus.bill.mapper.BillLadingMapper;
import com.zscat.mallplus.bill.service.IBillLadingService;
import org.springframework.stereotype.Service;
/**
* <p>
* 提货单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillLadingServiceImpl extends ServiceImpl<BillLadingMapper, BillLading> implements IBillLadingService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillPaymentsRel;
import com.zscat.mallplus.bill.mapper.BillPaymentsRelMapper;
import com.zscat.mallplus.bill.service.IBillPaymentsRelService;
import org.springframework.stereotype.Service;
/**
* <p>
* 支付单明细表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillPaymentsRelServiceImpl extends ServiceImpl<BillPaymentsRelMapper, BillPaymentsRel> implements IBillPaymentsRelService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillPayments;
import com.zscat.mallplus.bill.mapper.BillPaymentsMapper;
import com.zscat.mallplus.bill.service.IBillPaymentsService;
import org.springframework.stereotype.Service;
/**
* <p>
* 支付单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillPaymentsServiceImpl extends ServiceImpl<BillPaymentsMapper, BillPayments> implements IBillPaymentsService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillRefund;
import com.zscat.mallplus.bill.mapper.BillRefundMapper;
import com.zscat.mallplus.bill.service.IBillRefundService;
import org.springframework.stereotype.Service;
/**
* <p>
* 退款单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillRefundServiceImpl extends ServiceImpl<BillRefundMapper, BillRefund> implements IBillRefundService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillReshipItems;
import com.zscat.mallplus.bill.mapper.BillReshipItemsMapper;
import com.zscat.mallplus.bill.service.IBillReshipItemsService;
import org.springframework.stereotype.Service;
/**
* <p>
* 退货单明细表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillReshipItemsServiceImpl extends ServiceImpl<BillReshipItemsMapper, BillReshipItems> implements IBillReshipItemsService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.bill.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.bill.entity.BillReship;
import com.zscat.mallplus.bill.mapper.BillReshipMapper;
import com.zscat.mallplus.bill.service.IBillReshipService;
import org.springframework.stereotype.Service;
/**
* <p>
* 退货单表 服务实现类
* </p>
*
* @author zscat
* @since 2019-09-16
*/
@Service
public class BillReshipServiceImpl extends ServiceImpl<BillReshipMapper, BillReship> implements IBillReshipService {
}

View File

@@ -0,0 +1,72 @@
package com.zscat.mallplus.bo;
import com.zscat.mallplus.sys.entity.SysPermission;
import com.zscat.mallplus.sys.entity.SysUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* SpringSecurity需要的用户详情
* https://github.com/shenzhuan/mallplus on 2018/4/28.
*/
public class AdminUserDetails implements UserDetails {
private SysUser umsAdmin;
private List<SysPermission> permissionList;
public AdminUserDetails(SysUser umsAdmin, List<SysPermission> permissionList) {
this.umsAdmin = umsAdmin;
this.permissionList = permissionList;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
//返回当前用户的权限
return permissionList.stream()
.filter(permission -> permission.getValue() != null)
.map(permission -> new SimpleGrantedAuthority(permission.getValue()))
.collect(Collectors.toList());
}
@Override
public String getPassword() {
return umsAdmin.getPassword();
}
@Override
public String getUsername() {
return umsAdmin.getUsername();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return umsAdmin.getStatus().equals(1);
}
public SysUser getUmsAdmin() {
return umsAdmin;
}
public void setUmsAdmin(SysUser umsAdmin) {
this.umsAdmin = umsAdmin;
}
}

View File

@@ -0,0 +1,91 @@
package com.zscat.mallplus.bo;
/**
* 列的属性
*/
public class ColumnDO {
// 列名
private String columnName;
// 列名类型
private String dataType;
// 列名备注
private String comments;
// 属性名称(第一个字母大写)user_name => UserName
private String attrName;
// 属性名称(第一个字母小写)user_name => userName
private String attrname;
// 属性类型
private String attrType;
// auto_increment
private String extra;
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public String getAttrname() {
return attrname;
}
public void setAttrname(String attrname) {
this.attrname = attrname;
}
public String getAttrName() {
return attrName;
}
public void setAttrName(String attrName) {
this.attrName = attrName;
}
public String getAttrType() {
return attrType;
}
public void setAttrType(String attrType) {
this.attrType = attrType;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
@Override
public String toString() {
return "ColumnDO{" +
"columnName='" + columnName + '\'' +
", dataType='" + dataType + '\'' +
", comments='" + comments + '\'' +
", attrName='" + attrName + '\'' +
", attrname='" + attrname + '\'' +
", attrType='" + attrType + '\'' +
", extra='" + extra + '\'' +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.zscat.mallplus.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 列的数据信息
*
* @author mallplus
* @date 2019-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ColumnInfo {
// 数据库字段名称
private Object columnName;
// 允许空值
private Object isNullable;
// 数据库字段类型
private Object columnType;
// 数据库字段注释
private Object columnComment;
// 数据库字段键类型
private Object columnKey;
// 额外的参数
private Object extra;
// 查询 1:模糊 2精确
private String columnQuery;
// 是否在列表显示
private String columnShow;
}

View File

@@ -0,0 +1,40 @@
package com.zscat.mallplus.bo;
import com.zscat.mallplus.oms.vo.OrderStstic;
import com.zscat.mallplus.vo.OrderStatusCount;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @Auther: shenzhuan
* @Date: 2019/2/23 13:12
* @Description:
*/
@Data
public class HomeOrderData implements Serializable {
int nowOrderCount = 0; // 今日订单
BigDecimal nowOrderPay = new BigDecimal(0); //今日销售总额
int yesOrderCount = 0; // 昨日订单
BigDecimal yesOrderPay = new BigDecimal(0); //日销售总额
int qiOrderCount = 0; // 7日订单
BigDecimal qiOrderPay = new BigDecimal(0); //7日销售总额
int monthOrderCount = 0; // 本月订单
BigDecimal monthOrderPay = new BigDecimal(0); //本月销售总额
int weekOrderCount = 0; // 本月订单
BigDecimal weekOrderPay = new BigDecimal(0); //本月销售总额
int yesToatlOrderCount = 0; // 昨日订单
BigDecimal yesTotalOrderPay = new BigDecimal(0); //日销售总额
int nowTotalOrderCount = 0; // 今日订单
BigDecimal nowToatlOrderPay = new BigDecimal(0); //今日销售总额
private OrderStatusCount orderStatusCount;
int lastWeekOrderCount = 0; // 上周订单
BigDecimal lastWeekOrderPay = new BigDecimal(0); //上周销售总额
int lastMonthOrderCount = 0; // 上月订单
BigDecimal lastMonthOrderPay = new BigDecimal(0); //上月销售总额
List<OrderStstic> orderStsticList;
}

View File

@@ -0,0 +1,17 @@
package com.zscat.mallplus.bo;
import com.zscat.mallplus.pms.entity.PmsProduct;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class SmsFlashPromotionProducts implements Serializable {
private Long id;
private BigDecimal flashPromotionPrice;
private Integer flashPromotionCount;
private Integer flashPromotionLimit;
private Integer sort;
private PmsProduct product;
}

View File

@@ -0,0 +1,155 @@
package com.zscat.mallplus.bo;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.sys.entity.SysAdminLog;
import com.zscat.mallplus.sys.entity.SysUser;
import com.zscat.mallplus.sys.service.ISysAdminLogService;
import com.zscat.mallplus.sys.service.ISysUserService;
import com.zscat.mallplus.util.IpAddressUtil;
import com.zscat.mallplus.util.UserUtils;
import com.zscat.mallplus.utils.ValidatorUtils;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
/**
* 系统日志,切面处理类
*/
@Aspect
@Component
public class SysLogAspect {
@Resource
public ISysAdminLogService fopSystemOperationLogService;
@Resource
public ISysUserService adminService;
private Logger logger = LoggerFactory.getLogger(SysLogAspect.class);
public static String getString(Object o) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
StringBuffer sb = new StringBuffer();
sb.append("entity[");
Field[] farr = o.getClass().getDeclaredFields();
for (Field field : farr) {
try {
field.setAccessible(true);
if (!ValidatorUtils.empty(field.get(o))) {
sb.append(field.getName());
sb.append("=");
if (field.get(o) instanceof Date) {
// 日期的处理
sb.append(sdf.format(field.get(o)));
} else {
sb.append(field.get(o));
}
sb.append("|");
}
} catch (Exception e) {
e.printStackTrace();
}
}
sb.append("]");
return sb.toString();
}
@Pointcut("@annotation(com.zscat.mallplus.annotation.SysLog)")
public void logPointCut() {
}
@Before("logPointCut()")
public void saveSysLog(JoinPoint joinPoint) {
try {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
SysAdminLog sysLog = new SysAdminLog();
SysLog syslog1 = method.getAnnotation(SysLog.class);
if (syslog1 != null) {
//注解上的描述
sysLog.setServiceName(syslog1.MODULE());
sysLog.setOperationDesc(syslog1.REMARK());
}
//请求的方法名
String clazzName = joinPoint.getTarget().getClass().getName();
Class<?> clazz = Class.forName(clazzName);
String clazzSimpleName = clazz.getSimpleName();
String methodName = signature.getName();
sysLog.setMethod(clazzSimpleName + "." + methodName);
//请求的参数
String[] parameterNames = ((MethodSignature) joinPoint.getSignature()).getParameterNames();
StringBuilder sb = null;
if (Objects.nonNull(parameterNames)) {
sb = new StringBuilder();
for (int i = 0; i < parameterNames.length; i++) {
Object param = joinPoint.getArgs()[i] != null ? joinPoint.getArgs()[i] : "";
if (StringUtils.isNotEmpty(param.toString()) && !"request".equals(parameterNames[i]) && !"response".equals(parameterNames[i])
&& !"modelMap".equals(parameterNames[i])) {
if (param instanceof Integer) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof String) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Double) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Float) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Long) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Boolean) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Date) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else if (param instanceof Timestamp) {
sb.append(parameterNames[i] + ":" + param + "; ");
} else {
sb.append(parameterNames[i] + ":" + getString(param) + "; ");
}
}
}
}
sb = sb == null ? new StringBuilder() : sb;
sysLog.setParams(sb.toString());
//设置IP地址
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
sysLog.setIp(IpAddressUtil.getIpAddr(request));
//用户名
SysUser sysUserEntity = UserUtils.getCurrentMember();
if (null != sysUserEntity && sysUserEntity.getId() != null) {
sysLog.setUserId(sysUserEntity.getId());
sysLog.setUserName(sysUserEntity.getUsername());
}
sysLog.setCreateTime(new Date());
logger.info(getString(sysLog));
//保存系统日志
// fopSystemOperationLogService.save(sysLog);
} catch (Exception ex) {
logger.error("保存系统日志失败" + ex.getMessage());
}
}
}

View File

@@ -0,0 +1,86 @@
package com.zscat.mallplus.bo;
import java.util.List;
/**
* 表数据
*
* @author zscat
* @email sunlightcs@gmail.com
* @date 2016年12月20日 上午12:02:55
*/
public class TableDO {
//表的名称
private String tableName;
//表的备注
private String comments;
//表的主键
private ColumnDO pk;
//表的列名(不包含主键)
private List<ColumnDO> columns;
//类名(第一个字母大写)sys_user => SysUser
private String className;
//类名(第一个字母小写)sys_user => sysUser
private String classname;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public ColumnDO getPk() {
return pk;
}
public void setPk(ColumnDO pk) {
this.pk = pk;
}
public List<ColumnDO> getColumns() {
return columns;
}
public void setColumns(List<ColumnDO> columns) {
this.columns = columns;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getClassname() {
return classname;
}
public void setClassname(String classname) {
this.classname = classname;
}
@Override
public String toString() {
return "TableDO{" +
"tableName='" + tableName + '\'' +
", comments='" + comments + '\'' +
", pk=" + pk +
", columns=" + columns +
", className='" + className + '\'' +
", classname='" + classname + '\'' +
'}';
}
}

View File

@@ -0,0 +1,34 @@
package com.zscat.mallplus.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 表的数据信息
*
* @author mallplus
* @date 2019-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TableInfo {
// 表名称
private Object tableName;
// 创建日期
private Object createTime;
// 数据库引擎
private Object engine;
// 编码集
private Object coding;
// 备注
private Object remark;
}

View File

@@ -0,0 +1,180 @@
package com.zscat.mallplus.bo;
import com.alibaba.fastjson.JSON;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* tree TODO <br>
*
* @author kangxu2 2017-1-7
*/
public class Tree<T> {
/**
* 节点ID
*/
private String id;
/**
* 显示节点文本
*/
private String title;
/**
* 节点状态open closed
*/
private Map<String, Object> state;
/**
* 节点是否被选中 true false
*/
private boolean checked = false;
/**
* 节点属性
*/
private Map<String, Object> meta;
/**
* 节点的子节点
*/
private List<Tree<T>> children = new ArrayList<Tree<T>>();
private String component;
/**
* 父ID
*/
private String parentId;
private String path;
private String name;
/**
* 是否有父节点
*/
private boolean hasParent = false;
/**
* 是否有子节点
*/
private boolean hasChildren = false;
public Tree(String id, String text, Map<String, Object> state, boolean checked, Map<String, Object> attributes,
List<Tree<T>> children, boolean isParent, boolean isChildren, String parentID) {
super();
this.id = id;
this.title = text;
this.state = state;
this.checked = checked;
this.meta = attributes;
this.children = children;
this.hasParent = isParent;
this.hasChildren = isChildren;
this.parentId = parentID;
}
public Tree() {
super();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Map<String, Object> getState() {
return state;
}
public void setState(Map<String, Object> state) {
this.state = state;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public Map<String, Object> getMeta() {
return meta;
}
public void setMeta(Map<String, Object> meta) {
this.meta = meta;
}
public List<Tree<T>> getChildren() {
return children;
}
public void setChildren(boolean isChildren) {
this.hasChildren = isChildren;
}
public void setChildren(List<Tree<T>> children) {
this.children = children;
}
public boolean isHasParent() {
return hasParent;
}
public void setHasParent(boolean isParent) {
this.hasParent = isParent;
}
public boolean isHasChildren() {
return hasChildren;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}

View File

@@ -0,0 +1,144 @@
package com.zscat.mallplus.bo;
/**
* Controller层的日志封装类
* https://github.com/shenzhuan/mallplus on 2018/4/28.
*/
public class WebLog {
/**
* 操作描述
*/
private String description;
/**
* 操作用户
*/
private String username;
/**
* 操作时间
*/
private Long startTime;
/**
* 消耗时间
*/
private Integer spendTime;
/**
* 根路径
*/
private String basePath;
/**
* URI
*/
private String uri;
/**
* URL
*/
private String url;
/**
* 请求类型
*/
private String method;
/**
* IP地址
*/
private String ip;
private Object parameter;
private Object result;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Integer getSpendTime() {
return spendTime;
}
public void setSpendTime(Integer spendTime) {
this.spendTime = spendTime;
}
public String getBasePath() {
return basePath;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Object getParameter() {
return parameter;
}
public void setParameter(Object parameter) {
this.parameter = parameter;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
}

View File

@@ -0,0 +1,169 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildAdv;
import com.zscat.mallplus.build.service.IBuildAdvService;
import com.zscat.mallplus.enums.StatusEnum;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 首页轮播广告表 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/adv")
public class BuildAdvController {
@Resource
private IBuildAdvService IBuildAdvService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有轮播广告列表")
@ApiOperation("根据条件查询所有轮播广告列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:adv:read')")
public Object getBuildAdvByPage(BuildAdv entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildAdvService.page(new Page<BuildAdv>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有轮播广告列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存轮播广告")
@ApiOperation("保存轮播广告")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:adv:create')")
public Object saveBuildAdv(@RequestBody BuildAdv entity) {
try {
entity.setStatus(StatusEnum.AuditType.INIT.code());
if (IBuildAdvService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存轮播广告:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新轮播广告")
@ApiOperation("更新轮播广告")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:adv:update')")
public Object updateBuildAdv(@RequestBody BuildAdv entity) {
try {
if (IBuildAdvService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新轮播广告:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除轮播广告")
@ApiOperation("删除轮播广告")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:adv:delete')")
public Object deleteBuildAdv(@ApiParam("轮播广告id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("轮播广告id");
}
if (IBuildAdvService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除轮播广告:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给轮播广告分配轮播广告")
@ApiOperation("查询轮播广告明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:adv:read')")
public Object getBuildAdvById(@ApiParam("轮播广告id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("轮播广告id");
}
BuildAdv coupon = IBuildAdvService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询轮播广告明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除轮播广告")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除轮播广告")
@PreAuthorize("hasAuthority('build:adv:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildAdvService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@SysLog(MODULE = "build", REMARK = "修改上下线状态")
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@PathVariable Long id, Integer status) {
BuildAdv record = new BuildAdv();
record.setId(id);
record.setStatus(status);
return IBuildAdvService.updateById(record);
}
@SysLog(MODULE = "build", REMARK = "导出社区数据")
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildAdv entity) {
// 模拟从数据库获取需要导出的数据
List<BuildAdv> personList = IBuildAdvService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildAdv.class, "导出社区数据.xls", response);
}
@SysLog(MODULE = "build", REMARK = "导入社区数据")
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildAdv> personList = EasyPoiUtils.importExcel(file, BuildAdv.class);
IBuildAdvService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Controller
@RequestMapping("/build/buildApplyRoom")
public class BuildApplyRoomController {
}

View File

@@ -0,0 +1,153 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildGroup;
import com.zscat.mallplus.enums.StatusEnum;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/group")
public class BuildGroupController {
@Resource
private com.zscat.mallplus.build.service.IBuildGroupService IBuildGroupService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有拼团列表")
@ApiOperation("根据条件查询所有拼团列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:group:read')")
public Object getBuildGroupByPage(BuildGroup entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildGroupService.page(new Page<BuildGroup>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有拼团列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存拼团")
@ApiOperation("保存拼团")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:group:create')")
public Object saveBuildGroup(@RequestBody BuildGroup entity) {
try {
entity.setStatus(StatusEnum.AuditType.INIT.code());
if (IBuildGroupService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存拼团:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新拼团")
@ApiOperation("更新拼团")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:group:update')")
public Object updateBuildGroup(@RequestBody BuildGroup entity) {
try {
if (IBuildGroupService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新拼团:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除拼团")
@ApiOperation("删除拼团")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:group:delete')")
public Object deleteBuildGroup(@ApiParam("拼团id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("拼团id");
}
if (IBuildGroupService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除拼团:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给拼团分配拼团")
@ApiOperation("查询拼团明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:group:read')")
public Object getBuildGroupById(@ApiParam("拼团id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("拼团id");
}
BuildGroup coupon = IBuildGroupService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询拼团明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除拼团")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除拼团")
@PreAuthorize("hasAuthority('build:group:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildGroupService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildGroup entity) {
// 模拟从数据库获取需要导出的数据
List<BuildGroup> personList = IBuildGroupService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildGroup.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildGroup> personList = EasyPoiUtils.importExcel(file, BuildGroup.class);
IBuildGroupService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,154 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildGroupMember;
import com.zscat.mallplus.enums.StatusEnum;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/groupMember")
public class BuildGroupMemberController {
@Resource
private com.zscat.mallplus.build.service.IBuildGroupMemberService IBuildGroupMemberService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有拼团列表")
@ApiOperation("根据条件查询所有拼团列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:groupMember:read')")
public Object getBuildGroupMemberByPage(BuildGroupMember entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildGroupMemberService.page(new Page<BuildGroupMember>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有拼团列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存拼团")
@ApiOperation("保存拼团")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:groupMember:create')")
public Object saveBuildGroupMember(@RequestBody BuildGroupMember entity) {
try {
entity.setStatus(StatusEnum.AuditType.INIT.code());
if (IBuildGroupMemberService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存拼团:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新拼团")
@ApiOperation("更新拼团")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:groupMember:update')")
public Object updateBuildGroupMember(@RequestBody BuildGroupMember entity) {
try {
if (IBuildGroupMemberService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新拼团:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除拼团")
@ApiOperation("删除拼团")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:groupMember:delete')")
public Object deleteBuildGroupMember(@ApiParam("拼团id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("拼团id");
}
if (IBuildGroupMemberService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除拼团:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给拼团分配拼团")
@ApiOperation("查询拼团明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:groupMember:read')")
public Object getBuildGroupMemberById(@ApiParam("拼团id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("拼团id");
}
BuildGroupMember coupon = IBuildGroupMemberService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询拼团明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除拼团")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除拼团")
@PreAuthorize("hasAuthority('build:groupMember:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildGroupMemberService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildGroupMember entity) {
// 模拟从数据库获取需要导出的数据
List<BuildGroupMember> personList = IBuildGroupMemberService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildGroupMember.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildGroupMember> personList = EasyPoiUtils.importExcel(file, BuildGroupMember.class);
IBuildGroupMemberService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,154 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildNotice;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 公告表 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/notice")
public class BuildNoticeController {
@Resource
private com.zscat.mallplus.build.service.IBuildNoticeService IBuildNoticeService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有公告表列表")
@ApiOperation("根据条件查询所有公告表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:notice:read')")
public Object getBuildNoticeByPage(BuildNotice entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildNoticeService.page(new Page<BuildNotice>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有公告表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存公告表")
@ApiOperation("保存公告表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:notice:create')")
public Object saveBuildNotice(@RequestBody BuildNotice entity) {
try {
entity.setCreateTime(new Date());
if (IBuildNoticeService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存公告表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新公告表")
@ApiOperation("更新公告表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:notice:update')")
public Object updateBuildNotice(@RequestBody BuildNotice entity) {
try {
if (IBuildNoticeService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新公告表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除公告表")
@ApiOperation("删除公告表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:notice:delete')")
public Object deleteBuildNotice(@ApiParam("公告表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("公告表id");
}
if (IBuildNoticeService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除公告表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给公告表分配公告表")
@ApiOperation("查询公告表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:notice:read')")
public Object getBuildNoticeById(@ApiParam("公告表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("公告表id");
}
BuildNotice coupon = IBuildNoticeService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询公告表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除公告表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除公告表")
@PreAuthorize("hasAuthority('build:notice:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildNoticeService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildNotice entity) {
// 模拟从数据库获取需要导出的数据
List<BuildNotice> personList = IBuildNoticeService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildNotice.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildNotice> personList = EasyPoiUtils.importExcel(file, BuildNotice.class);
IBuildNoticeService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,152 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildRepair;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/repair")
public class BuildRepairController {
@Resource
private com.zscat.mallplus.build.service.IBuildRepairService IBuildRepairService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有报修表列表")
@ApiOperation("根据条件查询所有报修表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:repair:read')")
public Object getBuildRepairByPage(BuildRepair entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildRepairService.page(new Page<BuildRepair>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有报修表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存报修表")
@ApiOperation("保存报修表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:repair:create')")
public Object saveBuildRepair(@RequestBody BuildRepair entity) {
try {
if (IBuildRepairService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存报修表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新报修表")
@ApiOperation("更新报修表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:repair:update')")
public Object updateBuildRepair(@RequestBody BuildRepair entity) {
try {
if (IBuildRepairService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新报修表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除报修表")
@ApiOperation("删除报修表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:repair:delete')")
public Object deleteBuildRepair(@ApiParam("报修表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("报修表id");
}
if (IBuildRepairService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除报修表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给报修表分配报修表")
@ApiOperation("查询报修表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:repair:read')")
public Object getBuildRepairById(@ApiParam("报修表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("报修表id");
}
BuildRepair coupon = IBuildRepairService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询报修表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除报修表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除报修表")
@PreAuthorize("hasAuthority('build:repair:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildRepairService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildRepair entity) {
// 模拟从数据库获取需要导出的数据
List<BuildRepair> personList = IBuildRepairService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildRepair.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildRepair> personList = EasyPoiUtils.importExcel(file, BuildRepair.class);
IBuildRepairService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,155 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildTypePrice;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/typePrice")
public class BuildTypePriceController {
@Resource
private com.zscat.mallplus.build.service.IBuildTypePriceService IBuildTypePriceService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有价格类型表列表")
@ApiOperation("根据条件查询所有价格类型表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:typePrice:read')")
public Object getBuildTypePriceByPage(BuildTypePrice entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildTypePriceService.page(new Page<BuildTypePrice>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有价格类型表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存价格类型表")
@ApiOperation("保存价格类型表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:typePrice:create')")
public Object saveBuildTypePrice(@RequestBody BuildTypePrice entity) {
try {
entity.setCreateTime(new Date());
if (IBuildTypePriceService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存价格类型表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新价格类型表")
@ApiOperation("更新价格类型表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:typePrice:update')")
public Object updateBuildTypePrice(@RequestBody BuildTypePrice entity) {
try {
if (IBuildTypePriceService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新价格类型表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除价格类型表")
@ApiOperation("删除价格类型表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:typePrice:delete')")
public Object deleteBuildTypePrice(@ApiParam("价格类型表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("价格类型表id");
}
if (IBuildTypePriceService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除价格类型表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给价格类型表分配价格类型表")
@ApiOperation("查询价格类型表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:typePrice:read')")
public Object getBuildTypePriceById(@ApiParam("价格类型表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("价格类型表id");
}
BuildTypePrice coupon = IBuildTypePriceService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询价格类型表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除价格类型表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除价格类型表")
@PreAuthorize("hasAuthority('build:typePrice:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildTypePriceService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildTypePrice entity) {
// 模拟从数据库获取需要导出的数据
List<BuildTypePrice> personList = IBuildTypePriceService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildTypePrice.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildTypePrice> personList = EasyPoiUtils.importExcel(file, BuildTypePrice.class);
IBuildTypePriceService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,154 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
import com.zscat.mallplus.enums.StatusEnum;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/wuyeCompany")
public class BuildWuyeCompanyController {
@Resource
private com.zscat.mallplus.build.service.IBuildWuyeCompanyService IBuildWuyeCompanyService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有物业公司表列表")
@ApiOperation("根据条件查询所有物业公司表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:wuyeCompany:read')")
public Object getBuildWuyeCompanyByPage(BuildWuyeCompany entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildWuyeCompanyService.page(new Page<BuildWuyeCompany>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有物业公司表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存物业公司表")
@ApiOperation("保存物业公司表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:wuyeCompany:create')")
public Object saveBuildWuyeCompany(@RequestBody BuildWuyeCompany entity) {
try {
entity.setStatus(StatusEnum.AuditType.SUCESS.code());
if (IBuildWuyeCompanyService.saveCompany(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存物业公司表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新物业公司表")
@ApiOperation("更新物业公司表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:wuyeCompany:update')")
public Object updateBuildWuyeCompany(@RequestBody BuildWuyeCompany entity) {
try {
if (IBuildWuyeCompanyService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新物业公司表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除物业公司表")
@ApiOperation("删除物业公司表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:wuyeCompany:delete')")
public Object deleteBuildWuyeCompany(@ApiParam("物业公司表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("物业公司表id");
}
if (IBuildWuyeCompanyService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除物业公司表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给物业公司表分配物业公司表")
@ApiOperation("查询物业公司表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:wuyeCompany:read')")
public Object getBuildWuyeCompanyById(@ApiParam("物业公司表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("物业公司表id");
}
BuildWuyeCompany coupon = IBuildWuyeCompanyService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询物业公司表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除物业公司表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除物业公司表")
@PreAuthorize("hasAuthority('build:wuyeCompany:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildWuyeCompanyService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildWuyeCompany entity) {
// 模拟从数据库获取需要导出的数据
List<BuildWuyeCompany> personList = IBuildWuyeCompanyService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildWuyeCompany.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildWuyeCompany> personList = EasyPoiUtils.importExcel(file, BuildWuyeCompany.class);
IBuildWuyeCompanyService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,164 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildWuyePrice;
import com.zscat.mallplus.build.entity.BuildingRoom;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Slf4j
@RestController
@RequestMapping("/build/wuyePrice")
public class BuildWuyePriceController {
@Resource
private com.zscat.mallplus.build.service.IBuildWuyePriceService IBuildWuyePriceService;
@Resource
private com.zscat.mallplus.build.service.IBuildingRoomService IBuildingRoomService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有费用表列表")
@ApiOperation("根据条件查询所有费用表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('build:wuyePrice:read')")
public Object getBuildWuyePriceByPage(BuildWuyePrice entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildWuyePriceService.page(new Page<BuildWuyePrice>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有费用表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存费用表")
@ApiOperation("保存费用表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('build:wuyePrice:create')")
public Object saveBuildWuyePrice(@RequestBody BuildWuyePrice entity) {
try {
if (ValidatorUtils.empty(entity.getAmount()) || ValidatorUtils.empty(entity.getPrice())) {
return new CommonResult().failed("请输入价格");
}
BuildingRoom room = IBuildingRoomService.getById(entity.getRoomId());
if (room != null && room.getRoomDesc() != null) {
entity.setRoomDesc(room.getRoomDesc());
}
entity.setCreateDate(new Date());
entity.setMoneys(entity.getAmount().multiply(entity.getPrice()));
if (IBuildWuyePriceService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存费用表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新费用表")
@ApiOperation("更新费用表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('build:wuyePrice:update')")
public Object updateBuildWuyePrice(@RequestBody BuildWuyePrice entity) {
try {
if (IBuildWuyePriceService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新费用表:%s", e.getMessage(), e);
return new CommonResult().failed(e.getMessage());
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除费用表")
@ApiOperation("删除费用表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('build:wuyePrice:delete')")
public Object deleteBuildWuyePrice(@ApiParam("费用表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("费用表id");
}
if (IBuildWuyePriceService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除费用表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给费用表分配费用表")
@ApiOperation("查询费用表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('build:wuyePrice:read')")
public Object getBuildWuyePriceById(@ApiParam("费用表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("费用表id");
}
BuildWuyePrice coupon = IBuildWuyePriceService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询费用表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除费用表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@SysLog(MODULE = "build", REMARK = "批量删除费用表")
@PreAuthorize("hasAuthority('build:wuyePrice:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildWuyePriceService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildWuyePrice entity) {
// 模拟从数据库获取需要导出的数据
List<BuildWuyePrice> personList = IBuildWuyePriceService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildWuyePrice.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildWuyePrice> personList = EasyPoiUtils.importExcel(file, BuildWuyePrice.class);
IBuildWuyePriceService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,162 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.enums.StatusEnum;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 小区 前端控制器
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Slf4j
@RestController
@RequestMapping("/building/community")
public class BuildingCommunityController {
@Resource
private com.zscat.mallplus.build.service.IBuildingCommunityService IBuildingCommunityService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有小区表列表")
@ApiOperation("根据条件查询所有小区表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('building:community:read')")
public Object getBuildingCommunityByPage(BuildingCommunity entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildingCommunityService.page(new Page<BuildingCommunity>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有小区表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存小区表")
@ApiOperation("保存小区表")
@PostMapping(value = "/create")
public Object saveBuildingCommunity(@RequestBody BuildingCommunity entity) {
try {
entity.setCreateTime(new Date());
entity.setStatus(StatusEnum.AuditType.SUCESS.code());
if (ValidatorUtils.empty(entity.getCompanyId())) {
// entity.setCompanyId(UserUtils.getCurrentMember().getStoreId());
}
if (ValidatorUtils.empty(entity.getCompanyId())) {
return new CommonResult().failed("请选择物业攻啊");
}
if (IBuildingCommunityService.saveCommunity(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存小区表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新小区表")
@ApiOperation("更新小区表")
@PostMapping(value = "/update/{id}")
public Object updateBuildingCommunity(@RequestBody BuildingCommunity entity) {
try {
if (IBuildingCommunityService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新小区表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除小区表")
@ApiOperation("删除小区表")
@GetMapping(value = "/delete/{id}")
public Object deleteBuildingCommunity(@ApiParam("小区表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("小区表id");
}
if (IBuildingCommunityService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除小区表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给小区表分配小区表")
@ApiOperation("查询小区表明细")
@GetMapping(value = "/{id}")
public Object getBuildingCommunityById(@ApiParam("小区表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("小区表id");
}
BuildingCommunity coupon = IBuildingCommunityService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询小区表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除小区表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "build", REMARK = "批量删除小区表")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildingCommunityService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildingCommunity entity) {
// 模拟从数据库获取需要导出的数据
List<BuildingCommunity> personList = IBuildingCommunityService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildingCommunity.class, "导出社区数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildingCommunity> personList = EasyPoiUtils.importExcel(file, BuildingCommunity.class);
IBuildingCommunityService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,159 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.build.entity.BuildingFloor;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Slf4j
@RestController
@RequestMapping("/building/floor")
public class BuildingFloorController {
@Resource
private com.zscat.mallplus.build.service.IBuildingFloorService IBuildingFloorService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有楼房表列表")
@ApiOperation("根据条件查询所有楼房表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('building:floor:read')")
public Object getBuildingFloorByPage(BuildingFloor entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildingFloorService.page(new Page<BuildingFloor>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有楼房表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存楼房表")
@ApiOperation("保存楼房表")
@PostMapping(value = "/create")
public Object saveBuildingFloor(@RequestBody BuildingFloor entity) {
try {
if (ValidatorUtils.empty(entity.getCommunityId())) {
return new CommonResult().failed("请选择小区");
}
entity.setCreateTime(new Date());
if (IBuildingFloorService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存楼房表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新楼房表")
@ApiOperation("更新楼房表")
@PostMapping(value = "/update/{id}")
public Object updateBuildingFloor(@RequestBody BuildingFloor entity) {
try {
if (IBuildingFloorService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新楼房表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除楼房表")
@ApiOperation("删除楼房表")
@GetMapping(value = "/delete/{id}")
public Object deleteBuildingFloor(@ApiParam("楼房表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("楼房表id");
}
if (IBuildingFloorService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除楼房表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给楼房表分配楼房表")
@ApiOperation("查询楼房表明细")
@GetMapping(value = "/{id}")
public Object getBuildingFloorById(@ApiParam("楼房表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("楼房表id");
}
BuildingFloor coupon = IBuildingFloorService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询楼房表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除楼房表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "build", REMARK = "批量删除楼房表")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildingFloorService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildingFloor entity) {
// 模拟从数据库获取需要导出的数据
List<BuildingFloor> personList = IBuildingFloorService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出楼房数据", "楼房数据", BuildingCommunity.class, "导出楼房数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildingFloor> personList = EasyPoiUtils.importExcel(file, BuildingFloor.class);
IBuildingFloorService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,167 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.build.entity.BuildingOwner;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 业主成员表 前端控制器
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Slf4j
@RestController
@RequestMapping("/building/owner")
public class BuildingOwnerController {
@Resource
private com.zscat.mallplus.build.service.IBuildingOwnerService IBuildingOwnerService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有业主表列表")
@ApiOperation("根据条件查询所有业主表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('building:owner:read')")
public Object getBuildingOwnerByPage(BuildingOwner entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildingOwnerService.page(new Page<BuildingOwner>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有业主表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存业主表")
@ApiOperation("保存业主表")
@PostMapping(value = "/create")
public Object saveBuildingOwner(@RequestBody BuildingOwner entity) {
try {
if (ValidatorUtils.empty(entity.getRoomId())) {
return new CommonResult().failed("请选择房屋");
}
entity.setCreateTime(new Date());
if (entity.getType() == 2 || entity.getType() == 3) {
List<BuildingOwner> list = IBuildingOwnerService.list(new QueryWrapper<BuildingOwner>().eq("room_id", entity.getRoomId()).eq("type", 1).orderByAsc("id"));
if (list != null && list.size() > 0) {
entity.setOwnerId(list.get(0).getId());
} else {
return new CommonResult().failed("请先添加一个业主");
}
}
if (IBuildingOwnerService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存业主表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新业主表")
@ApiOperation("更新业主表")
@PostMapping(value = "/update/{id}")
public Object updateBuildingOwner(@RequestBody BuildingOwner entity) {
try {
if (IBuildingOwnerService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新业主表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除业主表")
@ApiOperation("删除业主表")
@GetMapping(value = "/delete/{id}")
public Object deleteBuildingOwner(@ApiParam("业主表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("业主表id");
}
if (IBuildingOwnerService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除业主表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给业主表分配业主表")
@ApiOperation("查询业主表明细")
@GetMapping(value = "/{id}")
public Object getBuildingOwnerById(@ApiParam("业主表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("业主表id");
}
BuildingOwner coupon = IBuildingOwnerService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询业主表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除业主表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "build", REMARK = "批量删除业主表")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildingOwnerService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildingOwner entity) {
// 模拟从数据库获取需要导出的数据
List<BuildingOwner> personList = IBuildingOwnerService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出业主数据", "业主数据", BuildingCommunity.class, "导出业主数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildingOwner> personList = EasyPoiUtils.importExcel(file, BuildingOwner.class);
IBuildingOwnerService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,197 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.build.entity.BuildingFloor;
import com.zscat.mallplus.build.entity.BuildingRoom;
import com.zscat.mallplus.build.entity.BuildingUnit;
import com.zscat.mallplus.build.service.IBuildingCommunityService;
import com.zscat.mallplus.build.service.IBuildingFloorService;
import com.zscat.mallplus.build.service.IBuildingUnitService;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.IdWorker;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 小区 前端控制器
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Slf4j
@RestController
@RequestMapping("/building/room")
public class BuildingRoomController {
@Resource
private com.zscat.mallplus.build.service.IBuildingRoomService IBuildingRoomService;
@Resource
private IBuildingUnitService unitService;
@Resource
private IBuildingFloorService floorService;
@Resource
private IBuildingCommunityService communityService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有房间表列表")
@ApiOperation("根据条件查询所有房间表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('building:room:read')")
public Object getBuildingRoomByPage(BuildingRoom entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildingRoomService.page(new Page<BuildingRoom>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有房间表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "根据条件查询楼层和房间")
@ApiOperation("根据条件查询所有房间表列表")
@GetMapping(value = "/withChilds")
public Object withChilds(BuildingFloor entity) {
try {
List<BuildingFloor> floors = floorService.list(new QueryWrapper<>(entity));
for (BuildingFloor floor : floors) {
List<BuildingRoom> list = IBuildingRoomService.list(new QueryWrapper<BuildingRoom>().eq("floor_id", floor.getId()));
floor.setChildren(list);
}
return new CommonResult().success(floors);
} catch (Exception e) {
log.error("根据条件查询所有房间表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存房间表")
@ApiOperation("保存房间表")
@PostMapping(value = "/create")
public Object saveBuildingRoom(@RequestBody BuildingRoom entity) {
try {
if (ValidatorUtils.empty(entity.getUnitId())) {
return new CommonResult().failed("请选择单元");
}
entity.setCreateTime(new Date());
BuildingUnit unit = unitService.getById(entity.getUnitId());
BuildingFloor floor = floorService.getById(unit.getFloorId());
entity.setFloorId(floor.getId());
entity.setCommunityId(floor.getCommunityId());
BuildingCommunity community = communityService.getById(floor.getCommunityId());
entity.setRoomDesc(community.getName() + "-" + floor.getName() + "-" + unit.getUnitNum() + "-" + entity.getRoomNum());
entity.setLayer(floor.getLayerCount());
entity.setId(IdWorker.getId());
if (IBuildingRoomService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存房间表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新房间表")
@ApiOperation("更新房间表")
@PostMapping(value = "/update/{id}")
public Object updateBuildingRoom(@RequestBody BuildingRoom entity) {
try {
if (IBuildingRoomService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新房间表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除房间表")
@ApiOperation("删除房间表")
@GetMapping(value = "/delete/{id}")
public Object deleteBuildingRoom(@ApiParam("房间表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("房间表id");
}
if (IBuildingRoomService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除房间表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给房间表分配房间表")
@ApiOperation("查询房间表明细")
@GetMapping(value = "/{id}")
public Object getBuildingRoomById(@ApiParam("房间表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("房间表id");
}
BuildingRoom coupon = IBuildingRoomService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询房间表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除房间表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "build", REMARK = "批量删除房间表")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildingRoomService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildingRoom entity) {
// 模拟从数据库获取需要导出的数据
List<BuildingRoom> personList = IBuildingRoomService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出房屋数据", "房屋数据", BuildingRoom.class, "导出房屋数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildingRoom> personList = EasyPoiUtils.importExcel(file, BuildingRoom.class);
IBuildingRoomService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,159 @@
package com.zscat.mallplus.build.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.build.entity.BuildingUnit;
import com.zscat.mallplus.util.EasyPoiUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Slf4j
@RestController
@RequestMapping("/building/unit")
public class BuildingUnitController {
@Resource
private com.zscat.mallplus.build.service.IBuildingUnitService IBuildingUnitService;
@SysLog(MODULE = "build", REMARK = "根据条件查询所有房屋单元列表")
@ApiOperation("根据条件查询所有房屋单元列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('building:unit:read')")
public Object getBuildingUnitByPage(BuildingUnit entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(IBuildingUnitService.page(new Page<BuildingUnit>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有房屋单元列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "保存房屋单元")
@ApiOperation("保存房屋单元")
@PostMapping(value = "/create")
public Object saveBuildingUnit(@RequestBody BuildingUnit entity) {
try {
if (ValidatorUtils.empty(entity.getFloorId())) {
return new CommonResult().failed("请选择楼");
}
entity.setCreateTime(new Date());
if (IBuildingUnitService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存房屋单元:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "更新房屋单元")
@ApiOperation("更新房屋单元")
@PostMapping(value = "/update/{id}")
public Object updateBuildingUnit(@RequestBody BuildingUnit entity) {
try {
if (IBuildingUnitService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新房屋单元:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "删除房屋单元")
@ApiOperation("删除房屋单元")
@GetMapping(value = "/delete/{id}")
public Object deleteBuildingUnit(@ApiParam("房屋单元id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("房屋单元id");
}
if (IBuildingUnitService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除房屋单元:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "build", REMARK = "给房屋单元分配房屋单元")
@ApiOperation("查询房屋单元明细")
@GetMapping(value = "/{id}")
public Object getBuildingUnitById(@ApiParam("房屋单元id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("房屋单元id");
}
BuildingUnit coupon = IBuildingUnitService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询房屋单元明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除房屋单元")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "build", REMARK = "批量删除房屋单元")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = IBuildingUnitService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@GetMapping("/exportExcel")
public void export(HttpServletResponse response, BuildingUnit entity) {
// 模拟从数据库获取需要导出的数据
List<BuildingUnit> personList = IBuildingUnitService.list(new QueryWrapper<>(entity));
// 导出操作
EasyPoiUtils.exportExcel(personList, "导出单元数据", "单元数据", BuildingCommunity.class, "导出单元数据.xls", response);
}
@PostMapping("/importExcel")
public void importUsers(@RequestParam MultipartFile file) {
List<BuildingUnit> personList = EasyPoiUtils.importExcel(file, BuildingUnit.class);
IBuildingUnitService.saveBatch(personList);
}
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildAdv;
/**
* <p>
* 首页轮播广告表 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildAdvService extends IService<BuildAdv> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildApplyRoom;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildApplyRoomService extends IService<BuildApplyRoom> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildGroupMember;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildGroupMemberService extends IService<BuildGroupMember> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildGroup;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildGroupService extends IService<BuildGroup> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildNotice;
/**
* <p>
* 公告表 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildNoticeService extends IService<BuildNotice> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildRepair;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildRepairService extends IService<BuildRepair> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildTypePrice;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildTypePriceService extends IService<BuildTypePrice> {
}

View File

@@ -0,0 +1,17 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildWuyeCompanyService extends IService<BuildWuyeCompany> {
boolean saveCompany(BuildWuyeCompany entity);
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildWuyePrice;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
public interface IBuildWuyePriceService extends IService<BuildWuyePrice> {
}

View File

@@ -0,0 +1,17 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildingCommunity;
/**
* <p>
* 小区 服务类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
public interface IBuildingCommunityService extends IService<BuildingCommunity> {
boolean saveCommunity(BuildingCommunity entity);
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildingFloor;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
public interface IBuildingFloorService extends IService<BuildingFloor> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildingOwner;
/**
* <p>
* 业主成员表 服务类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
public interface IBuildingOwnerService extends IService<BuildingOwner> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildingRoom;
/**
* <p>
* 小区 服务类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
public interface IBuildingRoomService extends IService<BuildingRoom> {
}

View File

@@ -0,0 +1,16 @@
package com.zscat.mallplus.build.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zscat.mallplus.build.entity.BuildingUnit;
/**
* <p>
* 服务类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
public interface IBuildingUnitService extends IService<BuildingUnit> {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildAdv;
import com.zscat.mallplus.build.mapper.BuildAdvMapper;
import com.zscat.mallplus.build.service.IBuildAdvService;
import org.springframework.stereotype.Service;
/**
* <p>
* 首页轮播广告表 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildAdvServiceImpl extends ServiceImpl<BuildAdvMapper, BuildAdv> implements IBuildAdvService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildApplyRoom;
import com.zscat.mallplus.build.mapper.BuildApplyRoomMapper;
import com.zscat.mallplus.build.service.IBuildApplyRoomService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildApplyRoomServiceImpl extends ServiceImpl<BuildApplyRoomMapper, BuildApplyRoom> implements IBuildApplyRoomService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildGroupMember;
import com.zscat.mallplus.build.mapper.BuildGroupMemberMapper;
import com.zscat.mallplus.build.service.IBuildGroupMemberService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildGroupMemberServiceImpl extends ServiceImpl<BuildGroupMemberMapper, BuildGroupMember> implements IBuildGroupMemberService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildGroup;
import com.zscat.mallplus.build.mapper.BuildGroupMapper;
import com.zscat.mallplus.build.service.IBuildGroupService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildGroupServiceImpl extends ServiceImpl<BuildGroupMapper, BuildGroup> implements IBuildGroupService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildNotice;
import com.zscat.mallplus.build.mapper.BuildNoticeMapper;
import com.zscat.mallplus.build.service.IBuildNoticeService;
import org.springframework.stereotype.Service;
/**
* <p>
* 公告表 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildNoticeServiceImpl extends ServiceImpl<BuildNoticeMapper, BuildNotice> implements IBuildNoticeService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildRepair;
import com.zscat.mallplus.build.mapper.BuildRepairMapper;
import com.zscat.mallplus.build.service.IBuildRepairService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildRepairServiceImpl extends ServiceImpl<BuildRepairMapper, BuildRepair> implements IBuildRepairService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildTypePrice;
import com.zscat.mallplus.build.mapper.BuildTypePriceMapper;
import com.zscat.mallplus.build.service.IBuildTypePriceService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildTypePriceServiceImpl extends ServiceImpl<BuildTypePriceMapper, BuildTypePrice> implements IBuildTypePriceService {
}

View File

@@ -0,0 +1,70 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
import com.zscat.mallplus.build.mapper.BuildWuyeCompanyMapper;
import com.zscat.mallplus.build.service.IBuildWuyeCompanyService;
import com.zscat.mallplus.exception.ApiMallPlusException;
import com.zscat.mallplus.sys.entity.SysUser;
import com.zscat.mallplus.sys.entity.SysUserRole;
import com.zscat.mallplus.sys.mapper.SysUserMapper;
import com.zscat.mallplus.sys.mapper.SysUserRoleMapper;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildWuyeCompanyServiceImpl extends ServiceImpl<BuildWuyeCompanyMapper, BuildWuyeCompany> implements IBuildWuyeCompanyService {
@Resource
private BuildWuyeCompanyMapper wuyeCompanyMapper;
@Resource
private SysUserMapper userMapper;
@Resource
private PasswordEncoder passwordEncoder;
@Resource
private SysUserRoleMapper userRoleMapper;
@Transactional
@Override
public boolean saveCompany(BuildWuyeCompany entity) {
//1 创建物业公司
entity.setCreateTime(new Date());
wuyeCompanyMapper.insert(entity);
// 2 创建物业公司账号
SysUser user = new SysUser();
user.setUsername(entity.getName());
SysUser umsAdminList = userMapper.selectByUserName(entity.getName());
if (umsAdminList != null) {
throw new ApiMallPlusException("此物业公司已存在");
}
user.setStatus(1);
// user.setStoreId(entity.getId());
user.setSupplyId(0L);
user.setPassword(passwordEncoder.encode("123456"));
user.setCreateTime(new Date());
user.setSupplyId(0L);
user.setNote("物业公司账户物业公司ID=" + entity.getName() + "," + entity.getId());
user.setIcon(entity.getPic());
user.setNickName(entity.getName());
userMapper.insert(user);
// 3 分配物业公司角色
SysUserRole userRole = new SysUserRole();
userRole.setAdminId(user.getId());
userRole.setRoleId(5L);
userRoleMapper.insert(userRole);
return true;
}
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildWuyePrice;
import com.zscat.mallplus.build.mapper.BuildWuyePriceMapper;
import com.zscat.mallplus.build.service.IBuildWuyePriceService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-12-02
*/
@Service
public class BuildWuyePriceServiceImpl extends ServiceImpl<BuildWuyePriceMapper, BuildWuyePrice> implements IBuildWuyePriceService {
}

View File

@@ -0,0 +1,66 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildingCommunity;
import com.zscat.mallplus.build.mapper.BuildingCommunityMapper;
import com.zscat.mallplus.build.service.IBuildingCommunityService;
import com.zscat.mallplus.exception.ApiMallPlusException;
import com.zscat.mallplus.sys.entity.SysUser;
import com.zscat.mallplus.sys.entity.SysUserRole;
import com.zscat.mallplus.sys.mapper.SysUserMapper;
import com.zscat.mallplus.sys.mapper.SysUserRoleMapper;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
* <p>
* 小区 服务实现类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Service
public class BuildingCommunityServiceImpl extends ServiceImpl<BuildingCommunityMapper, BuildingCommunity> implements IBuildingCommunityService {
@Resource
private BuildingCommunityMapper communityMapper;
@Resource
private SysUserMapper userMapper;
@Resource
private PasswordEncoder passwordEncoder;
@Resource
private SysUserRoleMapper userRoleMapper;
@Override
public boolean saveCommunity(BuildingCommunity entity) {
//1 创建小区
entity.setCreateTime(new Date());
communityMapper.insert(entity);
// 2 创建物业公司账号
SysUser user = new SysUser();
user.setUsername(entity.getName());
SysUser umsAdminList = userMapper.selectByUserName(entity.getName());
if (umsAdminList != null) {
throw new ApiMallPlusException("此小区已存在");
}
user.setStatus(1);
// user.setStoreId(entity.getId());
user.setPassword(passwordEncoder.encode("123456"));
user.setCreateTime(new Date());
user.setSupplyId(0L);
user.setNote("小区账户小区ID=" + entity.getName() + "," + entity.getId());
user.setNickName(entity.getName());
userMapper.insert(user);
// 3 分配物业公司角色
SysUserRole userRole = new SysUserRole();
userRole.setAdminId(user.getId());
userRole.setRoleId(5L);
userRoleMapper.insert(userRole);
return true;
}
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildingFloor;
import com.zscat.mallplus.build.mapper.BuildingFloorMapper;
import com.zscat.mallplus.build.service.IBuildingFloorService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Service
public class BuildingFloorServiceImpl extends ServiceImpl<BuildingFloorMapper, BuildingFloor> implements IBuildingFloorService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildingOwner;
import com.zscat.mallplus.build.mapper.BuildingOwnerMapper;
import com.zscat.mallplus.build.service.IBuildingOwnerService;
import org.springframework.stereotype.Service;
/**
* <p>
* 业主成员表 服务实现类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Service
public class BuildingOwnerServiceImpl extends ServiceImpl<BuildingOwnerMapper, BuildingOwner> implements IBuildingOwnerService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildingRoom;
import com.zscat.mallplus.build.mapper.BuildingRoomMapper;
import com.zscat.mallplus.build.service.IBuildingRoomService;
import org.springframework.stereotype.Service;
/**
* <p>
* 小区 服务实现类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Service
public class BuildingRoomServiceImpl extends ServiceImpl<BuildingRoomMapper, BuildingRoom> implements IBuildingRoomService {
}

View File

@@ -0,0 +1,20 @@
package com.zscat.mallplus.build.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.build.entity.BuildingUnit;
import com.zscat.mallplus.build.mapper.BuildingUnitMapper;
import com.zscat.mallplus.build.service.IBuildingUnitService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author zscat
* @since 2019-11-27
*/
@Service
public class BuildingUnitServiceImpl extends ServiceImpl<BuildingUnitMapper, BuildingUnit> implements IBuildingUnitService {
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsHelpCategory;
import com.zscat.mallplus.cms.service.ICmsHelpCategoryService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 帮助分类表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsHelpCategoryController", description = "帮助分类表管理")
@RequestMapping("/cms/CmsHelpCategory")
public class CmsHelpCategoryController {
@Resource
private ICmsHelpCategoryService ICmsHelpCategoryService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有帮助分类表列表")
@ApiOperation("根据条件查询所有帮助分类表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:read')")
public Object getCmsHelpCategoryByPage(CmsHelpCategory entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsHelpCategoryService.page(new Page<CmsHelpCategory>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助分类表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存帮助分类表")
@ApiOperation("保存帮助分类表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:create')")
public Object saveCmsHelpCategory(@RequestBody CmsHelpCategory entity) {
try {
if (ICmsHelpCategoryService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存帮助分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新帮助分类表")
@ApiOperation("更新帮助分类表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:update')")
public Object updateCmsHelpCategory(@RequestBody CmsHelpCategory entity) {
try {
if (ICmsHelpCategoryService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新帮助分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除帮助分类表")
@ApiOperation("删除帮助分类表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:delete')")
public Object deleteCmsHelpCategory(@ApiParam("帮助分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("帮助分类表id");
}
if (ICmsHelpCategoryService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除帮助分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给帮助分类表分配帮助分类表")
@ApiOperation("查询帮助分类表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:read')")
public Object getCmsHelpCategoryById(@ApiParam("帮助分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("帮助分类表id");
}
CmsHelpCategory coupon = ICmsHelpCategoryService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询帮助分类表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除帮助分类表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除帮助分类表")
@PreAuthorize("hasAuthority('cms:CmsHelpCategory:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsHelpCategoryService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,150 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsHelp;
import com.zscat.mallplus.cms.service.ICmsHelpService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 帮助表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsHelpController", description = "帮助表管理")
@RequestMapping("/cms/CmsHelp")
public class CmsHelpController {
@Resource
private ICmsHelpService ICmsHelpService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有帮助表列表")
@ApiOperation("根据条件查询所有帮助表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsHelp:read')")
public Object getCmsHelpByPage(CmsHelp entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsHelpService.page(new Page<CmsHelp>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存帮助表")
@ApiOperation("保存帮助表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsHelp:create')")
public Object saveCmsHelp(@RequestBody CmsHelp entity) {
try {
if (ICmsHelpService.saves(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存帮助表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新帮助表")
@ApiOperation("更新帮助表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelp:update')")
public Object updateCmsHelp(@RequestBody CmsHelp entity) {
try {
if (ICmsHelpService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新帮助表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除帮助表")
@ApiOperation("删除帮助表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelp:delete')")
public Object deleteCmsHelp(@ApiParam("帮助表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("帮助表id");
}
if (ICmsHelpService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除帮助表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给帮助表分配帮助表")
@ApiOperation("查询帮助表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsHelp:read')")
public Object getCmsHelpById(@ApiParam("帮助表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("帮助表id");
}
CmsHelp coupon = ICmsHelpService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询帮助表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除帮助表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除帮助表")
@PreAuthorize("hasAuthority('cms:CmsHelp:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsHelpService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改展示状态")
@RequestMapping(value = "/update/updateShowStatus")
@ResponseBody
@SysLog(MODULE = "cms", REMARK = "修改展示状态")
public Object updateShowStatus(@RequestParam("ids") Long ids,
@RequestParam("showStatus") Integer showStatus) {
CmsHelp record = new CmsHelp();
record.setShowStatus(showStatus);
record.setId(ids);
if (ICmsHelpService.updateById(record)) {
return new CommonResult().success();
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsMemberReport;
import com.zscat.mallplus.cms.service.ICmsMemberReportService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 用户举报表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsMemberReportController", description = "用户举报表管理")
@RequestMapping("/cms/CmsMemberReport")
public class CmsMemberReportController {
@Resource
private ICmsMemberReportService ICmsMemberReportService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有用户举报表列表")
@ApiOperation("根据条件查询所有用户举报表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:read')")
public Object getCmsMemberReportByPage(CmsMemberReport entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsMemberReportService.page(new Page<CmsMemberReport>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有用户举报表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存用户举报表")
@ApiOperation("保存用户举报表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:create')")
public Object saveCmsMemberReport(@RequestBody CmsMemberReport entity) {
try {
if (ICmsMemberReportService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存用户举报表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新用户举报表")
@ApiOperation("更新用户举报表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:update')")
public Object updateCmsMemberReport(@RequestBody CmsMemberReport entity) {
try {
if (ICmsMemberReportService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新用户举报表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除用户举报表")
@ApiOperation("删除用户举报表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:delete')")
public Object deleteCmsMemberReport(@ApiParam("用户举报表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("用户举报表id");
}
if (ICmsMemberReportService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除用户举报表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给用户举报表分配用户举报表")
@ApiOperation("查询用户举报表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:read')")
public Object getCmsMemberReportById(@ApiParam("用户举报表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("用户举报表id");
}
CmsMemberReport coupon = ICmsMemberReportService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询用户举报表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除用户举报表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除用户举报表")
@PreAuthorize("hasAuthority('cms:CmsMemberReport:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsMemberReportService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,134 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsPrefrenceArea;
import com.zscat.mallplus.cms.service.ICmsPrefrenceAreaService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 优选专区
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsPrefrenceAreaController", description = "优选专区管理")
@RequestMapping("/cms/CmsPrefrenceArea")
public class CmsPrefrenceAreaController {
@Resource
private ICmsPrefrenceAreaService ICmsPrefrenceAreaService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有优选专区列表")
@ApiOperation("根据条件查询所有优选专区列表")
@GetMapping(value = "/list")
public Object getCmsPrefrenceAreaByPage(CmsPrefrenceArea entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsPrefrenceAreaService.page(new Page<CmsPrefrenceArea>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有优选专区列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存优选专区")
@ApiOperation("保存优选专区")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceArea:create')")
public Object saveCmsPrefrenceArea(@RequestBody CmsPrefrenceArea entity) {
try {
if (ICmsPrefrenceAreaService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存优选专区:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新优选专区")
@ApiOperation("更新优选专区")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceArea:update')")
public Object updateCmsPrefrenceArea(@RequestBody CmsPrefrenceArea entity) {
try {
if (ICmsPrefrenceAreaService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新优选专区:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除优选专区")
@ApiOperation("删除优选专区")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceArea:delete')")
public Object deleteCmsPrefrenceArea(@ApiParam("优选专区id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("优选专区id");
}
if (ICmsPrefrenceAreaService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除优选专区:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给优选专区分配优选专区")
@ApiOperation("查询优选专区明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceArea:read')")
public Object getCmsPrefrenceAreaById(@ApiParam("优选专区id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("优选专区id");
}
CmsPrefrenceArea coupon = ICmsPrefrenceAreaService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询优选专区明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除优选专区")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除优选专区")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceArea:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsPrefrenceAreaService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.service.ICmsPrefrenceAreaProductRelationService;
import com.zscat.mallplus.pms.entity.CmsPrefrenceAreaProductRelation;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 优选专区和产品关系表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsPrefrenceAreaProductRelationController", description = "优选专区和产品关系表管理")
@RequestMapping("/cms/CmsPrefrenceAreaProductRelation")
public class CmsPrefrenceAreaProductRelationController {
@Resource
private ICmsPrefrenceAreaProductRelationService ICmsPrefrenceAreaProductRelationService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有优选专区和产品关系表列表")
@ApiOperation("根据条件查询所有优选专区和产品关系表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:read')")
public Object getCmsPrefrenceAreaProductRelationByPage(CmsPrefrenceAreaProductRelation entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsPrefrenceAreaProductRelationService.page(new Page<CmsPrefrenceAreaProductRelation>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有优选专区和产品关系表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存优选专区和产品关系表")
@ApiOperation("保存优选专区和产品关系表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:create')")
public Object saveCmsPrefrenceAreaProductRelation(@RequestBody CmsPrefrenceAreaProductRelation entity) {
try {
if (ICmsPrefrenceAreaProductRelationService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存优选专区和产品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新优选专区和产品关系表")
@ApiOperation("更新优选专区和产品关系表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:update')")
public Object updateCmsPrefrenceAreaProductRelation(@RequestBody CmsPrefrenceAreaProductRelation entity) {
try {
if (ICmsPrefrenceAreaProductRelationService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新优选专区和产品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除优选专区和产品关系表")
@ApiOperation("删除优选专区和产品关系表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:delete')")
public Object deleteCmsPrefrenceAreaProductRelation(@ApiParam("优选专区和产品关系表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("优选专区和产品关系表id");
}
if (ICmsPrefrenceAreaProductRelationService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除优选专区和产品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给优选专区和产品关系表分配优选专区和产品关系表")
@ApiOperation("查询优选专区和产品关系表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:read')")
public Object getCmsPrefrenceAreaProductRelationById(@ApiParam("优选专区和产品关系表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("优选专区和产品关系表id");
}
CmsPrefrenceAreaProductRelation coupon = ICmsPrefrenceAreaProductRelationService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询优选专区和产品关系表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除优选专区和产品关系表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除优选专区和产品关系表")
@PreAuthorize("hasAuthority('cms:CmsPrefrenceAreaProductRelation:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsPrefrenceAreaProductRelationService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsSubjectCategory;
import com.zscat.mallplus.cms.service.ICmsSubjectCategoryService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 专题分类表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsSubjectCategoryController", description = "专题分类表管理")
@RequestMapping("/cms/CmsSubjectCategory")
public class CmsSubjectCategoryController {
@Resource
private ICmsSubjectCategoryService ICmsSubjectCategoryService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有专题分类表列表")
@ApiOperation("根据条件查询所有专题分类表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:read')")
public Object getCmsSubjectCategoryByPage(CmsSubjectCategory entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsSubjectCategoryService.page(new Page<CmsSubjectCategory>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有专题分类表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存专题分类表")
@ApiOperation("保存专题分类表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:create')")
public Object saveCmsSubjectCategory(@RequestBody CmsSubjectCategory entity) {
try {
if (ICmsSubjectCategoryService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存专题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新专题分类表")
@ApiOperation("更新专题分类表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:update')")
public Object updateCmsSubjectCategory(@RequestBody CmsSubjectCategory entity) {
try {
if (ICmsSubjectCategoryService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新专题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除专题分类表")
@ApiOperation("删除专题分类表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:delete')")
public Object deleteCmsSubjectCategory(@ApiParam("专题分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题分类表id");
}
if (ICmsSubjectCategoryService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除专题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给专题分类表分配专题分类表")
@ApiOperation("查询专题分类表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:read')")
public Object getCmsSubjectCategoryById(@ApiParam("专题分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题分类表id");
}
CmsSubjectCategory coupon = ICmsSubjectCategoryService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询专题分类表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除专题分类表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除专题分类表")
@PreAuthorize("hasAuthority('cms:CmsSubjectCategory:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsSubjectCategoryService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsSubjectComment;
import com.zscat.mallplus.cms.service.ICmsSubjectCommentService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 专题评论表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsSubjectCommentController", description = "专题评论表管理")
@RequestMapping("/cms/CmsSubjectComment")
public class CmsSubjectCommentController {
@Resource
private ICmsSubjectCommentService ICmsSubjectCommentService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有专题评论表列表")
@ApiOperation("根据条件查询所有专题评论表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:read')")
public Object getCmsSubjectCommentByPage(CmsSubjectComment entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsSubjectCommentService.page(new Page<CmsSubjectComment>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有专题评论表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存专题评论表")
@ApiOperation("保存专题评论表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:create')")
public Object saveCmsSubjectComment(@RequestBody CmsSubjectComment entity) {
try {
if (ICmsSubjectCommentService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新专题评论表")
@ApiOperation("更新专题评论表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:update')")
public Object updateCmsSubjectComment(@RequestBody CmsSubjectComment entity) {
try {
if (ICmsSubjectCommentService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除专题评论表")
@ApiOperation("删除专题评论表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:delete')")
public Object deleteCmsSubjectComment(@ApiParam("专题评论表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题评论表id");
}
if (ICmsSubjectCommentService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给专题评论表分配专题评论表")
@ApiOperation("查询专题评论表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:read')")
public Object getCmsSubjectCommentById(@ApiParam("专题评论表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题评论表id");
}
CmsSubjectComment coupon = ICmsSubjectCommentService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询专题评论表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除专题评论表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除专题评论表")
@PreAuthorize("hasAuthority('cms:CmsSubjectComment:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsSubjectCommentService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,168 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsSubject;
import com.zscat.mallplus.cms.service.ICmsSubjectService;
import com.zscat.mallplus.enums.ConstansValue;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 专题表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsSubjectController", description = "专题表管理")
@RequestMapping("/cms/CmsSubject")
public class CmsSubjectController {
@Resource
private ICmsSubjectService ICmsSubjectService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有专题表列表")
@ApiOperation("根据条件查询所有专题表列表")
@GetMapping(value = "/list")
public Object getCmsSubjectByPage(CmsSubject entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsSubjectService.page(new Page<CmsSubject>(pageNum, pageSize), new QueryWrapper<>(entity).select(ConstansValue.sampleSubjectList)));
} catch (Exception e) {
log.error("根据条件查询所有专题表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存专题表")
@ApiOperation("保存专题表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsSubject:create')")
public Object saveCmsSubject(@RequestBody CmsSubject entity) {
try {
/* entity.setSchoolName(member.getSchoolName());
entity.setSchoolId(member.getSchoolId());
entity.setAreaName(member.getAreaName());
entity.setAreaId(member.getAreaId());*/
if (ICmsSubjectService.saves(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存专题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新专题表")
@ApiOperation("更新专题表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubject:update')")
public Object updateCmsSubject(@RequestBody CmsSubject entity) {
try {
if (ICmsSubjectService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新专题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除专题表")
@ApiOperation("删除专题表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubject:delete')")
public Object deleteCmsSubject(@ApiParam("专题表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题表id");
}
if (ICmsSubjectService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除专题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给专题表分配专题表")
@ApiOperation("查询专题表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubject:read')")
public Object getCmsSubjectById(@ApiParam("专题表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题表id");
}
CmsSubject coupon = ICmsSubjectService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询专题表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除专题表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除专题表")
@PreAuthorize("hasAuthority('cms:CmsSubject:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsSubjectService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改推荐状态")
@RequestMapping(value = "/update/updateRecommendStatus")
@ResponseBody
@SysLog(MODULE = "cms", REMARK = "修改推荐状态")
public Object updateRecommendStatus(@RequestParam("ids") Long ids,
@RequestParam("recommendStatus") Integer recommendStatus) {
int count = ICmsSubjectService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改展示状态")
@RequestMapping(value = "/update/updateShowStatus")
@ResponseBody
@SysLog(MODULE = "cms", REMARK = "修改展示状态")
public Object updateShowStatus(@RequestParam("ids") Long ids,
@RequestParam("showStatus") Integer showStatus) {
int count = ICmsSubjectService.updateShowStatus(ids, showStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.service.ICmsSubjectProductRelationService;
import com.zscat.mallplus.pms.entity.CmsSubjectProductRelation;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 专题商品关系表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsSubjectProductRelationController", description = "专题商品关系表管理")
@RequestMapping("/cms/CmsSubjectProductRelation")
public class CmsSubjectProductRelationController {
@Resource
private ICmsSubjectProductRelationService ICmsSubjectProductRelationService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有专题商品关系表列表")
@ApiOperation("根据条件查询所有专题商品关系表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:read')")
public Object getCmsSubjectProductRelationByPage(CmsSubjectProductRelation entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsSubjectProductRelationService.page(new Page<CmsSubjectProductRelation>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有专题商品关系表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存专题商品关系表")
@ApiOperation("保存专题商品关系表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:create')")
public Object saveCmsSubjectProductRelation(@RequestBody CmsSubjectProductRelation entity) {
try {
if (ICmsSubjectProductRelationService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存专题商品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新专题商品关系表")
@ApiOperation("更新专题商品关系表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:update')")
public Object updateCmsSubjectProductRelation(@RequestBody CmsSubjectProductRelation entity) {
try {
if (ICmsSubjectProductRelationService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新专题商品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除专题商品关系表")
@ApiOperation("删除专题商品关系表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:delete')")
public Object deleteCmsSubjectProductRelation(@ApiParam("专题商品关系表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题商品关系表id");
}
if (ICmsSubjectProductRelationService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除专题商品关系表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给专题商品关系表分配专题商品关系表")
@ApiOperation("查询专题商品关系表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:read')")
public Object getCmsSubjectProductRelationById(@ApiParam("专题商品关系表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题商品关系表id");
}
CmsSubjectProductRelation coupon = ICmsSubjectProductRelationService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询专题商品关系表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除专题商品关系表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除专题商品关系表")
@PreAuthorize("hasAuthority('cms:CmsSubjectProductRelation:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsSubjectProductRelationService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsTopicCategory;
import com.zscat.mallplus.cms.service.ICmsTopicCategoryService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 话题分类表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsTopicCategoryController", description = "话题分类表管理")
@RequestMapping("/cms/CmsTopicCategory")
public class CmsTopicCategoryController {
@Resource
private ICmsTopicCategoryService ICmsTopicCategoryService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有话题分类表列表")
@ApiOperation("根据条件查询所有话题分类表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:read')")
public Object getCmsTopicCategoryByPage(CmsTopicCategory entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsTopicCategoryService.page(new Page<CmsTopicCategory>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有话题分类表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存话题分类表")
@ApiOperation("保存话题分类表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:create')")
public Object saveCmsTopicCategory(@RequestBody CmsTopicCategory entity) {
try {
if (ICmsTopicCategoryService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存话题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新话题分类表")
@ApiOperation("更新话题分类表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:update')")
public Object updateCmsTopicCategory(@RequestBody CmsTopicCategory entity) {
try {
if (ICmsTopicCategoryService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新话题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除话题分类表")
@ApiOperation("删除话题分类表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:delete')")
public Object deleteCmsTopicCategory(@ApiParam("话题分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("话题分类表id");
}
if (ICmsTopicCategoryService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除话题分类表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给话题分类表分配话题分类表")
@ApiOperation("查询话题分类表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:read')")
public Object getCmsTopicCategoryById(@ApiParam("话题分类表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("话题分类表id");
}
CmsTopicCategory coupon = ICmsTopicCategoryService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询话题分类表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除话题分类表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除话题分类表")
@PreAuthorize("hasAuthority('cms:CmsTopicCategory:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsTopicCategoryService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,135 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsTopicComment;
import com.zscat.mallplus.cms.service.ICmsTopicCommentService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 专题评论表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsTopicCommentController", description = "专题评论表管理")
@RequestMapping("/cms/CmsTopicComment")
public class CmsTopicCommentController {
@Resource
private ICmsTopicCommentService ICmsTopicCommentService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有专题评论表列表")
@ApiOperation("根据条件查询所有专题评论表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:read')")
public Object getCmsTopicCommentByPage(CmsTopicComment entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsTopicCommentService.page(new Page<CmsTopicComment>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有专题评论表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存专题评论表")
@ApiOperation("保存专题评论表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:create')")
public Object saveCmsTopicComment(@RequestBody CmsTopicComment entity) {
try {
if (ICmsTopicCommentService.save(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新专题评论表")
@ApiOperation("更新专题评论表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:update')")
public Object updateCmsTopicComment(@RequestBody CmsTopicComment entity) {
try {
if (ICmsTopicCommentService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除专题评论表")
@ApiOperation("删除专题评论表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:delete')")
public Object deleteCmsTopicComment(@ApiParam("专题评论表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题评论表id");
}
if (ICmsTopicCommentService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除专题评论表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给专题评论表分配专题评论表")
@ApiOperation("查询专题评论表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:read')")
public Object getCmsTopicCommentById(@ApiParam("专题评论表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("专题评论表id");
}
CmsTopicComment coupon = ICmsTopicCommentService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询专题评论表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除专题评论表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除专题评论表")
@PreAuthorize("hasAuthority('cms:CmsTopicComment:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsTopicCommentService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

View File

@@ -0,0 +1,165 @@
package com.zscat.mallplus.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zscat.mallplus.annotation.SysLog;
import com.zscat.mallplus.cms.entity.CmsTopic;
import com.zscat.mallplus.cms.entity.CmsTopicMember;
import com.zscat.mallplus.cms.service.ICmsTopicMemberService;
import com.zscat.mallplus.cms.service.ICmsTopicService;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 话题表
* </p>
*
* @author zscat
* @since 2019-04-19
*/
@Slf4j
@RestController
@Api(tags = "CmsTopicController", description = "话题表管理")
@RequestMapping("/cms/CmsTopic")
public class CmsTopicController {
@Resource
private ICmsTopicService ICmsTopicService;
@Resource
private ICmsTopicMemberService topicMemberService;
@SysLog(MODULE = "cms", REMARK = "根据条件查询所有话题表列表")
@ApiOperation("根据条件查询所有话题表列表")
@GetMapping(value = "/list")
@PreAuthorize("hasAuthority('cms:CmsTopic:read')")
public Object getCmsTopicByPage(CmsTopic entity,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
) {
try {
return new CommonResult().success(ICmsTopicService.page(new Page<CmsTopic>(pageNum, pageSize), new QueryWrapper<>(entity)));
} catch (Exception e) {
log.error("根据条件查询所有话题表列表:%s", e.getMessage(), e);
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "保存话题表")
@ApiOperation("保存话题表")
@PostMapping(value = "/create")
@PreAuthorize("hasAuthority('cms:CmsTopic:create')")
public Object saveCmsTopic(@RequestBody CmsTopic entity) {
try {
if (ICmsTopicService.saves(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("保存话题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "更新话题表")
@ApiOperation("更新话题表")
@PostMapping(value = "/update/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopic:update')")
public Object updateCmsTopic(@RequestBody CmsTopic entity) {
try {
if (ICmsTopicService.updateById(entity)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("更新话题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "删除话题表")
@ApiOperation("删除话题表")
@GetMapping(value = "/delete/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopic:delete')")
public Object deleteCmsTopic(@ApiParam("话题表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("话题表id");
}
if (ICmsTopicService.removeById(id)) {
return new CommonResult().success();
}
} catch (Exception e) {
log.error("删除话题表:%s", e.getMessage(), e);
return new CommonResult().failed();
}
return new CommonResult().failed();
}
@SysLog(MODULE = "cms", REMARK = "给话题表分配话题表")
@ApiOperation("查询话题表明细")
@GetMapping(value = "/{id}")
@PreAuthorize("hasAuthority('cms:CmsTopic:read')")
public Object getCmsTopicById(@ApiParam("话题表id") @PathVariable Long id) {
try {
if (ValidatorUtils.empty(id)) {
return new CommonResult().paramFailed("话题表id");
}
CmsTopic coupon = ICmsTopicService.getById(id);
return new CommonResult().success(coupon);
} catch (Exception e) {
log.error("查询话题表明细:%s", e.getMessage(), e);
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量删除话题表")
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "pms", REMARK = "批量删除话题表")
@PreAuthorize("hasAuthority('cms:CmsTopic:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
boolean count = ICmsTopicService.removeByIds(ids);
if (count) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改审核状态")
@RequestMapping(value = "/update/verifyStatus")
@ResponseBody
@SysLog(MODULE = "cms", REMARK = "修改审核状态")
public Object updateVerifyStatus(@RequestParam("ids") Long ids,
@RequestParam("topicId") Long topicId,
@RequestParam("verifyStatus") Integer verifyStatus) {
int count = ICmsTopicService.updateVerifyStatus(ids, topicId, verifyStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("根据活动id获取活动参与人员信息")
@RequestMapping(value = "/fetchCmsTopicMember/{id}", method = RequestMethod.GET)
@ResponseBody
@SysLog(MODULE = "cms", REMARK = "根据活动id获取活动参与人员信息")
public Object fetchCmsTopicMember(@PathVariable Long id) {
CmsTopicMember member = new CmsTopicMember();
member.setTopicId(id);
List<CmsTopicMember> list = topicMemberService.list(new QueryWrapper<>(member));
return new CommonResult().success(list);
}
}

Some files were not shown because too many files have changed in this diff Show More