init git
This commit is contained in:
39
.gitignore
vendored
Normal file
39
.gitignore
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
.kotlin
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
159
pom.xml
Normal file
159
pom.xml
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>xingyun-core</module>
|
||||
<module>xingyun-server</module>
|
||||
<module>xingyun-basedata</module>
|
||||
<module>xingyun-sc</module>
|
||||
<module>xingyun-chart</module>
|
||||
<module>xingyun-settle</module>
|
||||
<module>xingyun-comp</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||
<lombok.version>1.18.32</lombok.version>
|
||||
<xingyun.version>1.0.0</xingyun.version>
|
||||
<framework.version>1.0.0</framework.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>${framework.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>mq-starter</artifactId>
|
||||
<version>${framework.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-basedata</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-comp</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-sc</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-chart</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-settle</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-core</artifactId>
|
||||
<version>${xingyun.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>2.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<release>${java.version}</release>
|
||||
<encoding>UTF-8</encoding>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<profiles-active>dev</profiles-active>
|
||||
<discovery-server>127.0.0.1:10000</discovery-server>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profiles-active>test</profiles-active>
|
||||
<discovery-server>127.0.0.1:10000</discovery-server>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<profiles-active>prod</profiles-active>
|
||||
<discovery-server>127.0.0.1:10000</discovery-server>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
27
xingyun-basedata/pom.xml
Normal file
27
xingyun-basedata/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>xingyun-basedata</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lframework</groupId>
|
||||
<artifactId>xingyun-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>2.2.36</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.events.DeleteCustomerEvent;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class AddressForDeleteCustomerListener implements
|
||||
ApplicationListener<DeleteCustomerEvent> {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteCustomerEvent event) {
|
||||
|
||||
Wrapper<Address> deleteWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, event.getEntity().getId())
|
||||
.eq(Address::getEntityType, AddressEntityType.CUSTOMER);
|
||||
addressService.remove(deleteWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.events.DeleteMemberEvent;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class AddressForDeleteMemberListener implements
|
||||
ApplicationListener<DeleteMemberEvent> {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteMemberEvent event) {
|
||||
|
||||
Wrapper<Address> deleteWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, event.getEntity().getId())
|
||||
.eq(Address::getEntityType, AddressEntityType.MEMBER);
|
||||
addressService.remove(deleteWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.events.DeleteShopEvent;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class AddressForDeleteShopListener implements
|
||||
ApplicationListener<DeleteShopEvent> {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteShopEvent event) {
|
||||
|
||||
Wrapper<Address> deleteWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, event.getEntity().getId())
|
||||
.eq(Address::getEntityType, AddressEntityType.SHOP);
|
||||
addressService.remove(deleteWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.events.DeleteStoreCenterEvent;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class AddressForDeleteStoreCenterListener implements
|
||||
ApplicationListener<DeleteStoreCenterEvent> {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteStoreCenterEvent event) {
|
||||
|
||||
Wrapper<Address> deleteWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, event.getEntity().getId())
|
||||
.eq(Address::getEntityType, AddressEntityType.SC);
|
||||
addressService.remove(deleteWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.events.DeleteSupplierEvent;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class AddressForDeleteSupplierListener implements
|
||||
ApplicationListener<DeleteSupplierEvent> {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteSupplierEvent event) {
|
||||
|
||||
Wrapper<Address> deleteWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, event.getEntity().getId())
|
||||
.eq(Address::getEntityType, AddressEntityType.SUPPLIER);
|
||||
addressService.remove(deleteWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategoryProperty;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductPropertyEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryPropertyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class ProductCategoryPropertyForDeleteProductPropertyListener implements
|
||||
ApplicationListener<DeleteProductPropertyEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductCategoryPropertyService productCategoryPropertyService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductPropertyEvent event) {
|
||||
|
||||
Wrapper<ProductCategoryProperty> queryWrapper = Wrappers.lambdaQuery(
|
||||
ProductCategoryProperty.class)
|
||||
.eq(ProductCategoryProperty::getPropertyId, event.getEntity().getId());
|
||||
if (productCategoryPropertyService.count(queryWrapper) > 0) {
|
||||
productCategoryPropertyService.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.xingyun.basedata.entity.Product;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductBrandEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ProductForDeleteProductBrandListener implements
|
||||
ApplicationListener<DeleteProductBrandEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductBrandEvent event) {
|
||||
Wrapper<Product> queryWrapper = Wrappers.lambdaQuery(Product.class)
|
||||
.eq(Product::getBrandId, event.getEntity().getId())
|
||||
.eq(Product::getAvailable, Boolean.TRUE);
|
||||
if (productService.count(queryWrapper) > 0) {
|
||||
throw new DefaultClientException(
|
||||
"商品品牌:" + event.getEntity().getName() + "下存在商品信息,无法删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.xingyun.basedata.entity.Product;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductCategoryEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ProductForDeleteProductCategoryListener implements
|
||||
ApplicationListener<DeleteProductCategoryEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductCategoryEvent event) {
|
||||
Wrapper<Product> queryWrapper = Wrappers.lambdaQuery(Product.class)
|
||||
.eq(Product::getCategoryId, event.getEntity().getId())
|
||||
.eq(Product::getAvailable, Boolean.TRUE);
|
||||
if (productService.count(queryWrapper) > 0) {
|
||||
throw new DefaultClientException(
|
||||
"商品分类:" + event.getEntity().getName() + "下存在商品信息,无法删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyItem;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductPropertyEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ProductPropertyItemForDeleteProductPropertyListener implements
|
||||
ApplicationListener<DeleteProductPropertyEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyItemService productPropertyItemService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductPropertyEvent event) {
|
||||
|
||||
List<ProductPropertyItem> productPropertyItemList = productPropertyItemService.getByPropertyId(
|
||||
event.getEntity().getId());
|
||||
for (ProductPropertyItem propertyItem : productPropertyItemList) {
|
||||
productPropertyItemService.deleteById(propertyItem.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyRelation;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductPropertyItemEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyRelationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class ProductPropertyRelationForDeleteProductPropertyItemListener implements
|
||||
ApplicationListener<DeleteProductPropertyItemEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyRelationService productPropertyRelationService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductPropertyItemEvent event) {
|
||||
|
||||
Wrapper<ProductPropertyRelation> queryWrapper = Wrappers.lambdaQuery(
|
||||
ProductPropertyRelation.class)
|
||||
.eq(ProductPropertyRelation::getPropertyId, event.getEntity().getPropertyId())
|
||||
.eq(ProductPropertyRelation::getPropertyItemId, event.getEntity().getId());
|
||||
if (productPropertyRelationService.count(queryWrapper) > 0) {
|
||||
productPropertyRelationService.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyRelation;
|
||||
import com.lframework.xingyun.basedata.events.DeleteProductPropertyEvent;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyRelationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Component
|
||||
public class ProductPropertyRelationForDeleteProductPropertyListener implements
|
||||
ApplicationListener<DeleteProductPropertyEvent> {
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyRelationService productPropertyRelationService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteProductPropertyEvent event) {
|
||||
|
||||
Wrapper<ProductPropertyRelation> queryWrapper = Wrappers.lambdaQuery(
|
||||
ProductPropertyRelation.class)
|
||||
.eq(ProductPropertyRelation::getPropertyId, event.getEntity().getId());
|
||||
if (productPropertyRelationService.count(queryWrapper) > 0) {
|
||||
productPropertyRelationService.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lframework.xingyun.basedata.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.web.inner.events.system.DeleteSysDeptEvent;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ShopForDeleteSysDeptListener implements
|
||||
ApplicationListener<DeleteSysDeptEvent> {
|
||||
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(DeleteSysDeptEvent event) {
|
||||
|
||||
Wrapper<Shop> queryWrapper = Wrappers.lambdaQuery(Shop.class)
|
||||
.eq(Shop::getDeptId, event.getEntity().getId()).eq(Shop::getAvailable, true);
|
||||
if (shopService.count(queryWrapper) > 0) {
|
||||
throw new DefaultClientException("部门:" + event.getEntity().getName() + "下存在门店,不允许删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.lframework.xingyun.basedata.bo.address;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AddressSelectorBo extends BaseBo<Address> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 地址类型
|
||||
*/
|
||||
@Schema(description = "地址类型")
|
||||
@EnumConvert
|
||||
private Integer addressType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 省ID
|
||||
*/
|
||||
@Schema(description = "省ID")
|
||||
private String provinceId;
|
||||
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
@Schema(description = "省名称")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市ID
|
||||
*/
|
||||
@Schema(description = "市ID")
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 市名称
|
||||
*/
|
||||
@Schema(description = "市名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区ID
|
||||
*/
|
||||
@Schema(description = "区ID")
|
||||
private String districtId;
|
||||
|
||||
/**
|
||||
* 区名称
|
||||
*/
|
||||
@Schema(description = "区名称")
|
||||
private String districtName;
|
||||
|
||||
/**
|
||||
* 地区全称
|
||||
*/
|
||||
@Schema(description = "地区全称")
|
||||
private String areaFullName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否默认地址
|
||||
*/
|
||||
@Schema(description = "是否默认地址")
|
||||
private Boolean isDefault;
|
||||
|
||||
public AddressSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public AddressSelectorBo(Address dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Address dto) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
DicCityDto province = dicCityService.findById(dto.getProvinceId());
|
||||
this.provinceName = province.getName();
|
||||
|
||||
DicCityDto city = dicCityService.findById(dto.getCityId());
|
||||
this.cityName = city.getName();
|
||||
|
||||
DicCityDto district = dicCityService.findById(dto.getDistrictId());
|
||||
this.districtName = district.getName();
|
||||
|
||||
this.areaFullName =
|
||||
this.provinceName + StringPool.CITY_SPLIT + this.cityName + StringPool.CITY_SPLIT
|
||||
+ this.districtName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.lframework.xingyun.basedata.bo.address;
|
||||
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.*;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.service.customer.CustomerService;
|
||||
import com.lframework.xingyun.basedata.service.member.MemberService;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
|
||||
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetAddressBo extends BaseBo<Address> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 实体ID
|
||||
*/
|
||||
@Schema(description = "实体ID")
|
||||
private String entityId;
|
||||
|
||||
/**
|
||||
* 实体名称
|
||||
*/
|
||||
@Schema(description = "实体名称")
|
||||
private String entityName;
|
||||
|
||||
/**
|
||||
* 实体类型
|
||||
*/
|
||||
@Schema(description = "实体类型")
|
||||
@EnumConvert
|
||||
private Integer entityType;
|
||||
|
||||
/**
|
||||
* 地址类型
|
||||
*/
|
||||
@Schema(description = "地址类型")
|
||||
@EnumConvert
|
||||
private Integer addressType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 省ID
|
||||
*/
|
||||
@Schema(description = "省ID")
|
||||
private String provinceId;
|
||||
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
@Schema(description = "省名称")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市ID
|
||||
*/
|
||||
@Schema(description = "市ID")
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 市名称
|
||||
*/
|
||||
@Schema(description = "市名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区ID
|
||||
*/
|
||||
@Schema(description = "区ID")
|
||||
private String districtId;
|
||||
|
||||
/**
|
||||
* 区名称
|
||||
*/
|
||||
@Schema(description = "区名称")
|
||||
private String districtName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否默认地址
|
||||
*/
|
||||
@Schema(description = "是否默认地址")
|
||||
private Boolean isDefault;
|
||||
|
||||
public GetAddressBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetAddressBo(Address dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Address dto) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
DicCityDto province = dicCityService.findById(dto.getProvinceId());
|
||||
this.provinceName = province.getName();
|
||||
|
||||
DicCityDto city = dicCityService.findById(dto.getCityId());
|
||||
this.cityName = city.getName();
|
||||
|
||||
DicCityDto district = dicCityService.findById(dto.getDistrictId());
|
||||
this.districtName = district.getName();
|
||||
|
||||
if (dto.getEntityType() == AddressEntityType.SC) {
|
||||
StoreCenterService storeCenterService = ApplicationUtil.getBean(StoreCenterService.class);
|
||||
StoreCenter sc = storeCenterService.findById(dto.getEntityId());
|
||||
this.entityName = sc.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.CUSTOMER) {
|
||||
CustomerService customerService = ApplicationUtil.getBean(CustomerService.class);
|
||||
Customer customer = customerService.findById(dto.getEntityId());
|
||||
this.entityName = customer.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.SUPPLIER) {
|
||||
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
|
||||
Supplier supplier = supplierService.findById(dto.getEntityId());
|
||||
this.entityName = supplier.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.MEMBER) {
|
||||
MemberService memberService = ApplicationUtil.getBean(MemberService.class);
|
||||
Member member = memberService.findById(dto.getEntityId());
|
||||
this.entityName = member.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.SHOP) {
|
||||
ShopService shopService = ApplicationUtil.getBean(ShopService.class);
|
||||
Shop shop = shopService.findById(dto.getEntityId());
|
||||
this.entityName = shop.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.lframework.xingyun.basedata.bo.address;
|
||||
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.*;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.service.customer.CustomerService;
|
||||
import com.lframework.xingyun.basedata.service.member.MemberService;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
|
||||
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryAddressBo extends BaseBo<Address> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 实体ID
|
||||
*/
|
||||
@Schema(description = "实体ID")
|
||||
private String entityId;
|
||||
|
||||
/**
|
||||
* 实体名称
|
||||
*/
|
||||
@Schema(description = "实体名称")
|
||||
private String entityName;
|
||||
|
||||
/**
|
||||
* 实体类型
|
||||
*/
|
||||
@Schema(description = "实体类型")
|
||||
@EnumConvert
|
||||
private Integer entityType;
|
||||
|
||||
/**
|
||||
* 地址类型
|
||||
*/
|
||||
@Schema(description = "地址类型")
|
||||
@EnumConvert
|
||||
private Integer addressType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 省ID
|
||||
*/
|
||||
@Schema(description = "省ID")
|
||||
private String provinceId;
|
||||
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
@Schema(description = "省名称")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市ID
|
||||
*/
|
||||
@Schema(description = "市ID")
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 市名称
|
||||
*/
|
||||
@Schema(description = "市名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区ID
|
||||
*/
|
||||
@Schema(description = "区ID")
|
||||
private String districtId;
|
||||
|
||||
/**
|
||||
* 区名称
|
||||
*/
|
||||
@Schema(description = "区名称")
|
||||
private String districtName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否默认地址
|
||||
*/
|
||||
@Schema(description = "是否默认地址")
|
||||
private Boolean isDefault;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
public QueryAddressBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryAddressBo(Address dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Address dto) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
DicCityDto province = dicCityService.findById(dto.getProvinceId());
|
||||
this.provinceName = province.getName();
|
||||
|
||||
DicCityDto city = dicCityService.findById(dto.getCityId());
|
||||
this.cityName = city.getName();
|
||||
|
||||
DicCityDto district = dicCityService.findById(dto.getDistrictId());
|
||||
this.districtName = district.getName();
|
||||
|
||||
if (dto.getEntityType() == AddressEntityType.SC) {
|
||||
StoreCenterService storeCenterService = ApplicationUtil.getBean(StoreCenterService.class);
|
||||
StoreCenter sc = storeCenterService.findById(dto.getEntityId());
|
||||
this.entityName = sc.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.CUSTOMER) {
|
||||
CustomerService customerService = ApplicationUtil.getBean(CustomerService.class);
|
||||
Customer customer = customerService.findById(dto.getEntityId());
|
||||
this.entityName = customer.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.SUPPLIER) {
|
||||
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
|
||||
Supplier supplier = supplierService.findById(dto.getEntityId());
|
||||
this.entityName = supplier.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.MEMBER) {
|
||||
MemberService memberService = ApplicationUtil.getBean(MemberService.class);
|
||||
Member member = memberService.findById(dto.getEntityId());
|
||||
this.entityName = member.getName();
|
||||
} else if (dto.getEntityType() == AddressEntityType.SHOP) {
|
||||
ShopService shopService = ApplicationUtil.getBean(ShopService.class);
|
||||
Shop shop = shopService.findById(dto.getEntityId());
|
||||
this.entityName = shop.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.bo.customer;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Customer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CustomerSelectorBo extends BaseBo<Customer> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public CustomerSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public CustomerSelectorBo(Customer dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.lframework.xingyun.basedata.bo.customer;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.Customer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetCustomerBo extends BaseBo<Customer> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
@Schema(description = "简码")
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
@Schema(description = "电子邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
@Schema(description = "邮编")
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
@Schema(description = "传真")
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
@Schema(description = "地区ID")
|
||||
private List<String> city;
|
||||
|
||||
/**
|
||||
* 地区名称
|
||||
*/
|
||||
@Schema(description = "地区名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
@Schema(description = "结算方式")
|
||||
private Integer settleType;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
@Schema(description = "纳税人识别号")
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
@Schema(description = "开户银行")
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
@Schema(description = "户名")
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
@Schema(description = "银行账号")
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetCustomerBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetCustomerBo(Customer dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<Customer> convert(Customer dto) {
|
||||
|
||||
return super.convert(dto, GetCustomerBo::getSettleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Customer dto) {
|
||||
|
||||
if (dto.getSettleType() != null) {
|
||||
this.settleType = dto.getSettleType().getCode();
|
||||
}
|
||||
|
||||
if (!StringUtil.isBlank(dto.getCityId())) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
List<DicCityDto> cityList = dicCityService.getChainById(dto.getCityId());
|
||||
this.city = cityList.stream().map(DicCityDto::getId).collect(Collectors.toList());
|
||||
|
||||
this.cityName = cityList.stream().map(DicCityDto::getName)
|
||||
.collect(Collectors.joining(StringPool.CITY_SPLIT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.customer;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Customer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryCustomerBo extends BaseBo<Customer> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryCustomerBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryCustomerBo(Customer dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Customer dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.lframework.xingyun.basedata.bo.logistics.company;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.LogisticsCompany;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetLogisticsCompanyBo extends BaseBo<LogisticsCompany> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
@Schema(description = "地区ID")
|
||||
private List<String> city;
|
||||
|
||||
/**
|
||||
* 地区名称
|
||||
*/
|
||||
@Schema(description = "地区名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetLogisticsCompanyBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetLogisticsCompanyBo(LogisticsCompany dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(LogisticsCompany dto) {
|
||||
|
||||
if (!StringUtil.isBlank(dto.getCityId())) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
List<DicCityDto> cityList = dicCityService.getChainById(dto.getCityId());
|
||||
this.city = cityList.stream().map(DicCityDto::getId).collect(Collectors.toList());
|
||||
|
||||
this.cityName = cityList.stream().map(DicCityDto::getName)
|
||||
.collect(Collectors.joining(StringPool.CITY_SPLIT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.bo.logistics.company;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.LogisticsCompany;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LogisticsCompanySelectorBo extends BaseBo<LogisticsCompany> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public LogisticsCompanySelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public LogisticsCompanySelectorBo(LogisticsCompany dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.logistics.company;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.LogisticsCompany;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryLogisticsCompanyBo extends BaseBo<LogisticsCompany> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryLogisticsCompanyBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryLogisticsCompanyBo(LogisticsCompany dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(LogisticsCompany dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.lframework.xingyun.basedata.bo.member;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.entity.SysUser;
|
||||
import com.lframework.starter.web.inner.service.system.SysUserService;
|
||||
import com.lframework.xingyun.basedata.entity.Member;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class GetMemberBo extends BaseBo<Member> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
@Schema(description = "电子邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@Schema(description = "出生日期")
|
||||
@JsonFormat(pattern = StringPool.DATE_PATTERN)
|
||||
private LocalDate birthday;
|
||||
|
||||
/**
|
||||
* 入会日期
|
||||
*/
|
||||
@Schema(description = "入会日期")
|
||||
@JsonFormat(pattern = StringPool.DATE_PATTERN)
|
||||
private LocalDate joinDay;
|
||||
|
||||
/**
|
||||
* 所属门店ID
|
||||
*/
|
||||
@Schema(description = "所属门店ID")
|
||||
private String shopId;
|
||||
|
||||
/**
|
||||
* 所属门店名称
|
||||
*/
|
||||
@Schema(description = "所属门店名称")
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 所属导购ID
|
||||
*/
|
||||
@Schema(description = "所属导购ID")
|
||||
private String guiderId;
|
||||
|
||||
/**
|
||||
* 所属导购名称
|
||||
*/
|
||||
@Schema(description = "所属导购名称")
|
||||
private String guiderName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetMemberBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetMemberBo(Member dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<Member> convert(Member dto) {
|
||||
|
||||
return super.convert(dto, GetMemberBo::getGender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Member dto) {
|
||||
|
||||
this.gender = dto.getGender().getCode();
|
||||
|
||||
if (!StringUtil.isBlank(dto.getShopId())) {
|
||||
ShopService shopService = ApplicationUtil.getBean(ShopService.class);
|
||||
Shop shop = shopService.findById(dto.getShopId());
|
||||
this.shopName = shop.getName();
|
||||
}
|
||||
|
||||
if (!StringUtil.isBlank(dto.getGuiderId())) {
|
||||
SysUserService userService = ApplicationUtil.getBean(SysUserService.class);
|
||||
SysUser guider = userService.findById(dto.getGuiderId());
|
||||
this.guiderName = guider.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.lframework.xingyun.basedata.bo.member;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Member;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MemberSelectorBo extends BaseBo<Member> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public MemberSelectorBo(Member dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.member;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Member;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryMemberBo extends BaseBo<Member> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryMemberBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryMemberBo(Member dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Member dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.lframework.xingyun.basedata.bo.paytype;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.PayType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetPayTypeBo extends BaseBo<PayType> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否记录内容
|
||||
*/
|
||||
@Schema(description = "是否记录内容")
|
||||
private Boolean recText;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetPayTypeBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetPayTypeBo(PayType dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lframework.xingyun.basedata.bo.paytype;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.PayType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayTypeSelectorBo extends BaseBo<PayType> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否记录内容
|
||||
*/
|
||||
@Schema(description = "是否记录内容")
|
||||
private Boolean recText;
|
||||
|
||||
public PayTypeSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public PayTypeSelectorBo(PayType dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.paytype;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.PayType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryPayTypeBo extends BaseBo<PayType> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryPayTypeBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryPayTypeBo(PayType dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(PayType dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lframework.xingyun.basedata.bo.print;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplate;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetPrintTemplateBo extends BaseBo<PrintTemplate> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public GetPrintTemplateBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetPrintTemplateBo(PrintTemplate dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lframework.xingyun.basedata.bo.print;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.JsonUtil;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplateComp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class GetPrintTemplateCompSettingBo extends BaseBo<PrintTemplateComp> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 组件配置
|
||||
*/
|
||||
@Schema(description = "组件配置")
|
||||
private Map<String, Object> compJson;
|
||||
|
||||
public GetPrintTemplateCompSettingBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetPrintTemplateCompSettingBo(PrintTemplateComp dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> BaseBo<PrintTemplateComp> convert(PrintTemplateComp dto) {
|
||||
return super.convert(dto, GetPrintTemplateCompSettingBo::getCompJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(PrintTemplateComp dto) {
|
||||
this.compJson = JsonUtil.parseMap(dto.getCompJson(), String.class, Object.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.lframework.xingyun.basedata.bo.print;
|
||||
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.core.utils.JsonUtil;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplate;
|
||||
import com.lframework.xingyun.basedata.service.print.PrintTemplateCompService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetPrintTemplateSettingBo extends BaseBo<PrintTemplate> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* JSON配置
|
||||
*/
|
||||
@Schema(description = "JSON配置")
|
||||
private Map<String, Object> templateJson;
|
||||
|
||||
/**
|
||||
* 示例数据
|
||||
*/
|
||||
@Schema(description = "示例数据")
|
||||
private Map<String, Object> demoData;
|
||||
|
||||
/**
|
||||
* 附加组件配置
|
||||
*/
|
||||
@Schema(description = "附加组件配置")
|
||||
private List<Map<String, Object>> compJsonList;
|
||||
|
||||
public GetPrintTemplateSettingBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetPrintTemplateSettingBo(PrintTemplate dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> BaseBo<PrintTemplate> convert(PrintTemplate dto) {
|
||||
return super.convert(dto, GetPrintTemplateSettingBo::getTemplateJson,
|
||||
GetPrintTemplateSettingBo::getDemoData);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(PrintTemplate dto) {
|
||||
this.templateJson = JsonUtil.parseMap(dto.getTemplateJson(), String.class, Object.class);
|
||||
|
||||
if (!StringUtil.isBlank(dto.getDemoData())) {
|
||||
this.demoData = JsonUtil.parseMap(dto.getDemoData(), String.class, Object.class);
|
||||
}
|
||||
|
||||
PrintTemplateCompService printTemplateCompService = ApplicationUtil.getBean(
|
||||
PrintTemplateCompService.class);
|
||||
List<String> compJsonList = printTemplateCompService.getCompJsonByTemplateId(dto.getId());
|
||||
this.compJsonList = compJsonList.stream()
|
||||
.map(t -> JsonUtil.parseMap(t, String.class, Object.class)).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lframework.xingyun.basedata.bo.print;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplate;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryPrintTemplateBo extends BaseBo<PrintTemplate> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryPrintTemplateBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryPrintTemplateBo(PrintTemplate dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.brand;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetProductBrandBo extends BaseBo<ProductBrand> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
@Schema(description = "简称")
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@Schema(description = "logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description = "简介")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetProductBrandBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetProductBrandBo(ProductBrand dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.brand;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductBrandSelectorBo extends BaseBo<ProductBrand> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public ProductBrandSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductBrandSelectorBo(ProductBrand dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.brand;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductCategorySelectorBo extends BaseBo<ProductCategory> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@Schema(description = "父级ID")
|
||||
private String parentId;
|
||||
|
||||
public ProductCategorySelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductCategorySelectorBo(ProductCategory dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.brand;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QueryProductBrandBo extends BaseBo<ProductBrand> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public QueryProductBrandBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryProductBrandBo(ProductBrand dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.category;
|
||||
|
||||
import com.lframework.starter.common.utils.ObjectUtil;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetProductCategoryBo extends BaseBo<ProductCategory> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@Schema(description = "父级ID")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 父级名称
|
||||
*/
|
||||
@Schema(description = "父级名称")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetProductCategoryBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetProductCategoryBo(ProductCategory dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(ProductCategory dto) {
|
||||
|
||||
if (!StringUtil.isBlank(this.getParentId())) {
|
||||
ProductCategoryService productCategoryService = ApplicationUtil.getBean(
|
||||
ProductCategoryService.class);
|
||||
ProductCategory parentCategory = productCategoryService.findById(this.getParentId());
|
||||
if (!ObjectUtil.isNull(parentCategory)) {
|
||||
this.setParentName(parentCategory.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.category;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductCategoryTreeBo extends BaseBo<ProductCategory> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@Schema(description = "父级ID")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public ProductCategoryTreeBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductCategoryTreeBo(ProductCategory dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.info;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.xingyun.basedata.dto.product.ProductPropertyRelationDto;
|
||||
import com.lframework.xingyun.basedata.entity.*;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnType;
|
||||
import com.lframework.xingyun.basedata.enums.ProductType;
|
||||
import com.lframework.xingyun.basedata.service.product.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetProductBo extends BaseBo<Product> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
@Schema(description = "简称")
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
@Schema(description = "SKU")
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
@Schema(description = "简码")
|
||||
private String externalCode;
|
||||
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
@Schema(description = "分类ID")
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
@Schema(description = "品牌ID")
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
@Schema(description = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 重量(kg)
|
||||
*/
|
||||
@Schema(description = "重量(kg)")
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 体积(cm3)
|
||||
*/
|
||||
@Schema(description = "体积(cm3)")
|
||||
private BigDecimal volume;
|
||||
|
||||
/**
|
||||
* 进项税率(%)
|
||||
*/
|
||||
@Schema(description = "进项税率(%)")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 销项税率(%)
|
||||
*/
|
||||
@Schema(description = "销项税率(%)")
|
||||
private BigDecimal saleTaxRate;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
@Schema(description = "商品类型")
|
||||
@EnumConvert
|
||||
private Integer productType;
|
||||
|
||||
/**
|
||||
* 单品
|
||||
*/
|
||||
@Schema(description = "单品")
|
||||
private List<ProductBundleBo> productBundles;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
@Schema(description = "采购价")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
@Schema(description = "销售价")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
@Schema(description = "零售价")
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*/
|
||||
@Schema(description = "属性")
|
||||
private List<PropertyBo> properties;
|
||||
|
||||
public GetProductBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetProductBo(Product dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<Product> convert(Product dto) {
|
||||
|
||||
return super.convert(dto, GetProductBo::getProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Product dto) {
|
||||
|
||||
ProductCategoryService productCategoryService = ApplicationUtil.getBean(
|
||||
ProductCategoryService.class);
|
||||
ProductCategory productCategory = productCategoryService.findById(dto.getCategoryId());
|
||||
this.categoryName = productCategory.getName();
|
||||
|
||||
if (StringUtil.isNotBlank(dto.getBrandId())) {
|
||||
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
|
||||
ProductBrand productBrand = productBrandService.findById(dto.getBrandId());
|
||||
this.brandName = productBrand.getName();
|
||||
}
|
||||
|
||||
if (dto.getProductType() == ProductType.BUNDLE) {
|
||||
ProductBundleService productBundleService = ApplicationUtil.getBean(
|
||||
ProductBundleService.class);
|
||||
List<ProductBundle> bundles = productBundleService.getByMainProductId(dto.getId());
|
||||
this.productBundles = bundles.stream().map(ProductBundleBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
ProductPurchaseService productPurchaseService = ApplicationUtil.getBean(
|
||||
ProductPurchaseService.class);
|
||||
ProductPurchase productPurchase = productPurchaseService.getById(dto.getId());
|
||||
this.purchasePrice = productPurchase.getPrice();
|
||||
|
||||
ProductSaleService productSaleService = ApplicationUtil.getBean(ProductSaleService.class);
|
||||
ProductSale productSale = productSaleService.getById(dto.getId());
|
||||
this.salePrice = productSale.getPrice();
|
||||
|
||||
ProductRetailService productRetailService = ApplicationUtil.getBean(
|
||||
ProductRetailService.class);
|
||||
ProductRetail productRetail = productRetailService.getById(dto.getId());
|
||||
this.retailPrice = productRetail.getPrice();
|
||||
|
||||
ProductPropertyRelationService productPropertyRelationService = ApplicationUtil.getBean(
|
||||
ProductPropertyRelationService.class);
|
||||
List<ProductPropertyRelationDto> propertyRelationDtos = productPropertyRelationService.getByProductId(
|
||||
dto.getId());
|
||||
if (!CollectionUtil.isEmpty(propertyRelationDtos)) {
|
||||
this.properties = new ArrayList<>();
|
||||
for (ProductPropertyRelationDto property : propertyRelationDtos) {
|
||||
if (property.getPropertyColumnType() == ColumnType.MULTIPLE) {
|
||||
PropertyBo propertyBo = this.properties.stream()
|
||||
.filter(t -> t.getId().equals(property.getPropertyId())).findFirst().orElse(null);
|
||||
if (propertyBo == null) {
|
||||
this.properties.add(new PropertyBo(property));
|
||||
} else {
|
||||
propertyBo.setText(propertyBo.getText().concat(StringPool.STR_SPLIT)
|
||||
.concat(property.getPropertyItemId()));
|
||||
propertyBo.setTextStr(propertyBo.getTextStr().concat(StringPool.STR_SPLIT_CN)
|
||||
.concat(property.getPropertyText()));
|
||||
}
|
||||
} else {
|
||||
this.properties.add(new PropertyBo(property));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class PropertyBo extends BaseBo<ProductPropertyRelationDto> {
|
||||
|
||||
/**
|
||||
* 属性ID
|
||||
*/
|
||||
@Schema(description = "属性ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 属性名
|
||||
*/
|
||||
@Schema(description = "属性名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*/
|
||||
@Schema(description = "字段类型")
|
||||
private Integer columnType;
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
@Schema(description = "属性值")
|
||||
private String text;
|
||||
|
||||
/**
|
||||
* 属性文本
|
||||
*/
|
||||
@Schema(description = "属性文本")
|
||||
private String textStr;
|
||||
|
||||
public PropertyBo() {
|
||||
|
||||
}
|
||||
|
||||
public PropertyBo(ProductPropertyRelationDto dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<ProductPropertyRelationDto> convert(ProductPropertyRelationDto dto) {
|
||||
|
||||
return super.convert(dto, PropertyBo::getColumnType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(ProductPropertyRelationDto dto) {
|
||||
|
||||
this.id = dto.getPropertyId();
|
||||
this.name = dto.getPropertyName();
|
||||
this.text = dto.getPropertyColumnType() == ColumnType.CUSTOM ? dto.getPropertyText()
|
||||
: dto.getPropertyItemId();
|
||||
this.textStr = dto.getPropertyText();
|
||||
this.columnType = dto.getPropertyColumnType().getCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.info;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBundle;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ProductBundleBo extends BaseBo<ProductBundle> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单品ID
|
||||
*/
|
||||
@Schema(description = "单品ID")
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 包含数量
|
||||
*/
|
||||
@Schema(description = "包含数量")
|
||||
private Integer bundleNum;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
@Schema(description = "采购价")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
@Schema(description = "销售价")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
@Schema(description = "零售价")
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
public ProductBundleBo() {
|
||||
}
|
||||
|
||||
public ProductBundleBo(ProductBundle dto) {
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.info;
|
||||
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.xingyun.basedata.entity.Product;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductBrandService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductSelectorBo extends BaseBo<Product> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
@Schema(description = "SKU")
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
@Schema(description = "简码")
|
||||
private String externalCode;
|
||||
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
@Schema(description = "分类ID")
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
@Schema(description = "品牌ID")
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
@Schema(description = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
@Schema(description = "商品类型")
|
||||
@EnumConvert
|
||||
private Integer productType;
|
||||
|
||||
public ProductSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductSelectorBo(Product dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Product dto) {
|
||||
ProductCategoryService productCategoryService = ApplicationUtil.getBean(
|
||||
ProductCategoryService.class);
|
||||
ProductCategory productCategory = productCategoryService.findById(dto.getCategoryId());
|
||||
this.categoryName = productCategory.getName();
|
||||
|
||||
if (StringUtil.isNotBlank(dto.getBrandId())) {
|
||||
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
|
||||
ProductBrand brand = productBrandService.findById(dto.getBrandId());
|
||||
this.brandName = brand.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.info;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.annotations.convert.EnumConvert;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.xingyun.basedata.entity.Product;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductBrandService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryProductBo extends BaseBo<Product> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "简称")
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
@Schema(description = "SKU")
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
@Schema(description = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
@Schema(description = "商品类型")
|
||||
@EnumConvert
|
||||
private Integer productType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryProductBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryProductBo(Product dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Product dto) {
|
||||
ProductCategoryService productCategoryService = ApplicationUtil.getBean(
|
||||
ProductCategoryService.class);
|
||||
ProductCategory productCategory = productCategoryService.findById(dto.getCategoryId());
|
||||
this.categoryName = productCategory.getName();
|
||||
|
||||
if (StringUtil.isNotBlank(dto.getBrandId())) {
|
||||
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
|
||||
ProductBrand brand = productBrandService.findById(dto.getBrandId());
|
||||
this.brandName = brand.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.property;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategoryProperty;
|
||||
import com.lframework.xingyun.basedata.entity.ProductProperty;
|
||||
import com.lframework.xingyun.basedata.enums.PropertyType;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryPropertyService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetProductPropertyBo extends BaseBo<ProductProperty> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
@Schema(description = "是否必填")
|
||||
private Boolean isRequired;
|
||||
|
||||
/**
|
||||
* 录入类型
|
||||
*/
|
||||
@Schema(description = "录入类型")
|
||||
private Integer columnType;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
@Schema(description = "数据类型")
|
||||
private Integer columnDataType;
|
||||
|
||||
/**
|
||||
* 属性类别
|
||||
*/
|
||||
@Schema(description = "属性类别")
|
||||
private Integer propertyType;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@Schema(description = "分类")
|
||||
private List<String> categories;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetProductPropertyBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetProductPropertyBo(ProductProperty dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(ProductProperty dto) {
|
||||
|
||||
this.columnType = dto.getColumnType().getCode();
|
||||
this.propertyType = dto.getPropertyType().getCode();
|
||||
if (dto.getColumnDataType() != null) {
|
||||
this.columnDataType = dto.getColumnDataType().getCode();
|
||||
}
|
||||
|
||||
if (dto.getPropertyType() == PropertyType.APPOINT) {
|
||||
ProductCategoryPropertyService productCategoryPropertyService = ApplicationUtil.getBean(
|
||||
ProductCategoryPropertyService.class);
|
||||
List<ProductCategoryProperty> categoryPropertyList = productCategoryPropertyService.getByPropertyId(
|
||||
dto.getId());
|
||||
|
||||
this.categories = categoryPropertyList.stream().map(ProductCategoryProperty::getCategoryId)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.property;
|
||||
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.dto.product.property.ProductPropertyModelorDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class ProductPropertyModelorBo extends BaseBo<ProductPropertyModelorDto> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
@Schema(description = "是否必填")
|
||||
private Boolean isRequired;
|
||||
|
||||
/**
|
||||
* 可选项,当columnType != CUSTOM时 不为空
|
||||
*/
|
||||
@Schema(description = "可选项,当columnType != CUSTOM时 不为空")
|
||||
private List<ProductPropertyItemModelorBo> items;
|
||||
|
||||
/**
|
||||
* 显示值 当columnType != CUSTOM时,此值为items项ID 当columnType == CUSTOM时,此值为录入值
|
||||
*/
|
||||
@Schema(description = "显示值 当columnType != CUSTOM时,此值为items项ID 当columnType == CUSTOM时,此值为录入值")
|
||||
private String text;
|
||||
|
||||
/**
|
||||
* 录入类型
|
||||
*/
|
||||
@Schema(description = "录入类型")
|
||||
private Integer columnType;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
@Schema(description = "数据类型")
|
||||
private Integer columnDataType;
|
||||
|
||||
/**
|
||||
* 属性类别
|
||||
*/
|
||||
@Schema(description = "属性类别")
|
||||
private Integer propertyType;
|
||||
|
||||
public ProductPropertyModelorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductPropertyModelorBo(ProductPropertyModelorDto dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<ProductPropertyModelorDto> convert(ProductPropertyModelorDto dto) {
|
||||
|
||||
return super.convert(dto, ProductPropertyModelorBo::getItems, ProductPropertyModelorBo::getColumnType,
|
||||
ProductPropertyModelorBo::getColumnDataType, ProductPropertyModelorBo::getPropertyType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(ProductPropertyModelorDto dto) {
|
||||
|
||||
if (!CollectionUtil.isEmpty(dto.getItems())) {
|
||||
this.items = dto.getItems().stream().map(ProductPropertyItemModelorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
this.columnType = dto.getColumnType().getCode();
|
||||
if (dto.getColumnDataType() != null) {
|
||||
this.columnDataType = dto.getColumnDataType().getCode();
|
||||
}
|
||||
|
||||
this.propertyType = dto.getPropertyType().getCode();
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ProductPropertyItemModelorBo
|
||||
extends BaseBo<ProductPropertyModelorDto.ProductPropertyItemModelorDto> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public ProductPropertyItemModelorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ProductPropertyItemModelorBo(ProductPropertyModelorDto.ProductPropertyItemModelorDto dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.property;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QueryProductPropertyBo extends BaseBo<ProductProperty> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
@Schema(description = "是否必填")
|
||||
private Boolean isRequired;
|
||||
|
||||
/**
|
||||
* 录入类型
|
||||
*/
|
||||
@Schema(description = "录入类型")
|
||||
private Integer columnType;
|
||||
|
||||
/**
|
||||
* 属性类别
|
||||
*/
|
||||
@Schema(description = "属性类别")
|
||||
private Integer propertyType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public QueryProductPropertyBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryProductPropertyBo(ProductProperty dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(ProductProperty dto) {
|
||||
|
||||
this.columnType = dto.getColumnType().getCode();
|
||||
this.propertyType = dto.getPropertyType().getCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.property.item;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyItem;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetProductPropertyItemBo extends BaseBo<ProductPropertyItem> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetProductPropertyItemBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetProductPropertyItemBo(ProductPropertyItem dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lframework.xingyun.basedata.bo.product.property.item;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyItem;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class QueryProductPropertyItemBo extends BaseBo<ProductPropertyItem> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public QueryProductPropertyItemBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryProductPropertyItemBo(ProductPropertyItem dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.lframework.xingyun.basedata.bo.shop;
|
||||
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.entity.SysDept;
|
||||
import com.lframework.starter.web.inner.service.system.SysDeptService;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店 GetBo
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Data
|
||||
public class GetShopBo extends BaseBo<Shop> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属部门ID
|
||||
*/
|
||||
@Schema(description = "所属部门ID")
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 所属部门名称
|
||||
*/
|
||||
@Schema(description = "所属部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetShopBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetShopBo(Shop dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Shop dto) {
|
||||
if (!StringUtil.isBlank(dto.getDeptId())) {
|
||||
SysDeptService sysDeptService = ApplicationUtil.getBean(SysDeptService.class);
|
||||
|
||||
SysDept dept = sysDeptService.findById(dto.getDeptId());
|
||||
|
||||
this.deptName = dept.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.lframework.xingyun.basedata.bo.shop;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.entity.SysDept;
|
||||
import com.lframework.starter.web.inner.service.system.SysDeptService;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店 QueryBo
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Data
|
||||
public class QueryShopBo extends BaseBo<Shop> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属部门名称
|
||||
*/
|
||||
@Schema(description = "所属部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
public QueryShopBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryShopBo(Shop dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Shop dto) {
|
||||
if (!StringUtil.isBlank(dto.getDeptId())) {
|
||||
SysDeptService sysDeptService = ApplicationUtil.getBean(SysDeptService.class);
|
||||
|
||||
SysDept dept = sysDeptService.findById(dto.getDeptId());
|
||||
|
||||
this.deptName = dept.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.lframework.xingyun.basedata.bo.shop;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店选择器 Bo
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Data
|
||||
public class ShopSelectorBo extends BaseBo<Shop> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public ShopSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public ShopSelectorBo(Shop dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.lframework.xingyun.basedata.bo.storecenter;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.StoreCenter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetStoreCenterBo extends BaseBo<StoreCenter> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系人手机号码
|
||||
*/
|
||||
@Schema(description = "联系人手机号码")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
@Schema(description = "地区ID")
|
||||
private List<String> city;
|
||||
|
||||
/**
|
||||
* 地区名称
|
||||
*/
|
||||
@Schema(description = "地区名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 仓库人数
|
||||
*/
|
||||
@Schema(description = "仓库人数")
|
||||
private Integer peopleNum;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetStoreCenterBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetStoreCenterBo(StoreCenter dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(StoreCenter dto) {
|
||||
|
||||
if (!StringUtil.isBlank(dto.getCityId())) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
List<DicCityDto> cityList = dicCityService.getChainById(dto.getCityId());
|
||||
this.city = cityList.stream().map(DicCityDto::getId).collect(Collectors.toList());
|
||||
|
||||
this.cityName = cityList.stream().map(DicCityDto::getName)
|
||||
.collect(Collectors.joining(StringPool.CITY_SPLIT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.storecenter;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.StoreCenter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryStoreCenterBo extends BaseBo<StoreCenter> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QueryStoreCenterBo() {
|
||||
|
||||
}
|
||||
|
||||
public QueryStoreCenterBo(StoreCenter dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(StoreCenter dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.bo.storecenter;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.StoreCenter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StoreCenterSelectorBo extends BaseBo<StoreCenter> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public StoreCenterSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public StoreCenterSelectorBo(StoreCenter dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.lframework.xingyun.basedata.bo.supplier;
|
||||
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.starter.web.core.utils.ApplicationUtil;
|
||||
import com.lframework.starter.web.inner.dto.dic.city.DicCityDto;
|
||||
import com.lframework.starter.web.inner.service.DicCityService;
|
||||
import com.lframework.xingyun.basedata.entity.Supplier;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class GetSupplierBo extends BaseBo<Supplier> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
@Schema(description = "简码")
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
@Schema(description = "电子邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
@Schema(description = "邮编")
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
@Schema(description = "传真")
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
@Schema(description = "地区ID")
|
||||
private List<String> city;
|
||||
|
||||
/**
|
||||
* 地区名称
|
||||
*/
|
||||
@Schema(description = "地区名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 送货周期(天)
|
||||
*/
|
||||
@Schema(description = "送货周期(天)")
|
||||
private Integer deliveryCycle;
|
||||
|
||||
/**
|
||||
* 经营方式
|
||||
*/
|
||||
@Schema(description = "经营方式")
|
||||
private Integer manageType;
|
||||
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
@Schema(description = "结算方式")
|
||||
private Integer settleType;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
@Schema(description = "纳税人识别号")
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
@Schema(description = "开户银行")
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
@Schema(description = "户名")
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
@Schema(description = "银行账号")
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
public GetSupplierBo() {
|
||||
|
||||
}
|
||||
|
||||
public GetSupplierBo(Supplier dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBo<Supplier> convert(Supplier dto) {
|
||||
|
||||
return super.convert(dto, GetSupplierBo::getSettleType, GetSupplierBo::getManageType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Supplier dto) {
|
||||
|
||||
if (dto.getManageType() != null) {
|
||||
this.manageType = dto.getManageType().getCode();
|
||||
}
|
||||
|
||||
if (dto.getSettleType() != null) {
|
||||
this.settleType = dto.getSettleType().getCode();
|
||||
}
|
||||
|
||||
if (!StringUtil.isBlank(dto.getCityId())) {
|
||||
DicCityService dicCityService = ApplicationUtil.getBean(DicCityService.class);
|
||||
List<DicCityDto> cityList = dicCityService.getChainById(dto.getCityId());
|
||||
this.city = cityList.stream().map(DicCityDto::getId).collect(Collectors.toList());
|
||||
|
||||
this.cityName = cityList.stream().map(DicCityDto::getName)
|
||||
.collect(Collectors.joining(StringPool.CITY_SPLIT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.lframework.xingyun.basedata.bo.supplier;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.lframework.starter.common.constants.StringPool;
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Supplier;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QuerySupplierBo extends BaseBo<Supplier> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Schema(description = "创建人ID")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
@Schema(description = "修改人ID")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public QuerySupplierBo() {
|
||||
|
||||
}
|
||||
|
||||
public QuerySupplierBo(Supplier dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInit(Supplier dto) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.bo.supplier;
|
||||
|
||||
import com.lframework.starter.web.core.bo.BaseBo;
|
||||
import com.lframework.xingyun.basedata.entity.Supplier;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SupplierSelectorBo extends BaseBo<Supplier> {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
public SupplierSelectorBo() {
|
||||
|
||||
}
|
||||
|
||||
public SupplierSelectorBo(Supplier dto) {
|
||||
|
||||
super(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.mq.core.utils.ExportTaskUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.address.GetAddressBo;
|
||||
import com.lframework.xingyun.basedata.bo.address.QueryAddressBo;
|
||||
import com.lframework.xingyun.basedata.entity.Address;
|
||||
import com.lframework.xingyun.basedata.excel.address.AddressExportTaskWorker;
|
||||
import com.lframework.xingyun.basedata.excel.address.AddressImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.address.AddressImportModel;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import com.lframework.xingyun.basedata.vo.address.CreateAddressVo;
|
||||
import com.lframework.xingyun.basedata.vo.address.QueryAddressVo;
|
||||
import com.lframework.xingyun.basedata.vo.address.UpdateAddressVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 地址库
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "地址库")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/address")
|
||||
public class AddressController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
/**
|
||||
* 地址列表
|
||||
*/
|
||||
@Operation(summary = "地址列表")
|
||||
@HasPermission({"base-data:address:query", "base-data:address:add", "base-data:address:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryAddressBo>> query(@Valid QueryAddressVo vo) {
|
||||
|
||||
PageResult<Address> pageResult = addressService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Address> datas = pageResult.getDatas();
|
||||
List<QueryAddressBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryAddressBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地址
|
||||
*/
|
||||
@Operation(summary = "查询地址")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:address:query", "base-data:address:add", "base-data:address:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetAddressBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
Address data = addressService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("地址不存在!");
|
||||
}
|
||||
|
||||
GetAddressBo result = new GetAddressBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增地址
|
||||
*/
|
||||
@Operation(summary = "新增地址")
|
||||
@HasPermission({"base-data:address:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateAddressVo vo) {
|
||||
|
||||
addressService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改地址
|
||||
*/
|
||||
@Operation(summary = "修改地址")
|
||||
@HasPermission({"base-data:address:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateAddressVo vo) {
|
||||
|
||||
addressService.update(vo);
|
||||
|
||||
addressService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@Operation(summary = "导出")
|
||||
@HasPermission({"base-data:address:export"})
|
||||
@PostMapping("/export")
|
||||
public InvokeResult<Void> export(@Valid QueryAddressVo vo) {
|
||||
|
||||
ExportTaskUtil.exportTask("地址信息", AddressExportTaskWorker.class, vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:address:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("地址导入模板", "地址导入模板", AddressImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:address:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
AddressImportListener listener = new AddressImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, AddressImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,578 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.common.utils.StringUtil;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.components.validation.IsEnum;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.address.AddressSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.customer.CustomerSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.logistics.company.LogisticsCompanySelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.member.MemberSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.paytype.PayTypeSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.brand.ProductBrandSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.brand.ProductCategorySelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.info.ProductSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.shop.ShopSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.storecenter.StoreCenterSelectorBo;
|
||||
import com.lframework.xingyun.basedata.bo.supplier.SupplierSelectorBo;
|
||||
import com.lframework.xingyun.basedata.entity.*;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.enums.AddressType;
|
||||
import com.lframework.xingyun.basedata.service.address.AddressService;
|
||||
import com.lframework.xingyun.basedata.service.customer.CustomerService;
|
||||
import com.lframework.xingyun.basedata.service.logistics.LogisticsCompanyService;
|
||||
import com.lframework.xingyun.basedata.service.member.MemberService;
|
||||
import com.lframework.xingyun.basedata.service.paytype.PayTypeService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductBrandService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductService;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
|
||||
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
|
||||
import com.lframework.xingyun.basedata.vo.address.AddressSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.customer.QueryCustomerSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.logistics.company.QueryLogisticsCompanySelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.member.QueryMemberSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.paytype.PayTypeSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.brand.QueryProductBrandSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.category.QueryProductCategorySelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.info.QueryProductSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.shop.ShopSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.storecenter.QueryStoreCenterSelectorVo;
|
||||
import com.lframework.xingyun.basedata.vo.supplier.QuerySupplierSelectorVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 基础数据数据选择器
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "基础数据数据选择器")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/selector")
|
||||
public class BaseDataSelectorController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductBrandService productBrandService;
|
||||
|
||||
@Autowired
|
||||
private ProductCategoryService productCategoryService;
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private StoreCenterService storeCenterService;
|
||||
|
||||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
@Autowired
|
||||
private AddressService addressService;
|
||||
|
||||
@Autowired
|
||||
private PayTypeService payTypeService;
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Autowired
|
||||
private LogisticsCompanyService logisticsCompanyService;
|
||||
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@Operation(summary = "商品")
|
||||
@GetMapping("/product")
|
||||
public InvokeResult<PageResult<ProductSelectorBo>> product(
|
||||
@Valid QueryProductSelectorVo vo) {
|
||||
|
||||
PageResult<Product> pageResult = productService.selector(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
List<Product> datas = pageResult.getDatas();
|
||||
List<ProductSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(ProductSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载商品
|
||||
*/
|
||||
@Operation(summary = "加载商品")
|
||||
@PostMapping("/product/load")
|
||||
public InvokeResult<List<ProductSelectorBo>> loadProduct(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Product> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> productService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<ProductSelectorBo> results = datas.stream().map(ProductSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@Operation(summary = "品牌")
|
||||
@GetMapping("/brand")
|
||||
public InvokeResult<PageResult<ProductBrandSelectorBo>> brand(
|
||||
@Valid QueryProductBrandSelectorVo vo) {
|
||||
|
||||
PageResult<ProductBrand> pageResult = productBrandService.selector(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
List<ProductBrand> datas = pageResult.getDatas();
|
||||
List<ProductBrandSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(ProductBrandSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载品牌
|
||||
*/
|
||||
@Operation(summary = "加载品牌")
|
||||
@PostMapping("/brand/load")
|
||||
public InvokeResult<List<ProductBrandSelectorBo>> loadBrand(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<ProductBrand> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> productBrandService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<ProductBrandSelectorBo> results = datas.stream().map(ProductBrandSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@Operation(summary = "分类")
|
||||
@GetMapping("/category")
|
||||
public InvokeResult<List<ProductCategorySelectorBo>> category(
|
||||
@Valid QueryProductCategorySelectorVo vo) {
|
||||
|
||||
List<ProductCategory> datas = productCategoryService.selector(vo);
|
||||
List<ProductCategorySelectorBo> results = CollectionUtil.emptyList();
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(ProductCategorySelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载分类
|
||||
*/
|
||||
@Operation(summary = "加载分类")
|
||||
@PostMapping("/category/load")
|
||||
public InvokeResult<List<ProductCategorySelectorBo>> loadCustomList(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<ProductCategory> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> productCategoryService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<ProductCategorySelectorBo> results = datas.stream()
|
||||
.map(ProductCategorySelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
@Operation(summary = "会员")
|
||||
@GetMapping("/member")
|
||||
public InvokeResult<PageResult<MemberSelectorBo>> selector(@Valid QueryMemberSelectorVo vo) {
|
||||
|
||||
PageResult<Member> pageResult = memberService.selector(getPageIndex(vo), getPageSize(vo), vo);
|
||||
List<Member> datas = pageResult.getDatas();
|
||||
List<MemberSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(MemberSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载会员
|
||||
*/
|
||||
@Operation(summary = "加载会员")
|
||||
@PostMapping("/member/load")
|
||||
public InvokeResult<List<MemberSelectorBo>> loadMember(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Member> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> memberService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<MemberSelectorBo> results = datas.stream().map(MemberSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓库
|
||||
*/
|
||||
@Operation(summary = "仓库")
|
||||
@GetMapping("/sc")
|
||||
public InvokeResult<PageResult<StoreCenterSelectorBo>> selector(
|
||||
@Valid QueryStoreCenterSelectorVo vo) {
|
||||
|
||||
PageResult<StoreCenter> pageResult = storeCenterService.selector(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
List<StoreCenter> datas = pageResult.getDatas();
|
||||
List<StoreCenterSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(StoreCenterSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载仓库
|
||||
*/
|
||||
@Operation(summary = "加载仓库")
|
||||
@PostMapping("/sc/load")
|
||||
public InvokeResult<List<StoreCenterSelectorBo>> loadSc(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<StoreCenter> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> storeCenterService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<StoreCenterSelectorBo> results = datas.stream().map(StoreCenterSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@Operation(summary = "供应商")
|
||||
@GetMapping("/supplier")
|
||||
public InvokeResult<PageResult<SupplierSelectorBo>> selector(@Valid QuerySupplierSelectorVo vo) {
|
||||
|
||||
PageResult<Supplier> pageResult = supplierService.selector(getPageIndex(vo), getPageSize(vo),
|
||||
vo);
|
||||
List<Supplier> datas = pageResult.getDatas();
|
||||
List<SupplierSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(SupplierSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载供应商
|
||||
*/
|
||||
@Operation(summary = "加载供应商")
|
||||
@PostMapping("/supplier/load")
|
||||
public InvokeResult<List<SupplierSelectorBo>> loadSupplier(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Supplier> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> supplierService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<SupplierSelectorBo> results = datas.stream().map(SupplierSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@Operation(summary = "客户")
|
||||
@GetMapping("/customer")
|
||||
public InvokeResult<PageResult<CustomerSelectorBo>> selector(@Valid QueryCustomerSelectorVo vo) {
|
||||
|
||||
PageResult<Customer> pageResult = customerService.selector(getPageIndex(vo), getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<Customer> datas = pageResult.getDatas();
|
||||
List<CustomerSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(CustomerSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载客户
|
||||
*/
|
||||
@Operation(summary = "加载客户")
|
||||
@PostMapping("/customer/load")
|
||||
public InvokeResult<List<CustomerSelectorBo>> loadCustomer(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Customer> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> customerService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<CustomerSelectorBo> results = datas.stream().map(CustomerSelectorBo::new).collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店
|
||||
*/
|
||||
@Operation(summary = "门店")
|
||||
@GetMapping("/shop")
|
||||
public InvokeResult<PageResult<ShopSelectorBo>> selector(@Valid ShopSelectorVo vo) {
|
||||
|
||||
LambdaQueryWrapper<Shop> queryWrapper = Wrappers.lambdaQuery(Shop.class)
|
||||
.orderByAsc(Shop::getCode);
|
||||
if (!StringUtil.isEmpty(vo.getCode())) {
|
||||
queryWrapper.eq(Shop::getCode, vo.getCode());
|
||||
}
|
||||
if (!StringUtil.isEmpty(vo.getName())) {
|
||||
queryWrapper.like(Shop::getName, vo.getName());
|
||||
}
|
||||
|
||||
Page<Shop> page = new Page<>(getPageIndex(vo), getPageSize(vo));
|
||||
page = shopService.page(page, queryWrapper);
|
||||
|
||||
PageResult<Shop> pageResult = PageResultUtil.convert(page);
|
||||
|
||||
List<Shop> datas = pageResult.getDatas();
|
||||
List<ShopSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(ShopSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载门店
|
||||
*/
|
||||
@Operation(summary = "加载门店")
|
||||
@PostMapping("/shop/load")
|
||||
public InvokeResult<List<ShopSelectorBo>> loadShop(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Shop> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> shopService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<ShopSelectorBo> results = datas.stream().map(ShopSelectorBo::new)
|
||||
.collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Operation(summary = "地址")
|
||||
@GetMapping("/address")
|
||||
public InvokeResult<PageResult<AddressSelectorBo>> selector(@Valid AddressSelectorVo vo) {
|
||||
|
||||
PageResult<Address> pageResult = addressService.selector(getPageIndex(vo), getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<Address> datas = pageResult.getDatas();
|
||||
List<AddressSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(AddressSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载地址
|
||||
*/
|
||||
@Operation(summary = "加载地址")
|
||||
@PostMapping("/address/load")
|
||||
public InvokeResult<List<AddressSelectorBo>> loadAddress(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<Address> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> addressService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<AddressSelectorBo> results = datas.stream().map(AddressSelectorBo::new)
|
||||
.collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认地址
|
||||
*/
|
||||
@Operation(summary = "默认地址")
|
||||
@GetMapping("/address/default")
|
||||
public InvokeResult<AddressSelectorBo> selector(
|
||||
@NotBlank(message = "实体ID不能为空!") String entityId,
|
||||
@NotNull(message = "实体类型不能为空!") @IsEnum(message = "实体类型格式错误!", enumClass = AddressEntityType.class) Integer entityType,
|
||||
@NotNull(message = "地址类型不能为空!") @IsEnum(message = "地址类型格式错误!", enumClass = AddressType.class) Integer addressType) {
|
||||
|
||||
Wrapper<Address> queryWrapper = Wrappers.lambdaQuery(Address.class)
|
||||
.eq(Address::getEntityId, entityId).eq(Address::getEntityType, entityType)
|
||||
.eq(Address::getAddressType, addressType)
|
||||
.eq(Address::getIsDefault, Boolean.TRUE);
|
||||
Address address = addressService.getOne(queryWrapper);
|
||||
|
||||
return InvokeResultBuilder.success(address == null ? null : new AddressSelectorBo(address));
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@Operation(summary = "支付方式")
|
||||
@GetMapping("/paytype")
|
||||
public InvokeResult<PageResult<PayTypeSelectorBo>> selector(@Valid PayTypeSelectorVo vo) {
|
||||
|
||||
PageResult<PayType> pageResult = payTypeService.selector(getPageIndex(vo), getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<PayType> datas = pageResult.getDatas();
|
||||
List<PayTypeSelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(PayTypeSelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载支付方式
|
||||
*/
|
||||
@Operation(summary = "加载支付方式")
|
||||
@PostMapping("/paytype/load")
|
||||
public InvokeResult<List<PayTypeSelectorBo>> loadPayType(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<PayType> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> payTypeService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<PayTypeSelectorBo> results = datas.stream().map(PayTypeSelectorBo::new)
|
||||
.collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流公司
|
||||
*/
|
||||
@Operation(summary = "物流公司")
|
||||
@GetMapping("/logistics/company")
|
||||
public InvokeResult<PageResult<LogisticsCompanySelectorBo>> selector(
|
||||
@Valid QueryLogisticsCompanySelectorVo vo) {
|
||||
|
||||
PageResult<LogisticsCompany> pageResult = logisticsCompanyService.selector(getPageIndex(vo),
|
||||
getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<LogisticsCompany> datas = pageResult.getDatas();
|
||||
List<LogisticsCompanySelectorBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(LogisticsCompanySelectorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载物流公司
|
||||
*/
|
||||
@Operation(summary = "加载物流公司")
|
||||
@PostMapping("/logistics/company/load")
|
||||
public InvokeResult<List<LogisticsCompanySelectorBo>> loadLogisticsCompany(
|
||||
@RequestBody(required = false) List<String> ids) {
|
||||
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<LogisticsCompany> datas = ids.stream().filter(StringUtil::isNotBlank)
|
||||
.map(t -> logisticsCompanyService.findById(t))
|
||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<LogisticsCompanySelectorBo> results = datas.stream().map(LogisticsCompanySelectorBo::new)
|
||||
.collect(
|
||||
Collectors.toList());
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.customer.GetCustomerBo;
|
||||
import com.lframework.xingyun.basedata.bo.customer.QueryCustomerBo;
|
||||
import com.lframework.xingyun.basedata.entity.Customer;
|
||||
import com.lframework.xingyun.basedata.excel.customer.CustomerImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.customer.CustomerImportModel;
|
||||
import com.lframework.xingyun.basedata.service.customer.CustomerService;
|
||||
import com.lframework.xingyun.basedata.vo.customer.CreateCustomerVo;
|
||||
import com.lframework.xingyun.basedata.vo.customer.QueryCustomerVo;
|
||||
import com.lframework.xingyun.basedata.vo.customer.UpdateCustomerVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 客户管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "客户管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/customer")
|
||||
public class CustomerController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
|
||||
/**
|
||||
* 客户列表
|
||||
*/
|
||||
@Operation(summary = "客户列表")
|
||||
@HasPermission({"base-data:customer:query", "base-data:customer:add",
|
||||
"base-data:customer:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryCustomerBo>> query(@Valid QueryCustomerVo vo) {
|
||||
|
||||
PageResult<Customer> pageResult = customerService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Customer> datas = pageResult.getDatas();
|
||||
List<QueryCustomerBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryCustomerBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户
|
||||
*/
|
||||
@Operation(summary = "查询客户")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:customer:query", "base-data:customer:add",
|
||||
"base-data:customer:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetCustomerBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
Customer data = customerService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("客户不存在!");
|
||||
}
|
||||
|
||||
GetCustomerBo result = new GetCustomerBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
*/
|
||||
@Operation(summary = "删除客户")
|
||||
@HasPermission({"base-data:customer:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "客户ID不能为空!") String id) {
|
||||
|
||||
customerService.deleteById(id);
|
||||
|
||||
customerService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*/
|
||||
@Operation(summary = "新增客户")
|
||||
@HasPermission({"base-data:customer:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateCustomerVo vo) {
|
||||
|
||||
customerService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*/
|
||||
@Operation(summary = "修改客户")
|
||||
@HasPermission({"base-data:customer:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateCustomerVo vo) {
|
||||
|
||||
customerService.update(vo);
|
||||
|
||||
customerService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:customer:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
System.out.println("当前版本:2026-04-18-v2");
|
||||
ExcelUtil.exportXlsx("客户导入模板", "客户导入模板", CustomerImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:customer:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
CustomerImportListener listener = new CustomerImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, CustomerImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.logistics.company.GetLogisticsCompanyBo;
|
||||
import com.lframework.xingyun.basedata.bo.logistics.company.QueryLogisticsCompanyBo;
|
||||
import com.lframework.xingyun.basedata.entity.LogisticsCompany;
|
||||
import com.lframework.xingyun.basedata.service.logistics.LogisticsCompanyService;
|
||||
import com.lframework.xingyun.basedata.vo.logistics.company.CreateLogisticsCompanyVo;
|
||||
import com.lframework.xingyun.basedata.vo.logistics.company.QueryLogisticsCompanyVo;
|
||||
import com.lframework.xingyun.basedata.vo.logistics.company.UpdateLogisticsCompanyVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物流公司管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "物流公司管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/logistics/company")
|
||||
public class LogisticsCompanyController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private LogisticsCompanyService logisticsCompanyService;
|
||||
|
||||
/**
|
||||
* 物流公司列表
|
||||
*/
|
||||
@Operation(summary = "物流公司列表")
|
||||
@HasPermission({"base-data:logistics-company:query", "base-data:logistics-company:add",
|
||||
"base-data:logistics-company:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryLogisticsCompanyBo>> query(
|
||||
@Valid QueryLogisticsCompanyVo vo) {
|
||||
|
||||
PageResult<LogisticsCompany> pageResult = logisticsCompanyService.query(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
|
||||
List<LogisticsCompany> datas = pageResult.getDatas();
|
||||
List<QueryLogisticsCompanyBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
|
||||
results = datas.stream().map(QueryLogisticsCompanyBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流公司
|
||||
*/
|
||||
@Operation(summary = "查询物流公司")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:logistics-company:query", "base-data:logistics-company:add",
|
||||
"base-data:logistics-company:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetLogisticsCompanyBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
LogisticsCompany data = logisticsCompanyService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("物流公司不存在!");
|
||||
}
|
||||
|
||||
GetLogisticsCompanyBo result = new GetLogisticsCompanyBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:logistics-company:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "物流公司ID不能为空!") String id) {
|
||||
|
||||
logisticsCompanyService.deleteById(id);
|
||||
|
||||
logisticsCompanyService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物流公司
|
||||
*/
|
||||
@Operation(summary = "新增物流公司")
|
||||
@HasPermission({"base-data:logistics-company:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateLogisticsCompanyVo vo) {
|
||||
|
||||
logisticsCompanyService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流公司
|
||||
*/
|
||||
@Operation(summary = "修改物流公司")
|
||||
@HasPermission({"base-data:logistics-company:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateLogisticsCompanyVo vo) {
|
||||
|
||||
logisticsCompanyService.update(vo);
|
||||
|
||||
logisticsCompanyService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
|
||||
import com.alibaba.excel.write.handler.WriteHandler;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.member.GetMemberBo;
|
||||
import com.lframework.xingyun.basedata.bo.member.QueryMemberBo;
|
||||
import com.lframework.xingyun.basedata.entity.Member;
|
||||
import com.lframework.xingyun.basedata.excel.member.MemberImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.member.MemberImportModel;
|
||||
import com.lframework.xingyun.basedata.service.member.MemberService;
|
||||
import com.lframework.xingyun.basedata.vo.member.CreateMemberVo;
|
||||
import com.lframework.xingyun.basedata.vo.member.QueryMemberVo;
|
||||
import com.lframework.xingyun.basedata.vo.member.UpdateMemberVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 会员管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "会员管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/member")
|
||||
public class MemberController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
/**
|
||||
* 会员列表
|
||||
*/
|
||||
@Operation(summary = "会员列表")
|
||||
@HasPermission({"base-data:member:query", "base-data:member:add", "base-data:member:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryMemberBo>> query(@Valid QueryMemberVo vo) {
|
||||
|
||||
PageResult<Member> pageResult = memberService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Member> datas = pageResult.getDatas();
|
||||
List<QueryMemberBo> results = CollectionUtil.isEmpty(datas)
|
||||
? CollectionUtil.emptyList()
|
||||
: datas.stream().map(QueryMemberBo::new).collect(Collectors.toList());
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*/
|
||||
@Operation(summary = "查询会员")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:member:query", "base-data:member:add", "base-data:member:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetMemberBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
Member data = memberService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("会员不存在!");
|
||||
}
|
||||
|
||||
GetMemberBo result = new GetMemberBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员
|
||||
*/
|
||||
@Operation(summary = "删除会员")
|
||||
@HasPermission({"base-data:member:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "会员ID不能为空!") String id) {
|
||||
|
||||
memberService.deleteById(id);
|
||||
|
||||
memberService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*/
|
||||
@Operation(summary = "新增会员")
|
||||
@HasPermission({"base-data:member:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateMemberVo vo) {
|
||||
|
||||
String id = memberService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*/
|
||||
@Operation(summary = "修改会员")
|
||||
@HasPermission({"base-data:member:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateMemberVo vo) {
|
||||
|
||||
memberService.update(vo);
|
||||
|
||||
memberService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:member:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("会员导入模板", "会员导入模板", MemberImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:member:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(
|
||||
@RequestParam("id") @NotBlank(message = "ID不能为空") String id,
|
||||
@RequestParam("file") @NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
// 1. 基础校验
|
||||
if (file.isEmpty()) {
|
||||
throw new DefaultClientException("上传文件不能为空");
|
||||
}
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName == null ||
|
||||
!(fileName.endsWith(".xls") || fileName.endsWith(".xlsx"))) {
|
||||
throw new DefaultClientException("只支持 Excel 文件(xls/xlsx)");
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 创建监听器
|
||||
MemberImportListener listener = new MemberImportListener();
|
||||
listener.setTaskId(id);
|
||||
|
||||
// 3. 执行读取(EasyExcel 3.x 标准写法)
|
||||
ExcelUtil.read(file, MemberImportModel.class, listener)
|
||||
.autoCloseStream(true)
|
||||
.sheet()
|
||||
.doRead();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new DefaultClientException("导入失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
private static <T> void write(OutputStream os,
|
||||
String sheetName,
|
||||
Class<T> clazz,
|
||||
List<T> data,
|
||||
List<WriteHandler> handlers,
|
||||
ExcelTypeEnum type) {
|
||||
|
||||
ExcelWriterBuilder builder = EasyExcel.write(os, clazz)
|
||||
.excelType(type);
|
||||
|
||||
if (handlers != null) {
|
||||
handlers.forEach(builder::registerWriteHandler);
|
||||
}
|
||||
|
||||
builder.sheet(sheetName).doWrite(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.paytype.GetPayTypeBo;
|
||||
import com.lframework.xingyun.basedata.bo.paytype.QueryPayTypeBo;
|
||||
import com.lframework.xingyun.basedata.entity.PayType;
|
||||
import com.lframework.xingyun.basedata.service.paytype.PayTypeService;
|
||||
import com.lframework.xingyun.basedata.vo.paytype.CreatePayTypeVo;
|
||||
import com.lframework.xingyun.basedata.vo.paytype.QueryPayTypeVo;
|
||||
import com.lframework.xingyun.basedata.vo.paytype.UpdatePayTypeVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 支付方式管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "支付方式管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/paytype")
|
||||
public class PayTypeController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private PayTypeService payTypeService;
|
||||
|
||||
/**
|
||||
* 支付方式列表
|
||||
*/
|
||||
@Operation(summary = "支付方式列表")
|
||||
@HasPermission({"base-data:pay-type:query", "base-data:pay-type:add",
|
||||
"base-data:pay-type:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryPayTypeBo>> query(@Valid QueryPayTypeVo vo) {
|
||||
|
||||
PageResult<PayType> pageResult = payTypeService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<PayType> datas = pageResult.getDatas();
|
||||
List<QueryPayTypeBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryPayTypeBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询支付方式
|
||||
*/
|
||||
@Operation(summary = "查询支付方式")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:pay-type:query", "base-data:pay-type:add",
|
||||
"base-data:pay-type:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetPayTypeBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
PayType data = payTypeService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("支付方式不存在!");
|
||||
}
|
||||
|
||||
GetPayTypeBo result = new GetPayTypeBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增支付方式
|
||||
*/
|
||||
@Operation(summary = "新增支付方式")
|
||||
@HasPermission({"base-data:pay-type:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreatePayTypeVo vo) {
|
||||
|
||||
payTypeService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付方式
|
||||
*/
|
||||
@Operation(summary = "修改支付方式")
|
||||
@HasPermission({"base-data:pay-type:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdatePayTypeVo vo) {
|
||||
|
||||
payTypeService.update(vo);
|
||||
|
||||
payTypeService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除支付方式
|
||||
*/
|
||||
@Operation(summary = "删除支付方式")
|
||||
@HasPermission({"base-data:pay-type:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotBlank(message = "支付方式ID不能为空!") String id) {
|
||||
|
||||
payTypeService.deleteById(id);
|
||||
|
||||
payTypeService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.print.GetPrintTemplateBo;
|
||||
import com.lframework.xingyun.basedata.bo.print.GetPrintTemplateCompSettingBo;
|
||||
import com.lframework.xingyun.basedata.bo.print.GetPrintTemplateSettingBo;
|
||||
import com.lframework.xingyun.basedata.bo.print.QueryPrintTemplateBo;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplate;
|
||||
import com.lframework.xingyun.basedata.entity.PrintTemplateComp;
|
||||
import com.lframework.xingyun.basedata.service.print.PrintTemplateCompService;
|
||||
import com.lframework.xingyun.basedata.service.print.PrintTemplateService;
|
||||
import com.lframework.xingyun.basedata.vo.print.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 打印模板
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "打印模板")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/print/template")
|
||||
public class PrintTemplateController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private PrintTemplateService printTemplateService;
|
||||
|
||||
@Autowired
|
||||
private PrintTemplateCompService printTemplateCompService;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@Operation(summary = "查询列表")
|
||||
@HasPermission({"base-data:print-template:query"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryPrintTemplateBo>> query(@Valid QueryPrintTemplateVo vo) {
|
||||
|
||||
PageResult<PrintTemplate> pageResult = printTemplateService.query(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
|
||||
List<PrintTemplate> datas = pageResult.getDatas();
|
||||
List<QueryPrintTemplateBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryPrintTemplateBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*/
|
||||
@Operation(summary = "根据ID查询")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:print-template:query"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetPrintTemplateBo> get(@NotNull(message = "ID不能为空!") Integer id) {
|
||||
|
||||
PrintTemplate data = printTemplateService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("打印模板不存在!");
|
||||
}
|
||||
|
||||
GetPrintTemplateBo result = new GetPrintTemplateBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@HasPermission({"base-data:print-template:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreatePrintTemplateVo vo) {
|
||||
|
||||
printTemplateService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Operation(summary = "修改")
|
||||
@HasPermission({"base-data:print-template:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdatePrintTemplateVo vo) {
|
||||
|
||||
printTemplateService.update(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设置
|
||||
*/
|
||||
@Operation(summary = "查询设置")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@GetMapping("/setting")
|
||||
public InvokeResult<GetPrintTemplateSettingBo> getSetting(
|
||||
@NotNull(message = "ID不能为空!") Integer id) {
|
||||
|
||||
PrintTemplate data = printTemplateService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("打印模板不存在!");
|
||||
}
|
||||
|
||||
GetPrintTemplateSettingBo result = new GetPrintTemplateSettingBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存设置
|
||||
*/
|
||||
@Operation(summary = "保存设置")
|
||||
@HasPermission({"base-data:print-template:modify"})
|
||||
@PutMapping("/setting")
|
||||
public InvokeResult<Void> updateSetting(@Valid UpdatePrintTemplateSettingVo vo) {
|
||||
|
||||
printTemplateService.updateSetting(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "设置示例数据")
|
||||
@HasPermission({"base-data:print-template:modify"})
|
||||
@PutMapping("/setting/demo")
|
||||
public InvokeResult<Void> updateDemoData(@Valid UpdatePrintTemplateDemoDataVo vo) {
|
||||
|
||||
printTemplateService.updateDemoData(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组件设置
|
||||
*/
|
||||
@Operation(summary = "查询组件设置")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:print-template:modify"})
|
||||
@GetMapping("/setting/comp")
|
||||
public InvokeResult<List<GetPrintTemplateCompSettingBo>> getCompSetting(
|
||||
@NotNull(message = "ID不能为空!") Integer id) {
|
||||
List<PrintTemplateComp> datas = new ArrayList<>();
|
||||
datas.addAll(printTemplateCompService.list(Wrappers.lambdaQuery(PrintTemplateComp.class)
|
||||
.eq(PrintTemplateComp::getTemplateId, 0)));
|
||||
datas.addAll(printTemplateCompService.list(Wrappers.lambdaQuery(PrintTemplateComp.class)
|
||||
.eq(PrintTemplateComp::getTemplateId, id)));
|
||||
|
||||
List<GetPrintTemplateCompSettingBo> results = datas.stream()
|
||||
.map(GetPrintTemplateCompSettingBo::new).collect(
|
||||
Collectors.toList());
|
||||
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.product.brand.GetProductBrandBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.brand.QueryProductBrandBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductBrand;
|
||||
import com.lframework.xingyun.basedata.excel.product.brand.ProductBrandImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.product.brand.ProductBrandImportModel;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductBrandService;
|
||||
import com.lframework.xingyun.basedata.vo.product.brand.CreateProductBrandVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.brand.QueryProductBrandVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.brand.UpdateProductBrandVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 品牌管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "品牌管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/product/brand")
|
||||
public class ProductBrandController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductBrandService productBrandService;
|
||||
|
||||
/**
|
||||
* 品牌列表
|
||||
*/
|
||||
@Operation(summary = "品牌列表")
|
||||
@HasPermission({"base-data:product:brand:query", "base-data:product:brand:add",
|
||||
"base-data:product:brand:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryProductBrandBo>> query(@Valid QueryProductBrandVo vo) {
|
||||
|
||||
PageResult<ProductBrand> pageResult = productBrandService.query(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
|
||||
List<ProductBrand> datas = pageResult.getDatas();
|
||||
List<QueryProductBrandBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
|
||||
results = datas.stream().map(QueryProductBrandBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询品牌
|
||||
*/
|
||||
@Operation(summary = "查询品牌")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:product:brand:query", "base-data:product:brand:add",
|
||||
"base-data:product:brand:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetProductBrandBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
ProductBrand data = productBrandService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("品牌不存在!");
|
||||
}
|
||||
|
||||
GetProductBrandBo result = new GetProductBrandBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:product:brand:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "品牌ID不能为空!") String id) {
|
||||
|
||||
productBrandService.deleteById(id);
|
||||
|
||||
productBrandService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增品牌
|
||||
*/
|
||||
@Operation(summary = "新增品牌")
|
||||
@HasPermission({"base-data:product:brand:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateProductBrandVo vo) {
|
||||
|
||||
productBrandService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改品牌
|
||||
*/
|
||||
@Operation(summary = "修改品牌")
|
||||
@HasPermission({"base-data:product:brand:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateProductBrandVo vo) {
|
||||
|
||||
productBrandService.update(vo);
|
||||
|
||||
productBrandService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:product:brand:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("品牌导入模板", "品牌导入模板", ProductBrandImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:product:brand:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
ProductBrandImportListener listener = new ProductBrandImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, ProductBrandImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.inner.service.RecursionMappingService;
|
||||
import com.lframework.xingyun.basedata.bo.product.category.GetProductCategoryBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.category.ProductCategoryTreeBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductCategory;
|
||||
import com.lframework.xingyun.basedata.excel.product.category.ProductCategoryImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.product.category.ProductCategoryImportModel;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
|
||||
import com.lframework.xingyun.basedata.vo.product.category.CreateProductCategoryVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.category.UpdateProductCategoryVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 分类管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "分类管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/product/category")
|
||||
public class ProductCategoryController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductCategoryService productCategoryService;
|
||||
|
||||
@Autowired
|
||||
private RecursionMappingService recursionMappingService;
|
||||
|
||||
/**
|
||||
* 分类列表
|
||||
*/
|
||||
@Operation(summary = "分类列表")
|
||||
@HasPermission({"base-data:product:category:query", "base-data:product:category:add",
|
||||
"base-data:product:category:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<List<ProductCategoryTreeBo>> query() {
|
||||
|
||||
List<ProductCategory> datas = productCategoryService.getAllProductCategories();
|
||||
if (CollectionUtil.isEmpty(datas)) {
|
||||
return InvokeResultBuilder.success(CollectionUtil.emptyList());
|
||||
}
|
||||
|
||||
List<ProductCategoryTreeBo> results = datas.stream().map(ProductCategoryTreeBo::new)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分类
|
||||
*/
|
||||
@Operation(summary = "查询分类")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:product:category:query", "base-data:product:category:add",
|
||||
"base-data:product:category:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetProductCategoryBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
ProductCategory data = productCategoryService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("分类不存在!");
|
||||
}
|
||||
|
||||
GetProductCategoryBo result = new GetProductCategoryBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:product:category:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "分类ID不能为空!") String id) {
|
||||
|
||||
productCategoryService.deleteById(id);
|
||||
productCategoryService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分类
|
||||
*/
|
||||
@Operation(summary = "新增分类")
|
||||
@HasPermission({"base-data:product:category:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateProductCategoryVo vo) {
|
||||
|
||||
productCategoryService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分类
|
||||
*/
|
||||
@Operation(summary = "修改分类")
|
||||
@HasPermission({"base-data:product:category:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateProductCategoryVo vo) {
|
||||
|
||||
productCategoryService.update(vo);
|
||||
|
||||
productCategoryService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:product:category:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("分类导入模板", "分类导入模板", ProductCategoryImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:product:category:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
ProductCategoryImportListener listener = new ProductCategoryImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, ProductCategoryImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.product.info.GetProductBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.info.QueryProductBo;
|
||||
import com.lframework.xingyun.basedata.entity.Product;
|
||||
import com.lframework.xingyun.basedata.excel.product.ProductImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.product.ProductImportModel;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductBundleService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyRelationService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductService;
|
||||
import com.lframework.xingyun.basedata.vo.product.info.CreateProductVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.info.QueryProductVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.info.UpdateProductVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 商品管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "商品管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/product")
|
||||
public class ProductController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Autowired
|
||||
private ProductBundleService productBundleService;
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyRelationService productPropertyRelationService;
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@Operation(summary = "商品列表")
|
||||
@HasPermission({"base-data:product:info:query", "base-data:product:info:add",
|
||||
"base-data:product:info:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryProductBo>> query(@Valid QueryProductVo vo) {
|
||||
|
||||
PageResult<Product> pageResult = productService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Product> datas = pageResult.getDatas();
|
||||
List<QueryProductBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
|
||||
results = datas.stream().map(QueryProductBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Operation(summary = "商品详情")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:product:info:query", "base-data:product:info:add",
|
||||
"base-data:product:info:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetProductBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
Product data = productService.findById(id);
|
||||
|
||||
GetProductBo result = new GetProductBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*/
|
||||
@Operation(summary = "新增商品")
|
||||
@HasPermission({"base-data:product:info:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid @RequestBody CreateProductVo vo) {
|
||||
|
||||
productService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
@Operation(summary = "修改商品")
|
||||
@HasPermission({"base-data:product:info:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid @RequestBody UpdateProductVo vo) {
|
||||
|
||||
productService.update(vo);
|
||||
|
||||
productService.cleanCacheByKey(vo.getId());
|
||||
|
||||
productPropertyRelationService.cleanCacheByKey(vo.getId());
|
||||
|
||||
productBundleService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:product:info:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "ID不能为空!") String id) {
|
||||
|
||||
productService.deleteById(id);
|
||||
|
||||
productService.cleanCacheByKey(id);
|
||||
|
||||
productPropertyRelationService.cleanCacheByKey(id);
|
||||
|
||||
productBundleService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:product:info:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("商品导入模板", "商品导入模板", ProductImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:product:info:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
ProductImportListener listener = new ProductImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, ProductImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.common.utils.ThreadUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.components.threads.DefaultRunnable;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.product.property.GetProductPropertyBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.property.ProductPropertyModelorBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.property.QueryProductPropertyBo;
|
||||
import com.lframework.xingyun.basedata.dto.product.property.ProductPropertyModelorDto;
|
||||
import com.lframework.xingyun.basedata.entity.ProductProperty;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyRelation;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyRelationService;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyService;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.CreateProductPropertyVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.QueryProductPropertyVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.UpdateProductPropertyVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 属性管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "属性管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/product/property")
|
||||
public class ProductPropertyController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyService productPropertyService;
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyRelationService productPropertyRelationService;
|
||||
|
||||
/**
|
||||
* 属性列表
|
||||
*/
|
||||
@Operation(summary = "属性列表")
|
||||
@HasPermission({"base-data:product:property:query", "base-data:product:property:add",
|
||||
"base-data:product:property:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryProductPropertyBo>> query(@Valid QueryProductPropertyVo vo) {
|
||||
|
||||
PageResult<ProductProperty> pageResult = productPropertyService.query(getPageIndex(vo),
|
||||
getPageSize(vo), vo);
|
||||
|
||||
List<ProductProperty> datas = pageResult.getDatas();
|
||||
List<QueryProductPropertyBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
|
||||
results = datas.stream().map(QueryProductPropertyBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询属性
|
||||
*/
|
||||
@Operation(summary = "查询属性")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:product:property:query", "base-data:product:property:add",
|
||||
"base-data:product:property:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetProductPropertyBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
ProductProperty data = productPropertyService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("属性不存在!");
|
||||
}
|
||||
|
||||
GetProductPropertyBo result = new GetProductPropertyBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:product:property:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "属性ID不能为空!") String id) {
|
||||
|
||||
productPropertyService.deleteById(id);
|
||||
|
||||
productPropertyService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增属性
|
||||
*/
|
||||
@Operation(summary = "新增属性")
|
||||
@HasPermission({"base-data:product:property:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid @RequestBody CreateProductPropertyVo vo) {
|
||||
|
||||
productPropertyService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改属性
|
||||
*/
|
||||
@Operation(summary = "修改属性")
|
||||
@HasPermission({"base-data:product:property:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid @RequestBody UpdateProductPropertyVo vo) {
|
||||
|
||||
productPropertyService.update(vo);
|
||||
|
||||
productPropertyService.cleanCacheByKey(vo.getId());
|
||||
|
||||
ThreadUtil.execAsync(new DefaultRunnable((() -> {
|
||||
Wrapper<ProductPropertyRelation> relationWrapper = Wrappers.lambdaQuery(
|
||||
ProductPropertyRelation.class).select(ProductPropertyRelation::getProductId)
|
||||
.eq(ProductPropertyRelation::getPropertyId, vo.getId())
|
||||
.groupBy(ProductPropertyRelation::getProductId);
|
||||
List<ProductPropertyRelation> relations = productPropertyRelationService.list(
|
||||
relationWrapper);
|
||||
|
||||
productPropertyRelationService.cleanCacheByKeys(
|
||||
relations.stream().map(ProductPropertyRelation::getProductId).collect(
|
||||
Collectors.toList()));
|
||||
})));
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性模型
|
||||
*/
|
||||
@Operation(summary = "属性模型")
|
||||
@Parameter(description = "分类ID", name = "categoryId", required = true)
|
||||
@GetMapping("/modelor/category")
|
||||
public InvokeResult<List<ProductPropertyModelorBo>> getModelorByCategory(
|
||||
@NotBlank(message = "分类ID不能为空!") String categoryId) {
|
||||
|
||||
List<ProductPropertyModelorDto> datas = productPropertyService.getModelorByCategoryId(
|
||||
categoryId);
|
||||
|
||||
List<ProductPropertyModelorBo> results = CollectionUtil.emptyList();
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(ProductPropertyModelorBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.product.property.item.GetProductPropertyItemBo;
|
||||
import com.lframework.xingyun.basedata.bo.product.property.item.QueryProductPropertyItemBo;
|
||||
import com.lframework.xingyun.basedata.entity.ProductPropertyItem;
|
||||
import com.lframework.xingyun.basedata.service.product.ProductPropertyItemService;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.item.CreateProductPropertyItemVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.item.QueryProductPropertyItemVo;
|
||||
import com.lframework.xingyun.basedata.vo.product.property.item.UpdateProductPropertyItemVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 属性值管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "属性值管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/product/property/item")
|
||||
public class ProductPropertyItemController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductPropertyItemService productPropertyItemService;
|
||||
|
||||
/**
|
||||
* 属性值列表
|
||||
*/
|
||||
@Operation(summary = "属性值列表")
|
||||
@HasPermission({"base-data:product:property-item:query", "base-data:product:property-item:add",
|
||||
"base-data:product:property-item:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryProductPropertyItemBo>> query(
|
||||
@Valid QueryProductPropertyItemVo vo) {
|
||||
|
||||
PageResult<ProductPropertyItem> pageResult = productPropertyItemService.query(getPageIndex(vo),
|
||||
getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<ProductPropertyItem> datas = pageResult.getDatas();
|
||||
List<QueryProductPropertyItemBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryProductPropertyItemBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询属性值
|
||||
*/
|
||||
@Operation(summary = "查询属性值")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:product:property-item:query", "base-data:product:property-item:add",
|
||||
"base-data:product:property-item:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetProductPropertyItemBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
ProductPropertyItem data = productPropertyItemService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("属性值不存在!");
|
||||
}
|
||||
|
||||
GetProductPropertyItemBo result = new GetProductPropertyItemBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增属性值
|
||||
*/
|
||||
@Operation(summary = "新增属性值")
|
||||
@HasPermission({"base-data:product:property-item:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateProductPropertyItemVo vo) {
|
||||
|
||||
productPropertyItemService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改属性值
|
||||
*/
|
||||
@Operation(summary = "修改属性值")
|
||||
@HasPermission({"base-data:product:property-item:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateProductPropertyItemVo vo) {
|
||||
|
||||
productPropertyItemService.update(vo);
|
||||
|
||||
productPropertyItemService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*/
|
||||
@Operation(summary = "根据ID删除")
|
||||
@HasPermission({"base-data:product:property-item:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "ID不能为空!") String id) {
|
||||
|
||||
productPropertyItemService.deleteById(id);
|
||||
|
||||
productPropertyItemService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.shop.GetShopBo;
|
||||
import com.lframework.xingyun.basedata.bo.shop.QueryShopBo;
|
||||
import com.lframework.xingyun.basedata.entity.Shop;
|
||||
import com.lframework.xingyun.basedata.excel.shop.ShopImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.shop.ShopImportModel;
|
||||
import com.lframework.xingyun.basedata.service.shop.ShopService;
|
||||
import com.lframework.xingyun.basedata.vo.shop.CreateShopVo;
|
||||
import com.lframework.xingyun.basedata.vo.shop.QueryShopVo;
|
||||
import com.lframework.xingyun.basedata.vo.shop.UpdateShopVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 门店 Controller
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "门店")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/shop")
|
||||
public class ShopController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@Operation(summary = "查询列表")
|
||||
@HasPermission({"base-data:shop:query"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryShopBo>> query(@Valid QueryShopVo vo) {
|
||||
|
||||
PageResult<Shop> pageResult = shopService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Shop> datas = pageResult.getDatas();
|
||||
List<QueryShopBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryShopBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*/
|
||||
@Operation(summary = "根据ID查询")
|
||||
@Parameter(description = "id", name = "id", required = true)
|
||||
@HasPermission({"base-data:shop:query"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetShopBo> get(@NotBlank(message = "id不能为空!") String id) {
|
||||
|
||||
Shop data = shopService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("门店不存在!");
|
||||
}
|
||||
|
||||
GetShopBo result = new GetShopBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@HasPermission({"base-data:shop:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateShopVo vo) {
|
||||
|
||||
shopService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Operation(summary = "删除")
|
||||
@HasPermission({"base-data:shop:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotBlank(message = "门店ID不能为空!") String id) {
|
||||
|
||||
shopService.deleteById(id);
|
||||
|
||||
shopService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Operation(summary = "修改")
|
||||
@HasPermission({"base-data:shop:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateShopVo vo) {
|
||||
|
||||
shopService.update(vo);
|
||||
|
||||
shopService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:shop:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("门店导入模板", "门店导入模板", ShopImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:shop:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
ShopImportListener listener = new ShopImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, ShopImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.storecenter.GetStoreCenterBo;
|
||||
import com.lframework.xingyun.basedata.bo.storecenter.QueryStoreCenterBo;
|
||||
import com.lframework.xingyun.basedata.entity.StoreCenter;
|
||||
import com.lframework.xingyun.basedata.excel.storecenter.StoreCenterImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.storecenter.StoreCenterImportModel;
|
||||
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
|
||||
import com.lframework.xingyun.basedata.vo.storecenter.CreateStoreCenterVo;
|
||||
import com.lframework.xingyun.basedata.vo.storecenter.QueryStoreCenterVo;
|
||||
import com.lframework.xingyun.basedata.vo.storecenter.UpdateStoreCenterVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 仓库管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "仓库管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/storecenter")
|
||||
public class StoreCenterController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private StoreCenterService storeCenterService;
|
||||
|
||||
/**
|
||||
* 仓库列表
|
||||
*/
|
||||
@Operation(summary = "仓库列表")
|
||||
@HasPermission({"base-data:store-center:query", "base-data:store-center:add",
|
||||
"base-data:store-center:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QueryStoreCenterBo>> query(@Valid QueryStoreCenterVo vo) {
|
||||
|
||||
PageResult<StoreCenter> pageResult = storeCenterService.query(getPageIndex(vo), getPageSize(vo),
|
||||
vo);
|
||||
|
||||
List<StoreCenter> datas = pageResult.getDatas();
|
||||
List<QueryStoreCenterBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryStoreCenterBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库
|
||||
*/
|
||||
@Operation(summary = "查询仓库")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:store-center:query", "base-data:store-center:add",
|
||||
"base-data:store-center:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetStoreCenterBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
StoreCenter data = storeCenterService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("仓库不存在!");
|
||||
}
|
||||
|
||||
GetStoreCenterBo result = new GetStoreCenterBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
@Operation(summary = "删除仓库")
|
||||
@HasPermission({"base-data:store-center:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "仓库ID不能为空!") String id) {
|
||||
|
||||
storeCenterService.deleteById(id);
|
||||
|
||||
storeCenterService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库
|
||||
*/
|
||||
@Operation(summary = "新增仓库")
|
||||
@HasPermission({"base-data:store-center:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateStoreCenterVo vo) {
|
||||
|
||||
storeCenterService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
@Operation(summary = "修改仓库")
|
||||
@HasPermission({"base-data:store-center:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateStoreCenterVo vo) {
|
||||
|
||||
storeCenterService.update(vo);
|
||||
|
||||
storeCenterService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:store-center:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("仓库导入模板", "仓库导入模板", StoreCenterImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:store-center:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
StoreCenterImportListener listener = new StoreCenterImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, StoreCenterImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.lframework.xingyun.basedata.controller;
|
||||
|
||||
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
|
||||
import com.lframework.starter.common.utils.CollectionUtil;
|
||||
import com.lframework.starter.web.core.annotations.security.HasPermission;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
||||
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
|
||||
import com.lframework.starter.web.core.components.resp.PageResult;
|
||||
import com.lframework.starter.web.core.controller.DefaultBaseController;
|
||||
import com.lframework.starter.web.core.utils.ExcelUtil;
|
||||
import com.lframework.starter.web.core.utils.PageResultUtil;
|
||||
import com.lframework.xingyun.basedata.bo.supplier.GetSupplierBo;
|
||||
import com.lframework.xingyun.basedata.bo.supplier.QuerySupplierBo;
|
||||
import com.lframework.xingyun.basedata.entity.Supplier;
|
||||
import com.lframework.xingyun.basedata.excel.supplier.SupplierImportListener;
|
||||
import com.lframework.xingyun.basedata.excel.supplier.SupplierImportModel;
|
||||
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
|
||||
import com.lframework.xingyun.basedata.vo.supplier.CreateSupplierVo;
|
||||
import com.lframework.xingyun.basedata.vo.supplier.QuerySupplierVo;
|
||||
import com.lframework.xingyun.basedata.vo.supplier.UpdateSupplierVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 供应商管理
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Tag(name = "供应商管理")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/basedata/supplier")
|
||||
public class SupplierController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
/**
|
||||
* 供应商列表
|
||||
*/
|
||||
@Operation(summary = "供应商列表")
|
||||
@HasPermission({"base-data:supplier:query", "base-data:supplier:add",
|
||||
"base-data:supplier:modify"})
|
||||
@GetMapping("/query")
|
||||
public InvokeResult<PageResult<QuerySupplierBo>> query(@Valid QuerySupplierVo vo) {
|
||||
|
||||
PageResult<Supplier> pageResult = supplierService.query(getPageIndex(vo), getPageSize(vo), vo);
|
||||
|
||||
List<Supplier> datas = pageResult.getDatas();
|
||||
List<QuerySupplierBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
|
||||
results = datas.stream().map(QuerySupplierBo::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商
|
||||
*/
|
||||
@Operation(summary = "查询供应商")
|
||||
@Parameter(description = "ID", name = "id", required = true)
|
||||
@HasPermission({"base-data:supplier:query", "base-data:supplier:add",
|
||||
"base-data:supplier:modify"})
|
||||
@GetMapping
|
||||
public InvokeResult<GetSupplierBo> get(@NotBlank(message = "ID不能为空!") String id) {
|
||||
|
||||
Supplier data = supplierService.findById(id);
|
||||
if (data == null) {
|
||||
throw new DefaultClientException("供应商不存在!");
|
||||
}
|
||||
|
||||
GetSupplierBo result = new GetSupplierBo(data);
|
||||
|
||||
return InvokeResultBuilder.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商
|
||||
*/
|
||||
@Operation(summary = "删除供应商")
|
||||
@HasPermission({"base-data:supplier:delete"})
|
||||
@DeleteMapping
|
||||
public InvokeResult<Void> deleteById(
|
||||
@Parameter(description = "ID", required = true) @NotEmpty(message = "供应商ID不能为空!") String id) {
|
||||
|
||||
supplierService.deleteById(id);
|
||||
|
||||
supplierService.cleanCacheByKey(id);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商
|
||||
*/
|
||||
@Operation(summary = "新增供应商")
|
||||
@HasPermission({"base-data:supplier:add"})
|
||||
@PostMapping
|
||||
public InvokeResult<Void> create(@Valid CreateSupplierVo vo) {
|
||||
|
||||
supplierService.create(vo);
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商
|
||||
*/
|
||||
@Operation(summary = "修改供应商")
|
||||
@HasPermission({"base-data:supplier:modify"})
|
||||
@PutMapping
|
||||
public InvokeResult<Void> update(@Valid UpdateSupplierVo vo) {
|
||||
|
||||
supplierService.update(vo);
|
||||
|
||||
supplierService.cleanCacheByKey(vo.getId());
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@HasPermission({"base-data:supplier:import"})
|
||||
@GetMapping("/import/template")
|
||||
public void downloadImportTemplate() {
|
||||
ExcelUtil.exportXlsx("供应商导入模板", "供应商导入模板", SupplierImportModel.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入")
|
||||
@HasPermission({"base-data:supplier:import"})
|
||||
@PostMapping("/import")
|
||||
public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
|
||||
@NotNull(message = "请上传文件") MultipartFile file) {
|
||||
|
||||
SupplierImportListener listener = new SupplierImportListener();
|
||||
listener.setTaskId(id);
|
||||
ExcelUtil.read(file, SupplierImportModel.class, listener).sheet().doRead();
|
||||
|
||||
return InvokeResultBuilder.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.lframework.xingyun.basedata.dto.product;
|
||||
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProductPropertyRelationDto implements BaseDto, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String CACHE_NAME = "ProductPropertyRelationDto";
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 属性ID
|
||||
*/
|
||||
private String propertyId;
|
||||
|
||||
/**
|
||||
* 属性值ID
|
||||
*/
|
||||
private String propertyItemId;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*/
|
||||
private ColumnType propertyColumnType;
|
||||
|
||||
/**
|
||||
* 属性名称
|
||||
*/
|
||||
private String propertyName;
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
private String propertyText;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.lframework.xingyun.basedata.dto.product.property;
|
||||
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnDataType;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnType;
|
||||
import com.lframework.xingyun.basedata.enums.PropertyType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductPropertyModelorDto implements BaseDto, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
private Boolean isRequired;
|
||||
|
||||
/**
|
||||
* 可选项,当columnType != CUSTOM时 不为空
|
||||
*/
|
||||
private List<ProductPropertyItemModelorDto> items;
|
||||
|
||||
/**
|
||||
* 显示值 当columnType != CUSTOM时,此值为items项ID 当columnType == CUSTOM时,此值为录入值
|
||||
*/
|
||||
private String text;
|
||||
|
||||
/**
|
||||
* 录入类型
|
||||
*/
|
||||
private ColumnType columnType;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private ColumnDataType columnDataType;
|
||||
|
||||
/**
|
||||
* 属性类别
|
||||
*/
|
||||
private PropertyType propertyType;
|
||||
|
||||
@Data
|
||||
public static class ProductPropertyItemModelorDto implements BaseDto, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.xingyun.basedata.enums.AddressEntityType;
|
||||
import com.lframework.xingyun.basedata.enums.AddressType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2023-03-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_address")
|
||||
public class Address extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "Address";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 实体ID
|
||||
*/
|
||||
private String entityId;
|
||||
|
||||
/**
|
||||
* 实体类型
|
||||
*/
|
||||
private AddressEntityType entityType;
|
||||
|
||||
/**
|
||||
* 地址类型
|
||||
*/
|
||||
private AddressType addressType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String provinceId;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String districtId;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否默认地址
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.xingyun.basedata.enums.SettleType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_customer")
|
||||
public class Customer extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "CustomerDto";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
private SettleType settleType;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2023-03-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_logistics_company")
|
||||
public class LogisticsCompany extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "LogisticsCompany";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.starter.web.inner.enums.system.Gender;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_member")
|
||||
public class Member extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "Member";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Gender gender;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private LocalDate birthday;
|
||||
|
||||
/**
|
||||
* 入会日期
|
||||
*/
|
||||
private LocalDate joinDay;
|
||||
|
||||
/**
|
||||
* 所属门店
|
||||
*/
|
||||
private String shopId;
|
||||
|
||||
/**
|
||||
* 所属导购
|
||||
*/
|
||||
private String guiderId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_pay_type")
|
||||
public class PayType extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "PayType";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否记录内容
|
||||
*/
|
||||
private Boolean recText;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2025-01-28
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_print_template")
|
||||
public class PrintTemplate extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "PrintTemplate";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* JSON配置
|
||||
*/
|
||||
private String templateJson;
|
||||
|
||||
/**
|
||||
* 示例数据
|
||||
*/
|
||||
private String demoData;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2025-01-28
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_print_template_comp")
|
||||
public class PrintTemplateComp extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "PrintTemplateComp";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private Integer templateId;
|
||||
|
||||
/**
|
||||
* 组件配置
|
||||
*/
|
||||
private String compJson;
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.xingyun.basedata.enums.ProductType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product")
|
||||
public class Product extends BaseEntity implements BaseDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String CACHE_NAME = "Product";
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String externalCode;
|
||||
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private ProductType productType;
|
||||
|
||||
/**
|
||||
* 进项税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 销项税率(%)
|
||||
*/
|
||||
private BigDecimal saleTaxRate;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 重量(kg)
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 体积(cm3)
|
||||
*/
|
||||
private BigDecimal volume;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-06
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_brand")
|
||||
public class ProductBrand extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductBrand";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组合商品
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_bundle")
|
||||
public class ProductBundle extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductBundle";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 主商品ID
|
||||
*/
|
||||
private String mainProductId;
|
||||
|
||||
/**
|
||||
* 单品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 包含数量
|
||||
*/
|
||||
private Integer bundleNum;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_category")
|
||||
public class ProductCategory extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductCategory";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_category_property")
|
||||
public class ProductCategoryProperty extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductCategoryPropertyDto";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商品属性ID
|
||||
*/
|
||||
private String propertyId;
|
||||
|
||||
/**
|
||||
* 商品分类ID
|
||||
*/
|
||||
private String categoryId;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnDataType;
|
||||
import com.lframework.xingyun.basedata.enums.ColumnType;
|
||||
import com.lframework.xingyun.basedata.enums.PropertyType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_property")
|
||||
public class ProductProperty extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductProperty";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
private Boolean isRequired;
|
||||
|
||||
/**
|
||||
* 录入类型
|
||||
*/
|
||||
private ColumnType columnType;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private ColumnDataType columnDataType;
|
||||
|
||||
/**
|
||||
* 属性类别
|
||||
*/
|
||||
private PropertyType propertyType;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-08-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_property_item")
|
||||
public class ProductPropertyItem extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "ProductPropertyItem";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 属性ID
|
||||
*/
|
||||
private String propertyId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-08-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_property_relation")
|
||||
public class ProductPropertyRelation extends BaseEntity implements BaseDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 商品属性ID
|
||||
*/
|
||||
private String propertyId;
|
||||
|
||||
/**
|
||||
* 属性值ID
|
||||
*/
|
||||
private String propertyItemId;
|
||||
|
||||
/**
|
||||
* 商品属性值
|
||||
*/
|
||||
private String propertyText;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_purchase")
|
||||
public class ProductPurchase extends BaseEntity implements BaseDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_retail")
|
||||
public class ProductRetail extends BaseEntity implements BaseDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product_sale")
|
||||
public class ProductSale extends BaseEntity implements BaseDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_shop")
|
||||
public class Shop extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "Shop";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_store_center")
|
||||
public class StoreCenter extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "StoreCenter";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系人手机号码
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 仓库人数
|
||||
*/
|
||||
private Integer peopleNum;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.lframework.xingyun.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lframework.starter.web.core.dto.BaseDto;
|
||||
import com.lframework.starter.web.core.entity.BaseEntity;
|
||||
import com.lframework.xingyun.basedata.enums.ManageType;
|
||||
import com.lframework.xingyun.basedata.enums.SettleType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_supplier")
|
||||
public class Supplier extends BaseEntity implements BaseDto {
|
||||
|
||||
public static final String CACHE_NAME = "Supplier";
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 送货周期(天)
|
||||
*/
|
||||
private Integer deliveryCycle;
|
||||
|
||||
/**
|
||||
* 经营方式
|
||||
*/
|
||||
private ManageType manageType;
|
||||
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
private SettleType settleType;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lframework.xingyun.basedata.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.lframework.starter.web.core.enums.BaseEnum;
|
||||
|
||||
public enum AddressEntityType implements BaseEnum<Integer> {
|
||||
SC(1, "仓库"), CUSTOMER(2, "客户"), SUPPLIER(3, "供应商"), MEMBER(4, "会员"), SHOP(5, "门店");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
AddressEntityType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lframework.xingyun.basedata.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.lframework.starter.web.core.enums.BaseEnum;
|
||||
|
||||
public enum AddressType implements BaseEnum<Integer> {
|
||||
DELIVERY(1, "发货地址"), RECEIVE(2, "收货地址");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
AddressType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lframework.xingyun.basedata.enums;
|
||||
|
||||
import com.lframework.starter.web.core.components.oplog.OpLogType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class BaseDataOpLogType implements OpLogType {
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.lframework.xingyun.basedata.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.lframework.starter.web.core.enums.BaseEnum;
|
||||
|
||||
public enum ColumnDataType implements BaseEnum<Integer> {
|
||||
INT(1, "整数型"), FLOAT(2, "浮点型"), STRING(3, "字符型"), DATE(4, "日期型"), TIME(5, "时间型"), DATE_TIME(6,
|
||||
"日期时间型");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
ColumnDataType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user