Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
|
9a3fde6eed | 1 year ago |
|
552367c4d3 | 1 year ago |
|
ef9f01c674 | 1 year ago |
|
de3e184f9c | 1 year ago |
|
0a4c2eabc5 | 1 year ago |
|
bd7154b81b | 1 year ago |
|
b7f26a1686 | 1 year ago |
|
71ed0bdf24 | 1 year ago |
|
c904e33654 | 1 year ago |
|
7c180b00ab | 1 year ago |
|
b231dd83bf | 1 year ago |
|
00899954ae | 1 year ago |
|
f44b5e9727 | 1 year ago |
|
48f0c29753 | 1 year ago |
|
b306c6a951 | 1 year ago |
|
88848d671d | 1 year ago |
|
1eea81cef6 | 1 year ago |
|
ee6a7a6775 | 2 years ago |
|
f0faabccc1 | 2 years ago |
|
d706a631b6 | 2 years ago |
|
24125058bc | 2 years ago |
|
91be062416 | 2 years ago |
|
35c6557734 | 2 years ago |
|
4fc006c1e5 | 2 years ago |
|
0fa3c04d98 | 2 years ago |
|
fec4a17f66 | 2 years ago |
|
e266ae4e7b | 2 years ago |
|
3f999b4e9c | 2 years ago |
|
e76c86a50c | 2 years ago |
|
ac7fea97d9 | 2 years ago |
|
5f50dba548 | 2 years ago |
|
918f778fd9 | 2 years ago |
|
4d80788458 | 2 years ago |
|
0c4632ade8 | 2 years ago |
|
2d83718b42 | 2 years ago |
|
2da4770377 | 2 years ago |
|
09151052c2 | 2 years ago |
@ -0,0 +1,224 @@
|
||||
package com.glxp.api.controller.auth;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigDetailRequest;
|
||||
import com.glxp.api.req.auth.SysCustomConfigRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.auth.SysCustomConfigFromDetailResponse;
|
||||
import com.glxp.api.res.auth.SysCustomConfigResponse;
|
||||
import com.glxp.api.service.auth.ISysCustomConfigDetailService;
|
||||
import com.glxp.api.service.auth.ISysCustomConfigService;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/custom/config")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysCustomConfigController extends BaseController {
|
||||
|
||||
private final ISysCustomConfigService sysCustomConfigService;
|
||||
|
||||
private final ISysCustomConfigDetailService sysCustomConfigDetailService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(SysCustomConfigRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<SysCustomConfigEntity> list = sysCustomConfigService.filterSysCustomConfig(request);
|
||||
PageInfo<SysCustomConfigEntity> authAdminPageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<SysCustomConfigEntity> authAdminPageSimpleResponse = new PageSimpleResponse<>();
|
||||
authAdminPageSimpleResponse.setTotal(authAdminPageInfo.getTotal());
|
||||
authAdminPageSimpleResponse.setList(list);
|
||||
|
||||
return ResultVOUtils.success(authAdminPageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody SysCustomConfigEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = sysCustomConfigService.insertSysCustomConfig(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid SysCustomConfigEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
SysCustomConfigEntity originEntity = sysCustomConfigService.selectById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = sysCustomConfigService.updateSysCustomConfig(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = sysCustomConfigService.deleteById(deleteRequest.getId());
|
||||
sysCustomConfigDetailService.deleteByConfigId(deleteRequest.getId());
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/getConfigs")
|
||||
@Log(title = "界面配置管理")
|
||||
public BaseResponse getConfigs(@RequestBody SysCustomConfigRequest request,BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<SysCustomConfigEntity> list = sysCustomConfigService.filterSysCustomConfig(request);
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_NOT);
|
||||
}
|
||||
SysCustomConfigEntity sysCustomConfigEntity = list.get(0);
|
||||
SysCustomConfigDetailRequest detailRequest = new SysCustomConfigDetailRequest();
|
||||
detailRequest.setConfigId(sysCustomConfigEntity.getId().toString());
|
||||
detailRequest.setIsShow("1");
|
||||
// detailRequest.setType(request.getType());
|
||||
List<SysCustomConfigDetailEntity> detailList = sysCustomConfigDetailService.filterSysCustomConfigDetail(detailRequest);
|
||||
Map<String,List<SysCustomConfigDetailEntity>> map = detailList.stream().collect(
|
||||
Collectors.groupingBy(SysCustomConfigDetailEntity::getType));
|
||||
List<SysCustomConfigDetailEntity> tableList = map.get("1") == null? Lists.newArrayList():map.get("1");
|
||||
List<SysCustomConfigDetailEntity> queryList = map.get("2") == null? Lists.newArrayList():map.get("2");
|
||||
List<SysCustomConfigDetailEntity> fromList = map.get("3") == null? Lists.newArrayList():map.get("3");
|
||||
|
||||
List<SysCustomConfigDetailEntity> fromSortList = fromList.stream().sorted(Comparator.comparing(SysCustomConfigDetailEntity::getLineNumber)).collect(Collectors.toList());
|
||||
|
||||
Map<Integer,List<SysCustomConfigDetailEntity>> fromMap = fromSortList.stream().collect(
|
||||
Collectors.groupingBy(SysCustomConfigDetailEntity::getLineNumber,LinkedHashMap::new,Collectors.toList()));
|
||||
List<SysCustomConfigFromDetailResponse> fromDetailList = Lists.newArrayList();
|
||||
for (Map.Entry<Integer, List<SysCustomConfigDetailEntity>> entry : fromMap.entrySet()) {
|
||||
SysCustomConfigFromDetailResponse sysCustomConfigFromDetailResponse = new SysCustomConfigFromDetailResponse();
|
||||
sysCustomConfigFromDetailResponse.setNumber(entry.getKey());
|
||||
List<SysCustomConfigDetailEntity> entities = entry.getValue();
|
||||
entities.stream().forEach(s->{
|
||||
if(StringUtils.isNotEmpty(s.getCheckRules())){
|
||||
String replacedJsonString = s.getCheckRules().replaceAll("(\\w+)(\\s*:\\s*)", "\"$1\"$2");
|
||||
JSONArray object = JSONArray.parseArray(replacedJsonString);
|
||||
s.setCheckRulesObj(object);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(s.getLableRule())){
|
||||
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
|
||||
List<Map> mapList = Lists.newArrayList();
|
||||
Iterator<String> it = objectLaber.keySet().iterator();
|
||||
String inputType = s.getInputType();
|
||||
while(it.hasNext()) {
|
||||
Map<String,Object> mapTemp = Maps.newHashMap();
|
||||
String key = (String) it.next();
|
||||
String value = objectLaber.getString(key);
|
||||
mapTemp.put("label", value);
|
||||
if("number".equals(inputType)){
|
||||
mapTemp.put("value", Integer.parseInt(key));
|
||||
}else{
|
||||
mapTemp.put("value", key);
|
||||
}
|
||||
mapList.add(mapTemp);
|
||||
}
|
||||
s.setLableRuleObj(mapList);
|
||||
}
|
||||
});
|
||||
sysCustomConfigFromDetailResponse.setList(entities);
|
||||
fromDetailList.add(sysCustomConfigFromDetailResponse);
|
||||
}
|
||||
|
||||
tableList.stream().forEach(s->{
|
||||
if(StringUtils.isNotEmpty(s.getLableRule())) {
|
||||
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
|
||||
s.setLableRuleObj(objectLaber);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(s.getButtonRule())){
|
||||
JSONArray objectButton = JSONArray.parseArray(s.getButtonRule());
|
||||
s.setButtonRulObj(objectButton);
|
||||
}
|
||||
});
|
||||
queryList.stream().forEach(s->{
|
||||
if(StringUtils.isNotEmpty(s.getLableRule())){
|
||||
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
|
||||
List<Map> mapList = Lists.newArrayList();
|
||||
Iterator<String> it = objectLaber.keySet().iterator();
|
||||
while(it.hasNext()) {
|
||||
Map<String,String> mapTemp = Maps.newHashMap();
|
||||
String key = (String) it.next();
|
||||
String value = objectLaber.getString(key);
|
||||
mapTemp.put("label", value);
|
||||
mapTemp.put("value", key);
|
||||
mapList.add(mapTemp);
|
||||
}
|
||||
s.setLableRuleObj(mapList);
|
||||
}
|
||||
});
|
||||
SysCustomConfigResponse sysCustomConfigResponse = new SysCustomConfigResponse();
|
||||
BeanUtil.copyProperties(sysCustomConfigEntity, sysCustomConfigResponse);
|
||||
sysCustomConfigResponse.setTableList(tableList);
|
||||
sysCustomConfigResponse.setQueryList(queryList);
|
||||
sysCustomConfigResponse.setFromList(fromDetailList);
|
||||
return ResultVOUtils.success(sysCustomConfigResponse);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.glxp.api.controller.auth;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigDetailRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.auth.ISysCustomConfigDetailService;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/custom/configDetail")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysCustomConfigDetailController extends BaseController {
|
||||
|
||||
private final ISysCustomConfigDetailService sysCustomConfigDetailService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(SysCustomConfigDetailRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<SysCustomConfigDetailEntity> list = sysCustomConfigDetailService.filterSysCustomConfigDetail(request);
|
||||
PageInfo<SysCustomConfigDetailEntity> authAdminPageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<SysCustomConfigDetailEntity> authAdminPageSimpleResponse = new PageSimpleResponse<>();
|
||||
authAdminPageSimpleResponse.setTotal(authAdminPageInfo.getTotal());
|
||||
authAdminPageSimpleResponse.setList(list);
|
||||
|
||||
return ResultVOUtils.success(authAdminPageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody SysCustomConfigDetailEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = sysCustomConfigDetailService.insertSysCustomConfigDetail(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid SysCustomConfigDetailEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
SysCustomConfigDetailEntity originEntity = sysCustomConfigDetailService.selectById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = sysCustomConfigDetailService.updateSysCustomConfigDetail(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "界面配置管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = sysCustomConfigDetailService.deleteById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.glxp.api.controller.sync;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.dao.basic.BasicProductsDao;
|
||||
import com.glxp.api.dao.basic.CompanyProductRelevanceDao;
|
||||
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
||||
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
||||
import com.glxp.api.req.sync.SpsSyncBasicRlRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "内网基础信息同步修改")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class SpsSyncBasicController {
|
||||
|
||||
private final UdiRelevanceDao udiRelevanceDao;
|
||||
private final BasicProductsDao basicProductsDao;
|
||||
private final CompanyProductRelevanceDao relevanceDao;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/spssync/basic/udirl/update")
|
||||
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse udiRlUpdate(@RequestBody UdiRelevanceEntity udiRelevanceEntity) {
|
||||
|
||||
if (udiRelevanceEntity.getId() == null) {
|
||||
return ResultVOUtils.error(500, "缺少唯一标识");
|
||||
}
|
||||
int b = udiRelevanceDao.updateById(udiRelevanceEntity);
|
||||
if (b > 0)
|
||||
return ResultVOUtils.success("更新成功!");
|
||||
else
|
||||
return ResultVOUtils.error(500, "更新失败!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/spssync/basic/udirl/batchInsert")
|
||||
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse udiRlUpdate(@RequestBody SpsSyncBasicRlRequest spsSyncBasicRlRequest) {
|
||||
|
||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getUdiRelevanceEntities())) {
|
||||
udiRelevanceDao.replaceBatchs(spsSyncBasicRlRequest.getUdiRelevanceEntities());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getBasicProductsEntities())) {
|
||||
basicProductsDao.replaceBatchs(spsSyncBasicRlRequest.getBasicProductsEntities());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities())) {
|
||||
relevanceDao.replaceBatchs(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities());
|
||||
}
|
||||
return ResultVOUtils.success("同步成功!");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.glxp.api.controller.thrsys;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.thrsys.ThrProductTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class ThrProductTypeCotroller {
|
||||
|
||||
@Resource
|
||||
ThrProductTypeService thrProductTypeService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/thrsys/getThrProductType")
|
||||
public BaseResponse getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<ThrProductTypeEntity> thrProductTypeEntityList
|
||||
= thrProductTypeService.getProductTypes(filterThrProductTypeRequest);
|
||||
PageInfo<ThrProductTypeEntity> pageInfo;
|
||||
pageInfo = new PageInfo<ThrProductTypeEntity>(thrProductTypeEntityList);
|
||||
PageSimpleResponse<ThrProductTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(thrProductTypeEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.glxp.api.dao.auth;
|
||||
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysCustomConfigDao {
|
||||
|
||||
List<SysCustomConfigEntity> filterSysCustomConfig(SysCustomConfigRequest request);
|
||||
|
||||
boolean insertSysCustomConfig(SysCustomConfigEntity entity);
|
||||
|
||||
boolean updateSysCustomConfig(SysCustomConfigEntity entity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
SysCustomConfigEntity selectById(Long id);
|
||||
|
||||
boolean deleteContact(DeleteRequest request);
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.api.dao.auth;
|
||||
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigDetailRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysCustomConfigDetailDao {
|
||||
|
||||
List<SysCustomConfigDetailEntity> filterSysCustomConfigDetail(SysCustomConfigDetailRequest request);
|
||||
|
||||
boolean insertSysCustomConfigDetail(SysCustomConfigDetailEntity entity);
|
||||
|
||||
boolean updateSysCustomConfigDetail(SysCustomConfigDetailEntity entity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByConfigId(String id);
|
||||
|
||||
SysCustomConfigDetailEntity selectById(Long id);
|
||||
|
||||
boolean deleteContact(DeleteRequest request);
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrProductTypeMapper extends BaseMapper<ThrProductTypeEntity> {
|
||||
|
||||
List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest);
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.glxp.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DictDto {
|
||||
|
||||
private String code;
|
||||
private String label;
|
||||
|
||||
public DictDto(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public DictDto(Integer code, String label) {
|
||||
this.code = code.toString();
|
||||
this.label = label;
|
||||
}
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
package com.glxp.api.entity.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-02-07
|
||||
*/
|
||||
@TableName("sys_custom_config_detail")
|
||||
@Data
|
||||
public class SysCustomConfigDetailEntity {
|
||||
|
||||
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
@TableField("configId")
|
||||
private Long configId;
|
||||
/**
|
||||
* 类型 1列表 2表单 3查询框
|
||||
*/
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否显示 1显示 2隐藏
|
||||
*/
|
||||
@TableField("isShow")
|
||||
private String isShow;
|
||||
|
||||
/**
|
||||
* 列名
|
||||
*/
|
||||
@TableField("columnName")
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 列描述
|
||||
*/
|
||||
@TableField("columnDesc")
|
||||
private String columnDesc;
|
||||
/**
|
||||
* 列类型
|
||||
*/
|
||||
@TableField("columnType")
|
||||
private String columnType;
|
||||
|
||||
/**
|
||||
* 颜色规则
|
||||
*/
|
||||
@TableField("colorRule")
|
||||
private String colorRule;
|
||||
|
||||
/**
|
||||
* 字段替换规则
|
||||
*/
|
||||
@TableField("lableRule")
|
||||
private String lableRule;
|
||||
|
||||
/**
|
||||
* 字段替换规则
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Object lableRuleObj;
|
||||
|
||||
/**
|
||||
* 按钮规则
|
||||
*/
|
||||
@TableField("buttonRule")
|
||||
private String buttonRule;
|
||||
|
||||
/**
|
||||
* 按钮规则
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Object buttonRulObj;
|
||||
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@TableField("width")
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 是否排序
|
||||
*/
|
||||
@TableField("sort")
|
||||
private Boolean sort;
|
||||
|
||||
|
||||
/**
|
||||
* 是否缩略
|
||||
*/
|
||||
@TableField("tooltip")
|
||||
private Boolean tooltip;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField("number")
|
||||
private Integer number;
|
||||
|
||||
|
||||
/**
|
||||
* 行号
|
||||
*/
|
||||
@TableField("lineNumber")
|
||||
private Integer lineNumber;
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
@TableField("clickFuc")
|
||||
private String clickFuc;
|
||||
|
||||
/**
|
||||
* 禁用方法
|
||||
*/
|
||||
@TableField("禁用方法")
|
||||
private String disabledFuc;
|
||||
|
||||
|
||||
/**
|
||||
* eval表达式
|
||||
*/
|
||||
@TableField("eval表达式")
|
||||
private String expression;
|
||||
|
||||
/**
|
||||
* 大小
|
||||
*/
|
||||
@TableField("size")
|
||||
private String size;
|
||||
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
@TableField("style")
|
||||
private String style;
|
||||
|
||||
/**
|
||||
* 是否禁用
|
||||
*/
|
||||
@TableField("disabled")
|
||||
private Boolean disabled;
|
||||
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
@TableField("checkRules")
|
||||
private String checkRules;
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Object checkRulesObj;
|
||||
|
||||
/**
|
||||
* input类型
|
||||
*/
|
||||
@TableField("inputType")
|
||||
private String inputType;
|
||||
|
||||
/**
|
||||
* 获取数据方法
|
||||
*/
|
||||
@TableField("dataFuc")
|
||||
private String dataFuc;
|
||||
|
||||
/**
|
||||
* 是否展示详细 1是 2否
|
||||
*/
|
||||
@TableField("isShowXx")
|
||||
private String isShowXx;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.glxp.api.entity.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-02-07
|
||||
*/
|
||||
@TableName("sys_custom_config")
|
||||
@Data
|
||||
public class SysCustomConfigEntity {
|
||||
|
||||
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 业务标识
|
||||
*/
|
||||
@TableField("businessType")
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 类型 1列表 2表单
|
||||
*/
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 列表点击方法
|
||||
*/
|
||||
@TableField("handleChangeFuc")
|
||||
private String handleChangeFuc;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.glxp.api.entity.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "com-glxp-api-entity-thrsys-ThrProductType")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "thr_product_type")
|
||||
public class ThrProductTypeEntity implements Serializable {
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 类别编码
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
@ApiModelProperty(value = "类别编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 类别名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
@ApiModelProperty(value = "类别名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 第三系统标识
|
||||
*/
|
||||
@TableField(value = "thirdSys")
|
||||
@ApiModelProperty(value = "第三系统标识")
|
||||
private String thirdSys;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.glxp.api.req.auth;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysCustomConfigDetailRequest extends ListPageRequest {
|
||||
private String configId;
|
||||
private String type;
|
||||
private String isShow;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.api.req.auth;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysCustomConfigRequest extends ListPageRequest {
|
||||
private String businessType;
|
||||
|
||||
private String remark;
|
||||
private String type;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.glxp.api.req.sync;
|
||||
|
||||
import com.glxp.api.entity.basic.BasicProductsEntity;
|
||||
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
||||
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpsSyncBasicRlRequest {
|
||||
|
||||
private List<UdiRelevanceEntity> udiRelevanceEntities;
|
||||
private List<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
|
||||
private List<BasicProductsEntity> basicProductsEntities;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterThrProductTypeRequest extends ListPageRequest {
|
||||
|
||||
|
||||
/**
|
||||
* 类别编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 类别名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 第三系统标识
|
||||
*/
|
||||
private String thirdSys;
|
||||
|
||||
private String key;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.glxp.api.res.auth;
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SysCustomConfigFromDetailResponse {
|
||||
Integer number;
|
||||
List<SysCustomConfigDetailEntity> list;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.api.res.auth;
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SysCustomConfigResponse extends SysCustomConfigEntity{
|
||||
|
||||
List<SysCustomConfigDetailEntity> tableList;
|
||||
|
||||
List<SysCustomConfigDetailEntity> queryList;
|
||||
|
||||
List<SysCustomConfigFromDetailResponse> fromList;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.service.auth;
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigDetailRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysCustomConfigDetailService {
|
||||
|
||||
List<SysCustomConfigDetailEntity> filterSysCustomConfigDetail(SysCustomConfigDetailRequest request);
|
||||
|
||||
|
||||
boolean insertSysCustomConfigDetail(SysCustomConfigDetailEntity entity);
|
||||
|
||||
boolean updateSysCustomConfigDetail(SysCustomConfigDetailEntity entity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByConfigId(String id);
|
||||
|
||||
SysCustomConfigDetailEntity selectById(Long id);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.api.service.auth;
|
||||
|
||||
import com.glxp.api.entity.auth.SysCustomConfigEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysCustomConfigService {
|
||||
|
||||
List<SysCustomConfigEntity> filterSysCustomConfig(SysCustomConfigRequest request);
|
||||
|
||||
|
||||
boolean insertSysCustomConfig(SysCustomConfigEntity entity);
|
||||
|
||||
boolean updateSysCustomConfig(SysCustomConfigEntity entity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
SysCustomConfigEntity selectById(Long id);
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.glxp.api.service.auth.impl;
|
||||
|
||||
import com.glxp.api.dao.auth.SysCustomConfigDetailDao;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigDetailEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigDetailRequest;
|
||||
import com.glxp.api.service.auth.ISysCustomConfigDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysCustomConfigDetailServiceImpl implements ISysCustomConfigDetailService {
|
||||
|
||||
|
||||
@Resource
|
||||
private SysCustomConfigDetailDao sysCustomConfigDetailDao;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SysCustomConfigDetailEntity> filterSysCustomConfigDetail(SysCustomConfigDetailRequest request) {
|
||||
return sysCustomConfigDetailDao.filterSysCustomConfigDetail(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertSysCustomConfigDetail(SysCustomConfigDetailEntity entity) {
|
||||
return sysCustomConfigDetailDao.insertSysCustomConfigDetail(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateSysCustomConfigDetail(SysCustomConfigDetailEntity entity) {
|
||||
return sysCustomConfigDetailDao.updateSysCustomConfigDetail(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return sysCustomConfigDetailDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByConfigId(String id) {
|
||||
return sysCustomConfigDetailDao.deleteByConfigId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysCustomConfigDetailEntity selectById(Long id) {
|
||||
return sysCustomConfigDetailDao.selectById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.glxp.api.service.auth.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.auth.SysCustomConfigDao;
|
||||
import com.glxp.api.entity.auth.SysCustomConfigEntity;
|
||||
import com.glxp.api.req.auth.SysCustomConfigRequest;
|
||||
import com.glxp.api.service.auth.ISysCustomConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysCustomConfigServiceImpl implements ISysCustomConfigService {
|
||||
|
||||
|
||||
@Resource
|
||||
private SysCustomConfigDao sysCustomConfigDao;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SysCustomConfigEntity> filterSysCustomConfig(SysCustomConfigRequest request) {
|
||||
if (request == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (request.getPage() != null) {
|
||||
int offset = (request.getPage() - 1) * request.getLimit();
|
||||
PageHelper.offsetPage(offset, request.getLimit());
|
||||
}
|
||||
return sysCustomConfigDao.filterSysCustomConfig(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertSysCustomConfig(SysCustomConfigEntity entity) {
|
||||
return sysCustomConfigDao.insertSysCustomConfig(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateSysCustomConfig(SysCustomConfigEntity entity) {
|
||||
return sysCustomConfigDao.updateSysCustomConfig(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return sysCustomConfigDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysCustomConfigEntity selectById(Long id) {
|
||||
return sysCustomConfigDao.selectById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.thrsys.ThrProductTypeMapper;
|
||||
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrProductTypeService extends ServiceImpl<ThrProductTypeMapper, ThrProductTypeEntity> {
|
||||
@Resource
|
||||
ThrProductTypeMapper thrProductTypeMapper;
|
||||
|
||||
public List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest) {
|
||||
if (filterThrProductTypeRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrProductTypeRequest.getPage() != null) {
|
||||
int offset = (filterThrProductTypeRequest.getPage() - 1) * filterThrProductTypeRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrProductTypeRequest.getLimit());
|
||||
}
|
||||
List<ThrProductTypeEntity> data = thrProductTypeMapper.getProductTypes(filterThrProductTypeRequest);
|
||||
return data;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue