feat: 产品中心
This commit is contained in:
parent
91297cc2f1
commit
0a7d7ac9fd
|
|
@ -25,10 +25,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<dependency>
|
||||
<groupId>ognl</groupId>
|
||||
<artifactId>ognl</artifactId>
|
||||
<version>3.1.26</version>
|
||||
<version>3.4.3</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.itextpdf</groupId>-->
|
||||
|
|
@ -84,6 +84,12 @@
|
|||
<groupId>org.xhtmlrenderer</groupId>
|
||||
<artifactId>flying-saucer-pdf</artifactId>
|
||||
<version>9.3.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>bcprov-jdk14</artifactId>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- iText (required by Flying Saucer) -->
|
||||
<dependency>
|
||||
|
|
@ -122,12 +128,18 @@
|
|||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>alimt20181012</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<version>1.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<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>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -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.vo.AdvertisementListVO;
|
||||
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.service.IAdvertisementService;
|
||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
||||
|
|
@ -43,7 +44,7 @@ public class AdvertisementController extends ControllerBase{
|
|||
@GetMapping("getType")
|
||||
@ApiMark(moduleName = "广告", apiName = "获取广告类型",isPublic = true)
|
||||
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")
|
||||
@ApiMark(moduleName = "广告", apiName = "获取广告位置",isPublic = true)
|
||||
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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package com.nflg.mobilebroken.admin.controller;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
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.nflg.mobilebroken.admin.annotation.ApiMark;
|
||||
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();
|
||||
Map<String, String> positionLanguageMp=new HashMap<>();
|
||||
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()) )
|
||||
.collect(Collectors.toMap(PositionLanguageVO::getCode, PositionLanguageVO::getLanguageValue));
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ public class PositionController extends ControllerBase {
|
|||
@ApiMark(moduleName = "职位管理", apiName = "新增")
|
||||
public ApiResult<Boolean> add(@Valid @RequestBody PositionDetailDTO 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.setDataCreateUserNo(AdminUserUtil.getUserNo());
|
||||
ent.setDataCreateUserName(AdminUserUtil.getUserName());
|
||||
|
|
@ -132,7 +132,7 @@ public class PositionController extends ControllerBase {
|
|||
VUtils.trueThrow(positionDetailDto.getId()<=0).throwMessage(STATE.ParamErr,"编辑时ID不能等于0");
|
||||
TBasePosition ent = Convert.convert(TBasePosition.class, positionDetailDto);
|
||||
ent.setPositionCode(null);
|
||||
ent.setPositionLanguage(JSON.toJSONString(positionDetailDto.getLanguage()));
|
||||
ent.setPositionLanguage(JSONUtil.toJsonStr(positionDetailDto.getLanguage()));
|
||||
ent.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||
ent.setDataModifyUserName(AdminUserUtil.getUserName());
|
||||
ent.setDataModifyTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -837,10 +837,11 @@ public class ProductModelController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取图册列表用于排序
|
||||
* @param modelId 机型ID
|
||||
*/
|
||||
@GetMapping("/getImageListForSort")
|
||||
public ApiResult<List<ProductModelImage>> getImageListForSort(){
|
||||
return ApiResult.success(productModelImageService.getListForSort());
|
||||
public ApiResult<List<ProductModelImage>> getImageListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
||||
return ApiResult.success(productModelImageService.getListForSort(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -922,10 +923,11 @@ public class ProductModelController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取视频列表用于排序
|
||||
* @param modelId 机型ID
|
||||
*/
|
||||
@GetMapping("/getVideoListForSort")
|
||||
public ApiResult<List<ProductModelVideo>> getVideoListForSort(){
|
||||
return ApiResult.success(productModelVideoService.getListForSort());
|
||||
public ApiResult<List<ProductModelVideo>> getVideoListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
||||
return ApiResult.success(productModelVideoService.getListForSort(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1031,10 +1033,11 @@ public class ProductModelController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取资料列表用于排序
|
||||
* @param modelId 机型ID
|
||||
*/
|
||||
@GetMapping("/getFileListForSort")
|
||||
public ApiResult<List<ProductModelFile>> getFileListForSort(){
|
||||
return ApiResult.success(productModelFileService.getListForSort());
|
||||
public ApiResult<List<ProductModelFile>> getFileListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
||||
return ApiResult.success(productModelFileService.getListForSort(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ package com.nflg.mobilebroken.admin.service;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
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.nflg.mobilebroken.admin.constant.DeviceSourceFromEnum;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.DeviceDTO;
|
||||
|
|
@ -145,8 +146,8 @@ public class AdminDeviceService {
|
|||
ent.setDeviceTypeSub(u.getAssetProductLine4__c());
|
||||
ent.setModelNo(u.getProductLine5__c());
|
||||
if (StrUtil.isNotBlank(u.getAccount())) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(u.getAccount());
|
||||
String cname = jsonObject.getString("Name");
|
||||
JSONObject jsonObject = JSONUtil.parseObj(u.getAccount());
|
||||
String cname = jsonObject.getStr("Name");
|
||||
ent.setCustomerName(cname);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package com.nflg.mobilebroken.admin.service;
|
|||
import cn.hutool.cache.CacheUtil;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.CrmGetTokenResultDTO;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.SyncFromCrmDTO;
|
||||
import com.nflg.mobilebroken.admin.pojo.vo.CmrAgentResultVO;
|
||||
|
|
@ -74,7 +74,7 @@ public class CrmService {
|
|||
paramMp.put("password", password);
|
||||
paramMp.put("client_secret", clientSecret);
|
||||
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())) {
|
||||
|
||||
crmTokenCache.put(tokenCacheKey, result.getAccess_token());
|
||||
|
|
@ -101,12 +101,12 @@ public class CrmService {
|
|||
// Map<String, String> reBody = new HashMap<>();
|
||||
// reBody.put("CrLsDate", date);
|
||||
String token = StrUtil.join(" ", "Bearer", getToken());
|
||||
String orderResult = httpUtils.doPost(getAgentUrl, JSON.toJSONString(dateParam), token);
|
||||
JSONObject jsonObject = JSONObject.parseObject(orderResult);
|
||||
String code = jsonObject.getString("code");
|
||||
String orderResult = httpUtils.doPost(getAgentUrl, JSONUtil.toJsonStr(dateParam), token);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(orderResult);
|
||||
String code = jsonObject.getStr("code");
|
||||
if (Objects.equals(code, "0")) {
|
||||
String dataResult = jsonObject.getString("jsonData");
|
||||
return JSON.parseArray(dataResult, CmrAgentResultVO.class);
|
||||
String dataResult = jsonObject.getStr("jsonData");
|
||||
return JSONUtil.toList(dataResult, CmrAgentResultVO.class);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new NflgException(STATE.BusinessError, ex.getMessage());
|
||||
|
|
@ -125,12 +125,12 @@ public class CrmService {
|
|||
Map<String, String> reBody = new HashMap<>();
|
||||
// reBody.put("CrLsDate", startDate);
|
||||
String token = StrUtil.join(" ", "Bearer", getToken());
|
||||
String orderResult = httpUtils.doPost(getDeviceUrl, JSON.toJSONString(dateParam), token);
|
||||
JSONObject jsonObject = JSONObject.parseObject(orderResult);
|
||||
String code = jsonObject.getString("code");
|
||||
String orderResult = httpUtils.doPost(getDeviceUrl, JSONUtil.toJsonStr(dateParam), token);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(orderResult);
|
||||
String code = jsonObject.getStr("code");
|
||||
if (Objects.equals(code, "0")) {
|
||||
String dataResult = jsonObject.getString("jsonData");
|
||||
return JSON.parseArray(dataResult, CmrDeviceResultVO.class);
|
||||
String dataResult = jsonObject.getStr("jsonData");
|
||||
return JSONUtil.toList(dataResult, CmrDeviceResultVO.class);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new NflgException(STATE.BusinessError, ex.getMessage());
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
<groupId>com.nflg</groupId>
|
||||
<artifactId>nflg-mobilebroken-repository</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,13 +21,11 @@ public class ProductIntroInfoAddRequest {
|
|||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@NotBlank
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,6 +26,16 @@ public class FrontendProductModelSearchVO {
|
|||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 系列批次号
|
||||
*/
|
||||
private String seriesNumber;
|
||||
|
||||
/**
|
||||
* 类型批次号
|
||||
*/
|
||||
private String typeNumber;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductSeriesSimpleVO {
|
||||
|
||||
|
|
@ -14,4 +16,9 @@ public class ProductSeriesSimpleVO {
|
|||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 类型列表
|
||||
*/
|
||||
private List<ProductTypeSimpleVO> types;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductTypeSimpleVO {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
}
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class InfoController extends BaseController{
|
|||
*/
|
||||
@GetMapping("/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()
|
||||
.setId(it.getId())
|
||||
.setName(it.getName())
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public interface DictionaryItemMapper extends BaseMapper<DictionaryItem> {
|
|||
|
||||
String getName(String dictionaryCode, String itemCode);
|
||||
|
||||
List<DictionaryItem> getListByDictionaryCode(String code);
|
||||
List<DictionaryItem> getListByDictionaryCode(String code,String language);
|
||||
|
||||
DictionaryItem getByCode(String dictionaryCode, String dictionaryItemCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,4 +27,6 @@ public interface ProductModelMapper extends BaseMapper<ProductModel> {
|
|||
Page<FrontendProductModelSearchVO> search(String name, String language, Page<?> page);
|
||||
|
||||
List<ProductModelSimpleVO> getSimpleList(String typeNumber);
|
||||
|
||||
List<ProductModelSearchVO> getListForSort();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,8 @@ public interface ProductTypeMapper extends BaseMapper<ProductType> {
|
|||
List<ProductFileVO> getFilesByLanguage(Integer moduleId, String seriesNumber, String language);
|
||||
|
||||
List<ProductSeriesSimpleVO> getSimpleList(String seriesNumber);
|
||||
|
||||
List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language);
|
||||
|
||||
List<ProductTypeSearchVO> getListForSort();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,5 +26,7 @@ public interface IDictionaryItemService extends IService<DictionaryItem> {
|
|||
|
||||
List<DictionaryItem> getListByDictionaryCode(String code);
|
||||
|
||||
List<DictionaryItem> getListByDictionaryCode(String code,String language);
|
||||
|
||||
DictionaryItem getByCode(String dictionaryCode, String DictionaryItemCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public interface IProductModelFileService extends IService<ProductModelFile> {
|
|||
|
||||
void deleteByModel(@NotEmpty List<Integer> ids);
|
||||
|
||||
List<ProductModelFile> getListForSort();
|
||||
List<ProductModelFile> getListForSort(Integer modelId);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public interface IProductModelImageService extends IService<ProductModelImage> {
|
|||
|
||||
void deleteByModel(@NotEmpty List<Integer> ids);
|
||||
|
||||
List<ProductModelImage> getListForSort();
|
||||
List<ProductModelImage> getListForSort(Integer modelId);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public interface IProductModelVideoService extends IService<ProductModelVideo> {
|
|||
|
||||
void deleteByModel(@NotEmpty List<Integer> ids);
|
||||
|
||||
List<ProductModelVideo> getListForSort();
|
||||
List<ProductModelVideo> getListForSort(Integer modelId);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public interface IProductSeriesService extends IService<ProductSeries> {
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,4 +49,6 @@ public interface IProductTypeService extends IService<ProductType> {
|
|||
List<ProductFileVO> getFilesByLanguage(@Valid @NotNull Integer moduleId, String seriesNumber, String language);
|
||||
|
||||
ProductTypeLanguageInfoVO getInfoByLanguage(@Valid @NotNull String typeNumber, String language);
|
||||
|
||||
List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.SaveDictionaryItemRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.TranslateMap;
|
||||
|
|
@ -133,7 +134,12 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
|
|||
|
|
@ -189,10 +189,11 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelFile> getListForSort() {
|
||||
public List<ProductModelFile> getListForSort(Integer modelId) {
|
||||
return lambdaQuery()
|
||||
.eq(ProductModelFile::getEnable, true)
|
||||
.eq(ProductModelFile::getState, PublishState.Published.getState())
|
||||
.eq(ProductModelFile::getModelId, modelId)
|
||||
.orderByAsc(ProductModelFile::getSort)
|
||||
.list();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,10 +178,11 @@ public class ProductModelImageServiceImpl extends ServiceImpl<ProductModelImageM
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelImage> getListForSort() {
|
||||
public List<ProductModelImage> getListForSort(Integer modelId) {
|
||||
return lambdaQuery()
|
||||
.eq(ProductModelImage::getEnable, true)
|
||||
.eq(ProductModelImage::getState, PublishState.Published.getState())
|
||||
.eq(ProductModelImage::getModelId, modelId)
|
||||
.orderByAsc(ProductModelImage::getSort)
|
||||
.list();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,13 +353,15 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
|
||||
@Override
|
||||
public List<ProductModelSearchVO> getListForSort() {
|
||||
return Convert.toList(ProductModelSearchVO.class,
|
||||
lambdaQuery()
|
||||
.eq(ProductModel::getEnable, true)
|
||||
.eq(ProductModel::getState, PublishState.Published.getState())
|
||||
.orderByAsc(ProductModel::getSort)
|
||||
.list()
|
||||
);
|
||||
// return Convert.toList(ProductModelSearchVO.class,
|
||||
// lambdaQuery()
|
||||
// .eq(ProductModel::getEnable, true)
|
||||
// .eq(ProductModel::getState, PublishState.Published.getState())
|
||||
// .eq(ProductModel::getTypeNumber, typeNumber)
|
||||
// .orderByAsc(ProductModel::getSort)
|
||||
// .list()
|
||||
// );
|
||||
return baseMapper.getListForSort();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
|||
|
|
@ -178,10 +178,11 @@ public class ProductModelVideoServiceImpl extends ServiceImpl<ProductModelVideoM
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelVideo> getListForSort() {
|
||||
public List<ProductModelVideo> getListForSort(Integer modelId) {
|
||||
return lambdaQuery()
|
||||
.eq(ProductModelVideo::getEnable, true)
|
||||
.eq(ProductModelVideo::getState, PublishState.Published.getState())
|
||||
.eq(ProductModelVideo::getModelId, modelId)
|
||||
.orderByAsc(ProductModelVideo::getSort)
|
||||
.list();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,11 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesMapper, P
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -264,13 +263,7 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
|
||||
@Override
|
||||
public List<ProductTypeSearchVO> getListForSort() {
|
||||
return Convert.toList(ProductTypeSearchVO.class,
|
||||
lambdaQuery()
|
||||
.eq(ProductType::getEnable, true)
|
||||
.eq(ProductType::getState, PublishState.Published.getState())
|
||||
.orderByAsc(ProductType::getSort)
|
||||
.list()
|
||||
);
|
||||
return baseMapper.getListForSort();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
@ -314,6 +307,11 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
return productTypeInfoService.getInfoByLanguage(typeNumber,language);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language) {
|
||||
return baseMapper.getSimpleListByLanguage(batchNumber,language);
|
||||
}
|
||||
|
||||
private void delete(Integer typeId){
|
||||
ProductType info=getById(typeId);
|
||||
removeById(typeId);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
|
|||
|
||||
@Override
|
||||
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);
|
||||
items.forEach(item->{
|
||||
if (vos.stream().noneMatch(vo->vo.getDeptName().equals(item.getName()))){
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
|
|||
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
|
||||
List<DictionaryItem> initial= new ArrayList<>();
|
||||
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();
|
||||
Map<String, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList()));
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@
|
|||
</select>
|
||||
|
||||
<select id="getListByDictionaryCode" resultType="com.nflg.mobilebroken.repository.entity.DictionaryItem">
|
||||
SELECT di.*
|
||||
SELECT ifnull(dit.value,di.`name`) as 'name',di.*
|
||||
FROM dictionary d
|
||||
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}
|
||||
ORDER BY di.id
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -83,4 +83,12 @@
|
|||
ORDER BY recommend DESC,sort,id DESC
|
||||
LIMIT 8
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,22 @@
|
|||
from product_type
|
||||
where enable=1 and state!=2
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -99,11 +99,11 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba</groupId>-->
|
||||
<!-- <artifactId>fastjson</artifactId>-->
|
||||
<!-- <version>1.2.83</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-jwt</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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.nflg.mobilebroken.common.constant.STATE;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
|
|
@ -67,9 +67,9 @@ public class LoggingAspect {
|
|||
|
||||
//日志明细
|
||||
logDetail.setRowId(requestId);
|
||||
logDetail.setRequestParam(JSON.toJSONString(joinPoint.getArgs()));
|
||||
logDetail.setRequestParam(JSONUtil.toJsonStr(joinPoint.getArgs()));
|
||||
Object result = joinPoint.proceed();
|
||||
logDetail.setRequestReturn(JSON.toJSONString(result));
|
||||
logDetail.setRequestReturn(JSONUtil.toJsonStr(result));
|
||||
|
||||
return result;
|
||||
} catch (Throwable ex) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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.TBaseRequestLogDetail;
|
||||
import com.nflg.mobilebroken.starter.service.IRequestLog;
|
||||
|
|
@ -17,6 +17,6 @@ public class DefaultRequestLogService implements IRequestLog {
|
|||
|
||||
@Override
|
||||
public void addLog(TBaseRequestLog log, TBaseRequestLogDetail logDetail) {
|
||||
logger.info(JSON.toJSONString(log));
|
||||
logger.info(JSONUtil.toJsonStr(log));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue