feat: 产品中心

This commit is contained in:
曹鹏飞 2025-06-20 15:21:31 +08:00
parent 91297cc2f1
commit 0a7d7ac9fd
38 changed files with 187 additions and 88 deletions

View File

@ -25,10 +25,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.alibaba.cloud</groupId> <!-- <groupId>com.alibaba.cloud</groupId>-->
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
@ -67,7 +67,7 @@
<dependency> <dependency>
<groupId>ognl</groupId> <groupId>ognl</groupId>
<artifactId>ognl</artifactId> <artifactId>ognl</artifactId>
<version>3.1.26</version> <version>3.4.3</version>
</dependency> </dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>com.itextpdf</groupId>--> <!-- <groupId>com.itextpdf</groupId>-->
@ -84,6 +84,12 @@
<groupId>org.xhtmlrenderer</groupId> <groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId> <artifactId>flying-saucer-pdf</artifactId>
<version>9.3.1</version> <version>9.3.1</version>
<exclusions>
<exclusion>
<artifactId>bcprov-jdk14</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- iText (required by Flying Saucer) --> <!-- iText (required by Flying Saucer) -->
<dependency> <dependency>
@ -122,12 +128,18 @@
<dependency> <dependency>
<groupId>com.aliyun</groupId> <groupId>com.aliyun</groupId>
<artifactId>alimt20181012</artifactId> <artifactId>alimt20181012</artifactId>
<version>1.4.0</version> <version>1.5.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.aliyun</groupId> <groupId>com.aliyun</groupId>
<artifactId>tea-openapi</artifactId> <artifactId>tea-openapi</artifactId>
<version>0.3.8</version> <version>0.3.9</version>
<exclusions>
<exclusion>
<artifactId>dom4j</artifactId>
<groupId>org.dom4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -9,6 +9,7 @@ import com.nflg.mobilebroken.common.pojo.request.AdvertisementSaveRequest;
import com.nflg.mobilebroken.common.pojo.request.PageRequest; import com.nflg.mobilebroken.common.pojo.request.PageRequest;
import com.nflg.mobilebroken.common.pojo.vo.AdvertisementListVO; import com.nflg.mobilebroken.common.pojo.vo.AdvertisementListVO;
import com.nflg.mobilebroken.common.pojo.vo.AdvertisementVO; import com.nflg.mobilebroken.common.pojo.vo.AdvertisementVO;
import com.nflg.mobilebroken.common.util.MultilingualUtil;
import com.nflg.mobilebroken.repository.entity.DictionaryItem; import com.nflg.mobilebroken.repository.entity.DictionaryItem;
import com.nflg.mobilebroken.repository.service.IAdvertisementService; import com.nflg.mobilebroken.repository.service.IAdvertisementService;
import com.nflg.mobilebroken.repository.service.IDictionaryItemService; import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
@ -43,7 +44,7 @@ public class AdvertisementController extends ControllerBase{
@GetMapping("getType") @GetMapping("getType")
@ApiMark(moduleName = "广告", apiName = "获取广告类型",isPublic = true) @ApiMark(moduleName = "广告", apiName = "获取广告类型",isPublic = true)
public ApiResult<List<DictionaryItem>> getType(){ public ApiResult<List<DictionaryItem>> getType(){
return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_AD_TYPE)); return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_AD_TYPE, MultilingualUtil.getLanguage()));
} }
/** /**
@ -53,7 +54,7 @@ public class AdvertisementController extends ControllerBase{
@GetMapping("getPosition") @GetMapping("getPosition")
@ApiMark(moduleName = "广告", apiName = "获取广告位置",isPublic = true) @ApiMark(moduleName = "广告", apiName = "获取广告位置",isPublic = true)
public ApiResult<List<DictionaryItem>> getPosition(){ public ApiResult<List<DictionaryItem>> getPosition(){
return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_AD_POSITION)); return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_AD_POSITION, MultilingualUtil.getLanguage()));
} }
/** /**

View File

@ -4,7 +4,7 @@ package com.nflg.mobilebroken.admin.controller;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.mobilebroken.admin.annotation.ApiMark; import com.nflg.mobilebroken.admin.annotation.ApiMark;
import com.nflg.mobilebroken.admin.constant.Constant; import com.nflg.mobilebroken.admin.constant.Constant;
@ -79,7 +79,7 @@ public class PositionController extends ControllerBase {
List<Language> allLanguage = languageService.lambdaQuery().eq(Language::getEnable, true).list(); List<Language> allLanguage = languageService.lambdaQuery().eq(Language::getEnable, true).list();
Map<String, String> positionLanguageMp=new HashMap<>(); Map<String, String> positionLanguageMp=new HashMap<>();
if(StrUtil.isNotBlank(ent.getPositionLanguage())) { if(StrUtil.isNotBlank(ent.getPositionLanguage())) {
List<PositionLanguageVO> positionLanguage = JSON.parseArray(ent.getPositionLanguage(), PositionLanguageVO.class); List<PositionLanguageVO> positionLanguage = JSONUtil.toList(ent.getPositionLanguage(), PositionLanguageVO.class);
positionLanguageMp = positionLanguage.stream().filter(u->StrUtil.isNotBlank(u.getLanguageValue()) ) positionLanguageMp = positionLanguage.stream().filter(u->StrUtil.isNotBlank(u.getLanguageValue()) )
.collect(Collectors.toMap(PositionLanguageVO::getCode, PositionLanguageVO::getLanguageValue)); .collect(Collectors.toMap(PositionLanguageVO::getCode, PositionLanguageVO::getLanguageValue));
} }
@ -113,7 +113,7 @@ public class PositionController extends ControllerBase {
@ApiMark(moduleName = "职位管理", apiName = "新增") @ApiMark(moduleName = "职位管理", apiName = "新增")
public ApiResult<Boolean> add(@Valid @RequestBody PositionDetailDTO positionDetailDto) { public ApiResult<Boolean> add(@Valid @RequestBody PositionDetailDTO positionDetailDto) {
TBasePosition ent = Convert.convert(TBasePosition.class, positionDetailDto); TBasePosition ent = Convert.convert(TBasePosition.class, positionDetailDto);
ent.setPositionLanguage(JSON.toJSONString(positionDetailDto.getLanguage())); ent.setPositionLanguage(JSONUtil.toJsonStr(positionDetailDto.getLanguage()));
ent.setPositionCode(UniqueSequenceGenerator.generateCode(Constant.JobCodePrefix)); ent.setPositionCode(UniqueSequenceGenerator.generateCode(Constant.JobCodePrefix));
ent.setDataCreateUserNo(AdminUserUtil.getUserNo()); ent.setDataCreateUserNo(AdminUserUtil.getUserNo());
ent.setDataCreateUserName(AdminUserUtil.getUserName()); ent.setDataCreateUserName(AdminUserUtil.getUserName());
@ -132,7 +132,7 @@ public class PositionController extends ControllerBase {
VUtils.trueThrow(positionDetailDto.getId()<=0).throwMessage(STATE.ParamErr,"编辑时ID不能等于0"); VUtils.trueThrow(positionDetailDto.getId()<=0).throwMessage(STATE.ParamErr,"编辑时ID不能等于0");
TBasePosition ent = Convert.convert(TBasePosition.class, positionDetailDto); TBasePosition ent = Convert.convert(TBasePosition.class, positionDetailDto);
ent.setPositionCode(null); ent.setPositionCode(null);
ent.setPositionLanguage(JSON.toJSONString(positionDetailDto.getLanguage())); ent.setPositionLanguage(JSONUtil.toJsonStr(positionDetailDto.getLanguage()));
ent.setDataModifyUserNo(AdminUserUtil.getUserNo()); ent.setDataModifyUserNo(AdminUserUtil.getUserNo());
ent.setDataModifyUserName(AdminUserUtil.getUserName()); ent.setDataModifyUserName(AdminUserUtil.getUserName());
ent.setDataModifyTime(LocalDateTime.now()); ent.setDataModifyTime(LocalDateTime.now());

View File

@ -837,10 +837,11 @@ public class ProductModelController extends ControllerBase{
/** /**
* 获取图册列表用于排序 * 获取图册列表用于排序
* @param modelId 机型ID
*/ */
@GetMapping("/getImageListForSort") @GetMapping("/getImageListForSort")
public ApiResult<List<ProductModelImage>> getImageListForSort(){ public ApiResult<List<ProductModelImage>> getImageListForSort(@Valid @RequestParam @NotNull Integer modelId){
return ApiResult.success(productModelImageService.getListForSort()); return ApiResult.success(productModelImageService.getListForSort(modelId));
} }
/** /**
@ -922,10 +923,11 @@ public class ProductModelController extends ControllerBase{
/** /**
* 获取视频列表用于排序 * 获取视频列表用于排序
* @param modelId 机型ID
*/ */
@GetMapping("/getVideoListForSort") @GetMapping("/getVideoListForSort")
public ApiResult<List<ProductModelVideo>> getVideoListForSort(){ public ApiResult<List<ProductModelVideo>> getVideoListForSort(@Valid @RequestParam @NotNull Integer modelId){
return ApiResult.success(productModelVideoService.getListForSort()); return ApiResult.success(productModelVideoService.getListForSort(modelId));
} }
/** /**
@ -1031,10 +1033,11 @@ public class ProductModelController extends ControllerBase{
/** /**
* 获取资料列表用于排序 * 获取资料列表用于排序
* @param modelId 机型ID
*/ */
@GetMapping("/getFileListForSort") @GetMapping("/getFileListForSort")
public ApiResult<List<ProductModelFile>> getFileListForSort(){ public ApiResult<List<ProductModelFile>> getFileListForSort(@Valid @RequestParam @NotNull Integer modelId){
return ApiResult.success(productModelFileService.getListForSort()); return ApiResult.success(productModelFileService.getListForSort(modelId));
} }
/** /**

View File

@ -3,7 +3,8 @@ package com.nflg.mobilebroken.admin.service;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.nflg.mobilebroken.admin.constant.DeviceSourceFromEnum; import com.nflg.mobilebroken.admin.constant.DeviceSourceFromEnum;
import com.nflg.mobilebroken.admin.pojo.dto.DeviceDTO; import com.nflg.mobilebroken.admin.pojo.dto.DeviceDTO;
@ -145,8 +146,8 @@ public class AdminDeviceService {
ent.setDeviceTypeSub(u.getAssetProductLine4__c()); ent.setDeviceTypeSub(u.getAssetProductLine4__c());
ent.setModelNo(u.getProductLine5__c()); ent.setModelNo(u.getProductLine5__c());
if (StrUtil.isNotBlank(u.getAccount())) { if (StrUtil.isNotBlank(u.getAccount())) {
JSONObject jsonObject = JSONObject.parseObject(u.getAccount()); JSONObject jsonObject = JSONUtil.parseObj(u.getAccount());
String cname = jsonObject.getString("Name"); String cname = jsonObject.getStr("Name");
ent.setCustomerName(cname); ent.setCustomerName(cname);
} }

View File

@ -3,8 +3,8 @@ package com.nflg.mobilebroken.admin.service;
import cn.hutool.cache.CacheUtil; import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache; import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSONObject; import cn.hutool.json.JSONUtil;
import com.nflg.mobilebroken.admin.pojo.dto.CrmGetTokenResultDTO; import com.nflg.mobilebroken.admin.pojo.dto.CrmGetTokenResultDTO;
import com.nflg.mobilebroken.admin.pojo.dto.SyncFromCrmDTO; import com.nflg.mobilebroken.admin.pojo.dto.SyncFromCrmDTO;
import com.nflg.mobilebroken.admin.pojo.vo.CmrAgentResultVO; import com.nflg.mobilebroken.admin.pojo.vo.CmrAgentResultVO;
@ -74,7 +74,7 @@ public class CrmService {
paramMp.put("password", password); paramMp.put("password", password);
paramMp.put("client_secret", clientSecret); paramMp.put("client_secret", clientSecret);
String s = httpUtils.doformPost(tokenUrl, paramMp); String s = httpUtils.doformPost(tokenUrl, paramMp);
CrmGetTokenResultDTO result = JSONObject.parseObject(s, CrmGetTokenResultDTO.class); CrmGetTokenResultDTO result = JSONUtil.toBean(s, CrmGetTokenResultDTO.class);
if (Objects.nonNull(result) && StrUtil.isNotBlank(result.getAccess_token())) { if (Objects.nonNull(result) && StrUtil.isNotBlank(result.getAccess_token())) {
crmTokenCache.put(tokenCacheKey, result.getAccess_token()); crmTokenCache.put(tokenCacheKey, result.getAccess_token());
@ -101,12 +101,12 @@ public class CrmService {
// Map<String, String> reBody = new HashMap<>(); // Map<String, String> reBody = new HashMap<>();
// reBody.put("CrLsDate", date); // reBody.put("CrLsDate", date);
String token = StrUtil.join(" ", "Bearer", getToken()); String token = StrUtil.join(" ", "Bearer", getToken());
String orderResult = httpUtils.doPost(getAgentUrl, JSON.toJSONString(dateParam), token); String orderResult = httpUtils.doPost(getAgentUrl, JSONUtil.toJsonStr(dateParam), token);
JSONObject jsonObject = JSONObject.parseObject(orderResult); JSONObject jsonObject = JSONUtil.parseObj(orderResult);
String code = jsonObject.getString("code"); String code = jsonObject.getStr("code");
if (Objects.equals(code, "0")) { if (Objects.equals(code, "0")) {
String dataResult = jsonObject.getString("jsonData"); String dataResult = jsonObject.getStr("jsonData");
return JSON.parseArray(dataResult, CmrAgentResultVO.class); return JSONUtil.toList(dataResult, CmrAgentResultVO.class);
} }
} catch (Exception ex) { } catch (Exception ex) {
throw new NflgException(STATE.BusinessError, ex.getMessage()); throw new NflgException(STATE.BusinessError, ex.getMessage());
@ -125,12 +125,12 @@ public class CrmService {
Map<String, String> reBody = new HashMap<>(); Map<String, String> reBody = new HashMap<>();
// reBody.put("CrLsDate", startDate); // reBody.put("CrLsDate", startDate);
String token = StrUtil.join(" ", "Bearer", getToken()); String token = StrUtil.join(" ", "Bearer", getToken());
String orderResult = httpUtils.doPost(getDeviceUrl, JSON.toJSONString(dateParam), token); String orderResult = httpUtils.doPost(getDeviceUrl, JSONUtil.toJsonStr(dateParam), token);
JSONObject jsonObject = JSONObject.parseObject(orderResult); JSONObject jsonObject = JSONUtil.parseObj(orderResult);
String code = jsonObject.getString("code"); String code = jsonObject.getStr("code");
if (Objects.equals(code, "0")) { if (Objects.equals(code, "0")) {
String dataResult = jsonObject.getString("jsonData"); String dataResult = jsonObject.getStr("jsonData");
return JSON.parseArray(dataResult, CmrDeviceResultVO.class); return JSONUtil.toList(dataResult, CmrDeviceResultVO.class);
} }
} catch (Exception ex) { } catch (Exception ex) {
throw new NflgException(STATE.BusinessError, ex.getMessage()); throw new NflgException(STATE.BusinessError, ex.getMessage());

View File

@ -16,10 +16,10 @@
<groupId>com.nflg</groupId> <groupId>com.nflg</groupId>
<artifactId>nflg-mobilebroken-repository</artifactId> <artifactId>nflg-mobilebroken-repository</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.alibaba.cloud</groupId> <!-- <groupId>com.alibaba.cloud</groupId>-->
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

View File

@ -21,13 +21,11 @@ public class ProductIntroInfoAddRequest {
/** /**
* 标题 * 标题
*/ */
@NotBlank
private String name; private String name;
/** /**
* 内容 * 内容
*/ */
@NotBlank
private String desc; private String desc;
/** /**

View File

@ -26,6 +26,16 @@ public class FrontendProductModelSearchVO {
*/ */
private String typeName; private String typeName;
/**
* 系列批次号
*/
private String seriesNumber;
/**
* 类型批次号
*/
private String typeNumber;
/** /**
* 名称 * 名称
*/ */

View File

@ -2,6 +2,8 @@ package com.nflg.mobilebroken.common.pojo.vo;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class ProductSeriesSimpleVO { public class ProductSeriesSimpleVO {
@ -14,4 +16,9 @@ public class ProductSeriesSimpleVO {
* 批次号 * 批次号
*/ */
private String batchNumber; private String batchNumber;
/**
* 类型列表
*/
private List<ProductTypeSimpleVO> types;
} }

View File

@ -0,0 +1,17 @@
package com.nflg.mobilebroken.common.pojo.vo;
import lombok.Data;
@Data
public class ProductTypeSimpleVO {
/**
* 名称
*/
private String name;
/**
* 批次号
*/
private String batchNumber;
}

View File

@ -25,10 +25,10 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId> <artifactId>spring-cloud-starter-gateway</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.alibaba.cloud</groupId> <!-- <groupId>com.alibaba.cloud</groupId>-->
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

View File

@ -25,10 +25,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.alibaba.cloud</groupId> <!-- <groupId>com.alibaba.cloud</groupId>-->
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

View File

@ -74,7 +74,7 @@ public class InfoController extends BaseController{
*/ */
@GetMapping("/getModuleList") @GetMapping("/getModuleList")
public ApiResult<List<ModuleVO>> getModuleList(){ public ApiResult<List<ModuleVO>> getModuleList(){
List<DictionaryItem> items = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_PRODUCT_MODULE); List<DictionaryItem> items = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_PRODUCT_MODULE, MultilingualUtil.getLanguage());
return ApiResult.success(items.stream().map(it -> new ModuleVO() return ApiResult.success(items.stream().map(it -> new ModuleVO()
.setId(it.getId()) .setId(it.getId())
.setName(it.getName()) .setName(it.getName())

View File

@ -22,7 +22,7 @@ public interface DictionaryItemMapper extends BaseMapper<DictionaryItem> {
String getName(String dictionaryCode, String itemCode); String getName(String dictionaryCode, String itemCode);
List<DictionaryItem> getListByDictionaryCode(String code); List<DictionaryItem> getListByDictionaryCode(String code,String language);
DictionaryItem getByCode(String dictionaryCode, String dictionaryItemCode); DictionaryItem getByCode(String dictionaryCode, String dictionaryItemCode);
} }

View File

@ -27,4 +27,6 @@ public interface ProductModelMapper extends BaseMapper<ProductModel> {
Page<FrontendProductModelSearchVO> search(String name, String language, Page<?> page); Page<FrontendProductModelSearchVO> search(String name, String language, Page<?> page);
List<ProductModelSimpleVO> getSimpleList(String typeNumber); List<ProductModelSimpleVO> getSimpleList(String typeNumber);
List<ProductModelSearchVO> getListForSort();
} }

View File

@ -30,4 +30,8 @@ public interface ProductTypeMapper extends BaseMapper<ProductType> {
List<ProductFileVO> getFilesByLanguage(Integer moduleId, String seriesNumber, String language); List<ProductFileVO> getFilesByLanguage(Integer moduleId, String seriesNumber, String language);
List<ProductSeriesSimpleVO> getSimpleList(String seriesNumber); List<ProductSeriesSimpleVO> getSimpleList(String seriesNumber);
List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language);
List<ProductTypeSearchVO> getListForSort();
} }

View File

@ -26,5 +26,7 @@ public interface IDictionaryItemService extends IService<DictionaryItem> {
List<DictionaryItem> getListByDictionaryCode(String code); List<DictionaryItem> getListByDictionaryCode(String code);
List<DictionaryItem> getListByDictionaryCode(String code,String language);
DictionaryItem getByCode(String dictionaryCode, String DictionaryItemCode); DictionaryItem getByCode(String dictionaryCode, String DictionaryItemCode);
} }

View File

@ -39,7 +39,7 @@ public interface IProductModelFileService extends IService<ProductModelFile> {
void deleteByModel(@NotEmpty List<Integer> ids); void deleteByModel(@NotEmpty List<Integer> ids);
List<ProductModelFile> getListForSort(); List<ProductModelFile> getListForSort(Integer modelId);
void saveSort(SortSaveRequest request); void saveSort(SortSaveRequest request);

View File

@ -39,7 +39,7 @@ public interface IProductModelImageService extends IService<ProductModelImage> {
void deleteByModel(@NotEmpty List<Integer> ids); void deleteByModel(@NotEmpty List<Integer> ids);
List<ProductModelImage> getListForSort(); List<ProductModelImage> getListForSort(Integer modelId);
void saveSort(SortSaveRequest request); void saveSort(SortSaveRequest request);

View File

@ -39,7 +39,7 @@ public interface IProductModelVideoService extends IService<ProductModelVideo> {
void deleteByModel(@NotEmpty List<Integer> ids); void deleteByModel(@NotEmpty List<Integer> ids);
List<ProductModelVideo> getListForSort(); List<ProductModelVideo> getListForSort(Integer modelId);
void saveSort(SortSaveRequest request); void saveSort(SortSaveRequest request);

View File

@ -36,7 +36,7 @@ public interface IProductSeriesService extends IService<ProductSeries> {
List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId); List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId);
List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId,String language); List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId, String language);
ProductSeriesInfoVO getInfo(@Valid @NotNull Integer seriesId); ProductSeriesInfoVO getInfo(@Valid @NotNull Integer seriesId);

View File

@ -49,4 +49,6 @@ public interface IProductTypeService extends IService<ProductType> {
List<ProductFileVO> getFilesByLanguage(@Valid @NotNull Integer moduleId, String seriesNumber, String language); List<ProductFileVO> getFilesByLanguage(@Valid @NotNull Integer moduleId, String seriesNumber, String language);
ProductTypeLanguageInfoVO getInfoByLanguage(@Valid @NotNull String typeNumber, String language); ProductTypeLanguageInfoVO getInfoByLanguage(@Valid @NotNull String typeNumber, String language);
List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language);
} }

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nflg.mobilebroken.common.constant.Constant;
import com.nflg.mobilebroken.common.pojo.request.DictionaryItemSearchRequest; import com.nflg.mobilebroken.common.pojo.request.DictionaryItemSearchRequest;
import com.nflg.mobilebroken.common.pojo.request.SaveDictionaryItemRequest; import com.nflg.mobilebroken.common.pojo.request.SaveDictionaryItemRequest;
import com.nflg.mobilebroken.common.pojo.request.TranslateMap; import com.nflg.mobilebroken.common.pojo.request.TranslateMap;
@ -133,7 +134,12 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
@Override @Override
public List<DictionaryItem> getListByDictionaryCode(String code) { public List<DictionaryItem> getListByDictionaryCode(String code) {
return baseMapper.getListByDictionaryCode(code); return getListByDictionaryCode(code, Constant.DEFAULT_LANGUAGE_CODE);
}
@Override
public List<DictionaryItem> getListByDictionaryCode(String code,String language) {
return baseMapper.getListByDictionaryCode(code,language);
} }
@Override @Override

View File

@ -189,10 +189,11 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
} }
@Override @Override
public List<ProductModelFile> getListForSort() { public List<ProductModelFile> getListForSort(Integer modelId) {
return lambdaQuery() return lambdaQuery()
.eq(ProductModelFile::getEnable, true) .eq(ProductModelFile::getEnable, true)
.eq(ProductModelFile::getState, PublishState.Published.getState()) .eq(ProductModelFile::getState, PublishState.Published.getState())
.eq(ProductModelFile::getModelId, modelId)
.orderByAsc(ProductModelFile::getSort) .orderByAsc(ProductModelFile::getSort)
.list(); .list();
} }

View File

@ -178,10 +178,11 @@ public class ProductModelImageServiceImpl extends ServiceImpl<ProductModelImageM
} }
@Override @Override
public List<ProductModelImage> getListForSort() { public List<ProductModelImage> getListForSort(Integer modelId) {
return lambdaQuery() return lambdaQuery()
.eq(ProductModelImage::getEnable, true) .eq(ProductModelImage::getEnable, true)
.eq(ProductModelImage::getState, PublishState.Published.getState()) .eq(ProductModelImage::getState, PublishState.Published.getState())
.eq(ProductModelImage::getModelId, modelId)
.orderByAsc(ProductModelImage::getSort) .orderByAsc(ProductModelImage::getSort)
.list(); .list();
} }

View File

@ -353,13 +353,15 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
@Override @Override
public List<ProductModelSearchVO> getListForSort() { public List<ProductModelSearchVO> getListForSort() {
return Convert.toList(ProductModelSearchVO.class, // return Convert.toList(ProductModelSearchVO.class,
lambdaQuery() // lambdaQuery()
.eq(ProductModel::getEnable, true) // .eq(ProductModel::getEnable, true)
.eq(ProductModel::getState, PublishState.Published.getState()) // .eq(ProductModel::getState, PublishState.Published.getState())
.orderByAsc(ProductModel::getSort) // .eq(ProductModel::getTypeNumber, typeNumber)
.list() // .orderByAsc(ProductModel::getSort)
); // .list()
// );
return baseMapper.getListForSort();
} }
@Transactional @Transactional

View File

@ -178,10 +178,11 @@ public class ProductModelVideoServiceImpl extends ServiceImpl<ProductModelVideoM
} }
@Override @Override
public List<ProductModelVideo> getListForSort() { public List<ProductModelVideo> getListForSort(Integer modelId) {
return lambdaQuery() return lambdaQuery()
.eq(ProductModelVideo::getEnable, true) .eq(ProductModelVideo::getEnable, true)
.eq(ProductModelVideo::getState, PublishState.Published.getState()) .eq(ProductModelVideo::getState, PublishState.Published.getState())
.eq(ProductModelVideo::getModelId, modelId)
.orderByAsc(ProductModelVideo::getSort) .orderByAsc(ProductModelVideo::getSort)
.list(); .list();
} }

View File

@ -205,7 +205,11 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesMapper, P
@Override @Override
public List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId, String language) { public List<ProductSeriesSimpleVO> getSimpleList(Integer moduleId, String language) {
return baseMapper.getSimpleListByLanguage(moduleId,language); List<ProductSeriesSimpleVO> list = baseMapper.getSimpleListByLanguage(moduleId,language);
list.forEach(item->{
item.setTypes(productTypeService.getSimpleListByLanguage(item.getBatchNumber(),language));
});
return list;
} }
@Override @Override

View File

@ -1,7 +1,6 @@
package com.nflg.mobilebroken.repository.service.impl; package com.nflg.mobilebroken.repository.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -264,13 +263,7 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
@Override @Override
public List<ProductTypeSearchVO> getListForSort() { public List<ProductTypeSearchVO> getListForSort() {
return Convert.toList(ProductTypeSearchVO.class, return baseMapper.getListForSort();
lambdaQuery()
.eq(ProductType::getEnable, true)
.eq(ProductType::getState, PublishState.Published.getState())
.orderByAsc(ProductType::getSort)
.list()
);
} }
@Transactional @Transactional
@ -314,6 +307,11 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
return productTypeInfoService.getInfoByLanguage(typeNumber,language); return productTypeInfoService.getInfoByLanguage(typeNumber,language);
} }
@Override
public List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language) {
return baseMapper.getSimpleListByLanguage(batchNumber,language);
}
private void delete(Integer typeId){ private void delete(Integer typeId){
ProductType info=getById(typeId); ProductType info=getById(typeId);
removeById(typeId); removeById(typeId);

View File

@ -53,7 +53,7 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
@Override @Override
public List<SolutionReviewDepartmentVO> getByTicket(Integer ticketId) { public List<SolutionReviewDepartmentVO> getByTicket(Integer ticketId) {
List<DictionaryItem> items=dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_REVIEW_DEPARTMENT); List<DictionaryItem> items=dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_REVIEW_DEPARTMENT,Constant.DEFAULT_LANGUAGE_CODE);
List<SolutionReviewDepartmentVO> vos=baseMapper.getByTicket(ticketId); List<SolutionReviewDepartmentVO> vos=baseMapper.getByTicket(ticketId);
items.forEach(item->{ items.forEach(item->{
if (vos.stream().noneMatch(vo->vo.getDeptName().equals(item.getName()))){ if (vos.stream().noneMatch(vo->vo.getDeptName().equals(item.getName()))){

View File

@ -56,7 +56,7 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在"); VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
List<DictionaryItem> initial= new ArrayList<>(); List<DictionaryItem> initial= new ArrayList<>();
if (Objects.equals(ticket.getState(), TicketState.Processing.getState()) || Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState())) { if (Objects.equals(ticket.getState(), TicketState.Processing.getState()) || Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState())) {
initial = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_MEASURES); initial = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_MEASURES,Constant.DEFAULT_LANGUAGE_CODE);
} }
List<TicketSolution> solutions = lambdaQuery().eq(TicketSolution::getTicketId, ticketId).orderByAsc(TicketSolution::getId).list(); List<TicketSolution> solutions = lambdaQuery().eq(TicketSolution::getTicketId, ticketId).orderByAsc(TicketSolution::getId).list();
Map<String, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList())); Map<String, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList()));

View File

@ -10,9 +10,10 @@
</select> </select>
<select id="getListByDictionaryCode" resultType="com.nflg.mobilebroken.repository.entity.DictionaryItem"> <select id="getListByDictionaryCode" resultType="com.nflg.mobilebroken.repository.entity.DictionaryItem">
SELECT di.* SELECT ifnull(dit.value,di.`name`) as 'name',di.*
FROM dictionary d FROM dictionary d
INNER JOIN dictionary_item di ON d.id=di.dictionary_id INNER JOIN dictionary_item di ON d.id=di.dictionary_id
LEFT JOIN dictionary_item_translate dit ON dit.dictionary_item_id=di.id and dit.language_code=#{language}
WHERE d.`code`=#{code} WHERE d.`code`=#{code}
ORDER BY di.id ORDER BY di.id
</select> </select>

View File

@ -83,4 +83,12 @@
ORDER BY recommend DESC,sort,id DESC ORDER BY recommend DESC,sort,id DESC
LIMIT 8 LIMIT 8
</select> </select>
<select id="getListForSort" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductModelSearchVO">
select *
,(SELECT `name` FROM product_type WHERE batch_number=type_number AND state!=2 ORDER BY state DESC LIMIT 1) as 'typeName'
from product_model
where enable=1 and state=1
order by typeName, sort
</select>
</mapper> </mapper>

View File

@ -82,4 +82,22 @@
from product_type from product_type
where enable=1 and state!=2 where enable=1 and state!=2
</select> </select>
<select id="getSimpleListByLanguage" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeSimpleVO">
select pt.batch_number, pti.name
from product_type pt
LEFT JOIN product_type_info pti ON pti.type_id = pt.id
where pt.state = 1
and pt.enable = 1
and pt.series_number = #{batchNumber}
AND pti.language_code = #{language}
</select>
<select id="getListForSort" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeSearchVO">
select *
,(SELECT `name` FROM product_series WHERE batch_number=series_number AND state!=2 ORDER BY state DESC LIMIT 1) as 'seriesName'
from product_type
where enable=1 and state=1
order by seriesName, sort
</select>
</mapper> </mapper>

View File

@ -99,11 +99,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.alibaba</groupId> <!-- <groupId>com.alibaba</groupId>-->
<artifactId>fastjson</artifactId> <!-- <artifactId>fastjson</artifactId>-->
<version>1.2.83</version> <!-- <version>1.2.83</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-jwt</artifactId> <artifactId>sa-token-jwt</artifactId>

View File

@ -1,6 +1,6 @@
package com.nflg.mobilebroken.starter.advice; package com.nflg.mobilebroken.starter.advice;
import com.alibaba.fastjson.JSON; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.nflg.mobilebroken.common.constant.STATE; import com.nflg.mobilebroken.common.constant.STATE;
import com.nflg.mobilebroken.common.pojo.ApiResult; import com.nflg.mobilebroken.common.pojo.ApiResult;
@ -67,9 +67,9 @@ public class LoggingAspect {
//日志明细 //日志明细
logDetail.setRowId(requestId); logDetail.setRowId(requestId);
logDetail.setRequestParam(JSON.toJSONString(joinPoint.getArgs())); logDetail.setRequestParam(JSONUtil.toJsonStr(joinPoint.getArgs()));
Object result = joinPoint.proceed(); Object result = joinPoint.proceed();
logDetail.setRequestReturn(JSON.toJSONString(result)); logDetail.setRequestReturn(JSONUtil.toJsonStr(result));
return result; return result;
} catch (Throwable ex) { } catch (Throwable ex) {

View File

@ -1,6 +1,6 @@
package com.nflg.mobilebroken.starter.service.impl; package com.nflg.mobilebroken.starter.service.impl;
import com.alibaba.fastjson.JSON; import cn.hutool.json.JSONUtil;
import com.nflg.mobilebroken.repository.entity.TBaseRequestLog; import com.nflg.mobilebroken.repository.entity.TBaseRequestLog;
import com.nflg.mobilebroken.repository.entity.TBaseRequestLogDetail; import com.nflg.mobilebroken.repository.entity.TBaseRequestLogDetail;
import com.nflg.mobilebroken.starter.service.IRequestLog; import com.nflg.mobilebroken.starter.service.IRequestLog;
@ -17,6 +17,6 @@ public class DefaultRequestLogService implements IRequestLog {
@Override @Override
public void addLog(TBaseRequestLog log, TBaseRequestLogDetail logDetail) { public void addLog(TBaseRequestLog log, TBaseRequestLogDetail logDetail) {
logger.info(JSON.toJSONString(log)); logger.info(JSONUtil.toJsonStr(log));
} }
} }