Merge branch 'feature/bug-20250707' into feature/product
# Conflicts: # nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/ProductModelVideoItem.java
This commit is contained in:
commit
bffd874909
|
|
@ -15,10 +15,7 @@ import com.nflg.mobilebroken.common.pojo.PageData;
|
|||
import com.nflg.mobilebroken.common.pojo.dto.ProductModelParamsExcelDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.request.*;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.*;
|
||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.EecExcelUtil;
|
||||
import com.nflg.mobilebroken.common.util.PageUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.common.util.*;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -312,6 +309,8 @@ public class ProductModelController extends ControllerBase{
|
|||
public ApiResult<Integer> deleteParamsIndexName(@Valid @RequestBody ParamsIndexNameDeleteRequest request) {
|
||||
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(!StrUtil.equals(info.getCreateBy(), AdminUserUtil.getUserName()))
|
||||
.throwMessage("不能删除其他人创建的数据");
|
||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||
Integer oldId = request.getModelParamsId();
|
||||
request.setModelParamsId(productModelParamsService.add(info.getModelId(),info.getBatchNumber()));
|
||||
|
|
@ -396,6 +395,8 @@ public class ProductModelController extends ControllerBase{
|
|||
VUtils.trueThrowBusinessError(Objects.isNull(request.getModelParamsId())).throwMessage("机型参数id不能为空");
|
||||
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(!StrUtil.equals(info.getCreateBy(), AdminUserUtil.getUserName()))
|
||||
.throwMessage("不能删除其他人创建的数据");
|
||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||
Integer oldId = request.getModelParamsId();
|
||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),info.getBatchNumber()));
|
||||
|
|
@ -744,88 +745,38 @@ public class ProductModelController extends ControllerBase{
|
|||
}
|
||||
|
||||
/**
|
||||
* 添加图册
|
||||
* 获取主要参数列表用于排序
|
||||
*/
|
||||
@GetMapping("/getMainParamsListForSort")
|
||||
public ApiResult<List<ParamsSortListVO>> getMainParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId){
|
||||
return ApiResult.success(productModelParamsService.getMainListForSort(modelParamsId,Constant.DEFAULT_LANGUAGE_CODE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存主要参数排序
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/addImage")
|
||||
public ApiResult<Void> addImage(@Valid @RequestBody ProductModelImageAddRequest request){
|
||||
productModelImageService.add(request);
|
||||
@PostMapping("/saveMainParamsSort")
|
||||
public ApiResult<Void> saveMainParamsSort(@Valid @RequestBody ParamsSortSaveRequest request){
|
||||
productModelParamsService.saveMainSort(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图册
|
||||
* 获取重要参数列表用于排序
|
||||
*/
|
||||
@GetMapping("/getImportantParamsListForSort")
|
||||
public ApiResult<List<ParamsSortListVO>> getImportantParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId){
|
||||
return ApiResult.success(productModelParamsService.getImportantParamsListForSort(modelParamsId,Constant.DEFAULT_LANGUAGE_CODE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存重要参数排序
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/updateImage")
|
||||
public ApiResult<Integer> updateImage(@Valid @RequestBody ProductModelImageUpdateRequest request){
|
||||
return ApiResult.success(productModelImageService.update(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/禁用图册
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/enableImage")
|
||||
public ApiResult<Void> enableImage(@Valid @RequestBody EnableRequest request){
|
||||
productModelImageService.enable(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图册
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/deleteImage")
|
||||
public ApiResult<Void> deleteImage(@Valid @RequestBody BatchDeleteRequest request){
|
||||
productModelImageService.delete(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布或者取消发布图册
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/publishImage")
|
||||
public ApiResult<Void> publishImage(@Valid @RequestBody ProductPublishRequest request){
|
||||
productModelImageService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图册列表
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/getImageList")
|
||||
public ApiResult<PageData<ProductModelImage>> getImageList(@Valid @RequestBody ProductModelImageSearchRequest request){
|
||||
return ApiResult.success(productModelImageService.getList(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图册详情
|
||||
* @param modelImagesId 图册ID
|
||||
*/
|
||||
@GetMapping("/getImageInfo")
|
||||
public ApiResult<ProductModelImagesInfoVO> getImageInfo(@RequestParam Integer modelImagesId){
|
||||
return ApiResult.success(productModelImageService.getInfo(modelImagesId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图册列表用于排序
|
||||
* @param modelId 机型ID
|
||||
*/
|
||||
@GetMapping("/getImageListForSort")
|
||||
public ApiResult<List<ProductModelImage>> getImageListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
||||
return ApiResult.success(productModelImageService.getListForSort(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存图册排序
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/saveImageSort")
|
||||
public ApiResult<Void> saveImageSort(@Valid @RequestBody SortSaveRequest request){
|
||||
productModelImageService.saveSort(request);
|
||||
@PostMapping("/saveImportantParamsSort")
|
||||
public ApiResult<Void> saveImportantParamsSort(@Valid @RequestBody ParamsSortSaveRequest request){
|
||||
productModelParamsService.saveImportantSort(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,13 +120,6 @@ public class AppController extends ControllerBase {
|
|||
@GetMapping("getPermissionMenus")
|
||||
public ApiResult<List<MenuVO>> getPermissionMenus() {
|
||||
VUtils.trueThrow(!SaTokenAppUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||
if (StrUtil.equals(AppUserUtil.getFrom(), "app") && !AppUserUtil.isPrimary()) {
|
||||
Integer primaryUserId = appUserService.getPrimaryByChild(AppUserUtil.getUserId());
|
||||
List<MenuVO> menus = adminRoleService.getMenusByRoleCodes(AppUserUtil.getFrom(), primaryUserId, "app");
|
||||
menus.removeIf(menu -> StrUtil.equals(menu.getComponent(), "identityManagement"));
|
||||
return ApiResult.success(menus);
|
||||
} else {
|
||||
return ApiResult.success(adminRoleService.getMenusByRoleCodes(AppUserUtil.getFrom(), AppUserUtil.getUserId(), "app"));
|
||||
}
|
||||
return ApiResult.success(adminRoleService.getMenusByRoleCodes(AppUserUtil.getFrom(), AppUserUtil.getUserId(), "app"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.common.pojo.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ParamsSortSaveRequest {
|
||||
|
||||
@NotNull
|
||||
private Integer modelParamsId;
|
||||
|
||||
/**
|
||||
* 排序后的列表
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<String> batchNumbers;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.nflg.mobilebroken.common.pojo.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductModelInfoAddRequest {
|
||||
|
||||
/**
|
||||
* 主键,添加时为空
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模型id
|
||||
*/
|
||||
private Integer modelId;
|
||||
|
||||
/**
|
||||
* 语言代码
|
||||
*/
|
||||
private String languageCode;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 图片或者视频地址
|
||||
*/
|
||||
private String url;
|
||||
}
|
||||
|
|
@ -43,8 +43,18 @@ public class ProductModelParamsItemAddRequest implements Serializable {
|
|||
*/
|
||||
private Boolean main=false;
|
||||
|
||||
/**
|
||||
* 是否重要参数
|
||||
*/
|
||||
private Boolean important=false;
|
||||
|
||||
/**
|
||||
* 是否参与比较
|
||||
*/
|
||||
private Boolean compare=true;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String ico;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -20,6 +21,12 @@ public class ProductModelVideoItemAddRequest {
|
|||
@NotBlank
|
||||
private String languageCode;
|
||||
|
||||
/**
|
||||
* 类型,0-视频;1:图片
|
||||
*/
|
||||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ public class ProductPartAddRequest {
|
|||
@NotNull
|
||||
private Integer attrId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
/**
|
||||
* 多语言数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
public class ParamsSortListVO {
|
||||
|
||||
private String batchNumber;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer sort;
|
||||
}
|
||||
|
|
@ -77,9 +77,9 @@ public class ProductModelInfoVO {
|
|||
private List<ProductParamsItemVO> mainParams;
|
||||
|
||||
/**
|
||||
* 产品图册
|
||||
* 重要技术参数
|
||||
*/
|
||||
private List<ProductImageVO> images;
|
||||
private List<ProductParamsItemVO> importantParams;
|
||||
|
||||
/**
|
||||
* 产品视频
|
||||
|
|
|
|||
|
|
@ -31,11 +31,21 @@ public class ProductParamsItemVO {
|
|||
*/
|
||||
private Boolean main;
|
||||
|
||||
/**
|
||||
* 是否重要参数
|
||||
*/
|
||||
private Boolean important;
|
||||
|
||||
/**
|
||||
* 是否参与比较
|
||||
*/
|
||||
private Boolean compare;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String ico;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ public class ProductPartSearchVO {
|
|||
*/
|
||||
private Integer attrId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
/**
|
||||
* 类别属性
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,9 +2,17 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ProductVideoVO extends ProductImageVO{
|
||||
|
||||
/**
|
||||
* 类型,0-视频;1:图片
|
||||
*/
|
||||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 视频地址
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
spring.application.name=product
|
||||
spring.profiles.active=dev
|
||||
server.port=8085
|
||||
server.port=8084
|
||||
# 设置最大文件大小 (默认为1MB)
|
||||
spring.servlet.multipart.max-file-size=100MB
|
||||
# 设置所有文件总大小 (默认为10MB)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品中心-机型详情
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("product_model_info")
|
||||
public class ProductModelInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 机型id
|
||||
*/
|
||||
private Integer modeId;
|
||||
|
||||
/**
|
||||
* 语言代码
|
||||
*/
|
||||
private String languageCode;
|
||||
|
||||
/**
|
||||
* 机型名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 机型介绍
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 视频或者图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -67,12 +67,34 @@ public class ProductModelParamsItem implements Serializable {
|
|||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Boolean main;
|
||||
|
||||
/**
|
||||
* 主要参数排序号
|
||||
*/
|
||||
@TableField(updateStrategy=FieldStrategy.ALWAYS)
|
||||
private Integer mainSort;
|
||||
|
||||
/**
|
||||
* 是否重要参数
|
||||
*/
|
||||
private Boolean important;
|
||||
|
||||
/**
|
||||
* 重要参数排序号
|
||||
*/
|
||||
@TableField(updateStrategy=FieldStrategy.ALWAYS)
|
||||
private Integer importantSort;
|
||||
|
||||
/**
|
||||
* 是否参与比较
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Boolean compare;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String ico;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ public class ProductModelVideoItem implements Serializable {
|
|||
*/
|
||||
private String languageCode;
|
||||
|
||||
/**
|
||||
* 类型,0-视频;1:图片
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 视频地址
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ public class ProductPart implements Serializable {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
/**
|
||||
* 部件类型id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelInfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品中心-机型详情 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface ProductModelInfoMapper extends BaseMapper<ProductModelInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ParamsSortListVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelParamVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductParamsItemVO;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelParams;
|
||||
|
|
@ -24,4 +25,10 @@ public interface ProductModelParamsMapper extends BaseMapper<ProductModelParams>
|
|||
void copyItems(Integer oldId, Integer newId);
|
||||
|
||||
List<ProductParamsItemVO> getMainListByLanguage(Integer modelId, String language);
|
||||
|
||||
List<ParamsSortListVO> getMainListForSort(Integer paramId, String language);
|
||||
|
||||
List<ParamsSortListVO> getImportantParamsListForSort(Integer paramId, String language);
|
||||
|
||||
List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductModelInfoAddRequest;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelInfo;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品中心-机型详情 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface IProductModelInfoService extends IService<ProductModelInfo> {
|
||||
|
||||
void add(Integer modelId, List<ProductModelInfoAddRequest> items);
|
||||
|
||||
@Transactional
|
||||
void update(List<ProductModelInfoAddRequest> items);
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@ package com.nflg.mobilebroken.repository.service;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.mobilebroken.common.pojo.request.BatchDeleteRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ParamsSortSaveRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductModelIntroSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductPublishRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ParamsSortListVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelMainParamsItemChildrenVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelParamVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductParamsItemVO;
|
||||
|
|
@ -52,4 +54,14 @@ public interface IProductModelParamsService extends IService<ProductModelParams>
|
|||
List<ProductModelMainParamsItemChildrenVO> getCNList(Integer modelId);
|
||||
|
||||
List<ProductParamsItemVO> getMainListByLanguage(Integer modelId, String language);
|
||||
|
||||
List<ParamsSortListVO> getMainListForSort(Integer paramId,String language);
|
||||
|
||||
void saveMainSort(@Valid ParamsSortSaveRequest request);
|
||||
|
||||
List<ParamsSortListVO> getImportantParamsListForSort(@Valid @NotNull Integer modelParamsId, String language);
|
||||
|
||||
void saveImportantSort(@Valid ParamsSortSaveRequest request);
|
||||
|
||||
List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -694,6 +694,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|||
.throwMessage("随机码不正确");
|
||||
appUser.setState(UserState.Activated.getState());
|
||||
appUser.setPassword(PASSWORDENCODER.encode(request.getPassword()));
|
||||
appUser.setUpdateBy(AppUserUtil.getUserName());
|
||||
appUser.setUpdateTime(LocalDateTime.now());
|
||||
updateById(appUser);
|
||||
}else if (StrUtil.equals("1", type)){
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ public class ProductAttrServiceImpl extends ServiceImpl<ProductAttrMapper, Produ
|
|||
|
||||
@Override
|
||||
public void delete(BatchDeleteRequest request) {
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductAttr::getId, request.getIds())
|
||||
.ne(ProductAttr::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ public class ProductCaseServiceImpl extends ServiceImpl<ProductCaseMapper, Produ
|
|||
.eq(ProductCase::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductCase::getId, request.getIds())
|
||||
.ne(ProductCase::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productCaseInfoService.delete(request.getIds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,10 @@ public class ProductHonorServiceImpl extends ServiceImpl<ProductHonorMapper, Pro
|
|||
.eq(ProductHonor::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductHonor::getId, request.getIds())
|
||||
.ne(ProductHonor::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productHonorInfoService.delete(request.getIds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,10 @@ public class ProductIntroServiceImpl extends ServiceImpl<ProductIntroMapper, Pro
|
|||
.eq(ProductIntro::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductIntro::getId, request.getIds())
|
||||
.ne(ProductIntro::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
introInfoService.delete(request.getIds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ public class ProductMobilebrokenIntroServiceImpl extends ServiceImpl<ProductMobi
|
|||
.eq(ProductMobilebrokenIntro::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductMobilebrokenIntro::getId, request.getIds())
|
||||
.ne(ProductMobilebrokenIntro::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productMobilebrokenIntroInfoService.delete(request.getIds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,10 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
|
|||
.eq(ProductModelFile::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelFile::getId, request.getIds())
|
||||
.ne(ProductModelFile::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ public class ProductModelHotimageServiceImpl extends ServiceImpl<ProductModelHot
|
|||
.eq(ProductModelHotimage::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelHotimage::getId, request.getIds())
|
||||
.ne(ProductModelHotimage::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@ public class ProductModelImageServiceImpl extends ServiceImpl<ProductModelImageM
|
|||
.eq(ProductModelImage::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelImage::getId, request.getIds())
|
||||
.ne(ProductModelImage::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductModelInfoAddRequest;
|
||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelInfo;
|
||||
import com.nflg.mobilebroken.repository.mapper.ProductModelInfoMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IProductModelInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品中心-机型详情 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Service
|
||||
public class ProductModelInfoServiceImpl extends ServiceImpl<ProductModelInfoMapper, ProductModelInfo> implements IProductModelInfoService {
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void add(Integer modelId, List<ProductModelInfoAddRequest> items) {
|
||||
if (CollectionUtil.isNotEmpty(items)){
|
||||
saveBatch(
|
||||
items.stream()
|
||||
.map(it -> new ProductModelInfo()
|
||||
.setModeId(it.getModelId())
|
||||
.setLanguageCode(it.getLanguageCode())
|
||||
.setName(it.getName())
|
||||
.setDesc(it.getDesc())
|
||||
.setUrl(it.getUrl())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void update(List<ProductModelInfoAddRequest> items) {
|
||||
if (CollectionUtil.isNotEmpty(items)){
|
||||
updateBatchById(
|
||||
items.stream()
|
||||
.map(it -> new ProductModelInfo()
|
||||
.setId(it.getId())
|
||||
.setName(it.getName())
|
||||
.setDesc(it.getDesc())
|
||||
.setUrl(it.getUrl())
|
||||
.setUpdateBy(AdminUserUtil.getUserName())
|
||||
.setUpdateTime(LocalDateTime.now())
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -70,6 +70,10 @@ public class ProductModelIntroServiceImpl extends ServiceImpl<ProductModelIntroM
|
|||
.eq(ProductModelIntro::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelIntro::getId, request.getIds())
|
||||
.ne(ProductModelIntro::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,9 @@ public class ProductModelParamsItemServiceImpl extends ServiceImpl<ProductModelP
|
|||
.setName(it.getName())
|
||||
.setValue(it.getValue())
|
||||
.setMain(it.getMain())
|
||||
.setImportant(it.getImportant())
|
||||
.setCompare(it.getCompare())
|
||||
.setIco(it.getIco())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now()))
|
||||
.collect(Collectors.toList())
|
||||
|
|
@ -263,7 +265,9 @@ public class ProductModelParamsItemServiceImpl extends ServiceImpl<ProductModelP
|
|||
.set(ProductModelParamsItem::getName, request.getName())
|
||||
.set(ProductModelParamsItem::getValue, request.getValue())
|
||||
.set(ProductModelParamsItem::getMain, request.getMain())
|
||||
.set(ProductModelParamsItem::getImportant, request.getImportant())
|
||||
.set(ProductModelParamsItem::getCompare, request.getCompare())
|
||||
.set(ProductModelParamsItem::getIco, request.getIco())
|
||||
.set(ProductModelParamsItem::getUpdateBy, AdminUserUtil.getUserName())
|
||||
.set(ProductModelParamsItem::getUpdateTime, LocalDateTime.now())
|
||||
.eq(ProductModelParamsItem::getId, request.getModelParamsItemId())
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.common.constant.PublishState;
|
||||
import com.nflg.mobilebroken.common.pojo.request.BatchDeleteRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ParamsSortSaveRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductModelIntroSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductPublishRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ParamsSortListVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelMainParamsItemChildrenVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelParamVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductParamsItemVO;
|
||||
|
|
@ -85,6 +87,10 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
.eq(ProductModelParams::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelParams::getId, request.getIds())
|
||||
.ne(ProductModelParams::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productModelParamsItemService.deleteByParamsIds(request.getIds());
|
||||
}
|
||||
|
|
@ -240,4 +246,47 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
public List<ProductParamsItemVO> getMainListByLanguage(Integer modelId, String language) {
|
||||
return baseMapper.getMainListByLanguage(modelId,language);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParamsSortListVO> getMainListForSort(Integer paramId,String language) {
|
||||
return baseMapper.getMainListForSort(paramId,language);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void saveMainSort(ParamsSortSaveRequest request) {
|
||||
for (int i = 0; i < request.getBatchNumbers().size(); i++) {
|
||||
productModelParamsItemService.lambdaUpdate()
|
||||
.set(ProductModelParamsItem::getMainSort, i + 1)
|
||||
.set(ProductModelParamsItem::getUpdateBy, AdminUserUtil.getUserName())
|
||||
.set(ProductModelParamsItem::getUpdateTime, LocalDateTime.now())
|
||||
.eq(ProductModelParamsItem::getModelParamsId, request.getModelParamsId())
|
||||
.eq(ProductModelParamsItem::getBatchNumber, request.getBatchNumbers().get(i))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParamsSortListVO> getImportantParamsListForSort(Integer modelParamsId, String language) {
|
||||
return baseMapper.getImportantParamsListForSort(modelParamsId,language);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void saveImportantSort(ParamsSortSaveRequest request) {
|
||||
for (int i = 0; i < request.getBatchNumbers().size(); i++) {
|
||||
productModelParamsItemService.lambdaUpdate()
|
||||
.set(ProductModelParamsItem::getImportantSort, i + 1)
|
||||
.set(ProductModelParamsItem::getUpdateBy, AdminUserUtil.getUserName())
|
||||
.set(ProductModelParamsItem::getUpdateTime, LocalDateTime.now())
|
||||
.eq(ProductModelParamsItem::getModelParamsId, request.getModelParamsId())
|
||||
.eq(ProductModelParamsItem::getBatchNumber, request.getBatchNumbers().get(i))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language) {
|
||||
return baseMapper.getImportantListByLanguage(modelId,language);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -221,6 +220,10 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.eq(ProductModel::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModel::getId, request.getIds())
|
||||
.ne(ProductModel::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productPartParamsService.deleteByModel(request.getIds());
|
||||
productModelIntroService.deleteByModel(request.getIds());
|
||||
|
|
@ -305,7 +308,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.setHotImage(productModelHotimageService.getListByLanguage(modelId))
|
||||
.setParams(productPartParamsService.getAListByLanguage(modelId, language))
|
||||
.setMainParams(productPartParamsService.getMainListByLanguage(modelId, language))
|
||||
.setImages(productModelImageService.getListByLanguage(modelId, language))
|
||||
.setImportantParams(productPartParamsService.getImportantListByLanguage(modelId, language))
|
||||
.setVideos(productModelVideoService.getListByLanguage(modelId, language))
|
||||
.setFiles(productModelFileService.getListByLanguage(modelId, language));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public class ProductModelVideoItemServiceImpl extends ServiceImpl<ProductModelVi
|
|||
.map(it -> new ProductModelVideoItem()
|
||||
.setModelVideoId(videoId)
|
||||
.setLanguageCode(it.getLanguageCode())
|
||||
.setType(it.getType())
|
||||
.setVideo(it.getVideo())
|
||||
.setContent(it.getContent())
|
||||
.setImage(it.getImage())
|
||||
|
|
@ -49,6 +50,7 @@ public class ProductModelVideoItemServiceImpl extends ServiceImpl<ProductModelVi
|
|||
items.stream()
|
||||
.map(it -> new ProductModelVideoItem()
|
||||
.setId(it.getId())
|
||||
.setType(it.getType())
|
||||
.setContent(it.getContent())
|
||||
.setImage(it.getImage())
|
||||
.setVideo(it.getVideo())
|
||||
|
|
@ -66,6 +68,7 @@ public class ProductModelVideoItemServiceImpl extends ServiceImpl<ProductModelVi
|
|||
.map(it -> new ProductModelVideoItemAddRequest()
|
||||
.setId(it.getId())
|
||||
.setLanguageCode(it.getLanguageCode())
|
||||
.setType(it.getType())
|
||||
.setContent(it.getContent())
|
||||
.setImage(it.getImage())
|
||||
.setVideo(it.getVideo())
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ public class ProductModelVideoServiceImpl extends ServiceImpl<ProductModelVideoM
|
|||
.eq(ProductModelVideo::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductModelVideo::getId, request.getIds())
|
||||
.ne(ProductModelVideo::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, Produ
|
|||
ProductPart part = new ProductPart()
|
||||
.setName(cn.getName())
|
||||
.setAttrId(request.getAttrId())
|
||||
.setDescribe(request.getDescribe())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
save(part);
|
||||
|
|
@ -67,6 +68,7 @@ public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, Produ
|
|||
lambdaUpdate()
|
||||
.set(ProductPart::getAttrId, request.getAttrId())
|
||||
.set(ProductPart::getName, cn.getName())
|
||||
.set(ProductPart::getDescribe, request.getDescribe())
|
||||
.set(ProductPart::getUpdateBy, AdminUserUtil.getUserName())
|
||||
.set(ProductPart::getUpdateTime, LocalDateTime.now())
|
||||
.eq(ProductPart::getId, request.getId())
|
||||
|
|
@ -105,6 +107,10 @@ public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, Produ
|
|||
@Transactional
|
||||
@Override
|
||||
public void delete(BatchDeleteRequest request) {
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductPart::getId, request.getIds())
|
||||
.ne(ProductPart::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productPartInfoService.delete(request.getIds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,10 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesMapper, P
|
|||
.eq(ProductSeries::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductSeries::getId, request.getIds())
|
||||
.ne(ProductSeries::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
Set<String> numbers = lambdaQuery()
|
||||
.in(ProductSeries::getId, request.getIds())
|
||||
.list()
|
||||
|
|
|
|||
|
|
@ -169,6 +169,10 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
.eq(ProductType::getState, PublishState.Published.getState())
|
||||
.exists())
|
||||
.throwMessage("禁止删除已发布的数据");
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
.in(ProductType::getId, request.getIds())
|
||||
.ne(ProductType::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
List<ProductType> list = lambdaQuery()
|
||||
.in(ProductType::getId, request.getIds())
|
||||
.list();
|
||||
|
|
|
|||
|
|
@ -91,13 +91,14 @@
|
|||
UNION
|
||||
SELECT u.id,u.user_phone AS 'phone',0 AS 'userState',u.title_id AS 'titleId',u.area_id AS 'areaId',u.company_id AS 'companyId'
|
||||
,p.position_name AS 'title',null AS 'expireTime',c.agency_company_name AS 'companyName',u.user_email AS 'loginName'
|
||||
,u.user_name AS 'name',u.user_email AS 'email',u.user_avatar AS 'avatar',a.`name` AS 'areaName',u.create_by AS 'createBy'
|
||||
,u.user_name AS 'name',u.user_email AS 'email',u.user_avatar AS 'avatar',a.`name` AS 'areaName',cau.name AS 'createBy'
|
||||
,u.create_time AS 'createTime',u.update_by AS 'updateBy',null AS 'updateTime',null AS 'lastLoginTime',null AS 'expireTime'
|
||||
,false AS 'isPrimary',0 AS 'state',u.language_code AS 'languageCode'
|
||||
FROM app_user_applyfor u
|
||||
INNER JOIN t_base_customer c ON u.company_id=c.id
|
||||
INNER JOIN app_area a ON u.area_id=a.id
|
||||
LEFT JOIN t_base_position p ON u.title_id=p.id
|
||||
LEFT JOIN app_user cau ON u.create_by=cau.id
|
||||
WHERE u.state=0 AND u.company_id=#{companyId}
|
||||
<if test="state > 0">
|
||||
AND 1=2
|
||||
|
|
|
|||
|
|
@ -37,8 +37,30 @@
|
|||
WHERE pmp.model_id = #{modelId}
|
||||
AND pmp.state = 1
|
||||
AND pmpi.main = 1
|
||||
AND pmpi.compare = 1
|
||||
AND pmpi.language_code = #{language}
|
||||
ORDER BY pmp.id DESC
|
||||
ORDER BY pmpi.main_sort
|
||||
</select>
|
||||
|
||||
<select id="getMainListForSort" resultType="com.nflg.mobilebroken.common.pojo.vo.ParamsSortListVO">
|
||||
select batch_number,name,main_sort as 'sort'
|
||||
from product_model_params_item
|
||||
where main and model_params_id=#{paramId} and language_code=#{language}
|
||||
</select>
|
||||
|
||||
<select id="getImportantParamsListForSort" resultType="com.nflg.mobilebroken.common.pojo.vo.ParamsSortListVO">
|
||||
select batch_number,name,important_sort as 'sort'
|
||||
from product_model_params_item
|
||||
where important and model_params_id=#{paramId} and language_code=#{language}
|
||||
</select>
|
||||
|
||||
<select id="getImportantListByLanguage" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductParamsItemVO">
|
||||
SELECT pmpi.*
|
||||
FROM product_model_params pmp
|
||||
INNER JOIN product_model_params_item pmpi ON pmp.id = pmpi.model_params_id
|
||||
WHERE pmp.model_id = #{modelId}
|
||||
AND pmp.state = 1
|
||||
AND pmpi.important = 1
|
||||
AND pmpi.language_code = #{language}
|
||||
ORDER BY pmpi.important_sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ public class CodeGenerator {
|
|||
, Paths.get(System.getProperty("user.dir")) + "/src/main/resources/mapper"))
|
||||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder
|
||||
.addInclude("^product_model_intro.*") //只生成指定表
|
||||
// .addInclude("product")
|
||||
builder.addInclude("anonymous_ticket") //只生成指定表
|
||||
.entityBuilder()
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
Loading…
Reference in New Issue