mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java
This commit is contained in:
+1
@@ -251,6 +251,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_033_006, "设计板材不存在");
|
||||
ErrorCode RAW_GOODS_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_002_033_007, "生产板材导入数据不可以为空");
|
||||
ErrorCode PLATENO_ERROR = new ErrorCode(1_002_033_008, "当前板编号无对应包裹信息");
|
||||
ErrorCode PLATE_GOODS_ID_NOT_SAME = new ErrorCode(1_002_033_009, "板材商品编号存在,请重新命名商品编号");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -213,6 +213,103 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<layout>ZIP</layout>
|
||||
<includes>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-common</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-infra-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-executor-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-system-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-banner</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-error-code</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-ip</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-sms</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-captcha</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-elasticsearch</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-env</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-excel</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-monitor</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mybatis</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-redis</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-rpc</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-security</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-web</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-mq</artifactId>
|
||||
</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
||||
+2
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import com.cf.imes.module.system.validation.system.dict.CssClassValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -44,6 +45,7 @@ public class DictDataSaveReqVO {
|
||||
private String colorType;
|
||||
|
||||
@Schema(description = "css 样式", example = "btn-visible")
|
||||
@CssClassValid
|
||||
private String cssClass;
|
||||
|
||||
@Schema(description = "备注", example = "我是一个角色")
|
||||
|
||||
+2
@@ -4,6 +4,7 @@ import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -18,6 +19,7 @@ public class TenantPackageSaveReqVO {
|
||||
|
||||
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "VIP")
|
||||
@NotEmpty(message = "套餐名不能为空")
|
||||
@Length(min = 1, max = 30, message = "套餐名长度不能超过30位")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态,参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public class MenuController {
|
||||
public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() {
|
||||
// status:0 开启 visiable:1 显示
|
||||
List<MenuDO> list = menuService.getMenuListByOrgan(
|
||||
new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()).setVisiable(CommonStatusEnum.DISABLE.getStatus()));
|
||||
new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
||||
list.sort(Comparator.comparing(MenuDO::getSort));
|
||||
return success(BeanUtils.toBean(list, MenuSimpleRespVO.class));
|
||||
}
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
package com.cf.imes.module.system.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.module.executor.enums.OrderStatisticsUnit;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* 生产单统计维度单位入参校验器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/7/17 9:33
|
||||
*/
|
||||
public class OrderStatisticsUnitInEnumValidator implements ConstraintValidator<OrderStatisticsUnitInEnum, Integer> {
|
||||
|
||||
@Override
|
||||
public void initialize(OrderStatisticsUnitInEnum constraintAnnotation) {
|
||||
ConstraintValidator.super.initialize(constraintAnnotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
OrderStatisticsUnit unit = OrderStatisticsUnit.fromValue(value);
|
||||
if (ObjectUtil.isNotNull(unit)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-2
@@ -1,17 +1,23 @@
|
||||
package com.cf.imes.module.system.service.dict;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.controller.admin.dict.vo.type.DictTypePageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.dict.vo.type.DictTypeSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.dict.DictTypeDO;
|
||||
import com.cf.imes.module.system.dal.mysql.dict.DictDataMapper;
|
||||
import com.cf.imes.module.system.dal.mysql.dict.DictTypeMapper;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -33,6 +39,9 @@ public class DictTypeServiceImpl implements DictTypeService {
|
||||
@Resource
|
||||
private DictTypeMapper dictTypeMapper;
|
||||
|
||||
@Resource
|
||||
private DictDataMapper dictDataMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<DictTypeDO> getDictTypePage(DictTypePageReqVO pageReqVO) {
|
||||
return dictTypeMapper.selectPage(pageReqVO);
|
||||
@@ -63,17 +72,25 @@ public class DictTypeServiceImpl implements DictTypeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateDictType(DictTypeSaveReqVO updateReqVO) {
|
||||
String updateReqVOType = updateReqVO.getType();
|
||||
// 校验自己存在
|
||||
validateDictTypeExists(updateReqVO.getId());
|
||||
DictTypeDO oldDictTypeDO = validateDictTypeExists(updateReqVO.getId());
|
||||
// 校验字典类型的名字的唯一性
|
||||
validateDictTypeNameUnique(updateReqVO.getId(), updateReqVO.getName());
|
||||
// 校验字典类型的类型的唯一性
|
||||
validateDictTypeUnique(updateReqVO.getId(), updateReqVO.getType());
|
||||
validateDictTypeUnique(updateReqVO.getId(), updateReqVOType);
|
||||
|
||||
// 更新字典类型
|
||||
DictTypeDO updateObj = BeanUtils.toBean(updateReqVO, DictTypeDO.class);
|
||||
dictTypeMapper.updateById(updateObj);
|
||||
|
||||
// 字典类型发生改变,更新关联字典数据
|
||||
String oldDictTypeDOType = oldDictTypeDO.getType();
|
||||
if (ObjectUtil.isAllNotEmpty(oldDictTypeDOType, updateReqVOType) && ObjectUtil.notEqual(oldDictTypeDOType, updateReqVOType)) {
|
||||
dictDataMapper.update(new LambdaUpdateWrapper<DictDataDO>().set(DictDataDO::getDictType, updateReqVOType).eq(DictDataDO::getDictType, oldDictTypeDOType).eq(DictDataDO::getStatus, DeletedCodeEnum.NOT_DELETED.getStatus()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-8
@@ -1,14 +1,16 @@
|
||||
package com.cf.imes.module.system.order;
|
||||
package com.cf.imes.module.system.validation.system.dict;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 生产单统计维度单位入参校验注解
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/7/17 9:33
|
||||
* @since 2024/9/20 15:24
|
||||
*/
|
||||
@Target({
|
||||
ElementType.METHOD,
|
||||
@@ -21,10 +23,10 @@ import java.lang.annotation.*;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {OrderStatisticsUnitInEnumValidator.class}
|
||||
validatedBy = {CssClassValidator.class}
|
||||
)
|
||||
public @interface OrderStatisticsUnitInEnum {
|
||||
String message() default "生产单统计维度单位[unit]错误,请检查";
|
||||
public @interface CssClassValid {
|
||||
String message() default "颜色格式错误,请检查";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.system.validation.system.dict;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author Gqr
|
||||
* @since 2024/9/20 15:27
|
||||
*/
|
||||
public class CssClassValidator implements ConstraintValidator<CssClassValid, String> {
|
||||
private static final String REGEX = "^#([0-9a-fA-F]{3}){1,2}$";
|
||||
|
||||
@Override
|
||||
public void initialize(CssClassValid constraintAnnotation) {
|
||||
ConstraintValidator.super.initialize(constraintAnnotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
return true;
|
||||
}
|
||||
return value.matches(REGEX);
|
||||
}
|
||||
}
|
||||
@@ -206,9 +206,9 @@ chenfeng:
|
||||
end-code: 9999 # 这里配置 9999 的原因是,测试方便。
|
||||
sms:
|
||||
channel: DEBUG_DING_TALK
|
||||
signature:
|
||||
apiKey: 28PlJanD0aJLMyMLuH6JI5oVj1/j5ZNGvZPx/zguEvJl02PdrbWe5yIV4s1RSD3CDX9obUhITNlc6glW7MNJq03N7H/v50MFgN4f8mK1oAA=
|
||||
apiSecret: O6Yk9gT3xQ9fqSKFuZa9I4bWOULCw2syH4/a1OrD2W7BAE2aQ+bSgqLXfBJT+de0GKHKgjuPNv0v+sDKkizLP22gsYIhdn/3OPSvyJF7Tng=
|
||||
signature: sELLIaR5FAhCp8xx6tDJr1goyvsziMfTsD1HHxWnLkZgbVQOoly0GeadK81IkxbMVlvA5AhB7Apapg38Gx+MuE7G5xiVXt4JSzOqW1Qa6gn88joGXe0wh++lAtw=
|
||||
apiKey: sELLIaR5FAhCp8xx6tDJr1goyvsziMfTsD1HHxWnLkZgbVQOoly0GeadK81IkxbMVlvA5AhB7Apapg38Gx+MuE7G5xiVXt4JSzOqW1Qa6gn88joGXe0wh++lAtw=
|
||||
apiSecret: UjISv3wc1DfeFeG4WaPF4q8boPdrdhuUKuIhUDr1MImA0bK1KMqV76HL7fzEW2NR/Uqrq9Fe3vfWOCwblgKgL/J0twmrNCknBQSXhLNDw9zosoQR9Q1Lgql8dcI/d4g=
|
||||
encrypt:
|
||||
enable: false
|
||||
publicKey: cfimes
|
||||
|
||||
Reference in New Issue
Block a user