fix: 0.1.1 修正问题如下:
1. 配置文件添加了生产环境配置文件,根据环境分别配置数据库配置,Swagger配置以及CORS配置。 2. 做了自动填充基础 Entity 配置,且分别对应了新老项目的基础 Entity,自动填充基本的创建信息和更新信息。 3. 修正了一下入库的状态问题和展示问题。 4. 修正了线上数据库表名的大小写和项目不符合的问题。 5. 优化了物料总表的 DTO。
This commit is contained in:
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.niuan"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
version = "0.1.1"
|
||||
description = "erp"
|
||||
|
||||
java {
|
||||
@@ -33,7 +33,7 @@ dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-websocket")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springframework.boot:spring-boot-starter-aop")
|
||||
compileOnly("com.baomidou:mybatis-plus-spring-boot3-starter:3.5.16")
|
||||
implementation("com.baomidou:mybatis-plus-spring-boot3-starter:3.5.16")
|
||||
implementation("com.baomidou:mybatis-plus-jsqlparser:3.5.16")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
runtimeOnly("com.mysql:mysql-connector-j")
|
||||
|
||||
44
src/main/java/com/niuan/erp/common/base/BaseEntity.java
Normal file
44
src/main/java/com/niuan/erp/common/base/BaseEntity.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.niuan.erp.common.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 基础 Entity
|
||||
* <br/>
|
||||
* 需要注意如果是老数据库迁移过来的表结构使用的是大写驼峰法命名,使用的基础类为 {@link com.niuan.erp.common.base.OldBaseEntity}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class BaseEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "status", fill = FieldFill.INSERT)
|
||||
private Integer status;
|
||||
|
||||
@TableField(value = "create_user_id", fill = FieldFill.INSERT)
|
||||
private Long createUserId;
|
||||
|
||||
@TableField(value = "create_user_name", fill = FieldFill.INSERT)
|
||||
private String createUserName;
|
||||
|
||||
@TableField(value = "create_date", fill = FieldFill.INSERT)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField(value = "update_user_id", fill = FieldFill.UPDATE)
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField(value = "update_user_name", fill = FieldFill.UPDATE)
|
||||
private String updateUserName;
|
||||
|
||||
@TableField(value = "update_date", fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateDate;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.niuan.erp.common.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 旧的包含 customerId 的基础 Entity
|
||||
* <br/>
|
||||
* 旧的数据库使用的是 `大写驼峰法` 命名的数据表字段
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class OldBaseCustomerEntity extends OldBaseEntity {
|
||||
|
||||
@TableField(value = "CustomerId", fill = FieldFill.INSERT)
|
||||
private Integer customerId;
|
||||
}
|
||||
46
src/main/java/com/niuan/erp/common/base/OldBaseEntity.java
Normal file
46
src/main/java/com/niuan/erp/common/base/OldBaseEntity.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.niuan.erp.common.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 旧数据结构的基础 Entity
|
||||
* <br/>
|
||||
* 旧的数据库使用的是 `大写驼峰法` 命名的数据表字段
|
||||
* <br/>
|
||||
* 新建的数据库表 Entity 使用 {@link com.niuan.erp.common.base.BaseEntity}
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class OldBaseEntity {
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "Status", fill = FieldFill.INSERT)
|
||||
private Integer status;
|
||||
|
||||
@TableField(value = "CreateUserId", fill = FieldFill.INSERT)
|
||||
private Long createUserId;
|
||||
|
||||
@TableField(value = "CreateUserName", fill = FieldFill.INSERT)
|
||||
private String createUserName;
|
||||
|
||||
@TableField(value = "CreateDate", fill = FieldFill.INSERT)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField(value = "UpdateUserId", fill = FieldFill.UPDATE)
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField(value = "UpdateUserName", fill = FieldFill.UPDATE)
|
||||
private String updateUserName;
|
||||
|
||||
@TableField(value = "UpdateDate", fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateDate;
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import com.niuan.erp.common.security.JwtAuthenticationFilter;
|
||||
import com.niuan.erp.common.security.TokenService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
@@ -17,6 +19,7 @@ import org.springframework.security.config.annotation.authentication.configurati
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.core.session.SessionRegistry;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@@ -26,6 +29,7 @@ import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -33,6 +37,7 @@ import java.util.List;
|
||||
* - Web端(后台管理):使用传统Session方式(基于Cookie)
|
||||
* - 小程序端:使用JWT方式(基于Token)
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableMethodSecurity
|
||||
@@ -49,11 +54,14 @@ public class SecurityConfig {
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
@Value("${cors.allowed-origins:http://localhost:*,http://127.0.0.1:*}")
|
||||
private String allowedOriginsStr;
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http, SessionRegistry sessionRegistry) throws Exception {
|
||||
http
|
||||
// 禁用 CSRF(JWT需要禁用,Session方式通过其他方式防护)
|
||||
.csrf(csrf -> csrf.disable())
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
|
||||
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
|
||||
|
||||
@@ -138,8 +146,10 @@ public class SecurityConfig {
|
||||
public CorsConfigurationSource corsConfigurationSource() {
|
||||
CorsConfiguration configuration = new CorsConfiguration();
|
||||
|
||||
// 允许的前端 origin
|
||||
configuration.setAllowedOriginPatterns(List.of("http://localhost:*", "http://127.0.0.1:*"));
|
||||
// 允许的前端 origin(从配置读取,逗号分隔转列表)
|
||||
List<String> allowedOrigins = Arrays.asList(allowedOriginsStr.split(","));
|
||||
configuration.setAllowedOriginPatterns(allowedOrigins);
|
||||
log.info("加载 CORS 配置允许地址:{}", allowedOrigins);
|
||||
|
||||
// 允许凭证(Cookie)
|
||||
configuration.setAllowCredentials(true);
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.niuan.erp.common.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.niuan.erp.common.base.BaseEntity;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import com.niuan.erp.common.utils.SecurityUtils;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
public class AutoFillEntityHandler implements MetaObjectHandler {
|
||||
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
Object originalObj = metaObject.getOriginalObject();
|
||||
|
||||
if (Objects.requireNonNull(originalObj) instanceof OldBaseEntity entity) {
|
||||
insertFillOldBaseEntity(entity);
|
||||
}
|
||||
|
||||
if (Objects.requireNonNull(originalObj) instanceof BaseEntity entity) {
|
||||
insertFillBaseEntity(entity);
|
||||
}
|
||||
|
||||
if (Objects.requireNonNull(originalObj) instanceof OldBaseCustomerEntity entity) {
|
||||
if (entity.getCustomerId() == null) entity.setCustomerId(SecurityUtils.getCustomerId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
Object originalObj = metaObject.getOriginalObject();
|
||||
if (Objects.requireNonNull(originalObj) instanceof OldBaseEntity entity) {
|
||||
updateFillOldBaseEntity(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void insertFillOldBaseEntity(OldBaseEntity entity) {
|
||||
if (entity.getStatus() == null) entity.setStatus(0);
|
||||
if (entity.getCreateUserId() == null) entity.setCreateUserId(SecurityUtils.getUserId());
|
||||
if (!StringUtils.hasText(entity.getCreateUserName())) entity.setCreateUserName(SecurityUtils.getUserName());
|
||||
if (entity.getCreateDate() == null) entity.setCreateDate(LocalDateTime.now());
|
||||
}
|
||||
|
||||
private void insertFillBaseEntity(BaseEntity entity) {
|
||||
if (entity.getStatus() == null) entity.setStatus(0);
|
||||
if (entity.getCreateUserId() == null) entity.setCreateUserId(SecurityUtils.getUserId());
|
||||
if (!StringUtils.hasText(entity.getCreateUserName())) entity.setCreateUserName(SecurityUtils.getUserName());
|
||||
if (entity.getCreateDate() == null) entity.setCreateDate(LocalDateTime.now());
|
||||
}
|
||||
|
||||
private void updateFillOldBaseEntity(OldBaseEntity entity) {
|
||||
if (entity.getUpdateUserId() == null) entity.setUpdateUserId(SecurityUtils.getUserId());
|
||||
if (!StringUtils.hasText(entity.getUpdateUserName())) entity.setUpdateUserName(SecurityUtils.getUserName());
|
||||
if (entity.getUpdateDate() == null) entity.setUpdateDate(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import com.niuan.erp.module.common.enums.DocumentType;
|
||||
import com.niuan.erp.module.common.enums.FormStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -25,34 +27,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("productionform")
|
||||
public class Document implements Serializable {
|
||||
public class Document extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("StoreNo")
|
||||
private Integer storeNo;
|
||||
|
||||
@@ -97,7 +76,4 @@ public class Document implements Serializable {
|
||||
|
||||
@TableField("GroupId")
|
||||
private Integer groupId;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("materialinout")
|
||||
public class DocumentMaterial implements Serializable {
|
||||
public class DocumentMaterial extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("DocumentNo")
|
||||
private Integer documentNo;
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import com.niuan.erp.module.production.controller.dto.BomItemDto;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -25,34 +27,11 @@ import java.util.List;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("bom_list")
|
||||
public class Bom implements Serializable {
|
||||
public class Bom extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("ParentId")
|
||||
private Long parentId;
|
||||
|
||||
@@ -77,9 +56,6 @@ public class Bom implements Serializable {
|
||||
@TableField("customerName")
|
||||
private String customerName;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<BomItemDto> bomItems;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,7 @@ import java.io.Serializable;
|
||||
@TableName("bom")
|
||||
public class BomItem implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
|
||||
@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import com.niuan.erp.module.production.enums.ProductionPlanStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -24,34 +26,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("produceorder")
|
||||
public class ProductionPlan implements Serializable {
|
||||
public class ProductionPlan extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("ProductionNum")
|
||||
private String productionNum;
|
||||
|
||||
@@ -93,7 +72,4 @@ public class ProductionPlan implements Serializable {
|
||||
|
||||
@TableField("GroupName")
|
||||
private String groupName;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class FinishedProductReceiptServiceImpl extends ServiceImpl<DocumentMappe
|
||||
entity.setCreateDate(LocalDateTime.now());
|
||||
entity.setStatus(0);
|
||||
entity.setFormType(DocumentType.FINISHED_PRODUCT_RECEIPT);
|
||||
entity.setFormStatus(FormStatus.APPROVE);
|
||||
entity.setFormStatus(FormStatus.NO_APPROVE);
|
||||
entity.setTotalValue(Double.valueOf(deviceItems.size()));
|
||||
entity.setCustomerId(SecurityUtils.getCustomerId());
|
||||
this.baseMapper.insert(entity);
|
||||
@@ -294,9 +294,9 @@ public class FinishedProductReceiptServiceImpl extends ServiceImpl<DocumentMappe
|
||||
throw new BusinessException("production.finished_product_receipt.exception.document_not_found");
|
||||
}
|
||||
|
||||
// 检查单据状态
|
||||
if (document.getFormStatus() != FormStatus.APPROVE) {
|
||||
throw new BusinessException("production.finished_product_receipt.exception.document_not_approved");
|
||||
// 检查单据状态,只有已完成状态不能出货(NO_APPROVE=0未出货, NO_COMPLETE=3出货中, COMPLETE=4已完成)
|
||||
if (document.getFormStatus() == FormStatus.COMPLETE) {
|
||||
throw new BusinessException("production.finished_product_receipt.exception.document_already_completed");
|
||||
}
|
||||
|
||||
// 使用事务处理出货操作
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("purchasematerial")
|
||||
public class PurchaseOrderItem implements Serializable {
|
||||
public class PurchaseOrderItem extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("DocumentNo")
|
||||
private Integer documentNo;
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import com.niuan.erp.module.purchase.enums.PurchasePlanStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -24,31 +26,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("purchaseplans")
|
||||
public class PurchasePlan implements Serializable {
|
||||
public class PurchasePlan extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Integer updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private LocalDateTime updateUserName;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -23,9 +24,10 @@ import java.math.BigDecimal;
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("purchaseplandetails")
|
||||
@TableName("PurchasePlanDetails")
|
||||
public class PurchasePlanItem implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
|
||||
@@ -93,8 +93,6 @@ public class PurchasePlanServiceImpl extends ServiceImpl<PurchasePlanMapper, Pur
|
||||
@Override
|
||||
public void updatePurchasePlan(PurchasePlanDto dto) {
|
||||
PurchasePlan entity = purchasePlanConverter.toEntity(dto);
|
||||
entity.setUpdateUserId(SecurityUtils.getUserId().intValue());
|
||||
entity.setUpdateDate(LocalDateTime.now());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
@@ -23,34 +24,13 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("modulesn")
|
||||
public class Device implements Serializable {
|
||||
public class Device extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("DocumentNo")
|
||||
private Integer documentNo;
|
||||
|
||||
@@ -93,9 +73,6 @@ public class Device implements Serializable {
|
||||
@TableField("KeyAccountId")
|
||||
private Integer keyAccountId;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
|
||||
@TableField("OutStatus")
|
||||
private Boolean outStatus;
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("repairrecord")
|
||||
public class RepairRecord implements Serializable {
|
||||
public class RepairRecord extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("ProductType")
|
||||
private String productType;
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("sale")
|
||||
public class SaleOrderItem implements Serializable {
|
||||
public class SaleOrderItem extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("DocumentNo")
|
||||
private Integer documentNo;
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -23,34 +22,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("keyaccount")
|
||||
public class KeyAccount implements Serializable {
|
||||
public class KeyAccount extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("KeyAccountCode")
|
||||
private String keyAccountCode;
|
||||
|
||||
@@ -80,7 +56,4 @@ public class KeyAccount implements Serializable {
|
||||
|
||||
@TableField("reserve2")
|
||||
private String reserve2;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Long customerId;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -23,34 +22,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("storage_list")
|
||||
public class Store implements Serializable {
|
||||
public class Store extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("StoreNo")
|
||||
private Integer storeNo;
|
||||
|
||||
@@ -68,7 +44,4 @@ public class Store implements Serializable {
|
||||
|
||||
@TableField("ProjectId")
|
||||
private Long projectId;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -2,37 +2,14 @@ package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("yy_syschannel")
|
||||
public class SysChannel {
|
||||
|
||||
@TableField("Id")
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
public class SysChannel extends OldBaseEntity {
|
||||
|
||||
@TableField("ChannelType")
|
||||
private Integer channelType;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.BaseEntity;
|
||||
import com.niuan.erp.module.sys.enums.PermissionType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,61 +23,17 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("sys_permission")
|
||||
public class SysPermission implements Serializable {
|
||||
public class SysPermission extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父权限ID,0表示根节点
|
||||
*/
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@TableField("create_user_id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@TableField("create_user_name")
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@TableField("update_user_id")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新人姓名
|
||||
*/
|
||||
@TableField("update_user_name")
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 权限名字,没有 i18n 时,作为显示名称
|
||||
*/
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -20,35 +20,11 @@ import java.time.LocalDateTime;
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("yy_sysrecord")
|
||||
public class SysRecord implements Serializable {
|
||||
@TableName("YY_SysRecord")
|
||||
public class SysRecord extends OldBaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("Id")
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("ChannelName")
|
||||
private String channelName;
|
||||
|
||||
|
||||
@@ -1,41 +1,17 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("yy_sysrole")
|
||||
public class SysRole {
|
||||
|
||||
@TableId(value = "Id", type = IdType.NONE) // 非自增,允许 null
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("YY_SysRole")
|
||||
public class SysRole extends OldBaseEntity {
|
||||
|
||||
@TableField("RoleType")
|
||||
private Integer roleType;
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("yy_sysrolechannelmapping")
|
||||
@TableName("YY_SysRoleChannelMapping")
|
||||
public class SysRoleChannel {
|
||||
|
||||
@TableId("Id")
|
||||
|
||||
@@ -1,41 +1,18 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import com.niuan.erp.module.sys.enums.UserType;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("yy_users")
|
||||
public class SysUser {
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("YY_Users")
|
||||
public class SysUser extends OldBaseCustomerEntity {
|
||||
|
||||
@TableField("UserType")
|
||||
private UserType userType;
|
||||
@@ -76,9 +53,6 @@ public class SysUser {
|
||||
@TableField("isCustomer")
|
||||
private Integer isCustomer;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
|
||||
@TableField(value = "openid")
|
||||
private String openid;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import lombok.Data;
|
||||
* User 和 Role 关联表
|
||||
*/
|
||||
@Data
|
||||
@TableName("yy_usersrolemapping")
|
||||
@TableName("YY_UsersRoleMapping")
|
||||
public class UserRole {
|
||||
|
||||
@TableId("Id")
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.niuan.erp.module.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -23,34 +21,10 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("vendor")
|
||||
public class Vendor implements Serializable {
|
||||
public class Vendor extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("VendorNo")
|
||||
private Integer vendorNo;
|
||||
|
||||
@@ -80,7 +54,4 @@ public class Vendor implements Serializable {
|
||||
|
||||
@TableField("reserve2")
|
||||
private String reserve2;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
/**
|
||||
* 根据角色ID查询用户ID列表
|
||||
*/
|
||||
@Select("SELECT DISTINCT ur.UserId FROM role_permission ur WHERE ur.role_id = #{roleId}")
|
||||
@Select("SELECT DISTINCT ur.UserId FROM YY_UsersRoleMapping ur WHERE ur.RoleId = #{roleId}")
|
||||
List<Long> selectUserIdsByRoleId(@Param("roleId") Long roleId);
|
||||
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
*/
|
||||
@Select("""
|
||||
SELECT DISTINCT ur.UserId
|
||||
FROM yy_usersrolemapping ur
|
||||
FROM YY_UsersRoleMapping ur
|
||||
INNER JOIN role_permission rp ON ur.RoleId = rp.role_id
|
||||
WHERE rp.permission_id = #{permissionId}
|
||||
""")
|
||||
|
||||
@@ -11,6 +11,6 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface UserRoleMapper extends BaseMapper<UserRole> {
|
||||
|
||||
@Select("SELECT RoleId FROM yy_usersrolemapping WHERE UserId = #{userId}")
|
||||
@Select("SELECT RoleId FROM YY_UsersRoleMapping WHERE UserId = #{userId}")
|
||||
List<Long> selectRoleIdsByUserId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@@ -77,11 +77,6 @@ public class KeyAccountServiceImpl extends ServiceImpl<KeyAccountMapper, KeyAcco
|
||||
@Override
|
||||
public void addKeyAccount(KeyAccountDto dto) {
|
||||
KeyAccount entity = keyAccountConverter.toEntity(dto);
|
||||
entity.setCreateUserId(SecurityUtils.getUserId());
|
||||
entity.setCreateUserName(SecurityUtils.getUserName());
|
||||
entity.setCreateDate(LocalDateTime.now());
|
||||
entity.setCustomerId(Long.valueOf(SecurityUtils.getLoginUser().getUser().getCustomerId()));
|
||||
entity.setStatus(0);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ import com.niuan.erp.common.annotation.ModuleLog;
|
||||
import com.niuan.erp.common.base.*;
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.Add;
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.DeleteOne;
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.Get;
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.Update;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapAddDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemAddAndUpdateDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemSearchParams;
|
||||
import com.niuan.erp.module.warehouse.entity.WarehouseItem;
|
||||
import com.niuan.erp.module.warehouse.service.WarehouseItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -49,11 +50,11 @@ public class WarehouseItemController {
|
||||
return BaseResult.successWithData(warehouseItemService.getProductBrandSelectList());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询WarehouseItem数据", operationId = "getWarehouseItemPage")
|
||||
@Operation(summary = "分页查询物料数据", operationId = "getWarehouseItemPage")
|
||||
@GetMapping("/getWarehouseItemPage")
|
||||
@PreAuthorize("hasAuthority('warehouse_item:index')")
|
||||
public BaseResult<IPage<WarehouseItemDto>> getWarehouseItemPage(@Validated BasePageReqParams pageParams,
|
||||
@Validated(Get.class) WarehouseItemDto searchParams) {
|
||||
WarehouseItemSearchParams searchParams) {
|
||||
var wrapper = new LambdaQueryWrapper<WarehouseItem>();
|
||||
if (searchParams != null) {
|
||||
if (StringUtils.hasText(searchParams.searchCode())) {
|
||||
@@ -69,7 +70,7 @@ public class WarehouseItemController {
|
||||
@Operation(summary = "新增物料信息", operationId = "addWarehouseItem")
|
||||
@PostMapping("/addWarehouseItem")
|
||||
@PreAuthorize("hasAuthority('warehouse_item:add')")
|
||||
public BaseResult<?> addWarehouseItem(@Validated(Add.class) @RequestBody WarehouseItemDto dto) {
|
||||
public BaseResult<?> addWarehouseItem(@Validated(Add.class) @RequestBody WarehouseItemAddAndUpdateDto dto) {
|
||||
warehouseItemService.addWarehouseItem(dto);
|
||||
return BaseResult.success();
|
||||
}
|
||||
@@ -78,7 +79,7 @@ public class WarehouseItemController {
|
||||
@Operation(summary = "更新物料信息", operationId = "updateWarehouseItem")
|
||||
@PostMapping("/updateWarehouseItem")
|
||||
@PreAuthorize("hasAuthority('warehouse_item:edit')")
|
||||
public BaseResult<?> updateWarehouseItem(@Validated(Update.class) @RequestBody WarehouseItemDto dto) {
|
||||
public BaseResult<?> updateWarehouseItem(@Validated(Update.class) @RequestBody WarehouseItemAddAndUpdateDto dto) {
|
||||
warehouseItemService.updateWarehouseItem(dto);
|
||||
return BaseResult.success();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.niuan.erp.module.warehouse.controller.dto;
|
||||
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.Add;
|
||||
import com.niuan.erp.common.base.CommonValidateGroup.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "物料新增/更新 DTO")
|
||||
public record WarehouseItemAddAndUpdateDto(
|
||||
@Schema(description = "ID (更新时必填)")
|
||||
@NotNull(message = "warehouse.warehouse_item.validate.id.not_null", groups = Update.class)
|
||||
Long id,
|
||||
|
||||
@Schema(description = "物料编号")
|
||||
@NotBlank(message = "warehouse.warehouse_item.validate.part_number.not_null", groups = {Add.class, Update.class})
|
||||
String partNumber,
|
||||
|
||||
@Schema(description = "物料规格")
|
||||
@NotBlank(message = "warehouse.warehouse_item.validate.product_specs.not_null", groups = {Add.class, Update.class})
|
||||
String productSpecs,
|
||||
|
||||
@Schema(description = "物料类型")
|
||||
@NotBlank(message = "warehouse.warehouse_item.validate.product_type.not_null", groups = {Add.class, Update.class})
|
||||
String productType,
|
||||
|
||||
@Schema(description = "物料品牌")
|
||||
String productBrand,
|
||||
|
||||
@Schema(description = "包装数量")
|
||||
@Min(value = 1, message = "warehouse.warehouse_item.validate.product_packing.min", groups = {Add.class, Update.class})
|
||||
Integer productPacking,
|
||||
|
||||
@Schema(description = "包装尺寸")
|
||||
String productPackSize,
|
||||
|
||||
@Schema(description = "物料备注")
|
||||
String productMark
|
||||
) {}
|
||||
@@ -1,33 +1,41 @@
|
||||
package com.niuan.erp.module.warehouse.controller.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "物料 DTO")
|
||||
public record WarehouseItemDto(
|
||||
@Schema(description = "ID")
|
||||
Long id,
|
||||
Integer status,
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
LocalDateTime createDate,
|
||||
Long createUserId,
|
||||
|
||||
@Schema(description = "创建人名称")
|
||||
String createUserName,
|
||||
LocalDateTime updateDate,
|
||||
Long updateUserId,
|
||||
String updateUserName,
|
||||
|
||||
@Schema(description = "物料编号")
|
||||
String partNumber,
|
||||
|
||||
@Schema(description = "物料类型")
|
||||
String productType,
|
||||
|
||||
@Schema(description = "物料规格")
|
||||
String productSpecs,
|
||||
|
||||
@Schema(description = "物料品牌")
|
||||
String productBrand,
|
||||
|
||||
@Schema(description = "包装数量")
|
||||
Integer productPacking,
|
||||
String productPackUnit,
|
||||
|
||||
@Schema(description = "包装尺寸")
|
||||
String productPackSize,
|
||||
|
||||
@Schema(description = "物料价格")
|
||||
Double productPrice,
|
||||
Integer productStockTotal,
|
||||
String vdName,
|
||||
Integer vendorCode1,
|
||||
Integer vendorCode2,
|
||||
Integer vendorCode3,
|
||||
Integer manufactureSpec,
|
||||
String productMark,
|
||||
Integer reserve1,
|
||||
String reserve2,
|
||||
Integer productOccupyTotal,
|
||||
Integer customerId,
|
||||
String searchCode) {}
|
||||
|
||||
@Schema(description = "物料备注")
|
||||
String productMark
|
||||
) {}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.niuan.erp.module.warehouse.controller.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "物料搜索参数")
|
||||
public record WarehouseItemSearchParams(
|
||||
@Schema(description = "搜索编码 (物料编号)")
|
||||
String searchCode
|
||||
) {}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.niuan.erp.module.warehouse.converter;
|
||||
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemAddAndUpdateDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemDto;
|
||||
import com.niuan.erp.module.warehouse.entity.WarehouseItem;
|
||||
import org.mapstruct.Mapper;
|
||||
@@ -12,4 +13,5 @@ public interface WarehouseItemConverter {
|
||||
WarehouseItem toEntity(WarehouseItemDto dto);
|
||||
WarehouseItemDto toDto(WarehouseItem entity);
|
||||
List<WarehouseItemDto> toDtoList(List<WarehouseItem> entities);
|
||||
WarehouseItem toEntity(WarehouseItemAddAndUpdateDto dto);
|
||||
}
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("stocktaking")
|
||||
public class InventoryCountItem implements Serializable {
|
||||
public class InventoryCountItem extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("StoreNo")
|
||||
private Integer storeNo;
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("storagecount")
|
||||
public class Stock implements Serializable {
|
||||
public class Stock extends OldBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("StoreNo")
|
||||
private Integer storeNo;
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("storage_list")
|
||||
public class Warehouse implements Serializable {
|
||||
public class Warehouse extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("StoreNo")
|
||||
private Integer storeNo;
|
||||
|
||||
@@ -68,7 +47,4 @@ public class Warehouse implements Serializable {
|
||||
|
||||
@TableField("ProjectId")
|
||||
private Long projectId;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.niuan.erp.common.base.OldBaseCustomerEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,34 +25,11 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName("product")
|
||||
public class WarehouseItem implements Serializable {
|
||||
public class WarehouseItem extends OldBaseCustomerEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("CreateDate")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@TableField("CreateUserId")
|
||||
private Long createUserId;
|
||||
|
||||
@TableField("CreateUserName")
|
||||
private String createUserName;
|
||||
|
||||
@TableField("UpdateDate")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@TableField("UpdateUserId")
|
||||
private Long updateUserId;
|
||||
|
||||
@TableField("UpdateUserName")
|
||||
private String updateUserName;
|
||||
|
||||
@TableField("PartNumber")
|
||||
private String partNumber;
|
||||
|
||||
@@ -104,7 +83,4 @@ public class WarehouseItem implements Serializable {
|
||||
|
||||
@TableField("ProductOccupyTotal")
|
||||
private Integer productOccupyTotal;
|
||||
|
||||
@TableField("CustomerId")
|
||||
private Integer customerId;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.niuan.erp.common.base.BasePageReqParams;
|
||||
import com.niuan.erp.common.base.BaseSelectDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapAddDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemAddAndUpdateDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemDto;
|
||||
import com.niuan.erp.module.warehouse.entity.WarehouseItem;
|
||||
|
||||
@@ -19,9 +20,9 @@ public interface WarehouseItemService {
|
||||
|
||||
IPage<WarehouseItemDto> getWarehouseItemPage(BasePageReqParams pageParams, LambdaQueryWrapper<WarehouseItem> wrapper);
|
||||
|
||||
void addWarehouseItem(WarehouseItemDto dto);
|
||||
void addWarehouseItem(WarehouseItemAddAndUpdateDto dto);
|
||||
|
||||
void updateWarehouseItem(WarehouseItemDto dto);
|
||||
void updateWarehouseItem(WarehouseItemAddAndUpdateDto dto);
|
||||
|
||||
void deleteWarehouseItem(long id);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.niuan.erp.module.sys.entity.Vendor;
|
||||
import com.niuan.erp.module.sys.service.VendorService;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapAddDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.ProductVendorMapDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemAddAndUpdateDto;
|
||||
import com.niuan.erp.module.warehouse.controller.dto.WarehouseItemDto;
|
||||
import com.niuan.erp.module.warehouse.converter.WarehouseItemConverter;
|
||||
import com.niuan.erp.module.warehouse.entity.ProductVendorMap;
|
||||
@@ -60,21 +61,14 @@ public class WarehouseItemServiceImpl extends ServiceImpl<WarehouseItemMapper, W
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWarehouseItem(WarehouseItemDto dto) {
|
||||
public void addWarehouseItem(WarehouseItemAddAndUpdateDto dto) {
|
||||
WarehouseItem entity = warehouseItemConverter.toEntity(dto);
|
||||
entity.setCreateUserId(SecurityUtils.getUserId());
|
||||
entity.setCreateUserName(SecurityUtils.getUserName());
|
||||
entity.setCreateDate(LocalDateTime.now());
|
||||
entity.setStatus(0);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWarehouseItem(WarehouseItemDto dto) {
|
||||
public void updateWarehouseItem(WarehouseItemAddAndUpdateDto dto) {
|
||||
WarehouseItem entity = warehouseItemConverter.toEntity(dto);
|
||||
entity.setUpdateUserId(SecurityUtils.getUserId());
|
||||
entity.setUpdateUserName(SecurityUtils.getUserName());
|
||||
entity.setUpdateDate(LocalDateTime.now());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ logging:
|
||||
web: debug
|
||||
sql: debug
|
||||
|
||||
# CORS 配置
|
||||
cors:
|
||||
allowed-origins: "http://localhost:*,http://127.0.0.1:*,http://192.168.*:*"
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
|
||||
17
src/main/resources/application-prod.yml
Normal file
17
src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
server:
|
||||
port: 9001
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/erp
|
||||
username: steven
|
||||
password: 781203
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: false # 关闭生成 OpenAPI JSON
|
||||
swagger-ui:
|
||||
enabled: false # 关闭 Swagger UI 页面
|
||||
|
||||
# CORS 配置
|
||||
cors:
|
||||
allowed-origins: "http://erp.pcbemc.com:*,https://erp.pcbemc.com:*"
|
||||
@@ -34,7 +34,7 @@ mybatis-plus:
|
||||
type-aliases-package: com.niuan.erp.module.*.entity,com.niuan.erp.module.*.controller.dto,com.niuan.erp.common.base
|
||||
mapper-locations: classpath*:mapper/**/*.xml
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
map-underscore-to-camel-case: true
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
erp:
|
||||
|
||||
@@ -24,6 +24,7 @@ warehouse.warehouse_item.validate.cost_price.min=Cost price cannot be less than
|
||||
warehouse.warehouse_item.validate.part_number.not_null=Part number cannot be empty
|
||||
warehouse.warehouse_item.validate.product_type.not_null=Product type cannot be empty
|
||||
warehouse.warehouse_item.validate.product_specs.not_null=Product specs cannot be empty
|
||||
warehouse.warehouse_item.validate.product_packing.min=Product packing must be greater than 0
|
||||
warehouse.warehouse_item.exception.not_found=Warehouse item not found
|
||||
warehouse.warehouse_item.exception.vendor_duplicate=Vendor cannot be duplicated
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ warehouse.warehouse_item.validate.cost_price.min=成本价不能小于 0
|
||||
warehouse.warehouse_item.validate.part_number.not_null=物料编号不能为空
|
||||
warehouse.warehouse_item.validate.product_type.not_null=物料规格不能为空
|
||||
warehouse.warehouse_item.validate.product_specs.not_null=物料型号不能为空
|
||||
warehouse.warehouse_item.validate.product_packing.min=包装数量必须大于 0
|
||||
warehouse.warehouse_item.exception.not_found=物料不存在
|
||||
warehouse.warehouse_item.exception.vendor_duplicate=供应商不能重复
|
||||
warehouse.stock_transfer_order.validate.form_code.not_null=单据编号不能为空
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByUserId" parameterType="long" resultMap="SysChannelResultMap">
|
||||
SELECT * FROM yy_syschannel c
|
||||
LEFT JOIN yy_sysrolechannelmapping rc ON rc.ChannelId = c.Id
|
||||
LEFT JOIN yy_usersrolemapping ur ON ur.RoleId = rc.RoleId
|
||||
SELECT * FROM YY_SysChannel c
|
||||
LEFT JOIN YY_SysRoleChannelMapping rc ON rc.ChannelId = c.Id
|
||||
LEFT JOIN YY_UsersRoleMapping ur ON ur.RoleId = rc.RoleId
|
||||
WHERE ur.UserId = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectChannelIdByRoleId" parameterType="Long" resultType="Long">
|
||||
SELECT rc.ChannelId FROM yy_syschannel c
|
||||
LEFT JOIN yy_sysrolechannelmapping rc ON rc.ChannelId = c.Id
|
||||
SELECT rc.ChannelId FROM YY_SysChannel c
|
||||
LEFT JOIN YY_SysRoleChannelMapping rc ON rc.ChannelId = c.Id
|
||||
WHERE rc.RoleId = #{roleId} AND c.status = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -29,8 +29,8 @@
|
||||
<select id="selectByUserId" parameterType="Long" resultMap="BaseResultMap">
|
||||
SELECT p.* FROM sys_permission p
|
||||
LEFT JOIN role_permission rp ON rp.permission_id = p.id
|
||||
LEFT JOIN yy_sysrole r ON r.Id = rp.role_id
|
||||
LEFT JOIN yy_usersrolemapping ur ON ur.RoleId = r.Id
|
||||
LEFT JOIN YY_SysRole r ON r.Id = rp.role_id
|
||||
LEFT JOIN YY_UsersRoleMapping ur ON ur.RoleId = r.Id
|
||||
WHERE ur.UserId = #{userId} AND r.status = 1 AND p.status = 0
|
||||
</select>
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByUserId" parameterType="long" resultMap="BaseResultMap">
|
||||
SELECT r.* FROM yy_sysrole r
|
||||
LEFT JOIN yy_usersrolemapping ur ON r.Id = ur.RoleId
|
||||
SELECT r.* FROM YY_SysRole r
|
||||
LEFT JOIN YY_UsersRoleMapping ur ON r.Id = ur.RoleId
|
||||
WHERE ur.UserId = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@ ALTER TABLE yy_sysrolechannelmapping DROP temp_id;
|
||||
ALTER TABLE yy_sysrolechannelmapping ADD PRIMARY KEY (id);
|
||||
ALTER TABLE yy_sysrolechannelmapping MODIFY id BIGINT NOT NULL AUTO_INCREMENT;
|
||||
|
||||
ALTER TABLE purchaseplandetails ADD Order_item_id BIGINT DEFAULT NULL COMMENT "关联 purchasematerial 的 ID, 订单明细 ID";
|
||||
ALTER TABLE PurchasePlanDetails ADD Order_item_id BIGINT DEFAULT NULL COMMENT "关联 purchasematerial 的 ID, 订单明细 ID";
|
||||
Reference in New Issue
Block a user